9.0.12 • Published 12 days ago

@exmg/exmg-dialogs v9.0.12

Weekly downloads
73
License
MIT
Repository
github
Last release
12 days 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

9.0.12

12 days ago

9.0.11

12 days ago

9.0.9

24 days ago

9.0.10

24 days ago

9.0.8

1 month ago

9.0.7

1 month ago

9.0.6

2 months ago

9.0.5

2 months ago

9.0.4

2 months ago

9.0.3

2 months ago

9.0.1

3 months ago

8.1.40

5 months ago

8.1.37

7 months ago

8.1.36

10 months ago

8.1.39

6 months ago

8.1.38

7 months ago

8.1.31

11 months ago

8.1.33

11 months ago

8.1.32

11 months ago

8.1.35

11 months ago

8.1.29

2 years ago

8.1.28

2 years ago

8.1.20

2 years ago

8.1.22

2 years ago

8.1.24

2 years ago

8.1.23

2 years ago

8.1.25

2 years ago

8.1.17

2 years ago

8.1.9

2 years ago

8.1.11

2 years ago

8.1.10

2 years ago

8.1.13

2 years ago

8.1.12

2 years ago

8.1.15

2 years ago

8.1.14

2 years ago

8.1.16

2 years ago

8.1.7

3 years ago

8.1.4

3 years ago

8.1.3

3 years ago

8.1.5

3 years ago

8.1.2

3 years ago

8.1.1

3 years ago

8.1.0

3 years ago

8.0.3

3 years ago

8.0.2

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

6.0.4

3 years ago

6.0.1

4 years ago

6.0.3

4 years ago

6.0.2

4 years ago

6.0.0

4 years ago

5.1.7

4 years ago

5.1.6

4 years ago

5.1.5

4 years ago

5.1.4

4 years ago

5.1.3

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

5 years ago

5.0.5

5 years ago

5.0.4

5 years ago

5.0.3

5 years ago

5.0.2

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.1.3

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago