@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
476 lines (471 loc) • 9.55 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "",
"name": "Dialog",
"slots": [
{
"description": "Use the graphic slot in order to replace the icon.",
"name": "graphic"
},
{
"description": "Use the body slot in order to add custom HTML to the dialog.",
"name": "body"
},
{
"description": "Use the footer slot in order to add action buttons to the bottom of the dialog.",
"name": "footer"
},
{
"description": "Assign nodes to the main slot to fully override a dialog’s predefined flow and style with your own.",
"name": "main"
},
{
"description": "Use the action-items slot in order to add action buttons to the bottom of the dialog.",
"name": "action-items"
}
],
"members": [
{
"kind": "field",
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Indicates dialog's state",
"privacy": "public"
},
{
"kind": "field",
"name": "icon",
"type": {
"text": "string | undefined"
}
},
{
"kind": "field",
"name": "iconPlacement",
"type": {
"text": "IconPlacement | undefined"
}
},
{
"kind": "field",
"name": "subtitle",
"type": {
"text": "string | undefined"
}
},
{
"kind": "field",
"name": "headline",
"type": {
"text": "string | undefined"
}
},
{
"kind": "field",
"name": "fullWidthBody",
"type": {
"text": "boolean"
},
"default": "false"
},
{
"kind": "field",
"name": "dismissButtonAriaLabel",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null"
},
{
"kind": "field",
"name": "noLightDismiss",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Prevents the dialog from being dismissed when clicking outside it."
},
{
"kind": "field",
"name": "noDismissOnEsc",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Prevents the dialog from being dismissed when the escape key is pressed."
},
{
"kind": "field",
"name": "noDismissButton",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Hides the dismiss button."
},
{
"kind": "field",
"name": "nonDismissible",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Disables all means of dismissal for the dialog."
},
{
"kind": "field",
"name": "modal",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Controls whether the dialog is modal."
},
{
"kind": "field",
"name": "scrollableBody",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Makes only the element's content area between the header and footer scrollable"
},
{
"kind": "field",
"name": "returnValue",
"type": {
"text": "string"
}
},
{
"kind": "field",
"name": "#dialogElement",
"privacy": "private",
"type": {
"text": "HTMLDialogElement | undefined"
}
},
{
"kind": "field",
"name": "#dialog",
"privacy": "private",
"readonly": true
},
{
"kind": "field",
"name": "_showDismissButton",
"readonly": true
},
{
"kind": "method",
"name": "#isDismissibleVia",
"parameters": [
{
"name": "method",
"type": {
"text": "DismissMethod"
}
}
]
},
{
"kind": "field",
"name": "#handleScrimClick",
"privacy": "private"
},
{
"kind": "field",
"name": "#handleInternalFormSubmit",
"privacy": "private"
},
{
"kind": "method",
"name": "close"
},
{
"kind": "method",
"name": "show"
},
{
"kind": "method",
"name": "showModal"
},
{
"kind": "method",
"name": "#closeDialog"
},
{
"kind": "method",
"name": "#showDialog"
},
{
"kind": "field",
"name": "_vividAriaBehaviour",
"default": "'delegate'",
"type": {
"text": "'delegate'"
},
"inheritedFrom": {
"name": "DelegatesAria",
"module": "src/shared/aria/delegates-aria.ts"
}
},
{
"kind": "field",
"name": "VIVID_VERSION",
"static": true,
"default": "__PACKAGE_VERSION__",
"description": "The current version of the Vivid library, which is useful for debugging.\nIt can be accessed from any Vivid element via `<el>.constructor.VIVID_VERSION`.",
"type": {
"text": "string"
},
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
},
{
"kind": "field",
"name": "componentName",
"type": {
"text": "string"
},
"static": true,
"description": "Core component name, without prefix",
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
}
],
"events": [
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "The `open` event fires when the dialog opens.",
"name": "open"
},
{
"type": {
"text": "CustomEvent<string>"
},
"description": "The `close` event fires when the dialog closes (either via user interaction or via the API). It returns the return value inside the event's details property.",
"name": "close"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "The `cancel` event fires when the user requests to close the dialog. You can prevent the dialog from closing by calling `.preventDefault()` on the event.",
"name": "cancel"
}
],
"attributes": [
{
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Indicates dialog's state",
"fieldName": "open"
},
{
"name": "icon",
"type": {
"text": "string | undefined"
},
"fieldName": "icon"
},
{
"name": "icon-placement",
"type": {
"text": "IconPlacement | undefined"
},
"fieldName": "iconPlacement"
},
{
"name": "subtitle",
"type": {
"text": "string | undefined"
},
"fieldName": "subtitle"
},
{
"name": "headline",
"type": {
"text": "string | undefined"
},
"fieldName": "headline"
},
{
"name": "full-width-body",
"type": {
"text": "boolean"
},
"default": "false",
"fieldName": "fullWidthBody"
},
{
"name": "dismiss-button-aria-label",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null",
"fieldName": "dismissButtonAriaLabel"
},
{
"name": "no-light-dismiss",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Prevents the dialog from being dismissed when clicking outside it.",
"fieldName": "noLightDismiss"
},
{
"name": "no-dismiss-on-esc",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Prevents the dialog from being dismissed when the escape key is pressed.",
"fieldName": "noDismissOnEsc"
},
{
"name": "no-dismiss-button",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Hides the dismiss button.",
"fieldName": "noDismissButton"
},
{
"name": "non-dismissible",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Disables all means of dismissal for the dialog.",
"fieldName": "nonDismissible"
},
{
"name": "modal",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Controls whether the dialog is modal.",
"fieldName": "modal"
},
{
"name": "scrollable-body",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Makes only the element's content area between the header and footer scrollable",
"fieldName": "scrollableBody"
}
],
"mixins": [
{
"name": "Localized",
"module": "/src/shared/patterns"
},
{
"name": "DelegatesAria",
"module": "/src/shared/aria/delegates-aria"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "dialog",
"vueModels": [
{
"name": "open",
"propName": "open",
"eventNames": [
"open",
"close"
],
"valueMapping": "event.currentTarget.open"
}
]
},
"vividTesting": {
"selectors": [
{
"name": "byHeadline",
"args": [
"byHeadline"
]
}
],
"actions": [
{
"name": "dismiss",
"args": [
"click",
"#dismissButton"
]
}
],
"queries": [
{
"name": "open",
"args": [
"open",
"true"
]
},
{
"name": "closed",
"args": [
"open",
"false"
]
},
{
"name": "headline",
"args": [
"headline"
]
}
],
"refs": [
{
"name": "dismissButton",
"args": [
"shadow",
".dismiss-button"
]
}
]
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerDialog } from '@vonage/vivid'
registerDialog('vvd3')
const VwcDialog = wrapper(`vvd3-dialog`, {
events: [{"name":"cancel","propName":"onCancel"},{"name":"close","propName":"onClose"},{"name":"open","propName":"onOpen"}],
attributes: [],
properties: ['open', 'icon', 'iconPlacement', 'subtitle', 'headline', 'fullWidthBody', 'dismissButtonAriaLabel', 'noLightDismiss', 'noDismissOnEsc', 'noDismissButton', 'nonDismissible', 'modal', 'scrollableBody', 'returnValue', '_vividAriaBehaviour', 'VIVID_VERSION', 'componentName']
})
VwcDialog.displayName = 'VwcDialog'
export default VwcDialog