2.45.0 • Published 3 months ago

@vonage/vwc-dialog v2.45.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

vwc-dialog

This component is an extension of

API

Slots

NameDescription
iconA slot meant for an icon. Appears above the heading.
primaryActionA focusable and clickable target. Typically a button such as <mwc-button>. Placed on the bottom right of the dialog (LTR) and above the secondary action when stacked. Automatically clicked when Enter key is pressed in the dialog.
secondaryActionA focusable and clickable target. Typically a button such as <mwc-button>. Placed immediately to the left of the primaryAction (LTR) or below when stacked.
defaultContent to display in the dialog's content area.

Properties/Attributes

NameTypeDescription
openbooleanWhether the dialog should open.
hideActionsbooleanHides the actions footer of the dialog. Needed to remove excess padding when no actions are slotted in.
stackedbooleanWhether to stack the action buttons.
headingstringHeading text of the dialog.
scrimClickActionstringDefault: 'close' – Action to be emitted with the closing and closed events when the dialog closes because the scrim was clicked.
escapeKeyActionstringDefault: 'close' – Action to be emitted with the closing and closed events when the dialog closes because the excape key was pressed.
defaultActionstringDefault: 'close' – Action to be emitted with the closing and closed events when <mwc-dialog>.open is toggled.
actionAttributestringDefault: 'dialogAction' – Attribute to read in light dom of dialog for closing action value.
initialFocusAttributestringDefault: 'dialogInitialFocus' – Attribute to search for in light dom for initial focus on dialog open.
closeButtonbooleanDefault: 'false' - show/hide the dismiss button
topPositionstringDefault: 'unset' - override the dialog centering to the screen and allow setting a unique top. Can get: small, medium, large, xlarge

Methods

NameDescription
forceLayout() => voidForces dialog to relayout (animation frame time). May be required if dialog size is incorrect or if stacked layout has not been triggered correctly.
focus() => voidFocuses on the initial focus element if defined.
blur() => voidBlurs the active element.
show() => voidOpens the dialog.
close() => voidCloses the dialog.

Listeners

Event NameTargetDescription
clickroot elementDetects if clicked target is a dialog action.
resizewindowPerforms dialog layout (passive).
orientationchangewindowPerforms dialog layout (passive).
keydownmwc-dialogListens for the enter key to click the default button (passive).
keydowndocumentListens for the escape key to close the dialog (see escapeKeyAction).

Events

Event NameTargetDetailDescription
openingmwc-dialog{}Fired when the dialog is beginning to open.
openedmwc-dialog{}Fired once the dialog is finished opening (after animation).
closingmwc-dialog{action: string}Fired when the dialog is is beginning to close. Detail is the action that closed the dialog.
closedmwc-dialog{action: string}Fired once the dialog is finished closing (after animation). Detail is the action that closed the dialog.
2.45.0

3 months ago

2.44.0

8 months ago

2.43.0

10 months ago

2.43.2

9 months ago

2.43.1

10 months ago

2.41.0

11 months ago

2.42.0

11 months ago

2.38.0

1 year ago

2.39.1

1 year ago

2.39.0

1 year ago

2.37.2

1 year ago

2.40.0

1 year ago

2.36.3

1 year ago

2.36.2

1 year ago

2.37.0

1 year ago

2.36.0

2 years ago

2.36.1

2 years ago

2.35.0

2 years ago

2.32.0

2 years ago

2.34.0

2 years ago

2.34.1

2 years ago

2.31.0

2 years ago

2.33.1

2 years ago

2.33.0

2 years ago

2.29.0

2 years ago

2.30.2

2 years ago

2.30.1

2 years ago

2.30.3

2 years ago

2.30.0

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.2

2 years ago

2.27.1

2 years ago

2.27.0

2 years ago

2.26.0

2 years ago

2.25.10

2 years ago

2.25.9

2 years ago

2.25.8

2 years ago

2.25.7

2 years ago

2.25.6

2 years ago

2.25.5

2 years ago

2.25.3

2 years ago

2.25.2

2 years ago

2.25.1

2 years ago

2.25.0

2 years ago

2.24.1

2 years ago

2.24.0

2 years ago

2.23.0

2 years ago

2.22.1

3 years ago

2.22.0

3 years ago

2.21.1

3 years ago

2.21.0

3 years ago

2.20.1

3 years ago

2.20.0

3 years ago

2.19.0

3 years ago

2.18.1

3 years ago

2.18.0

3 years ago

2.17.0

3 years ago

2.16.1

3 years ago

2.16.0

3 years ago

2.15.0

3 years ago

2.14.0

3 years ago

2.13.0

3 years ago

2.12.0

3 years ago

2.11.0

3 years ago

2.10.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago

2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago