@lion/ui 0.20.0 → 0.21.0
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/components/form-core/src/FormatMixin.js +10 -5
- package/components/form-core/test-helpers/mimicUserInput.js +1 -0
- package/components/form-core/test-suites/FormatMixin.suite.js +31 -14
- package/components/input-amount-dropdown/src/LionInputAmountDropdown.js +51 -8
- package/components/input-amount-dropdown/test/lion-input-amount-dropdown-integrations.test.js +5 -0
- package/components/input-amount-dropdown/test-suites/LionInputAmountDropdown.suite.js +1 -0
- package/components/input-datepicker/src/LionInputDatepicker.js +4 -0
- package/components/input-datepicker/test/lion-input-datepicker.test.js +55 -0
- package/components/input-range/src/LionInputRange.js +51 -8
- package/components/input-range/test/lion-input-range.test.js +114 -0
- package/custom-elements.json +415 -96
- package/dist-types/components/form-core/src/FormatMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-helpers/mimicUserInput.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/FormatMixin.suite.d.ts +8 -0
- package/dist-types/components/form-core/test-suites/FormatMixin.suite.d.ts.map +1 -1
- package/dist-types/components/input-amount-dropdown/src/LionInputAmountDropdown.d.ts +24 -6
- package/dist-types/components/input-amount-dropdown/src/LionInputAmountDropdown.d.ts.map +1 -1
- package/dist-types/components/input-amount-dropdown/test-suites/LionInputAmountDropdown.suite.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -0
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/test/lion-input-datepicker.test.d.ts.map +1 -1
- package/dist-types/components/input-range/src/LionInputRange.d.ts +11 -0
- package/dist-types/components/input-range/src/LionInputRange.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/api-table.md +4 -2
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/form/use-cases.md +2 -2
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/api-table.md +2 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +2 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount-dropdown/api-table.md +4 -3
- package/docs/components/input-date/api-table.md +2 -1
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +2 -1
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +2 -1
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +2 -1
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +2 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +7 -1
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-range/use-cases.md +14 -0
- package/docs/components/input-stepper/api-table.md +2 -1
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +2 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/api-table.md +2 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +2 -1
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/api-table.md +2 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +2 -1
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/use-cases.md +2 -2
- package/docs/components/switch/api-table.md +2 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +2 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/api-table.md +2 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +2 -2
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/how-to/index.md +1 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ eleventyNavigation:
|
|
|
14
14
|
|
|
15
15
|
A web component based on the date text input field. Its purpose is to provide a way for users to fill in a date with a datepicker.
|
|
16
16
|
For an input field with a big range, such as `birthday-input`, a datepicker is not the best choice due to the high variance between possible inputs.
|
|
17
|
-
We encourage using our standard [input-date](https://github.com/ing-bank/lion/blob/
|
|
17
|
+
We encourage using our standard [input-date](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-date/overview.md) for this.
|
|
18
18
|
|
|
19
19
|
```js script
|
|
20
20
|
import { html } from '@mdjs/mdjs-preview';
|
|
@@ -30,11 +30,11 @@ export const main = () => {
|
|
|
30
30
|
## Features
|
|
31
31
|
|
|
32
32
|
- Input field with a datepicker to help to choose a date
|
|
33
|
-
- Based on our [input-date](https://github.com/ing-bank/lion/blob/
|
|
34
|
-
- Makes use of our [calendar](https://github.com/ing-bank/lion/blob/
|
|
35
|
-
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/
|
|
33
|
+
- Based on our [input-date](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-date/overview.md)
|
|
34
|
+
- Makes use of our [calendar](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/calendar/overview.md) inside the datepicker
|
|
35
|
+
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/localize/dates.md) for formatting and parsing.
|
|
36
36
|
- Option to overwrite locale to change the formatting and parsing
|
|
37
|
-
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
38
38
|
- IsDate (default)
|
|
39
39
|
- MinDate
|
|
40
40
|
- MaxDate
|
|
@@ -62,6 +62,7 @@ eleventyNavigation:
|
|
|
62
62
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
63
63
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
64
64
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
65
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
65
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. | LionField |
|
|
66
67
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
67
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. | LionField |
|
|
@@ -92,7 +93,7 @@ eleventyNavigation:
|
|
|
92
93
|
| `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. | | | LionField |
|
|
93
94
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
94
95
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | LionField |
|
|
95
|
-
| `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
|
|
96
|
+
| `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 preprocessor 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` | LionField |
|
|
96
97
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
97
98
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
98
99
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -27,8 +27,8 @@ export const main = () => {
|
|
|
27
27
|
|
|
28
28
|
## Features
|
|
29
29
|
|
|
30
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
31
|
-
- Makes use of email [validators](https://github.com/ing-bank/lion/blob/
|
|
30
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md)
|
|
31
|
+
- Makes use of email [validators](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
32
32
|
- IsEmail (default)
|
|
33
33
|
|
|
34
34
|
## Installation
|
|
@@ -92,6 +92,7 @@ eleventyNavigation:
|
|
|
92
92
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
93
93
|
| `_inputNode` | protected | `HTMLInputElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
94
94
|
| `_isDragAndDropSupported` | protected | | | | |
|
|
95
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
95
96
|
| `_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. | LionField |
|
|
96
97
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
97
98
|
| `_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. | LionField |
|
|
@@ -123,7 +124,7 @@ eleventyNavigation:
|
|
|
123
124
|
| `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. | | | LionField |
|
|
124
125
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
125
126
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `InputFile[]` | LionField |
|
|
126
|
-
| `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
|
|
127
|
+
| `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 preprocessor 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` | LionField |
|
|
127
128
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
128
129
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
129
130
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -27,7 +27,7 @@ export const main = () => {
|
|
|
27
27
|
|
|
28
28
|
## Features
|
|
29
29
|
|
|
30
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
30
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md)
|
|
31
31
|
- Default labels and validation messages in different languages
|
|
32
32
|
- Options for multi file upload and drop-zone.
|
|
33
33
|
|
|
@@ -64,6 +64,7 @@ eleventyNavigation:
|
|
|
64
64
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
65
65
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
66
66
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
67
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
67
68
|
| `_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. | LionField |
|
|
68
69
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
69
70
|
| `_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. | LionField |
|
|
@@ -92,7 +93,7 @@ eleventyNavigation:
|
|
|
92
93
|
| `focus` | public | Calls \`focus()\` on focusable element within | | | LionField |
|
|
93
94
|
| `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. | | | LionField |
|
|
94
95
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
95
|
-
| `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
|
|
96
|
+
| `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 preprocessor 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` | LionField |
|
|
96
97
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
97
98
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
98
99
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -28,9 +28,9 @@ export const main = () => {
|
|
|
28
28
|
|
|
29
29
|
## Features
|
|
30
30
|
|
|
31
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
31
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md)
|
|
32
32
|
- Default label in different languages
|
|
33
|
-
- Makes use of IBAN specific [validate](https://github.com/ing-bank/lion/blob/
|
|
33
|
+
- Makes use of IBAN specific [validate](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
34
34
|
- IsIBAN (default)
|
|
35
35
|
- IsCountryIBAN
|
|
36
36
|
- Parses IBANs automatically
|
|
@@ -37,7 +37,9 @@ eleventyNavigation:
|
|
|
37
37
|
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionField |
|
|
38
38
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField |
|
|
39
39
|
| `max` | public | `number` | `Infinity` | | |
|
|
40
|
+
| `maxLabel` | public | `string` | `''` | | |
|
|
40
41
|
| `min` | public | `number` | `Infinity` | | |
|
|
42
|
+
| `minLabel` | public | `string` | `''` | | |
|
|
41
43
|
| `modelValue` | public | | | | LionField |
|
|
42
44
|
| `name` | public | `string` | `''` | The name the element will be registered with to the .formElements collection
of the parent. Also, it serves as the key of key/value pairs in
 modelValue/serializedValue objects | LionField |
|
|
43
45
|
| `noMinMaxLabels` | public | `boolean` | `false` | | |
|
|
@@ -69,6 +71,7 @@ eleventyNavigation:
|
|
|
69
71
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
70
72
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
71
73
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
74
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
72
75
|
| `_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. | LionField |
|
|
73
76
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
74
77
|
| `_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. | LionField |
|
|
@@ -78,6 +81,7 @@ eleventyNavigation:
|
|
|
78
81
|
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'child'` | Based on the role, details of handling model-value-changed repropagation differ. | LionField |
|
|
79
82
|
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | LionField |
|
|
80
83
|
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | LionField |
|
|
84
|
+
| `_valueDisplay` | protected | | | Get the display info for the current value | |
|
|
81
85
|
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | LionField |
|
|
82
86
|
|
|
83
87
|
### Methods
|
|
@@ -98,7 +102,7 @@ eleventyNavigation:
|
|
|
98
102
|
| `formatter` | public | Converts modelValue to formattedValue (formattedValue will be synced with
\`.\_inputNode.value\`)
For instance, a Date object to a localized date. | `v: *, opts: FormatOptions` | `string` | LionField |
|
|
99
103
|
| `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. | | | LionField |
|
|
100
104
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
101
|
-
| `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
|
|
105
|
+
| `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 preprocessor 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` | LionField |
|
|
102
106
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
103
107
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
104
108
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -179,6 +183,8 @@ eleventyNavigation:
|
|
|
179
183
|
| `unit` | unit | |
|
|
180
184
|
| `step` | step | |
|
|
181
185
|
| `no-min-max-labels` | noMinMaxLabels | |
|
|
186
|
+
| `min-label` | minLabel | |
|
|
187
|
+
| `max-label` | maxLabel | |
|
|
182
188
|
| `autocomplete` | autocomplete | NativeTextFieldMixin |
|
|
183
189
|
| `focused` | focused | LionField |
|
|
184
190
|
| `focused-visible` | focusedVisible | LionField |
|
|
@@ -25,11 +25,11 @@ import '@lion/ui/define/lion-input-range.js';
|
|
|
25
25
|
|
|
26
26
|
## Features
|
|
27
27
|
|
|
28
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md).
|
|
29
29
|
- Shows `modelValue` and `unit` above the range input.
|
|
30
30
|
- Shows `min` and `max` value after the range input.
|
|
31
31
|
- Can hide the `min` and `max` value via `no-min-max-labels`.
|
|
32
|
-
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/
|
|
32
|
+
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/localize/numbers.md) for formatting and parsing.
|
|
33
33
|
|
|
34
34
|
## Installation
|
|
35
35
|
|
|
@@ -60,6 +60,20 @@ import '@lion/ui/define/lion-input-range.js';
|
|
|
60
60
|
></lion-input-range>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
## Custom Min Max Labels
|
|
64
|
+
|
|
65
|
+
```html preview-story
|
|
66
|
+
<lion-input-range
|
|
67
|
+
min="0"
|
|
68
|
+
max="11"
|
|
69
|
+
min-label="less than 1 item"
|
|
70
|
+
max-label="more than 10 items"
|
|
71
|
+
.modelValue="${4}"
|
|
72
|
+
unit="Items"
|
|
73
|
+
label="Items"
|
|
74
|
+
></lion-input-range>
|
|
75
|
+
```
|
|
76
|
+
|
|
63
77
|
## Disabled
|
|
64
78
|
|
|
65
79
|
```html preview-story
|
|
@@ -70,6 +70,7 @@ eleventyNavigation:
|
|
|
70
70
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
71
71
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
72
72
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
73
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
73
74
|
| `_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. | LionField |
|
|
74
75
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
75
76
|
| `_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. | LionField |
|
|
@@ -98,7 +99,7 @@ eleventyNavigation:
|
|
|
98
99
|
| `focus` | public | Calls \`focus()\` on focusable element within | | | LionField |
|
|
99
100
|
| `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. | | | LionField |
|
|
100
101
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
101
|
-
| `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
|
|
102
|
+
| `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 preprocessor 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` | LionField |
|
|
102
103
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
103
104
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
104
105
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -30,7 +30,7 @@ loadDefaultFeedbackMessages();
|
|
|
30
30
|
|
|
31
31
|
## Features
|
|
32
32
|
|
|
33
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
33
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md).
|
|
34
34
|
- Set `min` and `max` value to define the range.
|
|
35
35
|
- Set `step` value in integer or decimal to increase and decrease the value.
|
|
36
36
|
- Use `ArrowUp` or `ArrowDown` to update the value.
|
|
@@ -69,6 +69,7 @@ eleventyNavigation:
|
|
|
69
69
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
70
70
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
71
71
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
72
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
72
73
|
| `_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. | LionField |
|
|
73
74
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
74
75
|
| `_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. | LionField |
|
|
@@ -101,7 +102,7 @@ eleventyNavigation:
|
|
|
101
102
|
| `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. | | | LionField |
|
|
102
103
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
103
104
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `viewValue: string` | `string` | LionField |
|
|
104
|
-
| `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
|
|
105
|
+
| `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 preprocessor that smartly
updates the viewValue and caret position for best UX. | `viewValue: string, { currentCaretIndex, prevViewValue }, options: @param {string} options.prevViewValue * @param {number} options.currentCaretIndex * ` | `{ viewValue: string; caretIndex: number; } \| undefined` | LionField |
|
|
105
106
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
106
107
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
107
108
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -51,7 +51,7 @@ export const main = () => {
|
|
|
51
51
|
|
|
52
52
|
## Features
|
|
53
53
|
|
|
54
|
-
- Extends our [input](https://github.com/ing-bank/lion/blob/
|
|
54
|
+
- Extends our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md)
|
|
55
55
|
- Shows a mobile telephone keypad on mobile (by having a native `<input inputmode="tel">` inside)
|
|
56
56
|
- Can be configured with a list of allowed region codes
|
|
57
57
|
- Will be preconfigured with region derived from locale
|
|
@@ -34,7 +34,7 @@ Say we have the following telephone number from Madrid, Spain: `+34919930432`.
|
|
|
34
34
|
It contains a [country code](https://en.wikipedia.org/wiki/Country_code) (34), an [area code](https://en.wikipedia.org/wiki/Telephone_numbering_plan#Area_code) (91) and a [dial code](https://en.wikipedia.org/wiki/Mobile_dial_code) (+34 91).
|
|
35
35
|
Input Tel interprets phone numbers based on their [region code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2): a two character long region representation('ES' in the telephone number above).
|
|
36
36
|
|
|
37
|
-
The table below lists all possible regions worldwide. When [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
The table below lists all possible regions worldwide. When [allowed regions](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/#allowed-regions) are not configured,
|
|
38
38
|
all of them will be supported as values of Input Tel.
|
|
39
39
|
|
|
40
40
|
```js story
|
|
@@ -49,11 +49,11 @@ export const regionCodesTable = () => {
|
|
|
49
49
|
The active region (accessible via readonly accessor `.activeRegion`) determines how validation and formatting
|
|
50
50
|
should be applied. It is dependent on the following factors:
|
|
51
51
|
|
|
52
|
-
- [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
53
|
-
[.allowedRegions has only one entry](https://github.com/ing-bank/lion/blob/
|
|
52
|
+
- [allowed regions](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/#allowed-regions): a list that determines what is allowed to become .activeRegion. If
|
|
53
|
+
[.allowedRegions has only one entry](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/#restrict-to-one-region), .activeRegion will always be this value.
|
|
54
54
|
- the modelValue or viewValue: once it contains sufficient info to derive its region code (and
|
|
55
|
-
the derived code is inside [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
56
|
-
- active locale (and the derived locale is inside [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
55
|
+
the derived code is inside [allowed regions](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/#allowed-regions) if configured)
|
|
56
|
+
- active locale (and the derived locale is inside [allowed regions](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/#allowed-regions) if configured)
|
|
57
57
|
|
|
58
58
|
What follows from the list above is that .activeRegion can change dynamically, after a value
|
|
59
59
|
change in the text box by the user (or when locales or allowed regions would be changed by the
|
|
@@ -142,7 +142,7 @@ export const heuristic = () => {
|
|
|
142
142
|
Once it is configured, validation and formatting will be restricted to those
|
|
143
143
|
values that are present in this list.
|
|
144
144
|
|
|
145
|
-
> Note that for [InputTelDropdown](https://github.com/ing-bank/lion/blob/
|
|
145
|
+
> Note that for [InputTelDropdown](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel-dropdown/index.md), only allowed regions will
|
|
146
146
|
> be shown in the dropdown list.
|
|
147
147
|
|
|
148
148
|
```js preview-story
|
|
@@ -71,6 +71,7 @@ eleventyNavigation:
|
|
|
71
71
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
72
72
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
73
73
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
74
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
74
75
|
| `_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. | LionField |
|
|
75
76
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
76
77
|
| `_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. | LionField |
|
|
@@ -105,7 +106,7 @@ eleventyNavigation:
|
|
|
105
106
|
| `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. | | | LionField |
|
|
106
107
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
107
108
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `viewValue: string` | `string` | LionField |
|
|
108
|
-
| `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
|
|
109
|
+
| `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 preprocessor that smartly
updates the viewValue and caret position for best UX. | `viewValue: string, { currentCaretIndex, prevViewValue }, options: @param {string} options.prevViewValue * @param {number} options.currentCaretIndex * ` | `{ viewValue: string; caretIndex: number; } \| undefined` | LionField |
|
|
109
110
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
110
111
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
111
112
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -31,7 +31,7 @@ export const main = () => {
|
|
|
31
31
|
|
|
32
32
|
## Features
|
|
33
33
|
|
|
34
|
-
- Extends our [input-tel](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
- Extends our [input-tel](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-tel/overview.md)
|
|
35
35
|
- Shows dropdown list with all possible regions
|
|
36
36
|
- Shows only allowed regions in dropdown list when .allowedRegions is configured
|
|
37
37
|
- Highlights regions on top of dropdown list when .preferredRegions is configured
|