8.2.3 • Published 6 months ago

@exmg/exmg-dialogs v8.2.3

Weekly downloads
73
License
MIT
Repository
github
Last release
6 months ago

<exmg-dialogs> Published on npm

Exmg Dialogs

Form Dialog

Form dialogs will handle styling, validation and make form submit easier. Also a loading indicator will be shown during the submit handling.

Example of implementation in html

<exmg-dialog-form title="Create account" button-copy="Save" @submit="${this.createAccount}">
  <paper-input name="name" label="Name" required></paper-input>
  <paper-input name="password" label="Password" required></paper-input>
</exmg-dialog-form>

Example of how submit could be handled

createAccount(e) {
  const {detail, target} = e;
  const {name, password} = detail;

  try {
    // Throw error to simulate error
    if(password.length < 6) {
      throw Error('User password to simple')
    }

    // Do server call

    // notify dialog successfull
    target.done();
  } catch (error) {
    target.handleError(error);
  }
}

Info Dialog

Info dialogs will handle styling, and content. Will throw a done event once the user clicked the button.

Example of implementation in html

<exmg-dialog-info button-copy="Continue" @done="${this.done}">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet pharetra turpis. Nullam tincidunt aliquet
    condimentum.
  </p>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet pharetra turpis. Nullam tincidunt aliquet
    condimentum.
  </p>
</exmg-dialog-info>

Example of implementation in html without close button option

<exmg-dialog-info button-copy="Continue" hide-close-button @done="${this.done}">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet pharetra turpis. Nullam tincidunt aliquet
    condimentum.
  </p>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet pharetra turpis. Nullam tincidunt aliquet
    condimentum.
  </p>
</exmg-dialog-info>

Example of how done could be handled

done(e) {
  const {target} = e;
  // Closes the dialog ...
  target.close();
}

Confirmation Dialogs

Easy way to display a pre styled confirmation dialog.

Example

<exmg-dialog-confirm
  title="Confirmation"
  message="Are you sure you want to delete this item?"
  button-copy="Delete account"
  @submit="${this.deleteItem}"
>
</exmg-dialog-confirm>
deleteItem(e) {
  const {target} = e;
  try {
    // Do server call

    // notify dialog successfull
    target.done();
  } catch (error) {
    target.error(error);
  }
}

API

<exmg-dialog-form />

PropertyUsage
title: stringDisplayed title of the Dialog
button-copy: stringDisplayed text of the submit button
hide-close-button: booleanIf set to true the dialog will not show a close icon
error-message: stringError text to display when the form is in error state
@submitEvent thrown when hitting the submit button, will serialize the form and return values in detail of the event
@cancelEvent thrown when hitting the cancel button

<exmg-dialog-confirm />

PropertyUsage
title: stringDisplayed title of the Dialog
message: stringDisplayed message of the Dialog
button-copy: stringDisplayed text of the submit button
hide-close-button: booleanIf set to true the dialog will not show a close icon
error-message: stringError text to display when the form is in error state
@submitEvent thrown when hitting the submit button, will serialize the form and return values in detail of the event
@cancelEvent thrown when hitting the cancel button

<exmg-dialog-confirm />

This element exposes a slot to wrap up any content you put in.

PropertyUsage
button-copy: stringDisplayed text of the submit button
hide-close-button: booleanIf set to true the dialog will not show a close icon
button-secondary: booleanIf set to true the button will be with secondary theme
@doneEvent thrown when hitting the main button

Additional references

8.2.3

6 months ago

8.2.2

6 months ago

8.2.1

6 months ago

8.2.0

6 months ago

9.0.12

1 year ago

9.0.11

1 year ago

9.0.9

1 year ago

9.0.10

1 year ago

9.0.8

1 year ago

9.0.7

1 year ago

9.0.6

1 year ago

9.0.5

1 year ago

9.0.4

1 year ago

9.0.3

1 year ago

9.0.1

1 year ago

8.1.40

1 year ago

8.1.37

2 years ago

8.1.36

2 years ago

8.1.39

1 year ago

8.1.38

2 years ago

8.1.31

2 years ago

8.1.33

2 years ago

8.1.32

2 years ago

8.1.35

2 years ago

8.1.29

3 years ago

8.1.28

3 years ago

8.1.20

3 years ago

8.1.22

3 years ago

8.1.24

3 years ago

8.1.23

3 years ago

8.1.25

3 years ago

8.1.17

3 years ago

8.1.9

3 years ago

8.1.11

3 years ago

8.1.10

3 years ago

8.1.13

3 years ago

8.1.12

3 years ago

8.1.15

3 years ago

8.1.14

3 years ago

8.1.16

3 years ago

8.1.7

3 years ago

8.1.4

3 years ago

8.1.3

4 years ago

8.1.5

3 years ago

8.1.2

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.0.3

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

6.0.4

4 years ago

6.0.1

5 years ago

6.0.3

5 years ago

6.0.2

5 years ago

6.0.0

5 years ago

5.1.7

5 years ago

5.1.6

5 years ago

5.1.5

5 years ago

5.1.4

5 years ago

5.1.3

5 years ago

5.1.2

5 years ago

5.1.1

5 years ago

5.1.0

6 years ago

5.0.5

6 years ago

5.0.4

6 years ago

5.0.3

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.1.3

6 years ago

4.1.2

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago