UNPKG

@lion/form-core

Version:

Form-core contains all essential building blocks for creating form fields and fieldsets

1,596 lines (1,595 loc) 1.2 MB
{ "schemaVersion": "1.0.0", "readme": "", "modules": [ { "kind": "javascript-module", "path": "define.d.ts", "declarations": [], "exports": [] }, { "kind": "javascript-module", "path": "define.js", "declarations": [], "exports": [] }, { "kind": "javascript-module", "path": "index.d.ts", "declarations": [], "exports": [ { "kind": "js", "name": "FocusMixin", "declaration": { "name": "FocusMixin", "module": "\"./src/FocusMixin.js\"" } }, { "kind": "js", "name": "FormatMixin", "declaration": { "name": "FormatMixin", "module": "\"./src/FormatMixin.js\"" } }, { "kind": "js", "name": "FormControlMixin", "declaration": { "name": "FormControlMixin", "module": "\"./src/FormControlMixin.js\"" } }, { "kind": "js", "name": "InteractionStateMixin", "declaration": { "name": "InteractionStateMixin", "module": "\"./src/InteractionStateMixin.js\"" } }, { "kind": "js", "name": "LionField", "declaration": { "name": "LionField", "module": "\"./src/LionField.js\"" } }, { "kind": "js", "name": "FormRegisteringMixin", "declaration": { "name": "FormRegisteringMixin", "module": "\"./src/registration/FormRegisteringMixin.js\"" } }, { "kind": "js", "name": "FormRegistrarMixin", "declaration": { "name": "FormRegistrarMixin", "module": "\"./src/registration/FormRegistrarMixin.js\"" } }, { "kind": "js", "name": "FormRegistrarPortalMixin", "declaration": { "name": "FormRegistrarPortalMixin", "module": "\"./src/registration/FormRegistrarPortalMixin.js\"" } }, { "kind": "js", "name": "NativeTextFieldMixin", "declaration": { "name": "NativeTextFieldMixin", "module": "\"./src/NativeTextFieldMixin.js\"" } }, { "kind": "js", "name": "FormControlsCollection", "declaration": { "name": "FormControlsCollection", "module": "\"./src/registration/FormControlsCollection.js\"" } }, { "kind": "js", "name": "ValidateMixin", "declaration": { "name": "ValidateMixin", "module": "\"./src/validate/ValidateMixin.js\"" } }, { "kind": "js", "name": "Unparseable", "declaration": { "name": "Unparseable", "module": "\"./src/validate/Unparseable.js\"" } }, { "kind": "js", "name": "Validator", "declaration": { "name": "Validator", "module": "\"./src/validate/Validator.js\"" } }, { "kind": "js", "name": "ResultValidator", "declaration": { "name": "ResultValidator", "module": "\"./src/validate/ResultValidator.js\"" } }, { "kind": "js", "name": "Required", "declaration": { "name": "Required", "module": "\"./src/validate/validators/Required.js\"" } }, { "kind": "js", "name": "DefaultSuccess", "declaration": { "name": "DefaultSuccess", "module": "\"./src/validate/resultValidators/DefaultSuccess.js\"" } }, { "kind": "js", "name": "LionValidationFeedback", "declaration": { "name": "LionValidationFeedback", "module": "\"./src/validate/LionValidationFeedback.js\"" } }, { "kind": "js", "name": "ChoiceGroupMixin", "declaration": { "name": "ChoiceGroupMixin", "module": "\"./src/choice-group/ChoiceGroupMixin.js\"" } }, { "kind": "js", "name": "ChoiceInputMixin", "declaration": { "name": "ChoiceInputMixin", "module": "\"./src/choice-group/ChoiceInputMixin.js\"" } }, { "kind": "js", "name": "FormGroupMixin", "declaration": { "name": "FormGroupMixin", "module": "\"./src/form-group/FormGroupMixin.js\"" } }, { "kind": "js", "name": "IsString", "declaration": { "name": "IsString", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "EqualsLength", "declaration": { "name": "EqualsLength", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "MinLength", "declaration": { "name": "MinLength", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "MaxLength", "declaration": { "name": "MaxLength", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "MinMaxLength", "declaration": { "name": "MinMaxLength", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "IsEmail", "declaration": { "name": "IsEmail", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "Pattern", "declaration": { "name": "Pattern", "module": "\"./src/validate/validators/StringValidators.js\"" } }, { "kind": "js", "name": "IsNumber", "declaration": { "name": "IsNumber", "module": "\"./src/validate/validators/NumberValidators.js\"" } }, { "kind": "js", "name": "MinNumber", "declaration": { "name": "MinNumber", "module": "\"./src/validate/validators/NumberValidators.js\"" } }, { "kind": "js", "name": "MaxNumber", "declaration": { "name": "MaxNumber", "module": "\"./src/validate/validators/NumberValidators.js\"" } }, { "kind": "js", "name": "MinMaxNumber", "declaration": { "name": "MinMaxNumber", "module": "\"./src/validate/validators/NumberValidators.js\"" } }, { "kind": "js", "name": "IsDate", "declaration": { "name": "IsDate", "module": "\"./src/validate/validators/DateValidators.js\"" } }, { "kind": "js", "name": "MinDate", "declaration": { "name": "MinDate", "module": "\"./src/validate/validators/DateValidators.js\"" } }, { "kind": "js", "name": "MaxDate", "declaration": { "name": "MaxDate", "module": "\"./src/validate/validators/DateValidators.js\"" } }, { "kind": "js", "name": "MinMaxDate", "declaration": { "name": "MinMaxDate", "module": "\"./src/validate/validators/DateValidators.js\"" } }, { "kind": "js", "name": "IsDateDisabled", "declaration": { "name": "IsDateDisabled", "module": "\"./src/validate/validators/DateValidators.js\"" } } ] }, { "kind": "javascript-module", "path": "index.js", "declarations": [], "exports": [ { "kind": "js", "name": "FocusMixin", "declaration": { "name": "FocusMixin", "module": "./src/FocusMixin.js" } }, { "kind": "js", "name": "FormatMixin", "declaration": { "name": "FormatMixin", "module": "./src/FormatMixin.js" } }, { "kind": "js", "name": "FormControlMixin", "declaration": { "name": "FormControlMixin", "module": "./src/FormControlMixin.js" } }, { "kind": "js", "name": "InteractionStateMixin", "declaration": { "name": "InteractionStateMixin", "module": "./src/InteractionStateMixin.js" } }, { "kind": "js", "name": "LionField", "declaration": { "name": "LionField", "module": "./src/LionField.js" } }, { "kind": "js", "name": "FormRegisteringMixin", "declaration": { "name": "FormRegisteringMixin", "module": "./src/registration/FormRegisteringMixin.js" } }, { "kind": "js", "name": "FormRegistrarMixin", "declaration": { "name": "FormRegistrarMixin", "module": "./src/registration/FormRegistrarMixin.js" } }, { "kind": "js", "name": "FormRegistrarPortalMixin", "declaration": { "name": "FormRegistrarPortalMixin", "module": "./src/registration/FormRegistrarPortalMixin.js" } }, { "kind": "js", "name": "NativeTextFieldMixin", "declaration": { "name": "NativeTextFieldMixin", "module": "./src/NativeTextFieldMixin.js" } }, { "kind": "js", "name": "FormControlsCollection", "declaration": { "name": "FormControlsCollection", "module": "./src/registration/FormControlsCollection.js" } }, { "kind": "js", "name": "ValidateMixin", "declaration": { "name": "ValidateMixin", "module": "./src/validate/ValidateMixin.js" } }, { "kind": "js", "name": "Unparseable", "declaration": { "name": "Unparseable", "module": "./src/validate/Unparseable.js" } }, { "kind": "js", "name": "Validator", "declaration": { "name": "Validator", "module": "./src/validate/Validator.js" } }, { "kind": "js", "name": "ResultValidator", "declaration": { "name": "ResultValidator", "module": "./src/validate/ResultValidator.js" } }, { "kind": "js", "name": "Required", "declaration": { "name": "Required", "module": "./src/validate/validators/Required.js" } }, { "kind": "js", "name": "IsString", "declaration": { "name": "IsString", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "EqualsLength", "declaration": { "name": "EqualsLength", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "MinLength", "declaration": { "name": "MinLength", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "MaxLength", "declaration": { "name": "MaxLength", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "MinMaxLength", "declaration": { "name": "MinMaxLength", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "IsEmail", "declaration": { "name": "IsEmail", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "Pattern", "declaration": { "name": "Pattern", "module": "./src/validate/validators/StringValidators.js" } }, { "kind": "js", "name": "IsNumber", "declaration": { "name": "IsNumber", "module": "./src/validate/validators/NumberValidators.js" } }, { "kind": "js", "name": "MinNumber", "declaration": { "name": "MinNumber", "module": "./src/validate/validators/NumberValidators.js" } }, { "kind": "js", "name": "MaxNumber", "declaration": { "name": "MaxNumber", "module": "./src/validate/validators/NumberValidators.js" } }, { "kind": "js", "name": "MinMaxNumber", "declaration": { "name": "MinMaxNumber", "module": "./src/validate/validators/NumberValidators.js" } }, { "kind": "js", "name": "IsDate", "declaration": { "name": "IsDate", "module": "./src/validate/validators/DateValidators.js" } }, { "kind": "js", "name": "MinDate", "declaration": { "name": "MinDate", "module": "./src/validate/validators/DateValidators.js" } }, { "kind": "js", "name": "MaxDate", "declaration": { "name": "MaxDate", "module": "./src/validate/validators/DateValidators.js" } }, { "kind": "js", "name": "MinMaxDate", "declaration": { "name": "MinMaxDate", "module": "./src/validate/validators/DateValidators.js" } }, { "kind": "js", "name": "IsDateDisabled", "declaration": { "name": "IsDateDisabled", "module": "./src/validate/validators/DateValidators.js" } }, { "kind": "js", "name": "DefaultSuccess", "declaration": { "name": "DefaultSuccess", "module": "./src/validate/resultValidators/DefaultSuccess.js" } }, { "kind": "js", "name": "LionValidationFeedback", "declaration": { "name": "LionValidationFeedback", "module": "./src/validate/LionValidationFeedback.js" } }, { "kind": "js", "name": "ChoiceGroupMixin", "declaration": { "name": "ChoiceGroupMixin", "module": "./src/choice-group/ChoiceGroupMixin.js" } }, { "kind": "js", "name": "ChoiceInputMixin", "declaration": { "name": "ChoiceInputMixin", "module": "./src/choice-group/ChoiceInputMixin.js" } }, { "kind": "js", "name": "FormGroupMixin", "declaration": { "name": "FormGroupMixin", "module": "./src/form-group/FormGroupMixin.js" } } ] }, { "kind": "javascript-module", "path": "lion-field.d.ts", "declarations": [], "exports": [] }, { "kind": "javascript-module", "path": "lion-field.js", "declarations": [], "exports": [ { "kind": "custom-element-definition", "name": "lion-field", "declaration": { "name": "LionField", "module": "/src/LionField.js" } } ] }, { "kind": "javascript-module", "path": "lion-validation-feedback.d.ts", "declarations": [], "exports": [] }, { "kind": "javascript-module", "path": "lion-validation-feedback.js", "declarations": [], "exports": [ { "kind": "custom-element-definition", "name": "lion-validation-feedback", "declaration": { "name": "LionValidationFeedback", "module": "/src/validate/LionValidationFeedback.js" } } ] }, { "kind": "javascript-module", "path": "src/FocusMixin.d.ts", "declarations": [ { "kind": "variable", "name": "FocusMixin", "type": { "text": "typeof import(\"../types/FocusMixinTypes\").FocusImplementation" }, "description": "For browsers that not support the [spec](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible),\nbe sure to load the polyfill into your application https://github.com/WICG/focus-visible\n(or go for progressive enhancement)." } ], "exports": [ { "kind": "js", "name": "FocusMixin", "declaration": { "name": "FocusMixin", "module": "src/FocusMixin.d.ts" } } ] }, { "kind": "javascript-module", "path": "src/FocusMixin.js", "declarations": [ { "kind": "mixin", "description": "", "name": "FocusMixin", "members": [ { "kind": "field", "name": "properties", "static": true, "type": { "text": "any" } }, { "kind": "method", "name": "focus", "description": "Calls `focus()` on focusable element within" }, { "kind": "method", "name": "blur", "description": "Calls `blur()` on focusable element within" }, { "kind": "field", "name": "_focusableNode", "description": "The focusable element:\ncould be an input, textarea, select, button or any other element with tabindex > -1", "privacy": "protected", "type": { "text": "HTMLElement" } }, { "kind": "method", "name": "__onFocus", "privacy": "private" }, { "kind": "method", "name": "__onBlur", "privacy": "private" }, { "kind": "method", "name": "__registerEventsForFocusMixin", "privacy": "private" }, { "kind": "method", "name": "__teardownEventsForFocusMixin", "privacy": "private" }, { "kind": "field", "name": "focused", "type": { "text": "boolean" }, "description": "Whether the focusable element within (`._focusableNode`) is focused.\nReflects to attribute '[focused]' as a styling hook", "default": "false" }, { "kind": "field", "name": "focusedVisible", "type": { "text": "boolean" }, "description": "Whether the focusable element within (`._focusableNode`) matches ':focus-visible'\nReflects to attribute '[focused-visible]' as a styling hook\nSee: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible", "default": "false" } ], "events": [ { "name": "focus", "type": { "text": "Event" } }, { "name": "blur", "type": { "text": "Event" } }, { "name": "focusin", "type": { "text": "Event" } }, { "name": "focusout", "type": { "text": "Event" } } ], "parameters": [ { "name": "superclass", "type": { "text": "Constructor<LitElement>" } } ], "type": { "text": "FocusMixin" }, "mixins": [ { "name": "dedupeMixin", "package": "@lion/core" } ] } ], "exports": [ { "kind": "js", "name": "FocusMixin", "declaration": { "name": "FocusMixin", "module": "src/FocusMixin.js" } } ] }, { "kind": "javascript-module", "path": "src/FormControlMixin.d.ts", "declarations": [ { "kind": "variable", "name": "FormControlMixin", "type": { "text": "typeof import(\"../types/FormControlMixinTypes.js\").FormControlImplementation" } } ], "exports": [ { "kind": "js", "name": "FormControlMixin", "declaration": { "name": "FormControlMixin", "module": "src/FormControlMixin.d.ts" } } ] }, { "kind": "javascript-module", "path": "src/FormControlMixin.js", "declarations": [ { "kind": "mixin", "description": "#FormControlMixin :\n\nThis Mixin is a shared fundament for all form components, it's applied on:\n- LionField (which is extended to LionInput, LionTextarea, LionSelect etc. etc.)\n- LionFieldset (which is extended to LionRadioGroup, LionCheckboxGroup, LionForm)", "name": "FormControlMixin", "members": [ { "kind": "field", "name": "properties", "static": true, "type": { "text": "any" } }, { "kind": "field", "name": "label", "description": "The label text for the input node.\nWhen no value is defined, textContent of [slot=label] will be used", "type": { "text": "string" }, "parameters": [ { "name": "newValue", "type": { "text": "string" } } ], "default": "''" }, { "kind": "field", "name": "helpText", "description": "The helpt text for the input node.\nWhen no value is defined, textContent of [slot=help-text] will be used", "type": { "text": "string" }, "parameters": [ { "name": "newValue", "type": { "text": "string" } } ], "default": "''" }, { "kind": "field", "name": "fieldName", "description": "Will be used in validation messages to refer to the current field", "type": { "text": "string" }, "parameters": [ { "name": "value", "type": { "text": "string" } } ] }, { "kind": "field", "name": "slots" }, { "kind": "field", "name": "_inputNode", "description": "The interactive (form) element. Can be a native element like input/textarea/select or\nan element with tabindex > -1", "privacy": "protected" }, { "kind": "field", "name": "_labelNode", "description": "Element where label will be rendered to", "privacy": "protected" }, { "kind": "field", "name": "_helpTextNode", "description": "Element where help text will be rendered to", "privacy": "protected" }, { "kind": "field", "name": "_feedbackNode", "description": "Element where validation feedback will be rendered to", "privacy": "protected" }, { "kind": "method", "name": "updated", "parameters": [ { "name": "changedProperties", "type": { "text": "PropertyValues" } } ] }, { "kind": "method", "name": "_triggerInitialModelValueChangedEvent", "privacy": "protected" }, { "kind": "method", "name": "_enhanceLightDomClasses", "privacy": "protected" }, { "kind": "method", "name": "_enhanceLightDomA11y", "privacy": "protected" }, { "kind": "method", "name": "_enhanceLightDomA11yForAdditionalSlots", "parameters": [ { "name": "additionalSlots", "default": "['prefix', 'suffix', 'before', 'after']", "type": { "text": "string[]" } } ], "description": "Enhances additional slots(prefix, suffix, before, after) defined by developer.\n\nWhen boolean attribute data-label or data-description is found,\nthe slot element will be connected to the input via aria-labelledby or aria-describedby", "privacy": "protected" }, { "kind": "method", "name": "__reflectAriaAttr", "parameters": [ { "name": "attrName", "type": { "text": "string" } }, { "name": "nodes", "type": { "text": "HTMLElement[]" } }, { "name": "reorder", "type": { "text": "boolean|undefined" } } ], "description": "Will handle help text, validation feedback and character counter,\nprefix/suffix/before/after (if they contain data-description flag attr).\nAlso, contents of id references that will be put in the <lion-field>._ariaDescribedby property\nfrom an external context, will be read by a screen reader." }, { "kind": "method", "name": "render", "description": "Default Render Result:\n<div class=\"form-field__group-one\">\n <div class=\"form-field__label\">\n <slot name=\"label\"></slot>\n </div>\n <small class=\"form-field__help-text\">\n <slot name=\"help-text\"></slot>\n </small>\n</div>\n<div class=\"form-field__group-two\">\n <div class=\"input-group\">\n <div class=\"input-group__before\">\n <slot name=\"before\"></slot>\n </div>\n <div class=\"input-group__container\">\n <div class=\"input-group__prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div class=\"input-group__input\">\n <slot name=\"input\"></slot>\n </div>\n <div class=\"input-group__suffix\">\n <slot name=\"suffix\"></slot>\n </div>\n </div>\n <div class=\"input-group__after\">\n <slot name=\"after\"></slot>\n </div>\n </div>\n <div class=\"form-field__feedback\">\n <slot name=\"feedback\"></slot>\n </div>\n</div>" }, { "kind": "method", "name": "_groupOneTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_groupTwoTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_labelTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_helpTextTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupBeforeTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupPrefixTemplate", "return": { "type": { "text": "TemplateResult | nothing" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupInputTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupSuffixTemplate", "return": { "type": { "text": "TemplateResult | nothing" } }, "privacy": "protected" }, { "kind": "method", "name": "_inputGroupAfterTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_feedbackTemplate", "return": { "type": { "text": "TemplateResult" } }, "privacy": "protected" }, { "kind": "method", "name": "_isEmpty", "parameters": [ { "name": "modelValue", "default": "(this).modelValue", "type": { "text": "any" } } ], "description": "Used for Required validation and computation of interaction states", "return": { "type": { "text": "boolean" } }, "privacy": "protected" }, { "kind": "field", "name": "styles", "static": true, "description": "{block} .input-group\n\nStructure:\n- {element} .input-group__before (optional) : a prefix that resides outside the container\n- {element} .input-group__container : an inner container: this element contains all styling\n - {element} .input-group__prefix (optional) : a prefix that resides in the container,\n allowing it to be detectable as a :first-child\n - {element} .input-group__input : a wrapper around the form-control component\n - {block} .form-control : the actual input element (input/select/textarea)\n - {element} .input-group__suffix (optional) : a suffix that resides inside the container,\n allowing it to be detectable as a :last-child\n - {element} .input-group__bottom (optional) : placeholder element for additional styling\n (like an animated line for material design input)\n- {element} .input-group__after (optional) : a suffix that resides outside the container" }, { "kind": "method", "name": "_getAriaDescriptionElements", "description": "This function exposes descripion elements that a FormGroup should expose to its\nchildren. See FormGroupMixin.__getAllDescriptionElementsInParentChain()", "return": { "type": { "text": "Array.<HTMLElement>" } }, "privacy": "protected" }, { "kind": "method", "name": "addToAriaLabelledBy", "parameters": [ { "name": "element", "type": { "text": "HTMLElement" } }, { "name": "{ idPrefix = '', reorder = true }", "default": "{}" }, { "name": "customConfig", "type": { "text": "{idPrefix?:string; reorder?: boolean}" } } ], "description": "Allows to add extra element references to aria-labelledby attribute." }, { "kind": "method", "name": "removeFromAriaLabelledBy", "parameters": [ { "name": "element", "type": { "text": "HTMLElement" } } ], "description": "Allows to remove element references from aria-labelledby attribute." }, { "kind": "method", "name": "addToAriaDescribedBy", "parameters": [ { "name": "element", "type": { "text": "HTMLElement" } }, { "name": "{ idPrefix = '', reorder = true }", "default": "{}" }, { "name": "customConfig", "type": { "text": "{idPrefix?:string; reorder?: boolean}" } } ], "description": "Allows to add element references to aria-describedby attribute." }, { "kind": "method", "name": "removeFromAriaDescribedBy", "parameters": [ { "name": "element", "type": { "text": "HTMLElement" } } ], "description": "Allows to remove element references from aria-describedby attribute." }, { "kind": "method", "name": "__getDirectSlotChild", "parameters": [ { "name": "slotName", "type": { "text": "string" } } ], "return": { "type": { "text": "HTMLElement | undefined" } } }, { "kind": "method", "name": "_dispatchInitialModelValueChangedEvent" }, { "kind": "method", "name": "_onBeforeRepropagateChildrenValues", "parameters": [ { "name": "ev", "type": { "text": "CustomEvent" } } ], "description": "Hook for Subclassers to add logic before repropagation", "privacy": "protected" }, { "kind": "method", "name": "__repropagateChildrenValues", "parameters": [ { "name": "ev", "type": { "text": "CustomEvent" } } ] }, { "kind": "method", "name": "_repropagationCondition", "parameters": [ { "name": "target", "type": { "text": "FormControlHost" } } ], "description": "Based on provided target, this condition determines whether received model-value-changed\nevent should be repropagated", "privacy": "protected" }, { "kind": "method", "name": "_onLabelClick", "privacy": "protected" }, { "kind": "field", "name": "name", "type": { "text": "string" }, "description": "The name the element will be registered with to the .formElements collection\nof the parent. Also, it serves as the key of key/value pairs in\n modelValue/serializedValue objects", "default": "''" }, { "kind": "field", "name": "readOnly", "type": { "text": "boolean" }, "description": "A Boolean attribute which, if present, indicates that the user should not be able to edit\nthe value of the input. The difference between disabled and readonly is that read-only\ncontrols can still function, whereas disabled controls generally do not function as\ncontrols until they are enabled.\n(From: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly)", "default": "false" }, { "kind": "field", "name": "labelSrOnly", "type": { "text": "boolean" }, "description": "The label will only be visible for srceen readers when true", "default": "false" }, { "kind": "field", "name": "_inputId", "description": "Unique id that can be used in all light dom", "type": { "text": "string" }, "privacy": "protected" }, { "kind": "field", "name": "_ariaLabelledNodes", "type": { "text": "HTMLElement[]" }, "description": "Contains all elements that should end up in aria-labelledby of `._inputNode`", "default": "[]" }, { "kind": "field", "name": "_ariaDescribedNodes", "type": { "text": "HTMLElement[]" }, "description": "Contains all elements that should end up in aria-describedby of `._inputNode`", "default": "[]" }, { "kind": "field", "name": "_repropagationRole", "type": { "text": "'child'|'choice-group'|'fieldset'" }, "description": "Based on the role, details of handling model-value-changed repropagation differ.", "default": "'child'" }, { "kind": "field", "name": "_isRepropagationEndpoint", "type": { "text": "boolean" }, "description": "By default, a field with _repropagationRole 'choice-group' will act as an\n'endpoint'. This means it will be considered as an individual field: for\na select, individual options will not be part of the formPath. They\nwill.\nSimilarly, components that (a11y wise) need to be fieldsets, but 'interaction wise'\n(from Application Developer perspective) need to be more like fields\n(think of an amount-input with a currency select box next to it), can set this\nto true to hide private internals in the formPath.", "default": "false" }, { "kind": "method", "name": "__unregisterFormElement", "description": "Putting this in a separate method makes testing easier", "privacy": "private", "inheritedFrom": { "name": "FormRegisteringMixin", "module": "src/registration/FormRegisteringMixin.js" } }, { "kind": "field", "name": "_parentFormGroup", "description": "The registrar this FormControl registers to, Usually a descendant of FormGroup or\nChoiceGroup", "type": { "text": "FormRegistrarHost | undefined" }, "default": "undefined", "inheritedFrom": { "name": "FormRegisteringMixin", "module": "src/registration/FormRegisteringMixin.js" } } ], "events": [ { "name": "form-element-name-changed", "type": { "text": "CustomEvent" } }, { "name": "model-value-changed", "type": { "text": "CustomEvent" } }, { "name": "form-element-register", "type": { "text": "CustomEvent" }, "inheritedFrom": { "name": "FormRegisteringMixin", "module": "src/registration/FormRegisteringMixin.js" } } ], "mixins": [ { "name": "FormRegisteringMixin", "module": "/src/registration/FormRegisteringMixin.js" }, { "name": "DisabledMixin", "package": "@lion/core" }, { "name": "SlotMixin", "package": "@lion/core" }, { "name": "dedupeMixin", "package": "@lion/core" } ], "parameters": [ { "name": "superclass", "type": { "text": "Constructor<LitElement>" } } ], "type": { "text": "FormControlMixin" } } ], "exports": [ { "kind": "js", "name": "FormControlMixin", "declaration": { "name": "FormControlMixin", "module": "src/FormControlMixin.js" } } ] }, { "kind": "javascript-module", "path": "src/FormatMixin.d.ts", "declarations": [ { "kind": "variable", "name": "FormatMixin", "type": { "text": "typeof import(\"../types/FormatMixinTypes\").FormatImplementation" } } ], "exports": [ { "kind": "js", "name": "FormatMixin", "declaration": { "name": "FormatMixin", "module": "src/FormatMixin.d.ts" } } ] }, { "kind": "javascript-module", "path": "src/FormatMixin.js", "declarations": [ { "kind": "mixin", "description": "", "name": "FormatMixin", "members": [ { "kind": "field", "name": "properties", "static": true, "type": { "text": "any" }, "inheritedFrom": { "name": "FormControlMixin", "module": "src/FormControlMixin.js" } }, { "kind": "method", "name": "requestUpdate", "parameters": [ { "name": "name", "type": { "text": "string" } }, { "name": "oldVal", "type": { "text": "any" } } ], "inheritedFrom": { "name": "SyncUpdatableMixin", "module": "src/utils/SyncUpdatableMixin.js" } }, { "kind": "field", "name": "value", "description": "The view value. Will be delegated to `._inputNode.value`", "parameters": [ { "name": "value", "type": { "text": "string" } } ] }, { "kind": "method", "name": "preprocessor", "parameters": [ { "name": "v", "description": "the raw value from the <input> after keyUp/Down event", "type": { "text": "string" } }, { "name": "opts", "description": "the raw value from the <input> after keyUp/Down event", "type": { "text": "FormatOptions & { prevViewValue: string; currentCaretIndex: number }" } } ], "description": "Preprocessors could be considered 'live formatters'. Their result is shown to the user\non keyup instead of after blurring the field. The biggest difference between preprocessors\nand formatters is their moment of execution: preprocessors are run before modelValue is\ncomputed (and work based on view value), whereas formatters are run after the parser (and\nare based on modelValue)\nAutomatically formats code while typing. It depends on a preprocessro that smartly\nupdates the viewValue and caret position for best UX.", "return": { "type": { "text": "{ viewValue:string; caretIndex:number; }|string|undefined" } } }, { "kind": "method", "name": "parser", "parameters": [ { "name": "v", "description": "viewValue: the formatted value inside <input>", "type": { "text": "string" } }, { "name": "opts", "type": { "text": "FormatOptions" } } ], "description": "Converts viewValue to modelValue\nFor instance, a localized date to a Date Object", "return": { "type": { "text": "*" } } }, { "kind": "method", "name": "formatter", "parameters": [ { "name": "v", "description": "modelValue: can be an Object, Number, String depending on the\ninput type(date, number, email etc)", "type": { "text": "*" } }, { "name": "opts", "type": { "text": "FormatOptions" } } ], "description": "Converts modelValue to formattedValue (formattedValue will be synced with\n`._inputNode.value`)\nFor instance, a Date object to a localized date.", "return": { "type": { "text": "string" } } },