@lion/ui 0.9.1 → 0.10.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/combobox/test/lion-combobox.test.js +2 -0
- package/components/core/test/ScopedElementsMixin.test.js +3 -3
- package/components/dialog/test/lion-dialog.test.js +54 -0
- package/components/dialog/test-helpers/test-router.js +43 -0
- package/components/form-core/src/FormatMixin.js +66 -18
- package/components/form-core/test-suites/FormatMixin.suite.js +107 -8
- package/components/form-core/types/FormatMixinTypes.ts +4 -1
- package/components/form-integrations/test/dialog-integrations.test.js +6 -2
- package/components/input-amount/src/parsers.js +3 -3
- package/components/input-amount/test/lion-input-amount.test.js +36 -2
- package/components/input-amount/test/parsers.test.js +11 -0
- package/components/localize/src/number/getDecimalSeparator.js +1 -1
- package/components/localize/src/number/parseNumber.js +9 -6
- package/components/localize/test/number/parseNumber.test.js +11 -0
- package/components/localize/types/LocalizeMixinTypes.ts +3 -3
- package/components/overlays/src/OverlayController.js +4 -5
- package/components/overlays/src/OverlayMixin.js +20 -14
- package/components/overlays/test/OverlayController.test.js +11 -8
- package/components/overlays/test-suites/OverlayMixin.suite.js +184 -9
- package/components/overlays/types/ArrowMixinTypes.ts +11 -2
- package/components/overlays/types/OverlayConfig.ts +15 -13
- package/components/select-rich/src/LionSelectRich.js +3 -1
- package/components/select-rich/test/lion-select-rich.test.js +44 -0
- package/custom-elements.json +1302 -76
- package/dist-types/components/dialog/test/lion-dialog.test.d.ts.map +1 -1
- package/dist-types/components/dialog/test-helpers/test-router.d.ts +2 -0
- package/dist-types/components/dialog/test-helpers/test-router.d.ts.map +1 -0
- package/dist-types/components/form-core/src/FormatMixin.d.ts +1 -1
- package/dist-types/components/form-core/src/FormatMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/FormatMixin.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/types/FormatMixinTypes.d.ts +3 -2
- package/dist-types/components/form-core/types/FormatMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/dialog-integrations.test.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/parsers.d.ts +2 -2
- package/dist-types/components/input-amount/src/parsers.d.ts.map +1 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +3 -2
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts +4 -4
- package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts.map +1 -1
- package/dist-types/components/overlays/types/ArrowMixinTypes.d.ts +2 -2
- package/dist-types/components/overlays/types/ArrowMixinTypes.d.ts.map +1 -1
- package/dist-types/components/overlays/types/OverlayConfig.d.ts +4 -4
- package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/select-rich/test/lion-select-rich.test.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/api-table.md +2 -2
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +1 -0
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +1 -0
- 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 +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +1 -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 +1 -1
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +1 -1
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +1 -1
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +1 -1
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +1 -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 +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +1 -1
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/api-table.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +1 -1
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +1 -0
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/switch/api-table.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +1 -1
- package/docs/components/tooltip/api-table.md +1 -0
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +5 -5
- 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 +1 -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/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
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | LionField |
|
|
23
23
|
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
24
24
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
25
|
-
| `formatOptions` | public | | `({})`
|
|
25
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
26
26
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
27
27
|
| `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) | LionField |
|
|
28
28
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -39,7 +39,7 @@ export const main = () => {
|
|
|
39
39
|
|
|
40
40
|
## Features
|
|
41
41
|
|
|
42
|
-
- Extends our [input](https://github.com/ing-bank/lion/blob/
|
|
42
|
+
- Extends our [input](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input/overview.md)
|
|
43
43
|
- Shows a mobile telephone keypad on mobile (by having a native `<input inputmode="tel">` inside)
|
|
44
44
|
- Can be configured with a list of allowed region codes
|
|
45
45
|
- Will be preconfigured with region derived from locale
|
|
@@ -22,7 +22,7 @@ Say we have the following telephone number from Madrid, Spain: `+34919930432`.
|
|
|
22
22
|
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).
|
|
23
23
|
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).
|
|
24
24
|
|
|
25
|
-
The table below lists all possible regions worldwide. When [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
The table below lists all possible regions worldwide. When [allowed regions](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/#allowed-regions) are not configured,
|
|
26
26
|
all of them will be supported as values of Input Tel.
|
|
27
27
|
|
|
28
28
|
```js story
|
|
@@ -37,11 +37,11 @@ export const regionCodesTable = () => {
|
|
|
37
37
|
The active region (accessible via readonly accessor `.activeRegion`) determines how validation and formatting
|
|
38
38
|
should be applied. It is dependent on the following factors:
|
|
39
39
|
|
|
40
|
-
- [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
41
|
-
[.allowedRegions has only one entry](https://github.com/ing-bank/lion/blob/
|
|
40
|
+
- [allowed regions](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/#allowed-regions): a list that determines what is allowed to become .activeRegion. If
|
|
41
|
+
[.allowedRegions has only one entry](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/#restrict-to-one-region), .activeRegion will always be this value.
|
|
42
42
|
- the modelValue or viewValue: once it contains sufficient info to derive its region code (and
|
|
43
|
-
the derived code is inside [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
44
|
-
- active locale (and the derived locale is inside [allowed regions](https://github.com/ing-bank/lion/blob/
|
|
43
|
+
the derived code is inside [allowed regions](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/#allowed-regions) if configured)
|
|
44
|
+
- active locale (and the derived locale is inside [allowed regions](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/#allowed-regions) if configured)
|
|
45
45
|
|
|
46
46
|
What follows from the list above is that .activeRegion can change dynamically, after a value
|
|
47
47
|
change in the text box by the user (or when locales or allowed regions would be changed by the
|
|
@@ -130,7 +130,7 @@ export const heuristic = () => {
|
|
|
130
130
|
Once it is configured, validation and formatting will be restricted to those
|
|
131
131
|
values that are present in this list.
|
|
132
132
|
|
|
133
|
-
> Note that for [InputTelDropdown](https://github.com/ing-bank/lion/blob/
|
|
133
|
+
> Note that for [InputTelDropdown](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel-dropdown/index.md), only allowed regions will
|
|
134
134
|
> be shown in the dropdown list.
|
|
135
135
|
|
|
136
136
|
```js preview-story
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | LionField |
|
|
29
29
|
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
30
30
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
31
|
-
| `formatOptions` | public | | `({})`
|
|
31
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
32
32
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
33
33
|
| `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) | LionField |
|
|
34
34
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -19,7 +19,7 @@ export const main = () => {
|
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
22
|
-
- Extends our [input-tel](https://github.com/ing-bank/lion/blob/
|
|
22
|
+
- Extends our [input-tel](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-tel/overview.md)
|
|
23
23
|
- Shows dropdown list with all possible regions
|
|
24
24
|
- Shows only allowed regions in dropdown list when .allowedRegions is configured
|
|
25
25
|
- Highlights regions on top of dropdown list when .preferredRegions is configured
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
| `checked` | public | `boolean` | | | ChoiceInputMixin |
|
|
210
210
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
211
211
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | FormatMixin |
|
|
212
|
-
| `formatOptions` | public | | `({})`
|
|
212
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
213
213
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | FormatMixin |
|
|
214
214
|
| `serializedValue` | public | `string\|undefined` | `undefined` | The serialized version of the model value.
This value exists for maximal compatibility with the platform API.
The serialized value can be an interface in context where data binding is not
supported and a serialized string needs to be set.

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

When no parser is available, the value is usually the same as the formattedValue
(being \_inputNode.value) | FormatMixin |
|
|
215
215
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
@@ -139,4 +139,4 @@ Navigation will skip over disabled options. Let's disable Artichoke and Brussel
|
|
|
139
139
|
|
|
140
140
|
## Validation
|
|
141
141
|
|
|
142
|
-
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/
|
|
142
|
+
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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/form/validate.md).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
| `checked` | public | `boolean` | | | ChoiceInputMixin |
|
|
13
13
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | LionField |
|
|
14
14
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
15
|
-
| `formatOptions` | public | | `({})`
|
|
15
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
16
16
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
17
17
|
| `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) | LionField |
|
|
18
18
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -20,12 +20,12 @@ export const main = () => html`
|
|
|
20
20
|
`;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
24
|
-
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/form/overview.md)'s serialization result.
|
|
24
|
+
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/select/overview.md) instead.
|
|
25
25
|
|
|
26
26
|
## Features
|
|
27
27
|
|
|
28
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/fieldset/overview.md), it has all the features a fieldset has.
|
|
29
29
|
|
|
30
30
|
- Get or set the checked value of the group:
|
|
31
31
|
- modelValue (default) - `checkedValue()`
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
| `autofocus` | public | `boolean` | `false` | | LionField |
|
|
44
44
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | LionField |
|
|
45
45
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
46
|
-
| `formatOptions` | public | | `({})`
|
|
46
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
47
47
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
48
48
|
| `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) | LionField |
|
|
49
49
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -53,7 +53,7 @@ Or by setting the `disabled` attribute on the entire `lion-select` field.
|
|
|
53
53
|
|
|
54
54
|
## Validation
|
|
55
55
|
|
|
56
|
-
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/
|
|
56
|
+
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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/form/validate.md).
|
|
57
57
|
|
|
58
58
|
## Rendering and updating select options
|
|
59
59
|
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
| `open` | public | Shows the overlay | | | OverlayMixin |
|
|
166
166
|
| `close` | public | Hides the overlay | | | OverlayMixin |
|
|
167
167
|
| `repositionOverlay` | public | Sometimes it's needed to recompute Popper position of an overlay, for instance when we have
an opened combobox and the surrounding context changes (the space consumed by the textbox
increases vertically) | | | OverlayMixin |
|
|
168
|
+
| `_isPermanentlyDisconnected` | protected | When we're moving around in dom, disconnectedCallback gets called.
Before we decide to teardown, let's wait to see if we were not just moving nodes around. | | `Promise<boolean>` | OverlayMixin |
|
|
168
169
|
| `setCheckedIndex` | public | If an array is passed for multiple-choice, it will check the indexes in array, and uncheck the rest
If a number is passed, the item with the passed index is checked without unchecking others
For single choice, \_\_onChildCheckedChanged we ensure that we uncheck siblings | `index: number\|number[]` | | LionListbox |
|
|
169
170
|
| `resetInteractionState` | public | Resets touched and dirty, and recomputes prefilled | | | LionListbox |
|
|
170
171
|
| `reset` | public | | | | LionListbox |
|
|
@@ -302,7 +302,7 @@ LionSelectRich will give it acces to:
|
|
|
302
302
|
- LionSelectRich itself, via `.hostElement`
|
|
303
303
|
|
|
304
304
|
Code of an advanced custom invoker is shown below (this is the code for the
|
|
305
|
-
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/
|
|
305
|
+
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/select-rich/examples.md)).
|
|
306
306
|
The invoker is usually added in the invoker slot of the LionSelectRich subclass.
|
|
307
307
|
However, it would also be possible for an application developer to provide the invoker
|
|
308
308
|
by putting it in light dom:
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
| `disabled` | public | `boolean` | `false` | Boolean indicating whether or not this element is disabled. | LionField |
|
|
15
15
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | LionField |
|
|
16
16
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
17
|
-
| `formatOptions` | public | | `({})`
|
|
17
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
18
18
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
19
19
|
| `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) | LionField |
|
|
20
20
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -9,7 +9,7 @@ import './src/lea-tab-panel.js';
|
|
|
9
9
|
|
|
10
10
|
## Lea Tabs
|
|
11
11
|
|
|
12
|
-
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/blog/ing-open-sources-lion.md).
|
|
13
13
|
|
|
14
14
|
```js preview-story
|
|
15
15
|
export const main = () => html`
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
| `_focusableNode` | protected | `HTMLElement` | | The focusable element:
could be an input, textarea, select, button or any other element with tabindex > -1 | LionField |
|
|
20
20
|
| `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin |
|
|
21
21
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | LionField |
|
|
22
|
-
| `formatOptions` | public | | `({})`
|
|
22
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
23
23
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | LionField |
|
|
24
24
|
| `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) | LionField |
|
|
25
25
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField |
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
| `open` | public | Shows the overlay | | | OverlayMixin |
|
|
36
36
|
| `close` | public | Hides the overlay | | | OverlayMixin |
|
|
37
37
|
| `repositionOverlay` | public | Sometimes it's needed to recompute Popper position of an overlay, for instance when we have
an opened combobox and the surrounding context changes (the space consumed by the textbox
increases vertically) | | | OverlayMixin |
|
|
38
|
+
| `_isPermanentlyDisconnected` | protected | When we're moving around in dom, disconnectedCallback gets called.
Before we decide to teardown, let's wait to see if we were not just moving nodes around. | | `Promise<boolean>` | OverlayMixin |
|
|
38
39
|
|
|
39
40
|
### Events
|
|
40
41
|
|
|
@@ -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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/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/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/rationales/side-effects.md) <br>
|
|
19
19
|
The reasoning behind some of our decisions.
|
|
@@ -28,7 +28,7 @@ It does this via the [oxc parser](https://oxc.rs/docs/guide/usage/parser.html),
|
|
|
28
28
|
Providence expects an analyzer name that tells it what type of analysis to run:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npx providence analyze <analyzer-name>
|
|
31
|
+
npx providence-analytics analyze <analyzer-name>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
By default Providence ships these analyzers:
|
|
@@ -42,7 +42,7 @@ By default Providence ships these analyzers:
|
|
|
42
42
|
Let's say we run `find-imports`:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
npx providence analyze find-imports
|
|
45
|
+
npx providence-analytics analyze find-imports
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Now it retrieves all relevant data about es module imports.
|
|
@@ -68,14 +68,14 @@ For a "find" analyzer, there is one project involved (the target project).
|
|
|
68
68
|
We can specify it like this (we override the default current working directory):
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
npx providence analyze find-imports -t /importing/project
|
|
71
|
+
npx providence-analytics analyze find-imports -t /importing/project
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
For a "match" analyzer, there is also a reference project.
|
|
75
75
|
Here we match the exports of the reference project (-r) against the imports of the target project (-t).
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
npx providence analyze match-imports -t /importing/project -r /exporting/project
|
|
78
|
+
npx providence-analytics analyze match-imports -t /importing/project -r /exporting/project
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
## Utils
|
|
@@ -91,5 +91,5 @@ For a better understanding, check out the utils folders (tests and code).
|
|
|
91
91
|
For more options, see:
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
npx providence --help
|
|
94
|
+
npx providence-analytics --help
|
|
95
95
|
```
|
|
@@ -31,7 +31,7 @@ For a Mono Repository
|
|
|
31
31
|
```md
|
|
32
32
|
# My Pkg
|
|
33
33
|
|
|
34
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/docs/deep/dir/overview.md)
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## CLI flags
|
|
@@ -61,7 +61,7 @@ Bring the `overview.md` in a docs folder along.
|
|
|
61
61
|
👉 `packages/[my-package]/docs/overview.md`
|
|
62
62
|
|
|
63
63
|
```md
|
|
64
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
64
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/docs/deep/dir/overview.md)
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Add a `use-cases.md`
|
|
@@ -69,7 +69,7 @@ Add a `use-cases.md`
|
|
|
69
69
|
👉 `packages/[my-package]/docs/use-cases.md`
|
|
70
70
|
|
|
71
71
|
```md
|
|
72
|
-
[=> See Source <=](https://github.com/ing-bank/lion/blob/
|
|
72
|
+
[=> See Source <=](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/docs/deep/dir/use-cases.md)
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
So you will end up with something like this in your package.
|
|
@@ -7,7 +7,7 @@ To do this automatically you can use this preset for [rocket](https://rocket.mod
|
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
- Import lion documentation and adjust it using [remark-extend](https://github.com/ing-bank/lion/blob/
|
|
10
|
+
- Import lion documentation and adjust it using [remark-extend](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/node-tools/remark-extend/overview.md)
|
|
11
11
|
- Renames named imports and all it's usage
|
|
12
12
|
- Adjusts import paths
|
|
13
13
|
- Replace tags in template literals
|
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
|
|
39
39
|
## Reusing documentation
|
|
40
40
|
|
|
41
|
-
To take an existing documentation you can "import" it using [remark-extend](https://github.com/ing-bank/lion/blob/
|
|
41
|
+
To take an existing documentation you can "import" it using [remark-extend](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/node-tools/remark-extend/overview.md).
|
|
42
42
|
|
|
43
43
|
As an example you can create `docs/components/tabs/overview.md`.
|
|
44
44
|
|
|
@@ -25,4 +25,4 @@ Internally, we delegate all intricacies involved in managing light dom to SlotMi
|
|
|
25
25
|
SlotMixin automatically mediates between light dom provided by the user ('public slots') and light dom provided by the component author ('private slots').
|
|
26
26
|
Also, SlotMixin allows to hook into the reactive update loop of LitElement (automatically rerendering on property changes) and it automatically respects
|
|
27
27
|
the scoped registry belonging to the shadow root.
|
|
28
|
-
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/core/SlotMixin.md)
|
|
@@ -152,4 +152,4 @@ This will make sure that the slot provided by the user always takes precedence a
|
|
|
152
152
|
|
|
153
153
|
### Default slot
|
|
154
154
|
|
|
155
|
-
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/
|
|
155
|
+
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/core/#slotfunctionresults), '' can be used to add content to the default slot
|
|
@@ -15,7 +15,7 @@ import { LitElement, html, render } from 'lit-element';
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- [function to deduplicate mixins (dedupeMixin)](https://github.com/ing-bank/lion/blob/
|
|
18
|
+
- [function to deduplicate mixins (dedupeMixin)](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/core/#deduping-of-mixins)
|
|
19
19
|
- Mixin to handle disabled (DisabledMixin)
|
|
20
20
|
- Mixin to handle disabled AND tabIndex (DisabledWithTabIndexMixin)
|
|
21
21
|
- Mixin to manage auto-generated needed slot elements in light dom (SlotMixin)
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
| `autofocus` | public | `boolean` | `false` | | FocusMixin |
|
|
41
41
|
| `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\` | FormatMixin |
|
|
42
42
|
| `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the
user sees the formatted value)
Default: 'change' | FormatMixin |
|
|
43
|
-
| `formatOptions` | public | | `({})`
|
|
43
|
+
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
44
44
|
| `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).
The result will be stored in the native \_inputNode (usually an input\[type=text]).

Examples:
- For a date input, this would be '20/01/1999' (dependent on locale).
- For a number input, this could be '1,234.56' (a String representation of modelValue
1234.56) | FormatMixin |
|
|
45
45
|
| `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 |
|
|
46
46
|
| `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | FormatMixin |
|
|
@@ -23,7 +23,7 @@ Our fields can automatically format/parse/serialize user input or an input set i
|
|
|
23
23
|
|
|
24
24
|
Below are some concrete examples of implementations of formatters and parsers mimicking a (basic) amount input.
|
|
25
25
|
|
|
26
|
-
> For an actual amount input, check out [lion-input-amount](https://github.com/ing-bank/lion/blob/
|
|
26
|
+
> For an actual amount input, check out [lion-input-amount](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/components/input-amount/overview.md).
|
|
27
27
|
> This comes with its own formatter, parser, serializer.
|
|
28
28
|
|
|
29
29
|
### Parsers & modelValue
|
|
@@ -230,16 +230,16 @@ Below we show three flow diagrams to show the flow of formatting, serializing an
|
|
|
230
230
|
|
|
231
231
|
Where a user changes the input with their keyboard:
|
|
232
232
|
|
|
233
|
-

|
|
234
234
|
|
|
235
235
|
### Unparseable flow
|
|
236
236
|
|
|
237
237
|
Where a user sets the input to something that is not parseable by the parser:
|
|
238
238
|
|
|
239
|
-

|
|
240
240
|
|
|
241
241
|
### Imperative / programmatic flow
|
|
242
242
|
|
|
243
243
|
Where the developer sets the modelValue of the input programmatically:
|
|
244
244
|
|
|
245
|
-

|
|
@@ -21,7 +21,7 @@ level, via:
|
|
|
21
21
|
> Internal/private concepts like viewValue, formattedValue, serializedValue are therefore not
|
|
22
22
|
> recommended as a means of interaction.
|
|
23
23
|
|
|
24
|
-
For more information about parsing and the Unparseable type, see [Formatting and Parsing](https://github.com/ing-bank/lion/blob/
|
|
24
|
+
For more information about parsing and the Unparseable type, see [Formatting and Parsing](https://github.com/ing-bank/lion/blob/43b694e7f86a4b0e8d949e2db0dd74af5c81de73/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
25
25
|
|
|
26
26
|
### Event meta
|
|
27
27
|
|