@lion/ui 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +39 -16
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +189 -1
- package/components/form-core/src/FocusMixin.js +4 -4
- package/components/form-core/src/LionField.js +1 -1
- package/components/input-amount/test/lion-input-amount.test.js +48 -1
- package/components/input-amount/test/parsers.test.js +1 -1
- package/components/localize/src/number/parseNumber.js +21 -12
- package/components/localize/test/number/parseNumber.test.js +1 -1
- package/components/localize/types/LocalizeMixinTypes.ts +0 -5
- package/components/select-rich/src/LionSelectRich.js +18 -2
- package/components/select-rich/test/lion-select-rich-interaction.test.js +139 -20
- package/components/select-rich/test/lion-select-rich.test.js +13 -1
- package/components/validate-messages/translations/pl.js +4 -4
- package/custom-elements.json +47661 -47626
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +10 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +0 -4
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +6 -6
- package/docs/components/button/api-table.md +27 -30
- package/docs/components/calendar/api-table.md +13 -13
- package/docs/components/checkbox-group/api-table.md +305 -329
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +5 -5
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +150 -154
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +12 -12
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +9 -10
- package/docs/components/fieldset/api-table.md +104 -118
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/form/use-cases.md +2 -2
- package/docs/components/icon/api-table.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/api-table.md +110 -120
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +129 -142
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +110 -120
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +148 -160
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +110 -120
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +132 -143
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +110 -120
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +116 -126
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +123 -133
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +118 -128
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/api-table.md +125 -135
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +126 -131
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/pagination/api-table.md +5 -5
- package/docs/components/progress-indicator/api-table.md +9 -10
- package/docs/components/radio-group/api-table.md +234 -258
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +106 -116
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +169 -178
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/steps/api-table.md +6 -6
- package/docs/components/switch/api-table.md +117 -128
- package/docs/components/tabs/api-table.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +114 -124
- package/docs/components/tooltip/api-table.md +13 -13
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/api-table.md +8 -11
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/api-table.md +77 -82
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +2 -2
- package/docs/fundamentals/systems/localize/api-table.md +19 -19
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +45 -46
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -6,149 +6,145 @@
|
|
|
6
6
|
|
|
7
7
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
8
8
|
| ------------------------------ | --------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
9
|
-
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | ValidateMixin |
|
|
10
|
-
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | FocusMixin |
|
|
11
|
-
| `_inputNode` | protected | | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
12
|
-
| `_listboxNode` | protected | | | | ListboxMixin |
|
|
13
|
-
| `_listboxActiveDescendantNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
14
|
-
| `_listboxSlot` | protected | `HTMLElement` | | | ListboxMixin |
|
|
15
|
-
| `_scrollTargetNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
16
|
-
| `_activeDescendantOwnerNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
17
9
|
| `activeIndex` | public | | | | ListboxMixin |
|
|
10
|
+
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
18
11
|
| `checkedIndex` | public | `number \| number[]` | | | ListboxMixin |
|
|
12
|
+
| `defaultValidators` | public | `Validator[]` | `[]` | Used by Subclassers to add default Validators to a particular FormControl.
A date input for instance, always needs the isDate validator. | ValidateMixin |
|
|
13
|
+
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
14
|
+
| `disabled` | public | `boolean` | `false` | | DisabledMixin |
|
|
15
|
+
| `done` | public | `boolean` | `false` | | FormRegistrarMixin |
|
|
16
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
17
|
+
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
18
|
+
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
19
|
+
| `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 | FocusMixin |
|
|
20
|
+
| `formattedValue` | public | | | | ChoiceGroupMixin |
|
|
21
|
+
| `formElements` | public | `FormControlsCollection` | `new FormControlsCollection()` | Closely mimics the natively supported HTMLFormControlsCollection. It can be accessed
both like an array and an object (based on control/element names). | FormRegistrarMixin |
|
|
22
|
+
| `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. | ValidateMixin |
|
|
19
23
|
| `hasNoDefaultSelected` | public | `boolean` | `false` | When setting this to true, on initial render, no option will be selected.
It is advisable to override \`\_noSelectionTemplate\` method in the select-invoker
to render some kind of placeholder initially | ListboxMixin |
|
|
20
|
-
| `orientation` | public | `string` | `'vertical'` | Informs screen reader and affects keyboard navigation.
By default 'vertical' | ListboxMixin |
|
|
21
|
-
| `rotateKeyboardNavigation` | public | `boolean` | `false` | Will give first option active state when navigated to the next option from
last option. | ListboxMixin |
|
|
22
|
-
| `selectionFollowsFocus` | public | `boolean` | `false` | When true, will synchronize activedescendant and selected element on
arrow key navigation.
This behavior can usually be seen on \<select> on the Windows platform.
Note that this behavior cannot be used when multiple-choice is true.
See: https\://www\.w3.org/TR/wai-aria-practices/#kbd\_selection\_follows\_focus | ListboxMixin |
|
|
23
|
-
| `_noTypeAhead` | public | `boolean` | `false` | When false, a user can type on which the focus will jump to the matching option | ListboxMixin |
|
|
24
|
-
| `_typeAheadTimeout` | protected | `number` | `1000` | The pending char sequence that will set active list item | ListboxMixin |
|
|
25
|
-
| `_listboxActiveDescendant` | protected | `number \| null` | `null` | | ListboxMixin |
|
|
26
|
-
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'choice-group'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
27
|
-
| `_listboxReceivesNoFocus` | protected | `boolean` | `false` | When listbox is coupled to a textbox (in case we are dealing with a combobox),
spaces should not select an element (they need to be put in the textbox) | ListboxMixin |
|
|
28
|
-
| `_oldModelValue` | protected | `string \| string[] \| undefined` | `undefined` | | ListboxMixin |
|
|
29
|
-
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
30
24
|
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
35
|
-
| `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) | FormControlMixin |
|
|
25
|
+
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => { this.__resolveInitComplete = resolve; this.__rejectInitComplete = reject; })` | initComplete resolves after all pending initialization logic
(for instance \`\<form-group .serializedValue=${{ child1: 'a', child2: 'b' }}>\`)
is executed | FormRegistrarMixin |
|
|
26
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
27
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
36
28
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
37
|
-
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
38
|
-
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
39
|
-
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
40
|
-
| `_isRepropagationEndpoint` | public | `boolean` | `false` | By default, a field with \_repropagationRole 'choice-group' will act as an
'endpoint'. This means it will be considered as an individual field: for
a select, individual options will not be part of the formPath. They
will.
Similarly, components that (a11y wise) need to be fieldsets, but 'interaction wise'
(from Application Developer perspective) need to be more like fields
(think of an amount-input with a currency select box next to it), can set this
to true to hide private internals in the formPath. | FormControlMixin |
|
|
41
29
|
| `modelValue` | public | | | | FormControlMixin |
|
|
42
|
-
| `serializedValue` | public | | | | ChoiceGroupMixin |
|
|
43
|
-
| `formattedValue` | public | | | | ChoiceGroupMixin |
|
|
44
|
-
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
45
30
|
| `multipleChoice` | public | `boolean` | `false` | When false (default), modelValue and serializedValue will reflect the
currently selected choice (usually a string). When true, modelValue will and
serializedValue will be an array of strings. | ChoiceGroupMixin |
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => { this.__resolveInitComplete = resolve; this.__rejectInitComplete = reject; })` | initComplete resolves after all pending initialization logic
(for instance \`\<form-group .serializedValue=${{ child1: 'a', child2: 'b' }}>\`)
is executed | FormRegistrarMixin |
|
|
49
|
-
| `registrationComplete` | public | `Promise<any> & {done?:boolean}` | `new Promise((resolve, reject) => { this.__resolveRegistrationComplete = resolve; this.__rejectRegistrationComplete = reject; })` | registrationComplete waits for all children formElements to have registered | FormRegistrarMixin |
|
|
50
|
-
| `done` | public | `boolean` | `false` | | FormRegistrarMixin |
|
|
51
|
-
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
52
|
-
| `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 | FocusMixin |
|
|
53
|
-
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
54
|
-
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
55
|
-
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
31
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
32
|
+
| `orientation` | public | `string` | `'vertical'` | Informs screen reader and affects keyboard navigation.
By default 'vertical' | ListboxMixin |
|
|
56
33
|
| `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. | InteractionStateMixin |
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `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. | ValidateMixin |
|
|
34
|
+
| `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) | FormControlMixin |
|
|
35
|
+
| `registrationComplete` | public | `Promise<any> & {done?:boolean}` | `new Promise((resolve, reject) => { this.__resolveRegistrationComplete = resolve; this.__rejectRegistrationComplete = reject; })` | registrationComplete waits for all children formElements to have registered | FormRegistrarMixin |
|
|
36
|
+
| `rotateKeyboardNavigation` | public | `boolean` | `false` | Will give first option active state when navigated to the next option from
last option. | ListboxMixin |
|
|
37
|
+
| `selectionFollowsFocus` | public | `boolean` | `false` | When true, will synchronize activedescendant and selected element on
arrow key navigation.
This behavior can usually be seen on \<select> on the Windows platform.
Note that this behavior cannot be used when multiple-choice is true.
See: https\://www\.w3.org/TR/wai-aria-practices/#kbd\_selection\_follows\_focus | ListboxMixin |
|
|
38
|
+
| `serializedValue` | public | | | | ChoiceGroupMixin |
|
|
63
39
|
| `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"]\` | ValidateMixin |
|
|
40
|
+
| `submitted` | public | | | | InteractionStateMixin |
|
|
41
|
+
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
64
42
|
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
65
|
-
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
66
43
|
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
44
|
+
| `_activeDescendantOwnerNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
45
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
46
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
47
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
48
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | ValidateMixin |
|
|
49
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
50
|
+
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | FocusMixin |
|
|
51
|
+
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
52
|
+
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
53
|
+
| `_inputNode` | protected | | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
54
|
+
| `_isFormOrFieldset` | protected | `boolean` | `false` | Flag that determines how ".formElements" should behave.
For a regular fieldset (see LionFieldset) we expect ".formElements"
to be accessible as an object.
In case of a radio-group, a checkbox-group or a select/listbox,
it should act like an array (see ChoiceGroupMixin).
Usually, when false, we deal with a choice-group (radio-group, checkbox-group,
(multi)select) | FormRegistrarMixin |
|
|
55
|
+
| `_isRepropagationEndpoint` | public | `boolean` | `false` | By default, a field with \_repropagationRole 'choice-group' will act as an
'endpoint'. This means it will be considered as an individual field: for
a select, individual options will not be part of the formPath. They
will.
Similarly, components that (a11y wise) need to be fieldsets, but 'interaction wise'
(from Application Developer perspective) need to be more like fields
(think of an amount-input with a currency select box next to it), can set this
to true to hide private internals in the formPath. | FormControlMixin |
|
|
56
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
57
|
+
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
58
|
+
| `_listboxActiveDescendant` | protected | `number \| null` | `null` | | ListboxMixin |
|
|
59
|
+
| `_listboxActiveDescendantNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
60
|
+
| `_listboxNode` | protected | | | | ListboxMixin |
|
|
61
|
+
| `_listboxReceivesNoFocus` | protected | `boolean` | `false` | When listbox is coupled to a textbox (in case we are dealing with a combobox),
spaces should not select an element (they need to be put in the textbox) | ListboxMixin |
|
|
62
|
+
| `_listboxSlot` | protected | `HTMLElement` | | | ListboxMixin |
|
|
63
|
+
| `_noTypeAhead` | public | `boolean` | `false` | When false, a user can type on which the focus will jump to the matching option | ListboxMixin |
|
|
64
|
+
| `_oldModelValue` | protected | `string \| string[] \| undefined` | `undefined` | | ListboxMixin |
|
|
65
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'choice-group'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
69
66
|
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
70
|
-
| `
|
|
67
|
+
| `_scrollTargetNode` | protected | `HTMLElement` | | | ListboxMixin |
|
|
68
|
+
| `_typeAheadTimeout` | protected | `number` | `1000` | The pending char sequence that will set active list item | ListboxMixin |
|
|
69
|
+
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | InteractionStateMixin |
|
|
70
|
+
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
71
71
|
|
|
72
72
|
### Methods
|
|
73
73
|
|
|
74
74
|
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
75
75
|
| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------- | --------------------- |
|
|
76
|
-
| `_inputGroupInputTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
77
|
-
| `setCheckedIndex` | public | If an array is passed for multiple-choice, it will check the indexes in array, and uncheck the rest
If a number is passed, the item with the passed index is checked without unchecking others
For single choice, \_\_onChildCheckedChanged we ensure that we uncheck siblings | `index: number\|number[]` | | ListboxMixin |
|
|
78
76
|
| `addFormElement` | public | | `child: FormControlHost & LionOption, indexToInsertAt: Number` | | FormRegistrarMixin |
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
77
|
+
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
78
|
+
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
79
|
+
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
81
80
|
| `clear` | public | | | | ChoiceGroupMixin |
|
|
82
|
-
| `
|
|
81
|
+
| `click` | public | | | | DisabledMixin |
|
|
82
|
+
| `feedbackCondition` | public | Allows the Application Developer to specify when a feedback message should be shown | `type: string, meta: object, currentCondition: ((type: string, meta: object) => boolean)` | `boolean` | ValidateMixin |
|
|
83
|
+
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
84
|
+
| `initInteractionState` | public | Evaluations performed on connectedCallback.
This method is public, so it can be called at a later moment (when we need to wait for
registering children for instance) as well.
Since this method will be called twice in last mentioned scenario, it must stay idempotent. | | | InteractionStateMixin |
|
|
85
|
+
| `isRegisteredFormElement` | public | | `el: ElementWithParentFormGroup` | | FormRegistrarMixin |
|
|
86
|
+
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
87
|
+
| `removeFormElement` | public | | `child: FormControlHost` | | FormRegistrarMixin |
|
|
88
|
+
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
89
|
+
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
90
|
+
| `reset` | public | | | | ListboxMixin |
|
|
91
|
+
| `resetInteractionState` | public | Resets touched and dirty, and recomputes prefilled | | | InteractionStateMixin |
|
|
92
|
+
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
93
|
+
| `setCheckedIndex` | public | If an array is passed for multiple-choice, it will check the indexes in array, and uncheck the rest
If a number is passed, the item with the passed index is checked without unchecking others
For single choice, \_\_onChildCheckedChanged we ensure that we uncheck siblings | `index: number\|number[]` | | ListboxMixin |
|
|
94
|
+
| `validate` | public | Triggered by:
 \- modelValue change
 \- change in the 'validators' array
 \- change in the config of an individual Validator

Three situations are handled:
- a1) the FormControl is empty: further execution is halted. When the Required Validator
(being mutually exclusive to the other Validators) is applied, it will end up in the
validation result (as the only Validator, since further execution was halted).
- a2) there are synchronous Validators: this is the most common flow. When modelValue hasn't
changed since last async results were generated, 'sync results' are merged with the
'async results'.
- a3) there are asynchronous Validators: for instance when server side evaluation is needed.
Executions are scheduled and awaited and the 'async results' are merged with the
'sync results'.

- b) there are MetaValidators. After steps a1, a2, or a3 are finished, the holistic
MetaValidators (evaluating the total result of the 'regular' (a1, a2 and a3) validators)
will be run...

Situations a2 and a3 are not mutually exclusive and can be triggered within one \`validate()\`
call. Situation b will occur after every call. | `{ clearCurrentResult = false }, opts: { clearCurrentResult?: boolean }` | | ValidateMixin |
|
|
95
|
+
| `_checkSingleChoiceElements` | protected | | `ev: CustomEvent & {target:FormControl}` | | ChoiceGroupMixin |
|
|
96
|
+
| `_completeRegistration` | protected | Resolves the registrationComplete promise. Subclassers can delay if needed | | | FormRegistrarMixin |
|
|
97
|
+
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
98
|
+
| `_enhanceLightDomA11y` | protected | | | | FormControlMixin |
|
|
99
|
+
| `_enhanceLightDomA11yForAdditionalSlots` | protected | Enhances additional slots(prefix, suffix, before, after) defined by developer.

When boolean attribute data-label or data-description is found,
the slot element will be connected to the input via aria-labelledby or aria-describedby | `additionalSlots: string[]` | | FormControlMixin |
|
|
100
|
+
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
101
|
+
| `_feedbackTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
102
|
+
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
83
103
|
| `_getCheckedElements` | protected | | | | ChoiceGroupMixin |
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `_teardownListboxNode` | protected | | | | ListboxMixin |
|
|
104
|
+
| `_getFromAllFormElements` | protected | Implicit :( | `property: string, filterFn: (el: FormControl, property?: string) => boolean` | `{[name:string]: any}` | ChoiceGroupMixin |
|
|
105
|
+
| `_getFromAllFormElementsFilter` | protected | A filter function which will exclude a form field when returning false
By default, exclude form fields which are disabled

The type is be passed as well for more fine grained control, e.g.
distinguish the filter when fetching modelValue versus serializedValue | `el: FormControl, type: string` | `boolean` | ChoiceGroupMixin |
|
|
87
106
|
| `_getNextEnabledOption` | protected | | `currentIndex: number, offset: number` | | ListboxMixin |
|
|
88
107
|
| `_getPreviousEnabledOption` | protected | | `currentIndex: number, offset: number` | | ListboxMixin |
|
|
89
|
-
| `_onChildActiveChanged` | protected | | `{ target }, ev: Event & { target: LionOption }` | | ListboxMixin |
|
|
90
|
-
| `_listboxOnKeyDown` | protected | | `ev: KeyboardEvent` | | ListboxMixin |
|
|
91
|
-
| `_listboxOnClick` | protected | | `ev: MouseEvent` | | ListboxMixin |
|
|
92
|
-
| `_listboxOnKeyUp` | protected | | `ev: KeyboardEvent` | | ListboxMixin |
|
|
93
|
-
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
94
|
-
| `_scrollIntoView` | protected | | `el: HTMLElement, scrollTargetEl: HTMLElement` | | ListboxMixin |
|
|
95
|
-
| `_uncheckChildren` | protected | | `exclude: LionOption\|LionOption[]` | | ListboxMixin |
|
|
96
|
-
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
97
|
-
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
98
|
-
| `_enhanceLightDomA11y` | protected | | | | FormControlMixin |
|
|
99
|
-
| `_enhanceLightDomA11yForAdditionalSlots` | protected | Enhances additional slots(prefix, suffix, before, after) defined by developer.

When boolean attribute data-label or data-description is found,
the slot element will be connected to the input via aria-labelledby or aria-describedby | `additionalSlots: string[]` | | FormControlMixin |
|
|
100
|
-
| `__reflectAriaAttr` | protected | Will handle help text, validation feedback and character counter,
prefix/suffix/before/after (if they contain data-description flag attr).
Also, contents of id references that will be put in the \<lion-field>.\_ariaDescribedby property
from an external context, will be read by a screen reader. | `attrName: string, nodes: Element[], reorder: boolean\|undefined` | | FormControlMixin |
|
|
101
108
|
| `_groupOneTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
102
109
|
| `_groupTwoTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
103
|
-
| `
|
|
110
|
+
| `_handleTypeAhead` | protected | | `ev: KeyboardEvent, { setAsChecked }, options: {setAsChecked:boolean}` | | ListboxMixin |
|
|
111
|
+
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
104
112
|
| `_helpTextTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
105
|
-
| `
|
|
113
|
+
| `_inputGroupAfterTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
106
114
|
| `_inputGroupBeforeTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
115
|
+
| `_inputGroupInputTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
107
116
|
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
108
117
|
| `_inputGroupSuffixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
109
|
-
| `
|
|
110
|
-
| `_feedbackTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
118
|
+
| `_inputGroupTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
111
119
|
| `_isEmpty` | protected | Used for Required validation and computation of interaction states | `modelValue: any` | `boolean` | FormControlMixin |
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
120
|
+
| `_iStateOnLeave` | protected | Sets touched value to true and reevaluates prefilled state.
When false, on next interaction, user will start with a clean state. | | | InteractionStateMixin |
|
|
121
|
+
| `_iStateOnValueChange` | protected | Sets dirty value and validates when already touched or invalid | | | InteractionStateMixin |
|
|
122
|
+
| `_labelTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
123
|
+
| `_listboxOnClick` | protected | | `ev: MouseEvent` | | ListboxMixin |
|
|
124
|
+
| `_listboxOnKeyDown` | protected | | `ev: KeyboardEvent` | | ListboxMixin |
|
|
125
|
+
| `_listboxOnKeyUp` | protected | | `ev: KeyboardEvent` | | ListboxMixin |
|
|
119
126
|
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `_getFromAllFormElements` | protected | Implicit :( | `property: string, filterFn: (el: FormControl, property?: string) => boolean` | `{[name:string]: any}` | ChoiceGroupMixin |
|
|
125
|
-
| `_throwWhenInvalidChildModelValue` | protected | | `child: FormControl` | | ChoiceGroupMixin |
|
|
126
|
-
| `_checkSingleChoiceElements` | protected | | `ev: CustomEvent & {target:FormControl}` | | ChoiceGroupMixin |
|
|
127
|
-
| `_setCheckedElements` | protected | | `value: string \| any[], check: Function` | | ChoiceGroupMixin |
|
|
128
|
-
| `isRegisteredFormElement` | public | | `el: ElementWithParentFormGroup` | | FormRegistrarMixin |
|
|
129
|
-
| `removeFormElement` | public | | `child: FormControlHost` | | FormRegistrarMixin |
|
|
127
|
+
| `_onChildActiveChanged` | protected | | `{ target }, ev: Event & { target: LionOption }` | | ListboxMixin |
|
|
128
|
+
| `_onDirtyChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
129
|
+
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
130
|
+
| `_onListboxContentChanged` | protected | A Subclasser can perform additional logic whenever the elements inside the listbox are
updated. For instance, when a combobox does server side autocomplete, we want to
match highlighted parts client side. | | | ListboxMixin |
|
|
130
131
|
| `_onRequestToAddFormElement` | protected | Hook for Subclassers to perform logic before an element is added | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
131
132
|
| `_onRequestToChangeFormElementName` | protected | | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
132
133
|
| `_onRequestToRemoveFormElement` | protected | | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
133
|
-
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
134
|
-
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
135
|
-
| `initInteractionState` | public | Evaluations performed on connectedCallback.
This method is public, so it can be called at a later moment (when we need to wait for
registering children for instance) as well.
Since this method will be called twice in last mentioned scenario, it must stay idempotent. | | | InteractionStateMixin |
|
|
136
|
-
| `_iStateOnLeave` | protected | Sets touched value to true and reevaluates prefilled state.
When false, on next interaction, user will start with a clean state. | | | InteractionStateMixin |
|
|
137
|
-
| `_iStateOnValueChange` | protected | Sets dirty value and validates when already touched or invalid | | | InteractionStateMixin |
|
|
138
134
|
| `_onTouchedChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
139
|
-
| `_onDirtyChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
140
|
-
| `_showFeedbackConditionFor` | protected | Default feedbackCondition condition, used by Subclassers, that will be used when
\`feedbackCondition()\` is not overridden by Application Developer.
Show the validity feedback when returning true, don't show when false | `type: string, meta: InteractionStates` | | ValidateMixin |
|
|
141
|
-
| `validate` | public | Triggered by:
 \- modelValue change
 \- change in the 'validators' array
 \- change in the config of an individual Validator

Three situations are handled:
- a1) the FormControl is empty: further execution is halted. When the Required Validator
(being mutually exclusive to the other Validators) is applied, it will end up in the
validation result (as the only Validator, since further execution was halted).
- a2) there are synchronous Validators: this is the most common flow. When modelValue hasn't
changed since last async results were generated, 'sync results' are merged with the
'async results'.
- a3) there are asynchronous Validators: for instance when server side evaluation is needed.
Executions are scheduled and awaited and the 'async results' are merged with the
'sync results'.

- b) there are MetaValidators. After steps a1, a2, or a3 are finished, the holistic
MetaValidators (evaluating the total result of the 'regular' (a1, a2 and a3) validators)
will be run...

Situations a2 and a3 are not mutually exclusive and can be triggered within one \`validate()\`
call. Situation b will occur after every call. | `{ clearCurrentResult = false }, opts: { clearCurrentResult?: boolean }` | | ValidateMixin |
|
|
142
|
-
| `__executeValidators` | protected | | | | ValidateMixin |
|
|
143
135
|
| `_onValidatorUpdated` | protected | | `e: Event\|CustomEvent` | | ValidateMixin |
|
|
136
|
+
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
137
|
+
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost` | | FormControlMixin |
|
|
138
|
+
| `_scrollIntoView` | protected | | `el: HTMLElement, scrollTargetEl: HTMLElement` | | ListboxMixin |
|
|
139
|
+
| `_setCheckedElements` | protected | | `value: string \| any[], check: Function` | | ChoiceGroupMixin |
|
|
140
|
+
| `_setupListboxNode` | protected | | | | ListboxMixin |
|
|
141
|
+
| `_showFeedbackConditionFor` | protected | Default feedbackCondition condition, used by Subclassers, that will be used when
\`feedbackCondition()\` is not overridden by Application Developer.
Show the validity feedback when returning true, don't show when false | `type: string, meta: InteractionStates` | | ValidateMixin |
|
|
142
|
+
| `_teardownListboxNode` | protected | | | | ListboxMixin |
|
|
143
|
+
| `_throwWhenInvalidChildModelValue` | protected | | `child: FormControl` | | ChoiceGroupMixin |
|
|
144
|
+
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
145
|
+
| `_uncheckChildren` | protected | | `exclude: LionOption\|LionOption[]` | | ListboxMixin |
|
|
144
146
|
| `_updateFeedbackComponent` | protected | Responsible for retrieving messages from Validators and
(delegation of) rendering them.

For \`.\_feedbackNode\` (extension of LionValidationFeedback):
- retrieve messages from highest prio Validators
- provide the result to custom feedback node and let the
custom node decide on their renderings

In both cases:
- we compute the 'show' flag (like 'hasErrorVisible') for all types
- we set the customValidity message of the highest prio Validator
- we set aria-invalid="true" in case hasErrorVisible is true | | | ValidateMixin |
|
|
145
|
-
| `feedbackCondition` | public | Allows the Application Developer to specify when a feedback message should be shown | `type: string, meta: object, currentCondition: ((type: string, meta: object) => boolean)` | `boolean` | ValidateMixin |
|
|
146
|
-
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
147
147
|
| `_updateShouldShowFeedbackFor` | protected | | | | ValidateMixin |
|
|
148
|
-
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
149
|
-
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
150
|
-
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
151
|
-
| `click` | public | | | | DisabledMixin |
|
|
152
148
|
|
|
153
149
|
### Events
|
|
154
150
|
|
|
@@ -202,50 +198,49 @@
|
|
|
202
198
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
203
199
|
| ---------------------------- | --------- | ------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
|
204
200
|
| `active` | public | `boolean` | `false` | | |
|
|
205
|
-
| `
|
|
206
|
-
| `disabled` | public | `boolean` | `false` | Boolean indicating whether or not this element is disabled. | ChoiceInputMixin |
|
|
207
|
-
| `choiceValue` | public | `string\|any` | | The value that will be registered to the modelValue of the parent ChoiceGroup. Recommended
to be a string | ChoiceInputMixin |
|
|
208
|
-
| `modelValue` | public | `{value:string\|any,checked:boolean}` | `{ value: '', checked: false }` | Whereas 'normal' \`.modelValue\`s usually store a complex/typed version
of a view value, choice inputs have a slightly different approach.
In order to remain their Single Source of Truth characteristic, choice inputs
store both the value and 'checkedness', in the format { value: 'x', checked: true }
Different from the platform, this also allows to serialize the 'non checkedness',
allowing to restore form state easily and inform the server about unchecked options. | ChoiceInputMixin |
|
|
201
|
+
| `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 | FormRegisteringMixin |
|
|
209
202
|
| `checked` | public | `boolean` | | | ChoiceInputMixin |
|
|
210
|
-
| `
|
|
203
|
+
| `choiceValue` | public | `string\|any` | | The value that will be registered to the modelValue of the parent ChoiceGroup. Recommended
to be a string | ChoiceInputMixin |
|
|
204
|
+
| `disabled` | public | `boolean` | `false` | Boolean indicating whether or not this element is disabled. | ChoiceInputMixin |
|
|
211
205
|
| `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' | FormatMixin |
|
|
212
206
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
213
207
|
| `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) | FormatMixin |
|
|
208
|
+
| `modelValue` | public | `{value:string\|any,checked:boolean}` | `{ value: '', checked: false }` | Whereas 'normal' \`.modelValue\`s usually store a complex/typed version
of a view value, choice inputs have a slightly different approach.
In order to remain their Single Source of Truth characteristic, choice inputs
store both the value and 'checkedness', in the format { value: 'x', checked: true }
Different from the platform, this also allows to serialize the 'non checkedness',
allowing to restore form state easily and inform the server about unchecked options. | ChoiceInputMixin |
|
|
209
|
+
| `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 | FormRegisteringMixin |
|
|
214
210
|
| `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) | FormatMixin |
|
|
215
|
-
| `
|
|
211
|
+
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
216
212
|
| `_isHandlingUserInput` | protected | `boolean` | `false` | Flag that will be set when user interaction takes place (for instance after an 'input'
event). Will be added as meta info to the \`model-value-changed\` event. Depending on
whether a user is interacting, formatting logic will be handled differently. | FormatMixin |
|
|
217
|
-
| `
|
|
213
|
+
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
218
214
|
| `_parentFormGroup` | protected | `FormRegistrarHost \| undefined` | `undefined` | The registrar this FormControl registers to, Usually a descendant of FormGroup or
ChoiceGroup | FormRegisteringMixin |
|
|
219
|
-
| `
|
|
215
|
+
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
220
216
|
|
|
221
217
|
### Methods
|
|
222
218
|
|
|
223
219
|
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
224
220
|
| ---------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ---------------- |
|
|
225
|
-
| `
|
|
226
|
-
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
221
|
+
| `clear` | public | | | | ChoiceInputMixin |
|
|
227
222
|
| `click` | public | | | | DisabledMixin |
|
|
228
|
-
| `
|
|
229
|
-
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
230
|
-
| `_preventDuplicateLabelClick` | protected | The native platform fires an event for both the click on the label, and also
the redispatched click on the native input element.
This results in two click events arriving at the host, but we only want one.
This method prevents the duplicate click and ensures the correct isTrusted event
with the correct event.target arrives at the host. | `ev: Event` | | ChoiceInputMixin |
|
|
231
|
-
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
232
|
-
| `_syncNameToParentFormGroup` | protected | Override this in case of extending ChoiceInputMixin and requiring
to sync differently with parent form group name
Right now it checks tag name match where the parent form group tagname
should include the child field tagname ('checkbox' is included in 'checkbox-group') | | | ChoiceInputMixin |
|
|
233
|
-
| `_proxyInputEvent` | protected | This can be called whenever the view value should be updated. Dependent on component type
("input" for \<input> or "change" for \<select>(mainly for IE)) a different event should be
used as source for the "user-input-changed" event (which can be seen as an abstraction
layer on top of other events (input, change, whatever)) | | | FormatMixin |
|
|
234
|
-
| `_onModelValueChanged` | protected | Responds to modelValue changes in the synchronous cycle (most subclassers should listen to
the asynchronous cycle ('modelValue' in the .updated lifecycle)) | `{ modelValue }, old: { modelValue:unknown }, newV: { modelValue:unknown }` | | FormatMixin |
|
|
235
|
-
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
223
|
+
| `deserializer` | public | Converts \`.serializedValue\` to \`.modelValue\`
For instance, an iso formatted date string to a Date object | `v: ?` | `?` | FormatMixin |
|
|
236
224
|
| `formatter` | public | Converts modelValue to formattedValue (formattedValue will be synced with
\`.\_inputNode.value\`)
For instance, a Date object to a localized date. | `modelValue: ChoiceInputModelValue` | `string` | FormatMixin |
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `_syncValueUpwards` | protected | Synchronization from \`.\_inputNode.value\` to \`LionField\` (flow \[2])
Downwards syncing should only happen for \`LionField\`.value changes from 'above'.
This triggers \_onModelValueChanged and connects user input
to the parsing/formatting/serializing loop. | | | FormatMixin |
|
|
225
|
+
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
226
|
+
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
240
227
|
| `preprocessor` | public | Preprocessors could be considered 'live formatters'. Their result is shown to the user
on keyup instead of after blurring the field. The biggest difference between preprocessors
and formatters is their moment of execution: preprocessors are run before modelValue is
computed (and work based on view value), whereas formatters are run after the parser (and
are based on modelValue)
Automatically formats code while typing. It depends on a preprocessro that smartly
updates the viewValue and caret position for best UX. | `v: string, opts: FormatOptions & { prevViewValue: string; currentCaretIndex: number }` | `{ viewValue:string; caretIndex:number; }\|string\|undefined` | FormatMixin |
|
|
228
|
+
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
241
229
|
| `serializer` | public | Converts \`.modelValue\` to \`.serializedValue\`
For instance, a Date object to an iso formatted date string | `v: ?` | `string` | FormatMixin |
|
|
242
|
-
| `
|
|
230
|
+
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
243
231
|
| `_calculateValues` | protected | Responsible for storing all representations(modelValue, serializedValue, formattedValue
and value) of the input value. Prevents infinite loops, so all value observers can be
treated like they will only be called once, without indirectly calling other observers.
(in fact, some are called twice, but the \_\_preventRecursiveTrigger lock prevents the
second call from having effect). | `{ source }, config: {source:'model'\|'serialized'\|'formatted'\|null}` | | FormatMixin |
|
|
232
|
+
| `_choiceGraphicTemplate` | protected | | | | ChoiceInputMixin |
|
|
244
233
|
| `_dispatchModelValueChangedEvent` | protected | This is wrapped in a distinct method, so that parents can control when the changed event
is fired. For objects, a deep comparison might be needed. | `args: { modelValue: unknown; }[]` | | FormatMixin |
|
|
234
|
+
| `_isEmpty` | protected | Used for required validator. | | | ChoiceInputMixin |
|
|
235
|
+
| `_onModelValueChanged` | protected | Responds to modelValue changes in the synchronous cycle (most subclassers should listen to
the asynchronous cycle ('modelValue' in the .updated lifecycle)) | `{ modelValue }, old: { modelValue:unknown }, newV: { modelValue:unknown }` | | FormatMixin |
|
|
236
|
+
| `_onUserInputChanged` | protected | | | | FormatMixin |
|
|
237
|
+
| `_preventDuplicateLabelClick` | protected | The native platform fires an event for both the click on the label, and also
the redispatched click on the native input element.
This results in two click events arriving at the host, but we only want one.
This method prevents the duplicate click and ensures the correct isTrusted event
with the correct event.target arrives at the host. | `ev: Event` | | ChoiceInputMixin |
|
|
238
|
+
| `_proxyInputEvent` | protected | This can be called whenever the view value should be updated. Dependent on component type
("input" for \<input> or "change" for \<select>(mainly for IE)) a different event should be
used as source for the "user-input-changed" event (which can be seen as an abstraction
layer on top of other events (input, change, whatever)) | | | FormatMixin |
|
|
245
239
|
| `_reflectBackFormattedValueToUser` | protected | Synchronization from \`LionField.value\` to \`.\_inputNode.value\`
- flow \[1] will always be reflected back
- flow \[2] will not be reflected back when this flow was triggered via
 \`@user-input-changed\` (this will happen later, when \`formatOn\` condition is met) | | | FormatMixin |
|
|
246
240
|
| `_reflectBackOn` | protected | Every time .formattedValue is attempted to sync to the view value (on change/blur and on
modelValue change), this condition is checked. When enhancing it, it's recommended to
call via \`return this.\_myExtraCondition && super.\_reflectBackOn()\` | | `boolean` | FormatMixin |
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
241
|
+
| `_syncNameToParentFormGroup` | protected | Override this in case of extending ChoiceInputMixin and requiring
to sync differently with parent form group name
Right now it checks tag name match where the parent form group tagname
should include the child field tagname ('checkbox' is included in 'checkbox-group') | | | ChoiceInputMixin |
|
|
242
|
+
| `_syncValueUpwards` | protected | Synchronization from \`.\_inputNode.value\` to \`LionField\` (flow \[2])
Downwards syncing should only happen for \`LionField\`.value changes from 'above'.
This triggers \_onModelValueChanged and connects user input
to the parsing/formatting/serializing loop. | | | FormatMixin |
|
|
243
|
+
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
249
244
|
|
|
250
245
|
### Events
|
|
251
246
|
|
|
@@ -277,8 +272,8 @@
|
|
|
277
272
|
|
|
278
273
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
279
274
|
| -------------------- | ------- | ------------------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
|
280
|
-
| `tabIndex` | public | `number` | `0` | | |
|
|
281
275
|
| `registrationTarget` | public | `(FormRegistrarPortalHost & HTMLElement) \| undefined` | `undefined` | Registration target: an element, usually in the body of the dom, that captures events
and redispatches them on host | FormRegistrarPortalMixin |
|
|
276
|
+
| `tabIndex` | public | `number` | `0` | | |
|
|
282
277
|
|
|
283
278
|
### Attributes
|
|
284
279
|
|