@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
|
@@ -63,6 +63,7 @@ eleventyNavigation:
|
|
|
63
63
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
64
64
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
65
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
|
+
| `_isEditingTextField` | protected | | | | FormatMixin |
|
|
66
67
|
| `_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
68
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
68
69
|
| `_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 |
|
|
@@ -90,7 +91,7 @@ eleventyNavigation:
|
|
|
90
91
|
| `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
92
|
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
92
93
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
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
|
|
94
|
+
| `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` | FormatMixin |
|
|
94
95
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
95
96
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
96
97
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -410,6 +411,7 @@ eleventyNavigation:
|
|
|
410
411
|
| `_indeterminateSubStates` | protected | `boolean[]` | `[]` | | |
|
|
411
412
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
412
413
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
414
|
+
| `_isEditingTextField` | protected | | | | FormatMixin |
|
|
413
415
|
| `_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
416
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
415
417
|
| `_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 |
|
|
@@ -438,7 +440,7 @@ eleventyNavigation:
|
|
|
438
440
|
| `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
441
|
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
440
442
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
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
|
|
443
|
+
| `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` | FormatMixin |
|
|
442
444
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
443
445
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
444
446
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -31,11 +31,11 @@ import '@lion/ui/define/lion-checkbox.js';
|
|
|
31
31
|
</lion-checkbox-group>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/form/overview.md)'s serialization result.
|
|
35
35
|
|
|
36
36
|
## Features
|
|
37
37
|
|
|
38
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
38
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/fieldset/overview.md),
|
|
39
39
|
it has all the features a fieldset has.
|
|
40
40
|
|
|
41
41
|
## Installation
|
|
@@ -34,7 +34,7 @@ export const main = () => html`
|
|
|
34
34
|
## Features
|
|
35
35
|
|
|
36
36
|
- Use `opened` attribute or `toggle()` method to render default open.
|
|
37
|
-
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/button/overview.md) or native `button` with custom styling.
|
|
38
38
|
- Observe the state with the help of `@opened-changed` event.
|
|
39
39
|
- `show()` and `hide()` are helper methods to hide or show the content from outside.
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ export const main = () => html`
|
|
|
46
46
|
`;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
[...show more](https://github.com/ing-bank/lion/blob/
|
|
49
|
+
[...show more](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/combobox/extensions.md)
|
|
50
50
|
|
|
51
51
|
## Features
|
|
52
52
|
|
|
@@ -558,4 +558,4 @@ export const complexObjectChoiceValue = () =>
|
|
|
558
558
|
## Listbox compatibility
|
|
559
559
|
|
|
560
560
|
All configurations that can be applied to `lion-listbox`, can be applied to `lion-combobox` as well.
|
|
561
|
-
See the [listbox documentation](https://github.com/ing-bank/lion/blob/
|
|
561
|
+
See the [listbox documentation](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/listbox/overview.md) for more information.
|
|
@@ -66,6 +66,6 @@ import '@lion/ui/define/lion-dialog.js';
|
|
|
66
66
|
## Changing the configuration
|
|
67
67
|
|
|
68
68
|
You can use the `.config` property on the dialog to change the configuration.
|
|
69
|
-
The documentation of the full config object can be found in the `overlays` folder or here in [Overlay System - Configuration](https://github.com/ing-bank/lion/blob/
|
|
69
|
+
The documentation of the full config object can be found in the `overlays` folder or here in [Overlay System - Configuration](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/overlays/configuration.md).
|
|
70
70
|
|
|
71
71
|
The `config` property uses a setter to merge the passed configuration with the current, so you only **overwrite what you pass** when updating `config`.
|
|
@@ -32,9 +32,9 @@ export const main = () => html`
|
|
|
32
32
|
|
|
33
33
|
We have three specific fieldset implementations:
|
|
34
34
|
|
|
35
|
-
- [form](https://github.com/ing-bank/lion/blob/
|
|
36
|
-
- [checkbox-group](https://github.com/ing-bank/lion/blob/
|
|
37
|
-
- [radio-group](https://github.com/ing-bank/lion/blob/
|
|
35
|
+
- [form](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/form/overview.md)
|
|
36
|
+
- [checkbox-group](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/checkbox-group/overview.md)
|
|
37
|
+
- [radio-group](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/radio-group/overview.md)
|
|
38
38
|
|
|
39
39
|
A native fieldset element should always have a legend-element for a11y purposes.
|
|
40
40
|
However, our fieldset element is not native and should not have a legend-element.
|
|
@@ -43,8 +43,8 @@ Our fieldset instead has a label attribute or you can add a label with a div- or
|
|
|
43
43
|
## Features
|
|
44
44
|
|
|
45
45
|
- Easy retrieval of form data based on field names
|
|
46
|
-
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
47
|
-
- Can have [validate](https://github.com/ing-bank/lion/blob/
|
|
46
|
+
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/interaction-states.md)
|
|
47
|
+
- Can have [validate](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md) on fieldset level and shows the validation feedback below the fieldset
|
|
48
48
|
- Can disable input fields on fieldset level
|
|
49
49
|
- Accessible out of the box
|
|
50
50
|
|
|
@@ -20,7 +20,7 @@ import '@lion/ui/define/lion-form.js';
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
A web component that enhances the functionality of the native `form` component.
|
|
23
|
-
It is designed to interact with (instances of) the [form controls](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
It is designed to interact with (instances of) the [form controls](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/overview.md).
|
|
24
24
|
|
|
25
25
|
```js preview-story
|
|
26
26
|
export const main = () => {
|
|
@@ -49,11 +49,11 @@ export const main = () => {
|
|
|
49
49
|
- Data synchronization with models
|
|
50
50
|
- Easy retrieval of form data based on field names
|
|
51
51
|
- Advanced validation possibilities
|
|
52
|
-
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
52
|
+
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/interaction-states.md)
|
|
53
53
|
- Registration mechanism for form controls
|
|
54
54
|
- Accessible out of the box
|
|
55
55
|
|
|
56
|
-
For more information about fields that are designed for our `form`, please read [form system](https://github.com/ing-bank/lion/blob/
|
|
56
|
+
For more information about fields that are designed for our `form`, please read [form system](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/overview.md).
|
|
57
57
|
|
|
58
58
|
## Installation
|
|
59
59
|
|
|
@@ -26,7 +26,7 @@ import '@lion/ui/define/lion-form.js';
|
|
|
26
26
|
To submit a form, use a regular `<button>` (or `<lion-button-submit>`) somewhere inside the native `<form>`. Then, add a `submit` handler on the `<lion-form>`. You can use this event to do your own (pre-)submit logic, like getting the serialized form data and sending it to a backend API.
|
|
27
27
|
|
|
28
28
|
Another example is checking if the form has errors, and focusing the first field with a validation error.
|
|
29
|
-
To learn more about form validation, please take a look at [validate](https://github.com/ing-bank/lion/blob/
|
|
29
|
+
To learn more about form validation, please take a look at [validate](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md).
|
|
30
30
|
|
|
31
31
|
To fire a submit from JavaScript, select the `<lion-form>` element and call `.submit()`.
|
|
32
32
|
|
|
@@ -128,7 +128,7 @@ export const prefilledData = () => {
|
|
|
128
128
|
};
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Learn more about [formatting and parsing](https://github.com/ing-bank/lion/blob/
|
|
131
|
+
Learn more about [formatting and parsing](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/formatting-and-parsing.md).
|
|
132
132
|
|
|
133
133
|
## Sub forms
|
|
134
134
|
|
|
@@ -25,7 +25,7 @@ import '@lion/ui/define/lion-icon.js';
|
|
|
25
25
|
## Icon sets
|
|
26
26
|
|
|
27
27
|
Icons are displayed using icon sets. These are collections of icons, lazily loaded on demand for performance.
|
|
28
|
-
See the [system documentation](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
See the [system documentation](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/icon/overview.md) to learn more about icon sets.
|
|
29
29
|
|
|
30
30
|
```js preview-story
|
|
31
31
|
export const iconSets = () => html`
|
|
@@ -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 |
|
|
@@ -35,7 +35,7 @@ export const main = () => html`<lion-input label="First Name"></lion-input>`;
|
|
|
35
35
|
- **before**: does not have an active use case yet, but the option is in place.
|
|
36
36
|
- **after**: can be used to show a currency or percentage.
|
|
37
37
|
- Delegates attributes like `type`, `disabled`, `placeholder` and `readonly` to the native input.
|
|
38
|
-
- Can make use of [validation](https://github.com/ing-bank/lion/blob/
|
|
38
|
+
- Can make use of [validation](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md).
|
|
39
39
|
|
|
40
40
|
## Installation
|
|
41
41
|
|
|
@@ -67,6 +67,7 @@ eleventyNavigation:
|
|
|
67
67
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
68
68
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
69
69
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
70
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
70
71
|
| `_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 |
|
|
71
72
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
72
73
|
| `_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 |
|
|
@@ -95,7 +96,7 @@ eleventyNavigation:
|
|
|
95
96
|
| `focus` | public | Calls \`focus()\` on focusable element within | | | LionField |
|
|
96
97
|
| `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 |
|
|
97
98
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
98
|
-
| `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
|
|
99
|
+
| `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 |
|
|
99
100
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
100
101
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
101
102
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -36,13 +36,13 @@ export const main = () => {
|
|
|
36
36
|
|
|
37
37
|
## Features
|
|
38
38
|
|
|
39
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
40
|
-
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/
|
|
39
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input/overview.md)
|
|
40
|
+
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/localize/numbers.md) for formatting and parsing.
|
|
41
41
|
- Option to show currency as a suffix
|
|
42
42
|
- Option to override locale to change the formatting and parsing
|
|
43
43
|
- Option to provide additional format options overrides
|
|
44
44
|
- Default label in different languages
|
|
45
|
-
- Can make use of number specific [validators](https://github.com/ing-bank/lion/blob/
|
|
45
|
+
- Can make use of number specific [validators](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
46
46
|
- IsNumber (default)
|
|
47
47
|
- MinNumber
|
|
48
48
|
- MaxNumber
|
|
@@ -41,7 +41,7 @@ eleventyNavigation:
|
|
|
41
41
|
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionField |
|
|
42
42
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField |
|
|
43
43
|
| `locale` | public | `string \| undefined` | `undefined` | | LionInputAmount |
|
|
44
|
-
| `modelValue` | public | `object` | |
|
|
44
|
+
| `modelValue` | public | `object` | | For a FormControl to function properly, its modelValue, serializedValue and viewValue/formattedValue
should always translate in two directions. This is expected by \`\_callParser\` method. It guards for empty
viewValues. As the viewValue (\`.value\`) only concerns the amount part and not the currency part in
InputAmountDropdown, this contract is broken.
Below, we compensate for this. | LionField |
|
|
45
45
|
| `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 |
|
|
46
46
|
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | LionField |
|
|
47
47
|
| `parser` | public | | `parseAmount` | Converts viewValue to modelValue
For instance, a localized date to a Date Object | LionField |
|
|
@@ -76,6 +76,7 @@ eleventyNavigation:
|
|
|
76
76
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
77
77
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
78
78
|
| `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
79
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
79
80
|
| `_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 |
|
|
80
81
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
81
82
|
| `_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
|
| `focus` | public | Calls \`focus()\` on focusable element within | | | LionField |
|
|
106
107
|
| `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 |
|
|
107
108
|
| `makeRequestToBeDisabled` | public | | | | 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. | `v: string, opts: FormatOptions & { prevViewValue: string; currentCaretIndex: number }` | `{ viewValue:string; caretIndex:number; }\|string\|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 |
|
|
@@ -183,11 +184,11 @@ eleventyNavigation:
|
|
|
183
184
|
|
|
184
185
|
| Name | Field | Inherited From |
|
|
185
186
|
| ------------------------------- | -------------------------- | -------------------- |
|
|
186
|
-
| `modelValue` | modelValue | LionInputAmount |
|
|
187
187
|
| `preferredCurrencies` | preferredCurrencies | |
|
|
188
188
|
| `allowedCurrencies` | allowedCurrencies | |
|
|
189
189
|
| `__dropdownSlot` | \_\_dropdownSlot | |
|
|
190
190
|
| `currency` | currency | LionInputAmount |
|
|
191
|
+
| `modelValue` | modelValue | LionInputAmount |
|
|
191
192
|
| `autocomplete` | autocomplete | NativeTextFieldMixin |
|
|
192
193
|
| `focused` | focused | LionField |
|
|
193
194
|
| `focused-visible` | focusedVisible | LionField |
|
|
@@ -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,11 +28,11 @@ import '@lion/ui/define/lion-input-date.js';
|
|
|
28
28
|
|
|
29
29
|
## Features
|
|
30
30
|
|
|
31
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
32
|
-
- Makes use of [formatDate](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
|
+
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/localize/dates.md) for formatting and parsing.
|
|
33
33
|
- Option to override locale to change the formatting and parsing
|
|
34
34
|
- Default label in different languages
|
|
35
|
-
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/
|
|
35
|
+
- 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
|
|
36
36
|
- IsDate (default)
|
|
37
37
|
- MinDate
|
|
38
38
|
- MaxDate
|
|
@@ -72,6 +72,7 @@ eleventyNavigation:
|
|
|
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
74
|
| `_invokerNode` | protected | | | | |
|
|
75
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
75
76
|
| `_isHandlingCalendarUserInput` | protected | `boolean` | `false` | | |
|
|
76
77
|
| `_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 |
|
|
77
78
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -104,7 +105,7 @@ eleventyNavigation:
|
|
|
104
105
|
| `focus` | public | Calls \`focus()\` on focusable element within | | | LionField |
|
|
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
|
-
| `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
|
|
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 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 |
|
|
108
109
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
109
110
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
110
111
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|