UNPKG

@lion/ui

Version:

A package of extendable web components

66 lines (62 loc) 188 kB
--- parts: - API Table - Input Tel Dropdown title: 'Input Tel Dropdown: API Table' eleventyNavigation: key: API Table >> Input Tel Dropdown title: API Table order: 90 parent: Input Tel Dropdown --- # Input Tel Dropdown: API Table ## class: `LionInputTelDropdown`, `lion-input-tel-dropdown` ### Fields | Name | Privacy | Type | Default | Description | Inherited From | | ---------------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | | `activePhoneNumberType` | public | | | Type of phone number, derived from textbox value. Enum with values:
-'fixed-line'
-'fixed-line-or-mobile'
-'mobile'
-'pager'
-'personal-number'
-'premium-rate'
-'shared-cost'
-'toll-free'
-'uan'
-'voip'
-'unknown'
See https\://www\.npmjs.com/package/awesome-phonenumber | LionInputTel | | `activeRegion` | public | `string` | | Currently active region based on:
1\. allowed regions: get the region from configured allowed regions (if one entry)
2\. user input: try to derive active region from user input
3\. locale: try to get the region from locale (\`html\[lang]\` attribute) | LionInputTel | | `allowCrossRootRegistration` | public | `boolean` | `false` | To encourage accessibility best practices, \`form-element-register\` events
do not pierce through shadow roots. This forces the developer to create form groups and fieldsets that automatically allow the creation of accessible relationships in the same dom tree.
Use this option if you know what you're doing. It will then be possible to nest FormControls
inside shadow dom. See https\://lion.js.org/fundamentals/rationales/accessibility/#shadow-roots-and-accessibility | LionField | | `allowedRegions` | public | `RegionCode[]` | `[]` | The regions that should be considered when international phone numbers are detected.
(when not configured, all regions worldwide will be considered) | LionInputTel | | `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin | | `autofocus` | public | `boolean` | `false` | | LionField | | `defaultValidators` | public | `Validator[]` | `[]` | Used by Subclassers to add default Validators to a particular FormControl.
A date input for instance, always needs the isDate validator. | LionField | | `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | LionField | | `disabled` | public | `boolean` | `false` | | LionField | | `fieldName` | public | `string` | | Set a default name for this field, so that validation feedback will be always
accessible and linguistically correct | LionField | | `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | LionField | | `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | LionField | | `focusedVisible` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) matches ':focus-visible'
Reflects to attribute '\[focused-visible]' as a styling hook
See: https\://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible | LionField | | `formatCountryCodeStyle` | public | `string` | `'default'` | Extra styling of the format strategy
default \| parentheses | LionInputTel | | `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField | | `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField | | `formatStrategy` | public | `PhoneNumberFormat` | `'international'` | Determines what the formatter output should look like.
Formatting strategies as provided by google-libphonenumber
See: https\://www\.npmjs.com/package/google-libphonenumber | LionInputTel | | `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField | | `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | LionField | | `helpText` | public | `string` | | The helpt text for the input node.
When no light dom defined via \[slot=help-text], this value will be used | LionField | | `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | LionField | | `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionField | | `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField | | `modelValue` | public | | | | LionField | | `name` | public | `string` | `''` | The name the element will be registered with to the .formElements collection
of the parent. Also, it serves as the key of key/value pairs in
 modelValue/serializedValue objects | LionField | | `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | LionField | | `placeholder` | public | `string` | `''` | | LionInput | | `preferredRegions` | public | `RegionCode[]` | `[]` | Regions that will be shown on top of the dropdown | LionInputTel | | `prefilled` | public | `boolean` | `false` | True when user has left non-empty field or input is prefilled.
The name must be seen from the point of view of the input field:
once the user enters the input field, the value is non-empty. | LionField | | `readOnly` | public | `boolean` | `false` | A Boolean attribute which, if present, indicates that the user should not be able to edit
the value of the input. The difference between disabled and readonly is that read-only
controls can still function, whereas disabled controls generally do not function as
controls until they are enabled.
(From: https\://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) | LionField | | `refs` | public | `object` | `{ /** @type {DropdownRef} */ dropdown: /** @type {DropdownRef} */ (createRef()), }` | | | | `selectionEnd` | public | `number` | | | NativeTextFieldMixin | | `selectionStart` | public | `number` | | | NativeTextFieldMixin | | `serializedValue` | public | `string\|undefined` | `undefined` | The serialized version of the model value.
This value exists for maximal compatibility with the platform API.
The serialized value can be an interface in context where data binding is not
supported and a serialized string needs to be set.

Examples:
- For a date input, this would be the iso format of a date, e.g. '1999-01-20'.
- For a number input this would be the String representation of a float ('1234.56'
 instead of 1234.56)

When no parser is available, the value is usually the same as the formattedValue
(being \_inputNode.value) | LionField | | `showsFeedbackFor` | public | `ValidationType[]` | `[]` | Based on outcome of feedbackCondition, this array decides what ValidationTypes should be
shown in validationFeedback, based on meta data like interaction states.

For styling purposes, it reflects it \`\[shows-feedback-for="error warning"]\` | LionField | | `slots` | public | | | Adds ".\_feedbackNode" as described below | LionField | | `submitted` | public | | | | LionField | | `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | LionField | | `type` | public | `string` | `'text'` | | LionInput | | `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | LionField | | `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | LionField | | `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\`

Note: Overrides the implementation from FormatMixin | LionField | | `_allCountriesLabel` | protected | `string` | `''` | Group label for all countries, when preferredCountries are shown | | | `_allowedOrAllRegions` | protected | `RegionCode[]` | | Used for rendering the region/country list | LionInputTel | | `_allValidators` | protected | `(Validator \| MetaValidator)[]` | | Combination of validators provided by Application Developer and the default validators | LionField | | `