@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
933 lines (928 loc) • 23.5 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "Base class for text-field",
"name": "TextField",
"cssProperties": [
{
"name": "--vvd-text-field-accent-primary",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-text-field-accent-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-text-field-accent-primary-increment",
"default": "var(--vvd-color-neutral-800)"
},
{
"name": "--vvd-text-field-accent-intermediate",
"default": "var(--vvd-color-neutral-500)"
},
{
"name": "--vvd-text-field-accent-firm",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-text-field-accent-fierce",
"default": "var(--vvd-color-neutral-700)"
},
{
"name": "--vvd-text-field-accent-faint",
"default": "var(--vvd-color-neutral-50)"
},
{
"name": "--vvd-text-field-accent-soft",
"default": "var(--vvd-color-neutral-100)"
}
],
"slots": [
{
"description": "Used to add action items to the start of the text-field.",
"name": "leading-action-items"
},
{
"description": "Used to add action items to the end of the text-field.",
"name": "action-items"
},
{
"description": "Describes how to use the text-field. Alternative to the `helper-text` attribute.",
"name": "helper-text"
}
],
"members": [
{
"kind": "field",
"name": "readOnly",
"type": {
"text": "boolean"
},
"description": "When true, the control will be immutable by user interaction. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute for more information.",
"privacy": "public"
},
{
"kind": "field",
"name": "autofocus",
"type": {
"text": "boolean"
},
"description": "Indicates that this element should get focus after the page finishes loading. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute for more information.",
"privacy": "public"
},
{
"kind": "field",
"name": "placeholder",
"type": {
"text": "string"
},
"description": "Sets the placeholder value of the element, generally used to provide a hint to the user.",
"privacy": "public"
},
{
"kind": "field",
"name": "type",
"type": {
"text": "TextFieldType"
},
"description": "Allows setting a type or mode of text.",
"privacy": "public"
},
{
"kind": "field",
"name": "list",
"type": {
"text": "string"
},
"description": "Allows associating a https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist to the element by https://developer.mozilla.org/en-US/docs/Web/API/Element/id.",
"privacy": "public"
},
{
"kind": "field",
"name": "maxlength",
"type": {
"text": "number"
},
"description": "The maximum number of characters a user can enter.",
"privacy": "public",
"inheritedFrom": {
"name": "WithCharCount",
"module": "src/shared/patterns/char-count/char-count.ts"
}
},
{
"kind": "field",
"name": "minlength",
"type": {
"text": "number"
},
"description": "The minimum number of characters a user can enter.",
"privacy": "public"
},
{
"kind": "field",
"name": "pattern",
"type": {
"text": "string"
},
"description": "A regular expression that the value must match to pass validation.",
"privacy": "public"
},
{
"kind": "field",
"name": "size",
"type": {
"text": "number"
},
"description": "Sets the width of the element to a specified number of characters.",
"privacy": "public"
},
{
"kind": "field",
"name": "spellcheck",
"type": {
"text": "boolean"
},
"description": "Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.",
"privacy": "public"
},
{
"kind": "method",
"name": "select",
"description": "Selects all the text in the text field",
"privacy": "public"
},
{
"kind": "method",
"name": "validate",
"description": "{@inheritDoc (FormAssociated:interface).validate}",
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "field",
"name": "appearance",
"type": {
"text": "TextFieldAppearance | undefined"
}
},
{
"kind": "field",
"name": "shape",
"type": {
"text": "TextFieldShape | undefined"
}
},
{
"kind": "field",
"name": "autoComplete",
"type": {
"text": "string | undefined"
}
},
{
"kind": "field",
"name": "scale",
"type": {
"text": "TextFieldSize | undefined"
},
"description": "The size the text-field should have.",
"privacy": "public"
},
{
"kind": "field",
"name": "inputMode",
"type": {
"text": "string"
},
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents.\nThis allows a browser to display an appropriate virtual keyboard.",
"privacy": "public"
},
{
"kind": "field",
"name": "leadingActionItemsSlottedContent",
"type": {
"text": "HTMLElement[] | undefined"
}
},
{
"kind": "method",
"name": "focus"
},
{
"kind": "field",
"name": "#randomId",
"privacy": "private"
},
{
"kind": "field",
"name": "helperText",
"type": {
"text": "string | undefined"
},
"description": "Provides additional information to help the user enter the correct information.\nTo add HTML to the helper text, use the helper-text slot instead.",
"privacy": "public",
"inheritedFrom": {
"name": "WithFeedback",
"module": "src/shared/feedback/mixins.ts"
}
},
{
"kind": "field",
"name": "value",
"type": {
"text": "string"
},
"description": "The current value of the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "charCount",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Use in combination with `maxlength` to display a character count.",
"privacy": "public",
"inheritedFrom": {
"name": "WithCharCount",
"module": "src/shared/patterns/char-count/char-count.ts"
}
},
{
"kind": "field",
"name": "errorText",
"type": {
"text": "string | undefined"
},
"description": "Provides a custom error message. Any current error state will be overridden.",
"privacy": "public",
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "field",
"name": "#blockValidateCalls",
"privacy": "private",
"type": {
"text": "boolean"
},
"default": "false",
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "field",
"name": "#originalValidateFn",
"privacy": "private",
"type": {
"text": "() => void"
},
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "method",
"name": "#forceCustomError",
"parameters": [
{
"name": "errorMessage",
"type": {
"text": "string"
}
}
],
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "method",
"name": "#clearCustomErrorAndRevalidate",
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"kind": "field",
"name": "successText",
"type": {
"text": "string | undefined"
},
"description": "Provides a custom success message. Any current error state will be overridden.",
"privacy": "public",
"inheritedFrom": {
"name": "WithSuccessText",
"module": "src/shared/patterns/form-elements/with-success-text.ts"
}
},
{
"kind": "field",
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "The label for the form element.",
"inheritedFrom": {
"name": "FormElement",
"module": "src/shared/patterns/form-elements/form-element.ts"
}
},
{
"kind": "field",
"name": "#handleInvalidEvent",
"privacy": "private",
"inheritedFrom": {
"name": "FormElement",
"module": "src/shared/patterns/form-elements/form-element.ts"
}
},
{
"kind": "field",
"name": "icon",
"type": {
"text": "string | undefined"
},
"description": "A decorative icon the custom element should have.",
"privacy": "public",
"inheritedFrom": {
"name": "AffixIcon",
"module": "src/shared/patterns/affix.ts"
}
},
{
"kind": "field",
"name": "_vividAriaBehaviour",
"default": "'delegate'",
"type": {
"text": "'delegate'"
},
"inheritedFrom": {
"name": "DelegatesAria",
"module": "src/shared/aria/delegates-aria.ts"
}
},
{
"kind": "field",
"name": "validity",
"type": {
"text": "ValidityState"
},
"description": "Returns the validity state of the element",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "form",
"type": {
"text": "HTMLFormElement | null"
},
"description": "Retrieve a reference to the associated form.\nReturns null if not associated to any form.",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "validationMessage",
"type": {
"text": "string"
},
"description": "Retrieve the localized validation message,\nor custom validation message if set.",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "willValidate",
"type": {
"text": "boolean"
},
"description": "Whether the element will be validated when the\nform is submitted",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "labels",
"type": {
"text": "ReadonlyArray<Node>"
},
"description": "A reference to all associated label elements",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "currentValue",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "initialValue",
"type": {
"text": "string"
},
"description": "The default value of the element. This value sets the `value` property\nonly when the `value` property has not been explicitly set.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Sets the element's disabled state. A disabled element will not be included during form submission.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the element. This element's value will be surfaced during form submission under the provided name.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "required",
"type": {
"text": "boolean"
},
"description": "Require the field to be completed prior to form submission.",
"default": "false",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "method",
"name": "checkValidity",
"return": {
"type": {
"text": "boolean"
}
},
"description": "Return the current validity of the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "method",
"name": "reportValidity",
"return": {
"type": {
"text": "boolean"
}
},
"description": "Return the current validity of the element.\nIf false, fires an invalid event at the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.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": "Fires a custom 'change' event when the value has changed",
"name": "change"
}
],
"attributes": [
{
"name": "readonly",
"type": {
"text": "boolean"
},
"description": "When true, the control will be immutable by user interaction. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute for more information.",
"fieldName": "readOnly"
},
{
"name": "autofocus",
"type": {
"text": "boolean"
},
"description": "Indicates that this element should get focus after the page finishes loading. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute for more information.",
"fieldName": "autofocus"
},
{
"name": "placeholder",
"type": {
"text": "string"
},
"description": "Sets the placeholder value of the element, generally used to provide a hint to the user.",
"fieldName": "placeholder"
},
{
"name": "type",
"type": {
"text": "TextFieldType"
},
"description": "Allows setting a type or mode of text.",
"fieldName": "type"
},
{
"name": "list",
"type": {
"text": "string"
},
"description": "Allows associating a https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist to the element by https://developer.mozilla.org/en-US/docs/Web/API/Element/id.",
"fieldName": "list"
},
{
"name": "maxlength",
"type": {
"text": "number"
},
"description": "The maximum number of characters a user can enter.",
"fieldName": "maxlength"
},
{
"name": "minlength",
"type": {
"text": "number"
},
"description": "The minimum number of characters a user can enter.",
"fieldName": "minlength"
},
{
"name": "pattern",
"type": {
"text": "string"
},
"description": "A regular expression that the value must match to pass validation.",
"fieldName": "pattern"
},
{
"name": "size",
"type": {
"text": "number"
},
"description": "Sets the width of the element to a specified number of characters.",
"fieldName": "size"
},
{
"name": "spellcheck",
"type": {
"text": "boolean"
},
"description": "Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.",
"fieldName": "spellcheck"
},
{
"name": "appearance",
"type": {
"text": "TextFieldAppearance | undefined"
},
"fieldName": "appearance"
},
{
"name": "shape",
"type": {
"text": "TextFieldShape | undefined"
},
"fieldName": "shape"
},
{
"name": "autoComplete",
"type": {
"text": "string | undefined"
},
"fieldName": "autoComplete"
},
{
"name": "scale",
"type": {
"text": "TextFieldSize | undefined"
},
"description": "The size the text-field should have.",
"fieldName": "scale"
},
{
"name": "inputmode",
"type": {
"text": "string"
},
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents.\nThis allows a browser to display an appropriate virtual keyboard.",
"fieldName": "inputMode"
},
{
"name": "helper-text",
"type": {
"text": "string | undefined"
},
"description": "Provides additional information to help the user enter the correct information.\nTo add HTML to the helper text, use the helper-text slot instead.",
"fieldName": "helperText",
"inheritedFrom": {
"name": "WithFeedback",
"module": "src/shared/feedback/mixins.ts"
}
},
{
"name": "char-count",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Use in combination with `maxlength` to display a character count.",
"fieldName": "charCount",
"inheritedFrom": {
"name": "WithCharCount",
"module": "src/shared/patterns/char-count/char-count.ts"
}
},
{
"name": "error-text",
"type": {
"text": "string | undefined"
},
"description": "Provides a custom error message. Any current error state will be overridden.",
"fieldName": "errorText",
"inheritedFrom": {
"name": "WithErrorText",
"module": "src/shared/patterns/form-elements/with-error-text.ts"
}
},
{
"name": "success-text",
"type": {
"text": "string | undefined"
},
"description": "Provides a custom success message. Any current error state will be overridden.",
"fieldName": "successText",
"inheritedFrom": {
"name": "WithSuccessText",
"module": "src/shared/patterns/form-elements/with-success-text.ts"
}
},
{
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "The label for the form element.",
"fieldName": "label",
"inheritedFrom": {
"name": "FormElement",
"module": "src/shared/patterns/form-elements/form-element.ts"
}
},
{
"name": "icon",
"type": {
"text": "string | undefined"
},
"description": "A decorative icon the custom element should have.",
"fieldName": "icon",
"inheritedFrom": {
"name": "AffixIcon",
"module": "src/shared/patterns/affix.ts"
}
},
{
"name": "current-value",
"type": {
"text": "string"
},
"description": "The current value of the element.",
"fieldName": "value",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "value",
"type": {
"text": "string"
},
"description": "The default value of the element. This value sets the `value` property\nonly when the `value` property has not been explicitly set.",
"fieldName": "initialValue",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Sets the element's disabled state. A disabled element will not be included during form submission.",
"fieldName": "disabled",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the element. This element's value will be surfaced during form submission under the provided name.",
"fieldName": "name",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "required",
"type": {
"text": "boolean"
},
"description": "Require the field to be completed prior to form submission.",
"default": "false",
"fieldName": "required",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
}
],
"mixins": [
{
"name": "WithContextualHelp",
"module": "/src/shared/patterns"
},
{
"name": "WithLightDOMFeedback",
"module": "/src/shared/feedback/mixins"
},
{
"name": "WithCharCount",
"module": "/src/shared/patterns"
},
{
"name": "WithErrorText",
"module": "/src/shared/patterns"
},
{
"name": "WithSuccessText",
"module": "/src/shared/patterns"
},
{
"name": "FormElement",
"module": "/src/shared/patterns"
},
{
"name": "AffixIcon",
"module": "/src/shared/patterns"
},
{
"name": "DelegatesAria",
"module": "/src/shared/aria/delegates-aria"
},
{
"name": "FormAssociated",
"module": "/src/shared/foundation/form-associated/form-associated"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "text-field",
"vueModels": [
{
"name": "modelValue",
"propName": "value",
"eventNames": [
"input"
],
"valueMapping": "event.currentTarget.value"
}
]
},
"vividTesting": {
"selectors": [],
"actions": [
{
"name": "fill",
"args": [
"fill",
"#control"
]
},
{
"name": "clear",
"args": [
"clear",
"#control"
]
},
{
"name": "blur",
"args": [
"blur",
"#control"
]
}
],
"queries": [],
"refs": [
{
"name": "control",
"args": [
"light",
"input[slot=\"_control\"]"
]
}
]
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerTextField } from '@vonage/vivid'
registerTextField('vvd3')
const VwcTextField = wrapper(`vvd3-text-field`, {
events: [{"name":"input","propName":"onInput"},{"name":"focus","propName":"onFocus"},{"name":"change","propName":"onChange"},{"name":"blur","propName":"onBlur"}],
attributes: [],
properties: ['icon', 'value', 'placeholder', 'label', 'onInput', 'charCount', 'disabled', 'errorText', 'helperText', 'required', 'successText', 'readOnly', 'autofocus', 'placeholder', 'type', 'list', 'maxlength', 'minlength', 'pattern', 'size', 'spellcheck', 'appearance', 'shape', 'autoComplete', 'scale', 'inputMode', 'leadingActionItemsSlottedContent', 'helperText', 'value', 'charCount', 'errorText', 'successText', 'label', 'icon', '_vividAriaBehaviour', 'currentValue', 'initialValue', 'disabled', 'name', 'required', 'VIVID_VERSION', 'componentName']
})
VwcTextField.displayName = 'VwcTextField'
export default VwcTextField