@lion/ui 0.11.0 → 0.11.2
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 +4 -4
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +39 -16
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +189 -1
- package/components/combobox/test/lion-combobox.test.js +75 -1
- package/components/form-core/src/FocusMixin.js +4 -4
- package/components/form-core/src/LionField.js +1 -1
- package/components/localize/src/date/parseDate.js +6 -1
- package/components/localize/src/date/utils/checkYearFormat.js +8 -0
- package/components/localize/test/date/parseDate.test.js +6 -0
- package/components/localize/types/LocalizeMixinTypes.ts +0 -5
- package/components/select-rich/src/LionSelectRich.js +1 -1
- package/components/select-rich/test/lion-select-rich.test.js +13 -1
- package/custom-elements.json +47758 -47690
- 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/date/parseDate.d.ts.map +1 -1
- package/dist-types/components/localize/src/date/utils/checkYearFormat.d.ts +7 -0
- package/dist-types/components/localize/src/date/utils/checkYearFormat.d.ts.map +1 -0
- 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/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +19 -7
- package/docs/components/accordion/index.md +10 -0
- package/docs/components/accordion/overview.md +13 -1
- package/docs/components/accordion/reference.md +13 -1
- package/docs/components/accordion/use-cases.md +13 -1
- package/docs/components/button/api-table.md +40 -31
- package/docs/components/button/examples.md +13 -1
- package/docs/components/button/extensions.md +13 -1
- package/docs/components/button/index.md +11 -1
- package/docs/components/button/overview.md +13 -1
- package/docs/components/button/use-cases.md +13 -1
- package/docs/components/calendar/api-table.md +26 -14
- package/docs/components/calendar/index.md +11 -1
- package/docs/components/calendar/overview.md +13 -1
- package/docs/components/calendar/use-cases.md +13 -1
- package/docs/components/checkbox-group/api-table.md +318 -330
- package/docs/components/checkbox-group/index.md +11 -1
- package/docs/components/checkbox-group/overview.md +15 -3
- package/docs/components/checkbox-group/use-cases.md +13 -1
- package/docs/components/collapsible/api-table.md +18 -6
- package/docs/components/collapsible/examples.md +13 -1
- package/docs/components/collapsible/index.md +11 -1
- package/docs/components/collapsible/overview.md +14 -2
- package/docs/components/collapsible/use-cases.md +13 -1
- package/docs/components/combobox/api-table.md +163 -155
- package/docs/components/combobox/extensions.md +13 -1
- package/docs/components/combobox/index.md +11 -1
- package/docs/components/combobox/overview.md +14 -2
- package/docs/components/combobox/use-cases.md +14 -2
- package/docs/components/dialog/api-table.md +25 -13
- package/docs/components/dialog/index.md +11 -1
- package/docs/components/dialog/overview.md +14 -2
- package/docs/components/dialog/use-cases.md +13 -1
- package/docs/components/drawer/api-table.md +22 -11
- package/docs/components/drawer/index.md +11 -1
- package/docs/components/drawer/overview.md +13 -1
- package/docs/components/drawer/use-cases.md +13 -1
- package/docs/components/fieldset/api-table.md +117 -119
- package/docs/components/fieldset/index.md +11 -1
- package/docs/components/fieldset/overview.md +18 -6
- package/docs/components/fieldset/use-cases.md +13 -1
- package/docs/components/form/api-table.md +12 -1
- package/docs/components/form/index.md +11 -1
- package/docs/components/form/overview.md +16 -4
- package/docs/components/form/use-cases.md +15 -3
- package/docs/components/icon/api-table.md +16 -4
- package/docs/components/icon/index.md +11 -1
- package/docs/components/icon/overview.md +13 -1
- package/docs/components/icon/use-cases.md +14 -2
- package/docs/components/index.md +11 -1
- package/docs/components/input/api-table.md +123 -121
- package/docs/components/input/index.md +11 -1
- package/docs/components/input/overview.md +14 -2
- package/docs/components/input/use-cases.md +13 -1
- package/docs/components/input-amount/api-table.md +142 -143
- package/docs/components/input-amount/index.md +11 -1
- package/docs/components/input-amount/overview.md +16 -4
- package/docs/components/input-amount/use-cases.md +13 -1
- package/docs/components/input-date/api-table.md +123 -121
- package/docs/components/input-date/index.md +11 -1
- package/docs/components/input-date/overview.md +16 -4
- package/docs/components/input-date/use-cases.md +13 -1
- package/docs/components/input-datepicker/api-table.md +161 -161
- package/docs/components/input-datepicker/index.md +11 -1
- package/docs/components/input-datepicker/overview.md +18 -6
- package/docs/components/input-datepicker/use-cases.md +13 -1
- package/docs/components/input-email/api-table.md +123 -121
- package/docs/components/input-email/index.md +11 -1
- package/docs/components/input-email/overview.md +15 -3
- package/docs/components/input-email/use-cases.md +13 -1
- package/docs/components/input-file/api-table.md +145 -144
- package/docs/components/input-file/index.md +11 -1
- package/docs/components/input-file/overview.md +14 -2
- package/docs/components/input-file/use-cases.md +13 -1
- package/docs/components/input-iban/api-table.md +123 -121
- package/docs/components/input-iban/index.md +11 -1
- package/docs/components/input-iban/overview.md +15 -3
- package/docs/components/input-iban/use-cases.md +13 -1
- package/docs/components/input-range/api-table.md +129 -127
- package/docs/components/input-range/index.md +11 -1
- package/docs/components/input-range/overview.md +15 -3
- package/docs/components/input-range/use-cases.md +13 -1
- package/docs/components/input-stepper/api-table.md +136 -134
- package/docs/components/input-stepper/index.md +11 -1
- package/docs/components/input-stepper/overview.md +14 -2
- package/docs/components/input-stepper/use-cases.md +13 -1
- package/docs/components/input-tel/api-table.md +131 -129
- package/docs/components/input-tel/index.md +11 -1
- package/docs/components/input-tel/overview.md +14 -2
- package/docs/components/input-tel/use-cases.md +19 -7
- package/docs/components/input-tel-dropdown/api-table.md +138 -136
- package/docs/components/input-tel-dropdown/extensions.md +13 -1
- package/docs/components/input-tel-dropdown/index.md +11 -1
- package/docs/components/input-tel-dropdown/overview.md +14 -2
- package/docs/components/input-tel-dropdown/use-cases.md +13 -1
- package/docs/components/listbox/api-table.md +139 -132
- package/docs/components/listbox/index.md +11 -1
- package/docs/components/listbox/overview.md +13 -1
- package/docs/components/listbox/use-cases.md +14 -2
- package/docs/components/pagination/api-table.md +18 -6
- package/docs/components/pagination/index.md +11 -1
- package/docs/components/pagination/overview.md +13 -1
- package/docs/components/pagination/use-cases.md +13 -1
- package/docs/components/progress-indicator/api-table.md +22 -11
- package/docs/components/progress-indicator/examples.md +13 -1
- package/docs/components/progress-indicator/index.md +11 -1
- package/docs/components/progress-indicator/overview.md +13 -1
- package/docs/components/radio-group/api-table.md +247 -259
- package/docs/components/radio-group/index.md +11 -1
- package/docs/components/radio-group/overview.md +16 -4
- package/docs/components/radio-group/use-cases.md +13 -1
- package/docs/components/select/api-table.md +119 -117
- package/docs/components/select/index.md +11 -1
- package/docs/components/select/overview.md +13 -1
- package/docs/components/select/use-cases.md +14 -2
- package/docs/components/select-rich/api-table.md +182 -179
- package/docs/components/select-rich/examples.md +13 -1
- package/docs/components/select-rich/index.md +11 -1
- package/docs/components/select-rich/overview.md +13 -1
- package/docs/components/select-rich/use-cases.md +14 -2
- package/docs/components/steps/api-table.md +19 -7
- package/docs/components/steps/index.md +11 -1
- package/docs/components/steps/overview.md +13 -1
- package/docs/components/steps/use-cases.md +13 -1
- package/docs/components/switch/api-table.md +130 -129
- package/docs/components/switch/index.md +11 -1
- package/docs/components/switch/overview.md +13 -1
- package/docs/components/switch/reference.md +13 -1
- package/docs/components/switch/use-cases.md +13 -1
- package/docs/components/tabs/api-table.md +14 -2
- package/docs/components/tabs/examples.md +14 -2
- package/docs/components/tabs/index.md +11 -1
- package/docs/components/tabs/overview.md +13 -1
- package/docs/components/tabs/use-cases.md +13 -1
- package/docs/components/textarea/api-table.md +127 -125
- package/docs/components/textarea/index.md +11 -1
- package/docs/components/textarea/overview.md +13 -1
- package/docs/components/textarea/use-cases.md +13 -1
- package/docs/components/tooltip/api-table.md +26 -14
- package/docs/components/tooltip/examples.md +13 -1
- package/docs/components/tooltip/index.md +11 -1
- package/docs/components/tooltip/overview.md +13 -1
- package/docs/components/tooltip/use-cases.md +13 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +12 -0
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +13 -0
- package/docs/fundamentals/node-tools/index.md +10 -0
- package/docs/fundamentals/node-tools/providence-analytics/index.md +12 -0
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +13 -0
- package/docs/fundamentals/node-tools/publish-docs/index.md +12 -0
- package/docs/fundamentals/node-tools/publish-docs/overview.md +16 -3
- package/docs/fundamentals/node-tools/remark-extend/index.md +12 -0
- package/docs/fundamentals/node-tools/remark-extend/overview.md +13 -0
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +12 -0
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +15 -2
- package/docs/fundamentals/rationales/TypeScript.md +12 -0
- package/docs/fundamentals/rationales/accessibility.md +13 -1
- package/docs/fundamentals/rationales/index.md +10 -0
- package/docs/fundamentals/rationales/side-effects.md +12 -0
- package/docs/fundamentals/rationales/versioning.md +12 -0
- package/docs/fundamentals/systems/core/SlotMixin.md +14 -1
- package/docs/fundamentals/systems/core/api-table.md +22 -12
- package/docs/fundamentals/systems/core/index.md +12 -0
- package/docs/fundamentals/systems/core/overview.md +14 -1
- package/docs/fundamentals/systems/form/api-table.md +91 -83
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +17 -4
- package/docs/fundamentals/systems/form/index.md +12 -0
- package/docs/fundamentals/systems/form/interaction-states.md +13 -0
- package/docs/fundamentals/systems/form/model-value.md +14 -1
- package/docs/fundamentals/systems/form/overview.md +41 -28
- package/docs/fundamentals/systems/form/styling.md +13 -0
- package/docs/fundamentals/systems/form/use-cases.md +13 -0
- package/docs/fundamentals/systems/form/validate.md +15 -2
- package/docs/fundamentals/systems/icon/index.md +12 -0
- package/docs/fundamentals/systems/icon/overview.md +13 -0
- package/docs/fundamentals/systems/index.md +10 -0
- package/docs/fundamentals/systems/localize/api-table.md +33 -20
- package/docs/fundamentals/systems/localize/dates.md +13 -0
- package/docs/fundamentals/systems/localize/index.md +12 -0
- package/docs/fundamentals/systems/localize/numbers.md +13 -0
- package/docs/fundamentals/systems/localize/overview.md +17 -4
- package/docs/fundamentals/systems/localize/rationale.md +13 -0
- package/docs/fundamentals/systems/localize/text.md +13 -0
- package/docs/fundamentals/systems/localize/use-cases.md +13 -0
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +11 -0
- package/docs/fundamentals/systems/overlays/_edge-cases.md +10 -0
- package/docs/fundamentals/systems/overlays/api-table.md +59 -47
- package/docs/fundamentals/systems/overlays/configuration.md +15 -2
- package/docs/fundamentals/systems/overlays/index.md +12 -0
- package/docs/fundamentals/systems/overlays/overview.md +18 -5
- package/docs/fundamentals/systems/overlays/rationale.md +13 -0
- package/docs/fundamentals/systems/overlays/use-cases.md +15 -2
- package/docs/fundamentals/tools/ajax/index.md +12 -0
- package/docs/fundamentals/tools/ajax/overview.md +13 -0
- package/docs/fundamentals/tools/ajax/use-cases.md +13 -0
- package/docs/fundamentals/tools/helpers/action-logger.md +13 -0
- package/docs/fundamentals/tools/helpers/index.md +12 -0
- package/docs/fundamentals/tools/helpers/overview.md +14 -1
- package/docs/fundamentals/tools/index.md +10 -0
- package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +13 -0
- package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +13 -0
- package/docs/fundamentals/tools/singleton-manager/example-success/index.md +13 -0
- package/docs/fundamentals/tools/singleton-manager/index.md +12 -0
- package/docs/fundamentals/tools/singleton-manager/overview.md +17 -4
- package/docs/guides/how-to/create-a-custom-field.md +18 -6
- package/docs/guides/how-to/create-a-form.md +17 -5
- package/docs/guides/how-to/extend-a-native-input.md +15 -3
- package/docs/guides/how-to/get-started.md +13 -1
- package/docs/guides/how-to/index.md +11 -1
- package/docs/guides/index.md +19 -9
- package/docs/guides/principles/definitions-and-terms.md +13 -1
- package/docs/guides/principles/index.md +16 -6
- package/docs/guides/principles/scoped-elements.md +13 -1
- package/docs/guides/principles/styling.md +14 -2
- package/docs/guides/principles/subclasser-apis.md +13 -1
- package/package.json +1 -1
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
parts:
|
|
3
|
+
- API Table
|
|
4
|
+
- Checkbox Group
|
|
5
|
+
title: 'Checkbox Group: API Table'
|
|
6
|
+
eleventyNavigation:
|
|
7
|
+
key: API Table >> Checkbox Group
|
|
8
|
+
title: API Table
|
|
9
|
+
order: 90
|
|
10
|
+
parent: Checkbox Group
|
|
11
|
+
---
|
|
12
|
+
# Checkbox Group: API Table
|
|
13
|
+
|
|
2
14
|
|
|
3
15
|
## class: `LionCheckbox`, `lion-checkbox`
|
|
4
16
|
|
|
@@ -6,137 +18,132 @@
|
|
|
6
18
|
|
|
7
19
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
8
20
|
| ---------------------------- | --------- | ----------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
21
|
+
| `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 |
|
|
22
|
+
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
23
|
+
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
24
|
+
| `checked` | public | `boolean` | | | ChoiceInputMixin |
|
|
9
25
|
| `choiceValue` | public | `string\|any` | | The value that will be registered to the modelValue of the parent ChoiceGroup. Recommended
to be a string | ChoiceInputMixin |
|
|
10
|
-
| `
|
|
26
|
+
| `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 |
|
|
27
|
+
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
11
28
|
| `disabled` | public | `boolean` | `false` | Boolean indicating whether or not this element is disabled. | DisabledMixin |
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
29
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
30
|
+
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
31
|
+
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
32
|
+
| `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 |
|
|
14
33
|
| `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 |
|
|
15
34
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
16
35
|
| `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 |
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
36
|
+
| `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 |
|
|
37
|
+
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
38
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
39
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
40
|
+
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
41
|
+
| `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. | FormControlMixin |
|
|
42
|
+
| `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 |
|
|
43
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
44
|
+
| `placeholder` | public | `string` | `''` | | LionInput |
|
|
45
|
+
| `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 |
|
|
46
|
+
| `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 |
|
|
22
47
|
| `selectionEnd` | public | `number` | | | NativeTextFieldMixin |
|
|
48
|
+
| `selectionStart` | public | `number` | | | NativeTextFieldMixin |
|
|
49
|
+
| `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 |
|
|
50
|
+
| `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 |
|
|
51
|
+
| `submitted` | public | | | | InteractionStateMixin |
|
|
52
|
+
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
53
|
+
| `type` | public | `string` | `'text'` | | LionInput |
|
|
54
|
+
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
55
|
+
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
56
|
+
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
57
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
58
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
59
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
60
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | LionField |
|
|
61
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
23
62
|
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | LionField |
|
|
24
|
-
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
25
|
-
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
26
|
-
| `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 |
|
|
27
|
-
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
28
|
-
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
29
|
-
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
30
|
-
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
31
|
-
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
32
63
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
33
|
-
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
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
|
-
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
36
64
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
65
|
+
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
66
|
+
| `_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 |
|
|
67
|
+
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
40
68
|
| `_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
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `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 |
|
|
69
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
70
|
+
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
44
71
|
| `_parentFormGroup` | protected | `FormRegistrarHost \| undefined` | `undefined` | The registrar this FormControl registers to, Usually a descendant of FormGroup or
ChoiceGroup | FormRegisteringMixin |
|
|
45
|
-
| `
|
|
72
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'child'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
46
73
|
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
47
|
-
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | LionField |
|
|
48
|
-
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
49
|
-
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
50
|
-
| `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 |
|
|
51
|
-
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
52
|
-
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
53
74
|
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | InteractionStateMixin |
|
|
54
|
-
| `submitted` | public | | | | InteractionStateMixin |
|
|
55
|
-
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
56
|
-
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
57
|
-
| `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 |
|
|
58
|
-
| `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 |
|
|
59
|
-
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
60
|
-
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
61
|
-
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
62
|
-
| `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 |
|
|
63
75
|
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
64
76
|
|
|
65
77
|
### Methods
|
|
66
78
|
|
|
67
79
|
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
68
80
|
| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------- |
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
73
|
-
| `_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 |
|
|
74
|
-
| `_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 |
|
|
75
|
-
| `_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 |
|
|
76
|
-
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
77
|
-
| `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 |
|
|
81
|
+
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
82
|
+
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
83
|
+
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
78
84
|
| `clear` | public | Clears modelValue.
Interaction states are not cleared (use resetInteractionState for this) | | | LionField |
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
85
|
+
| `click` | public | | | | DisabledMixin |
|
|
86
|
+
| `deserializer` | public | Converts \`.serializedValue\` to \`.modelValue\`
For instance, an iso formatted date string to a Date object | `v: ?` | `?` | FormatMixin |
|
|
87
|
+
| `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 |
|
|
88
|
+
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
89
|
+
| `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 |
|
|
90
|
+
| `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 |
|
|
91
|
+
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
92
|
+
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
81
93
|
| `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 |
|
|
94
|
+
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
95
|
+
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
96
|
+
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
97
|
+
| `resetInteractionState` | public | Resets touched and dirty, and recomputes prefilled | | | LionField |
|
|
98
|
+
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
82
99
|
| `serializer` | public | Converts \`.modelValue\` to \`.serializedValue\`
For instance, a Date object to an iso formatted date string | `v: ?` | `string` | FormatMixin |
|
|
83
|
-
| `
|
|
100
|
+
| `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 |
|
|
101
|
+
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
84
102
|
| `_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 |
|
|
103
|
+
| `_choiceGraphicTemplate` | protected | | | | ChoiceInputMixin |
|
|
104
|
+
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
85
105
|
| `_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 |
|
|
86
|
-
| `_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 |
|
|
87
|
-
| `_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 |
|
|
88
|
-
| `_onUserInputChanged` | protected | | | | FormatMixin |
|
|
89
|
-
| `__onCompositionEvent` | protected | | `{ type }, event: Event` | | FormatMixin |
|
|
90
|
-
| `_setValueAndPreserveCaret` | protected | Restores the cursor to its original position after updating the value. | `newValue: string` | | NativeTextFieldMixin |
|
|
91
|
-
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
92
|
-
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
93
|
-
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
94
|
-
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
95
106
|
| `_enhanceLightDomA11y` | protected | | | | FormControlMixin |
|
|
96
107
|
| `_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 |
|
|
97
|
-
| `
|
|
108
|
+
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
109
|
+
| `_feedbackTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
110
|
+
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
98
111
|
| `_groupOneTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
99
112
|
| `_groupTwoTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
100
|
-
| `
|
|
113
|
+
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
101
114
|
| `_helpTextTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
102
|
-
| `
|
|
115
|
+
| `_inputGroupAfterTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
103
116
|
| `_inputGroupBeforeTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
104
|
-
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
105
117
|
| `_inputGroupInputTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
118
|
+
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
106
119
|
| `_inputGroupSuffixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
110
|
-
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
111
|
-
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
112
|
-
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
113
|
-
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
114
|
-
| `__getDirectSlotChild` | protected | | `slotName: string` | `HTMLElement \| undefined` | FormControlMixin |
|
|
115
|
-
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
116
|
-
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
117
|
-
| `__repropagateChildrenValues` | protected | | `ev: CustomEvent` | | FormControlMixin |
|
|
118
|
-
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost` | | FormControlMixin |
|
|
119
|
-
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
120
|
-
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
121
|
-
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
122
|
-
| `click` | public | | | | DisabledMixin |
|
|
123
|
-
| `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 |
|
|
120
|
+
| `_inputGroupTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
121
|
+
| `_isEmpty` | protected | Used for required validator. | `modelValue: any` | `boolean` | FormControlMixin |
|
|
124
122
|
| `_iStateOnLeave` | protected | Sets touched value to true and reevaluates prefilled state.
When false, on next interaction, user will start with a clean state. | | | InteractionStateMixin |
|
|
125
123
|
| `_iStateOnValueChange` | protected | Sets dirty value and validates when already touched or invalid | | | InteractionStateMixin |
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
124
|
+
| `_labelTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
125
|
+
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
126
|
+
| `_onChange` | protected | Dispatches custom bubble event | `ev: Event=` | | LionField |
|
|
128
127
|
| `_onDirtyChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
128
|
+
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
129
|
+
| `_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 |
|
|
130
|
+
| `_onTouchedChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
131
|
+
| `_onUserInputChanged` | protected | | | | FormatMixin |
|
|
132
132
|
| `_onValidatorUpdated` | protected | | `e: Event\|CustomEvent` | | ValidateMixin |
|
|
133
|
+
| `_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 |
|
|
134
|
+
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
135
|
+
| `_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 |
|
|
136
|
+
| `_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 |
|
|
137
|
+
| `_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 |
|
|
138
|
+
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost` | | FormControlMixin |
|
|
139
|
+
| `_setValueAndPreserveCaret` | protected | Restores the cursor to its original position after updating the value. | `newValue: string` | | NativeTextFieldMixin |
|
|
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
|
+
| `_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 |
|
|
142
|
+
| `_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 |
|
|
143
|
+
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
144
|
+
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
133
145
|
| `_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 |
|
|
134
|
-
| `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 |
|
|
135
|
-
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
136
146
|
| `_updateShouldShowFeedbackFor` | protected | | | | ValidateMixin |
|
|
137
|
-
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
138
|
-
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
139
|
-
| `_onChange` | protected | Dispatches custom bubble event | `ev: Event=` | | LionField |
|
|
140
147
|
|
|
141
148
|
### Events
|
|
142
149
|
|
|
@@ -190,141 +197,127 @@
|
|
|
190
197
|
|
|
191
198
|
### Fields
|
|
192
199
|
|
|
193
|
-
| Name
|
|
194
|
-
|
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
201
|
-
| `
|
|
202
|
-
| `
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
| `
|
|
216
|
-
| `
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `_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 |
|
|
241
|
-
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
200
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
201
|
+
| -------------------------- | --------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
202
|
+
| `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 |
|
|
203
|
+
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | FormGroupMixin |
|
|
204
|
+
| `disabled` | public | `boolean` | `false` | Disables all formElements in group | DisabledMixin |
|
|
205
|
+
| `done` | public | `boolean` | `false` | | FormRegistrarMixin |
|
|
206
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
207
|
+
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
208
|
+
| `focused` | public | `boolean` | `false` | True when any of the children is focused. | FormGroupMixin |
|
|
209
|
+
| `formattedValue` | public | | | Object keyed by formElements names, containing formElements' formattedValues | FormGroupMixin |
|
|
210
|
+
| `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 |
|
|
211
|
+
| `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 |
|
|
212
|
+
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
213
|
+
| `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 |
|
|
214
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
215
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
216
|
+
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
217
|
+
| `modelValue` | public | | | Object keyed by formElements names, containing formElements' modelValues | FormControlMixin |
|
|
218
|
+
| `multipleChoice` | public | `boolean` | `true` | 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 |
|
|
219
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
220
|
+
| `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. | FormGroupMixin |
|
|
221
|
+
| `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 |
|
|
222
|
+
| `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 |
|
|
223
|
+
| `serializedValue` | public | | | Object keyed by formElements names, containing formElements' serializedValues | FormGroupMixin |
|
|
224
|
+
| `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 |
|
|
225
|
+
| `submitted` | public | `boolean` | `false` | True when parent form is submitted | FormGroupMixin |
|
|
226
|
+
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | FormGroupMixin |
|
|
227
|
+
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
228
|
+
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
229
|
+
| `value` | public | `string` | `''` | | FormGroupMixin |
|
|
230
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
231
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
232
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
233
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | ValidateMixin |
|
|
234
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
235
|
+
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
236
|
+
| `_initialModelValue` | protected | | | Gathers initial model values of all children. Used when resetGroup() is called. | FormGroupMixin |
|
|
237
|
+
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
238
|
+
| `_inputNode` | protected | | | The host element with role group (or radio-group or form) containing necessary aria attributes | FormControlMixin |
|
|
239
|
+
| `_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 |
|
|
240
|
+
| `_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 |
|
|
241
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
242
|
+
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
243
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'choice-group'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
244
|
+
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
245
|
+
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | InteractionStateMixin |
|
|
246
|
+
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
242
247
|
|
|
243
248
|
### Methods
|
|
244
249
|
|
|
245
|
-
| Name
|
|
246
|
-
|
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `
|
|
252
|
-
| `
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
| `
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
296
|
-
| `
|
|
297
|
-
| `_onFocusOut`
|
|
298
|
-
| `
|
|
299
|
-
| `
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
302
|
-
| `
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
305
|
-
| `
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
317
|
-
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
318
|
-
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
319
|
-
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
320
|
-
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
321
|
-
| `__getDirectSlotChild` | protected | | `slotName: string` | `HTMLElement \| undefined` | FormControlMixin |
|
|
322
|
-
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
323
|
-
| `__repropagateChildrenValues` | protected | | `ev: CustomEvent` | | FormControlMixin |
|
|
324
|
-
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
325
|
-
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
326
|
-
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
327
|
-
| `click` | public | | | | DisabledMixin |
|
|
250
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
251
|
+
| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------- | --------------------- |
|
|
252
|
+
| `addFormElement` | public | | `child: FormControl, indexToInsertAt: number` | | FormRegistrarMixin |
|
|
253
|
+
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
254
|
+
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
255
|
+
| `clear` | public | | | | ChoiceGroupMixin |
|
|
256
|
+
| `clearGroup` | public | Clears all values and resets all interaction states of all FormControls in group, | | | FormGroupMixin |
|
|
257
|
+
| `click` | public | | | | DisabledMixin |
|
|
258
|
+
| `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 |
|
|
259
|
+
| `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 |
|
|
260
|
+
| `isRegisteredFormElement` | public | | `el: ElementWithParentFormGroup` | | FormRegistrarMixin |
|
|
261
|
+
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
262
|
+
| `removeFormElement` | public | | `child: FormControlHost` | | FormRegistrarMixin |
|
|
263
|
+
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
264
|
+
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
265
|
+
| `resetGroup` | public | Resets to initial/prefilled values and interaction states of all FormControls in group, | | | FormGroupMixin |
|
|
266
|
+
| `resetInteractionState` | public | Resets touched and dirty, and recomputes prefilled | | | FormGroupMixin |
|
|
267
|
+
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
268
|
+
| `submitGroup` | public | Handles interaction state 'submitted'.
This allows children to enable visibility of validation feedback | | | FormGroupMixin |
|
|
269
|
+
| `updateSync` | public | | `name: string, oldValue: ?` | | ValidateMixin |
|
|
270
|
+
| `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 |
|
|
271
|
+
| `_anyFormElementHas` | protected | Returns true when one of the formElements has requested | `property: string` | | FormGroupMixin |
|
|
272
|
+
| `_anyFormElementHasFeedbackFor` | protected | | `state: string` | | FormGroupMixin |
|
|
273
|
+
| `_checkForOutsideClick` | protected | | `event: Event` | | FormGroupMixin |
|
|
274
|
+
| `_checkSingleChoiceElements` | protected | | `ev: CustomEvent & {target:FormControl}` | | ChoiceGroupMixin |
|
|
275
|
+
| `_completeRegistration` | protected | Resolves the registrationComplete promise. Subclassers can delay if needed | | | FormRegistrarMixin |
|
|
276
|
+
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
277
|
+
| `_enhanceLightDomA11y` | protected | | | | FormControlMixin |
|
|
278
|
+
| `_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 |
|
|
279
|
+
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
280
|
+
| `_everyFormElementHas` | protected | Returns true when all of the formElements have requested property | `property: string` | | FormGroupMixin |
|
|
281
|
+
| `_feedbackTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
282
|
+
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
283
|
+
| `_getCheckedElements` | protected | | | | ChoiceGroupMixin |
|
|
284
|
+
| `_getFromAllFormElements` | protected | Implicit :( | `property: string, filterFn: (el: FormControl, property?: string) => boolean` | `{[name:string]: any}` | FormGroupMixin |
|
|
285
|
+
| `_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` | FormGroupMixin |
|
|
286
|
+
| `_groupOneTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
287
|
+
| `_groupTwoTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
288
|
+
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
289
|
+
| `_helpTextTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
290
|
+
| `_inputGroupAfterTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
291
|
+
| `_inputGroupBeforeTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
292
|
+
| `_inputGroupInputTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
293
|
+
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
294
|
+
| `_inputGroupSuffixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
295
|
+
| `_inputGroupTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
296
|
+
| `_isEmpty` | protected | Used for Required validation and computation of interaction states | `modelValue: any` | `boolean` | FormControlMixin |
|
|
297
|
+
| `_iStateOnLeave` | protected | Sets touched value to true and reevaluates prefilled state.
When false, on next interaction, user will start with a clean state. | | | InteractionStateMixin |
|
|
298
|
+
| `_iStateOnValueChange` | protected | Sets dirty value and validates when already touched or invalid | | | InteractionStateMixin |
|
|
299
|
+
| `_labelTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
300
|
+
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
301
|
+
| `_onDirtyChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
302
|
+
| `_onFocusOut` | protected | | `ev: Event` | | FormGroupMixin |
|
|
303
|
+
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
304
|
+
| `_onRequestToAddFormElement` | protected | Hook for Subclassers to perform logic before an element is added | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
305
|
+
| `_onRequestToChangeFormElementName` | protected | | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
306
|
+
| `_onRequestToRemoveFormElement` | protected | | `ev: CustomEvent` | | FormRegistrarMixin |
|
|
307
|
+
| `_onTouchedChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
308
|
+
| `_onValidatorUpdated` | protected | | `e: Event\|CustomEvent` | | ValidateMixin |
|
|
309
|
+
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
310
|
+
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost & ChoiceInputHost` | | FormControlMixin |
|
|
311
|
+
| `_setCheckedElements` | protected | | `value: string \| any[], check: Function` | | ChoiceGroupMixin |
|
|
312
|
+
| `_setValueForAllFormElements` | protected | Sets the same value for requested property in all formElements | `property: string \| number, value: any` | | FormGroupMixin |
|
|
313
|
+
| `_setValueMapForAllFormElements` | protected | Allows to set formElements values via a keyed object structure | `property: string, values: { [x: string]: any; }` | | FormGroupMixin |
|
|
314
|
+
| `_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: object` | | ValidateMixin |
|
|
315
|
+
| `_syncDirty` | protected | | | | FormGroupMixin |
|
|
316
|
+
| `_syncFocused` | protected | | | | FormGroupMixin |
|
|
317
|
+
| `_throwWhenInvalidChildModelValue` | protected | | `child: FormControl` | | ChoiceGroupMixin |
|
|
318
|
+
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
319
|
+
| `_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 |
|
|
320
|
+
| `_updateShouldShowFeedbackFor` | protected | | | | ValidateMixin |
|
|
328
321
|
|
|
329
322
|
### Events
|
|
330
323
|
|
|
@@ -368,148 +361,143 @@
|
|
|
368
361
|
|
|
369
362
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
370
363
|
| ---------------------------- | --------- | ----------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
371
|
-
| `
|
|
372
|
-
| `
|
|
373
|
-
| `
|
|
374
|
-
| `
|
|
375
|
-
| `mixedState` | public | `boolean` | `false` | | |
|
|
364
|
+
| `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 |
|
|
365
|
+
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
366
|
+
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
367
|
+
| `checked` | public | `boolean` | | | ChoiceInputMixin |
|
|
376
368
|
| `choiceValue` | public | `string\|any` | | The value that will be registered to the modelValue of the parent ChoiceGroup. Recommended
to be a string | ChoiceInputMixin |
|
|
377
|
-
| `
|
|
369
|
+
| `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 |
|
|
370
|
+
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
378
371
|
| `disabled` | public | `boolean` | `false` | Boolean indicating whether or not this element is disabled. | DisabledMixin |
|
|
379
|
-
| `
|
|
380
|
-
| `
|
|
372
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
373
|
+
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
374
|
+
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
375
|
+
| `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 |
|
|
381
376
|
| `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 |
|
|
382
377
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
383
378
|
| `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 |
|
|
384
|
-
| `
|
|
385
|
-
| `
|
|
386
|
-
| `
|
|
387
|
-
| `
|
|
388
|
-
| `
|
|
379
|
+
| `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 |
|
|
380
|
+
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
381
|
+
| `indeterminate` | public | `boolean` | `false` | Indeterminate state of the checkbox | |
|
|
382
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
383
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
384
|
+
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
385
|
+
| `mixedState` | public | `boolean` | `false` | | |
|
|
386
|
+
| `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. | FormControlMixin |
|
|
387
|
+
| `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 |
|
|
388
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
389
|
+
| `placeholder` | public | `string` | `''` | | LionInput |
|
|
390
|
+
| `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 |
|
|
391
|
+
| `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 |
|
|
389
392
|
| `selectionEnd` | public | `number` | | | NativeTextFieldMixin |
|
|
393
|
+
| `selectionStart` | public | `number` | | | NativeTextFieldMixin |
|
|
394
|
+
| `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 |
|
|
395
|
+
| `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 |
|
|
396
|
+
| `submitted` | public | | | | InteractionStateMixin |
|
|
397
|
+
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
398
|
+
| `type` | public | `string` | `'text'` | | LionInput |
|
|
399
|
+
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
400
|
+
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
401
|
+
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
402
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
403
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
404
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
405
|
+
| `_checkboxGroupNode` | protected | | | | |
|
|
406
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | LionField |
|
|
407
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
390
408
|
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | LionField |
|
|
391
|
-
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
392
|
-
| `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.
Reflects to attribute '\[focused]' as a styling hook | FocusMixin |
|
|
393
|
-
| `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 |
|
|
394
|
-
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
395
|
-
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
396
|
-
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
397
|
-
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
398
|
-
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
399
409
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
400
|
-
| `
|
|
401
|
-
| `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 |
|
|
402
|
-
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
410
|
+
| `_indeterminateSubStates` | protected | `boolean[]` | `[]` | | |
|
|
403
411
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
404
|
-
| `
|
|
405
|
-
| `
|
|
406
|
-
| `
|
|
412
|
+
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
413
|
+
| `_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 |
|
|
414
|
+
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
407
415
|
| `_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 |
|
|
408
|
-
| `
|
|
409
|
-
| `
|
|
410
|
-
| `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 |
|
|
416
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
417
|
+
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
411
418
|
| `_parentFormGroup` | protected | `FormRegistrarHost \| undefined` | `undefined` | The registrar this FormControl registers to, Usually a descendant of FormGroup or
ChoiceGroup | FormRegisteringMixin |
|
|
412
|
-
| `
|
|
419
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'child'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
413
420
|
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
414
|
-
| `
|
|
415
|
-
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | InteractionStateMixin |
|
|
416
|
-
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | InteractionStateMixin |
|
|
417
|
-
| `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 |
|
|
418
|
-
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
419
|
-
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
421
|
+
| `_subCheckboxes` | protected | | | | |
|
|
420
422
|
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | InteractionStateMixin |
|
|
421
|
-
| `submitted` | public | | | | InteractionStateMixin |
|
|
422
|
-
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
423
|
-
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
424
|
-
| `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 |
|
|
425
|
-
| `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 |
|
|
426
|
-
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
427
|
-
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
428
|
-
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
429
|
-
| `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 |
|
|
430
423
|
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
431
424
|
|
|
432
425
|
### Methods
|
|
433
426
|
|
|
434
427
|
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
435
428
|
| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------- |
|
|
436
|
-
| `
|
|
437
|
-
| `
|
|
438
|
-
| `
|
|
439
|
-
| `_setBasedOnMixedState` | protected | | | | |
|
|
440
|
-
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
441
|
-
| `_onRequestToAddFormElement` | protected | | `ev: Event` | | |
|
|
442
|
-
| `_onRequestToRemoveFormElement` | protected | | `ev: Event` | | |
|
|
443
|
-
| `_choiceGraphicTemplate` | protected | | | | ChoiceInputMixin |
|
|
444
|
-
| `_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 |
|
|
445
|
-
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
446
|
-
| `_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 |
|
|
447
|
-
| `_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 |
|
|
448
|
-
| `_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 |
|
|
449
|
-
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
450
|
-
| `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 |
|
|
429
|
+
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
430
|
+
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
431
|
+
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
451
432
|
| `clear` | public | Clears modelValue.
Interaction states are not cleared (use resetInteractionState for this) | | | LionField |
|
|
452
|
-
| `
|
|
453
|
-
| `
|
|
433
|
+
| `click` | public | | | | DisabledMixin |
|
|
434
|
+
| `deserializer` | public | Converts \`.serializedValue\` to \`.modelValue\`
For instance, an iso formatted date string to a Date object | `v: ?` | `?` | FormatMixin |
|
|
435
|
+
| `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 |
|
|
436
|
+
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
437
|
+
| `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 |
|
|
438
|
+
| `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 |
|
|
439
|
+
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
440
|
+
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
454
441
|
| `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 |
|
|
442
|
+
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
443
|
+
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
444
|
+
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
445
|
+
| `resetInteractionState` | public | Resets touched and dirty, and recomputes prefilled | | | LionField |
|
|
446
|
+
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
455
447
|
| `serializer` | public | Converts \`.modelValue\` to \`.serializedValue\`
For instance, a Date object to an iso formatted date string | `v: ?` | `string` | FormatMixin |
|
|
456
|
-
| `
|
|
448
|
+
| `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 |
|
|
449
|
+
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
457
450
|
| `_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 |
|
|
451
|
+
| `_choiceGraphicTemplate` | protected | | | | ChoiceInputMixin |
|
|
452
|
+
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
458
453
|
| `_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 |
|
|
459
|
-
| `_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 |
|
|
460
|
-
| `_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 |
|
|
461
|
-
| `_onUserInputChanged` | protected | | | | FormatMixin |
|
|
462
|
-
| `__onCompositionEvent` | protected | | `{ type }, event: Event` | | FormatMixin |
|
|
463
|
-
| `_setValueAndPreserveCaret` | protected | Restores the cursor to its original position after updating the value. | `newValue: string` | | NativeTextFieldMixin |
|
|
464
|
-
| `focus` | public | Calls \`focus()\` on focusable element within | | | FocusMixin |
|
|
465
|
-
| `blur` | public | Calls \`blur()\` on focusable element within | | | FocusMixin |
|
|
466
|
-
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
467
|
-
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
468
454
|
| `_enhanceLightDomA11y` | protected | | | | FormControlMixin |
|
|
469
455
|
| `_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 |
|
|
470
|
-
| `
|
|
456
|
+
| `_enhanceLightDomClasses` | protected | | | | FormControlMixin |
|
|
457
|
+
| `_feedbackTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
458
|
+
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
471
459
|
| `_groupOneTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
472
460
|
| `_groupTwoTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
473
|
-
| `
|
|
461
|
+
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
474
462
|
| `_helpTextTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
475
|
-
| `
|
|
463
|
+
| `_inputGroupAfterTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
476
464
|
| `_inputGroupBeforeTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
477
|
-
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
478
465
|
| `_inputGroupInputTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
466
|
+
| `_inputGroupPrefixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
479
467
|
| `_inputGroupSuffixTemplate` | protected | | | `TemplateResult \| nothing` | FormControlMixin |
|
|
480
|
-
| `
|
|
481
|
-
| `
|
|
482
|
-
| `_getAriaDescriptionElements` | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.\_\_getAllDescriptionElementsInParentChain() | | `Array.<HTMLElement>` | FormControlMixin |
|
|
483
|
-
| `addToAriaLabelledBy` | public | Allows to add extra element references to aria-labelledby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
484
|
-
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
485
|
-
| `addToAriaDescribedBy` | public | Allows to add element references to aria-describedby attribute. | `element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}` | | FormControlMixin |
|
|
486
|
-
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
487
|
-
| `__getDirectSlotChild` | protected | | `slotName: string` | `HTMLElement \| undefined` | FormControlMixin |
|
|
488
|
-
| `_dispatchInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
489
|
-
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
490
|
-
| `__repropagateChildrenValues` | protected | | `ev: CustomEvent` | | FormControlMixin |
|
|
491
|
-
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost` | | FormControlMixin |
|
|
492
|
-
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
493
|
-
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
494
|
-
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
495
|
-
| `click` | public | | | | DisabledMixin |
|
|
496
|
-
| `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 |
|
|
468
|
+
| `_inputGroupTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
469
|
+
| `_isEmpty` | protected | Used for required validator. | `modelValue: any` | `boolean` | FormControlMixin |
|
|
497
470
|
| `_iStateOnLeave` | protected | Sets touched value to true and reevaluates prefilled state.
When false, on next interaction, user will start with a clean state. | | | InteractionStateMixin |
|
|
498
471
|
| `_iStateOnValueChange` | protected | Sets dirty value and validates when already touched or invalid | | | InteractionStateMixin |
|
|
499
|
-
| `
|
|
500
|
-
| `
|
|
472
|
+
| `_labelTemplate` | protected | | | `TemplateResult` | FormControlMixin |
|
|
473
|
+
| `_onBeforeRepropagateChildrenValues` | protected | Hook for Subclassers to add logic before repropagation | `ev: CustomEvent` | | FormControlMixin |
|
|
474
|
+
| `_onChange` | protected | Dispatches custom bubble event | `ev: Event=` | | LionField |
|
|
501
475
|
| `_onDirtyChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
502
|
-
| `
|
|
503
|
-
| `
|
|
504
|
-
| `
|
|
476
|
+
| `_onLabelClick` | protected | | | | FormControlMixin |
|
|
477
|
+
| `_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 |
|
|
478
|
+
| `_onRequestToAddFormElement` | protected | | `ev: Event` | | |
|
|
479
|
+
| `_onRequestToRemoveFormElement` | protected | | `ev: Event` | | |
|
|
480
|
+
| `_onTouchedChanged` | protected | Dispatches event on touched state change | | | InteractionStateMixin |
|
|
481
|
+
| `_onUserInputChanged` | protected | | | | FormatMixin |
|
|
505
482
|
| `_onValidatorUpdated` | protected | | `e: Event\|CustomEvent` | | ValidateMixin |
|
|
483
|
+
| `_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 |
|
|
484
|
+
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
485
|
+
| `_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 |
|
|
486
|
+
| `_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 |
|
|
487
|
+
| `_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 |
|
|
488
|
+
| `_repropagationCondition` | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | `target: FormControlHost` | | FormControlMixin |
|
|
489
|
+
| `_setBasedOnMixedState` | protected | | | | |
|
|
490
|
+
| `_setOldState` | protected | | | | |
|
|
491
|
+
| `_setOwnCheckedState` | protected | | | | |
|
|
492
|
+
| `_setValueAndPreserveCaret` | protected | Restores the cursor to its original position after updating the value. | `newValue: string` | | NativeTextFieldMixin |
|
|
493
|
+
| `_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 |
|
|
494
|
+
| `_storeIndeterminateState` | protected | | | | |
|
|
495
|
+
| `_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 |
|
|
496
|
+
| `_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 |
|
|
497
|
+
| `_toggleChecked` | protected | | `ev: Event` | | ChoiceInputMixin |
|
|
498
|
+
| `_triggerInitialModelValueChangedEvent` | protected | | | | FormControlMixin |
|
|
506
499
|
| `_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 |
|
|
507
|
-
| `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 |
|
|
508
|
-
| `_hasFeedbackVisibleFor` | protected | Used to translate \`.hasFeedbackFor\` and \`.shouldShowFeedbackFor\` to \`.showsFeedbackFor\` | `type: string` | | ValidateMixin |
|
|
509
500
|
| `_updateShouldShowFeedbackFor` | protected | | | | ValidateMixin |
|
|
510
|
-
| `_prioritizeAndFilterFeedback` | protected | Orders all active validators in this.\_\_validationResult.
Can also filter out occurrences (based on interaction states) | `{ validationResult }, opts: { validationResult: Validator[] }` | `Validator[]` | ValidateMixin |
|
|
511
|
-
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
512
|
-
| `_onChange` | protected | Dispatches custom bubble event | `ev: Event=` | | LionField |
|
|
513
501
|
|
|
514
502
|
### Events
|
|
515
503
|
|