@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
|
@@ -221,6 +221,7 @@ eleventyNavigation:
|
|
|
221
221
|
| `name` | public | `string` | `''` | The name the element will be registered with to the .formElements collection
of the parent. Also, it serves as the key of key/value pairs in
 modelValue/serializedValue objects | FormRegisteringMixin |
|
|
222
222
|
| `serializedValue` | public | `string\|undefined` | `undefined` | The serialized version of the model value.
This value exists for maximal compatibility with the platform API.
The serialized value can be an interface in context where data binding is not
supported and a serialized string needs to be set.

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

When no parser is available, the value is usually the same as the formattedValue
(being \_inputNode.value) | FormatMixin |
|
|
223
223
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
224
|
+
| `_isEditingTextField` | protected | | | | FormatMixin |
|
|
224
225
|
| `_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 |
|
|
225
226
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
226
227
|
| `_parentFormGroup` | protected | `FormRegistrarHost \| undefined` | `undefined` | The registrar this FormControl registers to, Usually a descendant of FormGroup or
ChoiceGroup | FormRegisteringMixin |
|
|
@@ -236,7 +237,7 @@ eleventyNavigation:
|
|
|
236
237
|
| `formatter` | public | Converts modelValue to formattedValue (formattedValue will be synced with
\`.\_inputNode.value\`)
For instance, a Date object to a localized date. | `modelValue: ChoiceInputModelValue` | `string` | FormatMixin |
|
|
237
238
|
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
238
239
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
239
|
-
| `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
|
|
240
|
+
| `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 |
|
|
240
241
|
| `retractRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
241
242
|
| `serializer` | public | Converts \`.modelValue\` to \`.serializedValue\`
For instance, a Date object to an iso formatted date string | `v: ?` | `string` | FormatMixin |
|
|
242
243
|
| `_afterTemplate` | protected | | | | ChoiceInputMixin |
|
|
@@ -151,4 +151,4 @@ Navigation will skip over disabled options. Let's disable Artichoke and Brussel
|
|
|
151
151
|
|
|
152
152
|
## Validation
|
|
153
153
|
|
|
154
|
-
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/
|
|
154
|
+
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md).
|
|
@@ -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 |
|
|
@@ -94,7 +95,7 @@ eleventyNavigation:
|
|
|
94
95
|
| `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 |
|
|
95
96
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
96
97
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | LionField |
|
|
97
|
-
| `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
|
|
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 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 |
|
|
98
99
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
99
100
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
100
101
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -32,12 +32,12 @@ export const main = () => html`
|
|
|
32
32
|
`;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
36
|
-
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/
|
|
35
|
+
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/form/overview.md)'s serialization result.
|
|
36
|
+
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/select/overview.md) instead.
|
|
37
37
|
|
|
38
38
|
## Features
|
|
39
39
|
|
|
40
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
40
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/fieldset/overview.md), it has all the features a fieldset has.
|
|
41
41
|
|
|
42
42
|
- Get or set the checked value of the group:
|
|
43
43
|
- modelValue (default) - `checkedValue()`
|
|
@@ -58,6 +58,7 @@ eleventyNavigation:
|
|
|
58
58
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
59
59
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
60
60
|
| `_inputNode` | protected | | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | LionField |
|
|
61
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
61
62
|
| `_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 |
|
|
62
63
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
63
64
|
| `_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 |
|
|
@@ -88,7 +89,7 @@ eleventyNavigation:
|
|
|
88
89
|
| `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 |
|
|
89
90
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
90
91
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | LionField |
|
|
91
|
-
| `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
|
|
92
|
+
| `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 |
|
|
92
93
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
93
94
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
94
95
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -65,7 +65,7 @@ Or by setting the `disabled` attribute on the entire `lion-select` field.
|
|
|
65
65
|
|
|
66
66
|
## Validation
|
|
67
67
|
|
|
68
|
-
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/
|
|
68
|
+
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/validate.md).
|
|
69
69
|
|
|
70
70
|
## Rendering and updating select options
|
|
71
71
|
|
|
@@ -29,7 +29,7 @@ You can set the full `modelValue` for each option, which includes the checked pr
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Note, when rendering with the help of the `cache` function imported from `lit/directives/cache.js`, setting model by
|
|
32
|
-
the `modelValue` property is not fully supported. Consider setting the model by the `choiceValue` property instead. See [Setting model by `choiceValue` property](https://github.com/ing-bank/lion/blob/
|
|
32
|
+
the `modelValue` property is not fully supported. Consider setting the model by the `choiceValue` property instead. See [Setting model by `choiceValue` property](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/select-rich/#setting-model-by-the-choicevalue-property) for more details.
|
|
33
33
|
|
|
34
34
|
### Setting model by the `choiceValue` property
|
|
35
35
|
|
|
@@ -328,7 +328,7 @@ LionSelectRich will give it acces to:
|
|
|
328
328
|
- LionSelectRich itself, via `.hostElement`
|
|
329
329
|
|
|
330
330
|
Code of an advanced custom invoker is shown below (this is the code for the
|
|
331
|
-
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/
|
|
331
|
+
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/select-rich/examples.md)).
|
|
332
332
|
The invoker is usually added in the invoker slot of the LionSelectRich subclass.
|
|
333
333
|
However, it would also be possible for an application developer to provide the invoker
|
|
334
334
|
by putting it in light dom:
|
|
@@ -59,6 +59,7 @@ eleventyNavigation:
|
|
|
59
59
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField |
|
|
60
60
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField |
|
|
61
61
|
| `_inputNode` | protected | `LionSwitchButton` | | Input node here is the lion-switch-button, which is not compatible with LionField \_inputNode --> HTMLInputElement
Therefore we do a full override and typecast to an intersection type that includes LionSwitchButton | LionField |
|
|
62
|
+
| `_isEditingTextField` | protected | | | | LionField |
|
|
62
63
|
| `_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 |
|
|
63
64
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
64
65
|
| `_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 |
|
|
@@ -89,7 +90,7 @@ eleventyNavigation:
|
|
|
89
90
|
| `initInteractionState` | public | Evaluations performed on connectedCallback.
This method is public, so it can be called at a later moment (when we need to wait for
registering children for instance) as well.
Since this method will be called twice in last mentioned scenario, it must stay idempotent. | | | LionField |
|
|
90
91
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
91
92
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | LionField |
|
|
92
|
-
| `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
|
|
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 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 |
|
|
93
94
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
94
95
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
95
96
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -21,7 +21,7 @@ import './src/lea-tab-panel.js';
|
|
|
21
21
|
|
|
22
22
|
## Lea Tabs
|
|
23
23
|
|
|
24
|
-
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/
|
|
24
|
+
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/blog/ing-open-sources-lion.md).
|
|
25
25
|
|
|
26
26
|
```js preview-story
|
|
27
27
|
export const main = () => html`
|
|
@@ -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 |
|
|
@@ -94,7 +95,7 @@ eleventyNavigation:
|
|
|
94
95
|
| `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 |
|
|
95
96
|
| `makeRequestToBeDisabled` | public | | | | LionField |
|
|
96
97
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | LionField |
|
|
97
|
-
| `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
|
|
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 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 |
|
|
98
99
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | LionField |
|
|
99
100
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | LionField |
|
|
100
101
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | LionField |
|
|
@@ -9,11 +9,11 @@ Here you find more details about what we offer.
|
|
|
9
9
|
|
|
10
10
|
Let's see what each section describes.
|
|
11
11
|
|
|
12
|
-
1. [Systems](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
1. [Systems](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/core/overview.md) <br>
|
|
13
13
|
These are the fundamental systems that power all of our components.
|
|
14
|
-
2. [Tools](https://github.com/ing-bank/lion/blob/
|
|
14
|
+
2. [Tools](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/tools/helpers/overview.md) <br>
|
|
15
15
|
Frontend Tools useful for web development but are not visual and therefore are not components.
|
|
16
|
-
3. [Node Tools](https://github.com/ing-bank/lion/blob/
|
|
16
|
+
3. [Node Tools](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md) <br>
|
|
17
17
|
Node tools to analyse the code and for extending the documentation.
|
|
18
|
-
4. [Rationales](https://github.com/ing-bank/lion/blob/
|
|
18
|
+
4. [Rationales](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/rationales/side-effects.md) <br>
|
|
19
19
|
The reasoning behind some of our decisions.
|
|
@@ -44,7 +44,7 @@ For a Mono Repository
|
|
|
44
44
|
```md
|
|
45
45
|
# My Pkg
|
|
46
46
|
|
|
47
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
47
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/docs/deep/dir/overview.md)
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## CLI flags
|
|
@@ -74,7 +74,7 @@ Bring the `overview.md` in a docs folder along.
|
|
|
74
74
|
👉 `packages/[my-package]/docs/overview.md`
|
|
75
75
|
|
|
76
76
|
```md
|
|
77
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
77
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/docs/deep/dir/overview.md)
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Add a `use-cases.md`
|
|
@@ -82,7 +82,7 @@ Add a `use-cases.md`
|
|
|
82
82
|
👉 `packages/[my-package]/docs/use-cases.md`
|
|
83
83
|
|
|
84
84
|
```md
|
|
85
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
85
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/docs/deep/dir/use-cases.md)
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
So you will end up with something like this in your package.
|
|
@@ -20,7 +20,7 @@ To do this automatically you can use this preset for [rocket](https://rocket.mod
|
|
|
20
20
|
|
|
21
21
|
## Features
|
|
22
22
|
|
|
23
|
-
- Import lion documentation and adjust it using [remark-extend](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- Import lion documentation and adjust it using [remark-extend](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/node-tools/remark-extend/overview.md)
|
|
24
24
|
- Renames named imports and all it's usage
|
|
25
25
|
- Adjusts import paths
|
|
26
26
|
- Replace tags in template literals
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
|
|
52
52
|
## Reusing documentation
|
|
53
53
|
|
|
54
|
-
To take an existing documentation you can "import" it using [remark-extend](https://github.com/ing-bank/lion/blob/
|
|
54
|
+
To take an existing documentation you can "import" it using [remark-extend](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/node-tools/remark-extend/overview.md).
|
|
55
55
|
|
|
56
56
|
As an example you can create `docs/components/tabs/overview.md`.
|
|
57
57
|
|
|
@@ -37,4 +37,4 @@ Internally, we delegate all intricacies involved in managing light dom to SlotMi
|
|
|
37
37
|
SlotMixin automatically mediates between light dom provided by the user ('public slots') and light dom provided by the component author ('private slots').
|
|
38
38
|
Also, SlotMixin allows to hook into the reactive update loop of LitElement (automatically rerendering on property changes) and it automatically respects
|
|
39
39
|
the scoped registry belonging to the shadow root.
|
|
40
|
-
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/
|
|
40
|
+
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/core/SlotMixin.md)
|
|
@@ -165,4 +165,4 @@ This will make sure that the slot provided by the user always takes precedence a
|
|
|
165
165
|
|
|
166
166
|
### Default slot
|
|
167
167
|
|
|
168
|
-
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/
|
|
168
|
+
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/core/#slotfunctionresults), '' can be used to add content to the default slot
|
|
@@ -28,7 +28,7 @@ import { LitElement, html, render } from 'lit-element';
|
|
|
28
28
|
|
|
29
29
|
## Features
|
|
30
30
|
|
|
31
|
-
- [function to deduplicate mixins (dedupeMixin)](https://github.com/ing-bank/lion/blob/
|
|
31
|
+
- [function to deduplicate mixins (dedupeMixin)](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/core/#deduping-of-mixins)
|
|
32
32
|
- Mixin to handle disabled (DisabledMixin)
|
|
33
33
|
- Mixin to handle disabled AND tabIndex (DisabledWithTabIndexMixin)
|
|
34
34
|
- Mixin to manage auto-generated needed slot elements in light dom (SlotMixin)
|
|
@@ -57,6 +57,7 @@ eleventyNavigation:
|
|
|
57
57
|
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
58
58
|
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
59
59
|
| `_inputNode` | protected | | | The interactive (form) element. Can be a native element like input/textarea/select or
an element with tabindex > -1 | FormControlMixin |
|
|
60
|
+
| `_isEditingTextField` | protected | | | | FormatMixin |
|
|
60
61
|
| `_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 |
|
|
61
62
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
62
63
|
| `_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 |
|
|
@@ -84,7 +85,7 @@ eleventyNavigation:
|
|
|
84
85
|
| `initInteractionState` | public | Evaluations performed on connectedCallback.
This method is public, so it can be called at a later moment (when we need to wait for
registering children for instance) as well.
Since this method will be called twice in last mentioned scenario, it must stay idempotent. | | | InteractionStateMixin |
|
|
85
86
|
| `makeRequestToBeDisabled` | public | | | | DisabledMixin |
|
|
86
87
|
| `parser` | public | Converts viewValue to modelValue
For instance, a localized date to a Date Object | `v: string, opts: FormatOptions` | `*` | FormatMixin |
|
|
87
|
-
| `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
|
|
88
|
+
| `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 |
|
|
88
89
|
| `removeFromAriaDescribedBy` | public | Allows to remove element references from aria-describedby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
89
90
|
| `removeFromAriaLabelledBy` | public | Allows to remove element references from aria-labelledby attribute. | `element: HTMLElement` | | FormControlMixin |
|
|
90
91
|
| `reset` | public | Resets modelValue to initial value.
Interaction states are cleared | | | |
|
|
@@ -36,7 +36,7 @@ Our fields can automatically format/parse/serialize user input or an input set i
|
|
|
36
36
|
|
|
37
37
|
Below are some concrete examples of implementations of formatters and parsers mimicking a (basic) amount input.
|
|
38
38
|
|
|
39
|
-
> For an actual amount input, check out [lion-input-amount](https://github.com/ing-bank/lion/blob/
|
|
39
|
+
> For an actual amount input, check out [lion-input-amount](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/components/input-amount/overview.md).
|
|
40
40
|
> This comes with its own formatter, parser, serializer.
|
|
41
41
|
|
|
42
42
|
### Parsers & modelValue
|
|
@@ -243,16 +243,16 @@ Below we show three flow diagrams to show the flow of formatting, serializing an
|
|
|
243
243
|
|
|
244
244
|
Where a user changes the input with their keyboard:
|
|
245
245
|
|
|
246
|
-

|
|
247
247
|
|
|
248
248
|
### Unparseable flow
|
|
249
249
|
|
|
250
250
|
Where a user sets the input to something that is not parseable by the parser:
|
|
251
251
|
|
|
252
|
-

|
|
253
253
|
|
|
254
254
|
### Imperative / programmatic flow
|
|
255
255
|
|
|
256
256
|
Where the developer sets the modelValue of the input programmatically:
|
|
257
257
|
|
|
258
|
-

|
|
@@ -34,7 +34,7 @@ level, via:
|
|
|
34
34
|
> Internal/private concepts like viewValue, formattedValue, serializedValue are therefore not
|
|
35
35
|
> recommended as a means of interaction.
|
|
36
36
|
|
|
37
|
-
For more information about parsing and the Unparseable type, see [Formatting and Parsing](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
For more information about parsing and the Unparseable type, see [Formatting and Parsing](https://github.com/ing-bank/lion/blob/5c228561a361a8ed95aabcacf735f87fb2746a5f/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
38
38
|
|
|
39
39
|
### Event meta
|
|
40
40
|
|