@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
460 lines (455 loc) • 9.22 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "",
"name": "Menu",
"slots": [
{
"description": "Default slot.",
"name": ""
},
{
"description": "Used to set the anchor element for the menu.",
"name": "anchor"
},
{
"description": "Used to add additional content to the top of the menu.",
"name": "header"
},
{
"description": "Used to add action items to the bottom of the menu.",
"name": "action-items"
}
],
"members": [
{
"kind": "field",
"name": "menuItems",
"type": {
"text": "HTMLElement[] | undefined"
},
"privacy": "private"
},
{
"kind": "field",
"name": "expandedItem",
"type": {
"text": "MenuItem | null"
},
"privacy": "private",
"default": "null"
},
{
"kind": "field",
"name": "focusIndex",
"type": {
"text": "number"
},
"privacy": "private",
"default": "-1",
"description": "The index of the focusable element in the items array\ndefaults to -1"
},
{
"kind": "method",
"name": "focus",
"return": {
"type": {
"text": "void"
}
},
"description": "Moves focus into the menu. If there is a child with the `autofocus` attribute, it will be focused.\nOtherwise, the first focusable child will be focused.",
"privacy": "public"
},
{
"kind": "method",
"name": "collapseExpandedItem",
"return": {
"type": {
"text": "void"
}
},
"description": "Collapses any expanded Menu Items.",
"privacy": "public"
},
{
"kind": "field",
"name": "handleItemFocus",
"privacy": "private"
},
{
"kind": "field",
"name": "handleExpandedChanged",
"privacy": "private"
},
{
"kind": "field",
"name": "removeItemListeners",
"privacy": "private"
},
{
"kind": "field",
"name": "setItems",
"privacy": "private"
},
{
"kind": "method",
"name": "domChildren",
"privacy": "private",
"return": {
"type": {
"text": "Element[]"
}
},
"description": "get an array of valid DOM children"
},
{
"kind": "method",
"name": "setFocus",
"privacy": "private",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "focusIndex",
"type": {
"text": "number"
}
}
]
},
{
"kind": "field",
"name": "placement",
"type": {
"text": "Placement | undefined"
},
"default": "'bottom'",
"description": "placement of the menu",
"privacy": "public"
},
{
"kind": "field",
"name": "trigger",
"type": {
"text": "'auto' | 'legacy' | 'off' | undefined"
},
"description": "Controls how the menu opens and closes itself.",
"privacy": "public"
},
{
"kind": "field",
"name": "#triggerBehaviour",
"privacy": "private",
"type": {
"text": "'auto' | 'legacy' | 'off'"
},
"readonly": true
},
{
"kind": "field",
"name": "autoDismiss",
"type": {
"text": "boolean"
},
"default": "false",
"description": "indicates whether the menu will automatically close when focus moves away from it.",
"privacy": "public"
},
{
"kind": "field",
"name": "positionStrategy",
"type": {
"text": "Strategy | undefined"
},
"default": "'fixed'",
"description": "The strategy-absolute attribute.",
"privacy": "public"
},
{
"kind": "field",
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "indicates whether the menu is open",
"privacy": "public"
},
{
"kind": "method",
"name": "openChanged",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "_",
"type": {
"text": "boolean"
}
},
{
"name": "newValue",
"type": {
"text": "boolean"
}
}
]
},
{
"kind": "method",
"name": "#setupAnchor",
"parameters": [
{
"name": "a",
"type": {
"text": "HTMLElement"
}
}
]
},
{
"kind": "method",
"name": "#updateAnchor",
"parameters": [
{
"name": "a",
"type": {
"text": "HTMLElement"
}
}
]
},
{
"kind": "method",
"name": "#cleanupAnchor",
"parameters": [
{
"name": "a",
"type": {
"text": "HTMLElement"
}
}
]
},
{
"kind": "field",
"name": "#onAnchorClick",
"privacy": "private"
},
{
"kind": "field",
"name": "_onFocusout"
},
{
"kind": "field",
"name": "actionItemsSlottedContent",
"type": {
"text": "HTMLElement[] | undefined"
}
},
{
"kind": "field",
"name": "anchor",
"type": {
"text": "AnchorType | undefined"
},
"description": "ID or direct reference to the component's anchor element.",
"privacy": "public",
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
},
{
"kind": "field",
"name": "#updateAnchorEl",
"privacy": "private",
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
},
{
"kind": "field",
"name": "#observer",
"privacy": "private",
"type": {
"text": "MutationObserver | undefined"
},
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
},
{
"kind": "field",
"name": "#observeMissingAnchor",
"privacy": "private",
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
},
{
"kind": "field",
"name": "#cleanupObserverIfNeeded",
"privacy": "private",
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
},
{
"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": "Fired when the menu is opened",
"name": "open"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Fired when the menu is closed",
"name": "close"
}
],
"attributes": [
{
"name": "placement",
"type": {
"text": "Placement | undefined"
},
"default": "'bottom'",
"description": "placement of the menu",
"fieldName": "placement"
},
{
"name": "trigger",
"type": {
"text": "'auto' | 'legacy' | 'off' | undefined"
},
"description": "Controls how the menu opens and closes itself.",
"fieldName": "trigger"
},
{
"name": "auto-dismiss",
"type": {
"text": "boolean"
},
"default": "false",
"description": "indicates whether the menu will automatically close when focus moves away from it.",
"fieldName": "autoDismiss"
},
{
"name": "position-strategy",
"type": {
"text": "Strategy | undefined"
},
"default": "'fixed'",
"description": "The strategy-absolute attribute.",
"fieldName": "positionStrategy"
},
{
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "indicates whether the menu is open",
"fieldName": "open"
},
{
"name": "anchor",
"type": {
"text": "AnchorType | undefined"
},
"description": "ID or direct reference to the component's anchor element.",
"fieldName": "anchor",
"inheritedFrom": {
"name": "Anchored",
"module": "src/shared/patterns/anchored.ts"
}
}
],
"mixins": [
{
"name": "Anchored",
"module": "/src/shared/patterns/anchored"
},
{
"name": "DelegatesAria",
"module": "/src/shared/aria/delegates-aria"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "menu"
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerMenu } from '@vonage/vivid'
registerMenu('vvd3')
const VwcMenu = wrapper(`vvd3-menu`, {
events: [{"name":"close","propName":"onClose"},{"name":"open","propName":"onOpen"}],
attributes: [],
properties: ['placement', 'trigger', 'autoDismiss', 'positionStrategy', 'open', '_onFocusout', 'actionItemsSlottedContent', 'anchor', '_vividAriaBehaviour', 'VIVID_VERSION', 'componentName']
})
VwcMenu.displayName = 'VwcMenu'
export default VwcMenu