@lion/ui 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +39 -16
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +189 -1
- package/components/form-core/src/FocusMixin.js +4 -4
- package/components/form-core/src/LionField.js +1 -1
- package/components/localize/types/LocalizeMixinTypes.ts +0 -5
- package/components/select-rich/src/LionSelectRich.js +1 -1
- package/components/select-rich/test/lion-select-rich.test.js +13 -1
- package/custom-elements.json +47661 -47626
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +10 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +0 -4
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +6 -6
- package/docs/components/button/api-table.md +27 -30
- package/docs/components/calendar/api-table.md +13 -13
- package/docs/components/checkbox-group/api-table.md +305 -329
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +5 -5
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +150 -154
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +12 -12
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +9 -10
- package/docs/components/fieldset/api-table.md +104 -118
- 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/api-table.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/api-table.md +110 -120
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +129 -142
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +110 -120
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +148 -160
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +110 -120
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +132 -143
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +110 -120
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +116 -126
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +123 -133
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +118 -128
- 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 +125 -135
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +126 -131
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/pagination/api-table.md +5 -5
- package/docs/components/progress-indicator/api-table.md +9 -10
- package/docs/components/radio-group/api-table.md +234 -258
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +106 -116
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +169 -178
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/steps/api-table.md +6 -6
- package/docs/components/switch/api-table.md +117 -128
- package/docs/components/tabs/api-table.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +114 -124
- package/docs/components/tooltip/api-table.md +13 -13
- 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/api-table.md +8 -11
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/api-table.md +77 -82
- 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/api-table.md +19 -19
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +45 -46
- 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
|
@@ -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/593b753f0f99acb36ea6009677bc7fdda9184184/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/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
25
25
|
|
|
26
26
|
### Event meta
|
|
27
27
|
|
|
@@ -20,9 +20,9 @@ Fields (think of an input, textarea, select) are the actual form controls the en
|
|
|
20
20
|
|
|
21
21
|
On top of this, they feature:
|
|
22
22
|
|
|
23
|
-
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/
|
|
24
|
-
- Advanced [validation](https://github.com/ing-bank/lion/blob/
|
|
25
|
-
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/formatting-and-parsing.md) of view values.
|
|
24
|
+
- Advanced [validation](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/validate.md) possibilities.
|
|
25
|
+
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/interaction-states.md).
|
|
26
26
|
- Provision of labels and help texts in an easy, declarative manner.
|
|
27
27
|
- Accessibility out of the box.
|
|
28
28
|
- Advanced styling possibilities: map your own Design System to the internal HTML structure.
|
|
@@ -31,33 +31,33 @@ On top of this, they feature:
|
|
|
31
31
|
|
|
32
32
|
### Platform fields (wrappers)
|
|
33
33
|
|
|
34
|
-
- [LionInput](https://github.com/ing-bank/lion/blob/
|
|
35
|
-
- [LionTextarea](https://github.com/ing-bank/lion/blob/
|
|
36
|
-
- [LionSelect](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
- [LionInput](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input/overview.md), a wrapper for `<input>`.
|
|
35
|
+
- [LionTextarea](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/textarea/overview.md), a wrapper for `<textarea>`.
|
|
36
|
+
- [LionSelect](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/select/overview.md), a wrapper for `<select>`.
|
|
37
37
|
|
|
38
38
|
### Custom fields (wrappers)
|
|
39
39
|
|
|
40
|
-
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/
|
|
40
|
+
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/guides/how-to/create-a-custom-field.md) should be created. One could think of components like:
|
|
41
41
|
|
|
42
|
-
- [LionCombobox](https://github.com/ing-bank/lion/blob/
|
|
43
|
-
- [LionDate](https://github.com/ing-bank/lion/blob/
|
|
44
|
-
- [LionDatepicker](https://github.com/ing-bank/lion/blob/
|
|
45
|
-
- [LionListbox](https://github.com/ing-bank/lion/blob/
|
|
46
|
-
- [LionInputAmount](https://github.com/ing-bank/lion/blob/
|
|
47
|
-
- [LionInputEmail](https://github.com/ing-bank/lion/blob/
|
|
48
|
-
- [LionInputIban](https://github.com/ing-bank/lion/blob/
|
|
49
|
-
- [LionInputRange](https://github.com/ing-bank/lion/blob/
|
|
50
|
-
- [LionInputStepper](https://github.com/ing-bank/lion/blob/
|
|
51
|
-
- [LionSelectRich](https://github.com/ing-bank/lion/blob/
|
|
42
|
+
- [LionCombobox](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/combobox/overview.md), a custom implementation of a combobox.
|
|
43
|
+
- [LionDate](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-date/overview.md), an alternative for `<input type="date">`.
|
|
44
|
+
- [LionDatepicker](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-datepicker/overview.md), an alternative for `<input type="date">` including a calendar dropdown.
|
|
45
|
+
- [LionListbox](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/listbox/overview.md), a custom implementation of a listbox.
|
|
46
|
+
- [LionInputAmount](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-amount/overview.md), an alternative for `<input type="number">` special for amounts.
|
|
47
|
+
- [LionInputEmail](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-email/overview.md), an alternative for `<input type="email">`.
|
|
48
|
+
- [LionInputIban](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-iban/overview.md), an ING specific for an input with IBAN numbers.
|
|
49
|
+
- [LionInputRange](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-range/overview.md), an alternative for `<input type="range">`.
|
|
50
|
+
- [LionInputStepper](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/input-stepper/overview.md), an alternative for `<input type="number">`.
|
|
51
|
+
- [LionSelectRich](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/select-rich/overview.md), an alternative for `<select>` with multiline options.
|
|
52
52
|
|
|
53
53
|
### Choice Input Fields
|
|
54
54
|
|
|
55
55
|
For form controls which return a `checked-state` you can use the `lion-choice-input` mixin. It is used in:
|
|
56
56
|
|
|
57
|
-
- [LionCheckbox](https://github.com/ing-bank/lion/blob/
|
|
57
|
+
- [LionCheckbox](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/checkbox-group/overview.md), a wrapper for `<input type="checkbox">`.
|
|
58
58
|
- LionOption, an alternative for `<option>`.
|
|
59
|
-
- [LionRadio](https://github.com/ing-bank/lion/blob/
|
|
60
|
-
- [LionSwitch](https://github.com/ing-bank/lion/blob/
|
|
59
|
+
- [LionRadio](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/radio-group/overview.md), a wrapper for `<input type="radio">`.
|
|
60
|
+
- [LionSwitch](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/switch/overview.md), a custom implementation of a switch.
|
|
61
61
|
|
|
62
62
|
Which contains the following features:
|
|
63
63
|
|
|
@@ -69,14 +69,14 @@ Which contains the following features:
|
|
|
69
69
|
|
|
70
70
|
Fieldsets are groups of fields. They can be considered fields on their own as well, since they partly share the normalized API via `FormControlMixin`. Fieldsets are the basis for:
|
|
71
71
|
|
|
72
|
-
- [LionFieldset](https://github.com/ing-bank/lion/blob/
|
|
73
|
-
- [LionForm](https://github.com/ing-bank/lion/blob/
|
|
74
|
-
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/
|
|
75
|
-
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/
|
|
72
|
+
- [LionFieldset](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/fieldset/overview.md), a wrapper around multiple input fields or other fieldsets.
|
|
73
|
+
- [LionForm](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/form/overview.md), enhances the functionality of the native `<form>` component.
|
|
74
|
+
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/checkbox-group/overview.md), a wrapper component for multiple checkboxes.
|
|
75
|
+
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/components/radio-group/overview.md), a wrapper component for multiple radio inputs.
|
|
76
76
|
|
|
77
77
|
## Other Resources
|
|
78
78
|
|
|
79
|
-
- [Model Value](https://github.com/ing-bank/lion/blob/
|
|
80
|
-
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/
|
|
81
|
-
- [Interaction states](https://github.com/ing-bank/lion/blob/
|
|
82
|
-
- [Validation System](https://github.com/ing-bank/lion/blob/
|
|
79
|
+
- [Model Value](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/model-value.md)
|
|
80
|
+
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
81
|
+
- [Interaction states](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/interaction-states.md)
|
|
82
|
+
- [Validation System](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/validate.md)
|
|
@@ -57,7 +57,7 @@ Validation happens on every change of `modelValue`. A change in modelValue can b
|
|
|
57
57
|
|
|
58
58
|
## When validation feedback will be shown
|
|
59
59
|
|
|
60
|
-
Although validation happens realtime under the hood, displaying validity feedback in realtime may not always lead to the desired User Experience. Together with [interaction states](https://github.com/ing-bank/lion/blob/
|
|
60
|
+
Although validation happens realtime under the hood, displaying validity feedback in realtime may not always lead to the desired User Experience. Together with [interaction states](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/interaction-states.md),
|
|
61
61
|
validity states can determine whether a validation message should be shown along the input field.
|
|
62
62
|
|
|
63
63
|
## Assessing field validation state programmatically
|
|
@@ -232,7 +232,7 @@ export const requiredValidator = () => html`
|
|
|
232
232
|
`;
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
The default `Required` validation message is "Please, enter a(n) {fieldName}". In which the "fieldName" can be provided separately via the `fieldName` attribute, with a fallback to the label. See [override fieldname](https://github.com/ing-bank/lion/blob/
|
|
235
|
+
The default `Required` validation message is "Please, enter a(n) {fieldName}". In which the "fieldName" can be provided separately via the `fieldName` attribute, with a fallback to the label. See [override fieldname](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/form/#override-fieldname) for more information.
|
|
236
236
|
|
|
237
237
|
Specific required messages for a select and file-upload are created.
|
|
238
238
|
|
|
@@ -6,45 +6,45 @@
|
|
|
6
6
|
|
|
7
7
|
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
8
8
|
| ---------------------------------- | --------- | --------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------- |
|
|
9
|
-
| `formatNumberOptions` | public | `object` | `{ returnIfNaN: '', /** @type {Map<string, NumberPostProcessor>} */ postProcessors: new Map(), }` | The localize system uses (normalized) Intl for formatting numbers.
It's possible to customize this output per locale | |
|
|
10
9
|
| `formatDateOptions` | public | `object` | `{ /** @type {Map<string, DatePostProcessor>} */ postProcessors: new Map(), }` | The localize system uses (normalized) Intl for formatting dates.
It's possible to customize this output per locale | |
|
|
11
|
-
| `
|
|
10
|
+
| `formatNumberOptions` | public | `object` | `{ returnIfNaN: '', /** @type {Map<string, NumberPostProcessor>} */ postProcessors: new Map(), }` | The localize system uses (normalized) Intl for formatting numbers.
It's possible to customize this output per locale | |
|
|
12
11
|
| `loadingComplete` | public | | | | |
|
|
13
|
-
| `
|
|
14
|
-
| `_langAttrSetByTranslationTool` | protected | | | | |
|
|
12
|
+
| `locale` | public | | | | |
|
|
15
13
|
| `_autoLoadOnLocaleChange` | protected | `boolean` | `!!autoLoadOnLocaleChange` | | |
|
|
16
|
-
| `_showKeyAsFallback` | protected | | `showKeyAsFallback` | | |
|
|
17
14
|
| `_fallbackLocale` | protected | | `fallbackLocale` | | |
|
|
15
|
+
| `_langAttrSetByTranslationTool` | protected | | | | |
|
|
16
|
+
| `_showKeyAsFallback` | protected | | `showKeyAsFallback` | | |
|
|
17
|
+
| `_supportExternalTranslationTools` | protected | | | | |
|
|
18
18
|
|
|
19
19
|
### Methods
|
|
20
20
|
|
|
21
21
|
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
22
22
|
| ------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | ----------------------- | -------------- |
|
|
23
23
|
| `addData` | public | | `locale: string, namespace: string, data: object` | | |
|
|
24
|
-
| `setupNamespaceLoader` | public | | `pattern: RegExp\|string, loader: function` | | |
|
|
25
|
-
| `loadNamespaces` | public | | `namespaces: NamespaceObject[], { locale }, options: @param {string} [options.locale] * ` | `Promise<Object>` | |
|
|
26
24
|
| `loadNamespace` | public | | `namespaceObj: NamespaceObject, { locale = this.locale }, options: @param {string} [options.locale] * ` | `Promise<Object\|void>` | |
|
|
25
|
+
| `loadNamespaces` | public | | `namespaces: NamespaceObject[], { locale }, options: @param {string} [options.locale] * ` | `Promise<Object>` | |
|
|
27
26
|
| `msg` | public | | `keys: string \| string[], vars: Object<string,?>, opts: @param {string} [opts.locale] * ` | `string` | |
|
|
28
|
-
| `teardown` | public | | | | |
|
|
29
27
|
| `reset` | public | | | | |
|
|
30
28
|
| `setDatePostProcessorForLocale` | public | | `{ locale, postProcessor }, options: {locale:string, postProcessor:DatePostProcessor}` | | |
|
|
31
29
|
| `setNumberPostProcessorForLocale` | public | | `{ locale, postProcessor }, options: {locale:string, postProcessor:NumberPostProcessor}` | | |
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `_teardownHtmlLangAttributeObserver` | protected | | | | |
|
|
36
|
-
| `_isNamespaceInCache` | protected | | `locale: string, namespace: string` | | |
|
|
30
|
+
| `setupNamespaceLoader` | public | | `pattern: RegExp\|string, loader: function` | | |
|
|
31
|
+
| `teardown` | public | | | | |
|
|
32
|
+
| `_cacheNamespaceLoaderPromise` | protected | | `locale: string, namespace: string, promise: Promise<Object\|void>` | | |
|
|
37
33
|
| `_getCachedNamespaceLoaderPromise` | protected | | `locale: string, namespace: string` | | |
|
|
38
|
-
| `
|
|
34
|
+
| `_getLangFromLocale` | protected | | `locale: string` | `string` | |
|
|
35
|
+
| `_getMessageForKey` | protected | | `key: string \| undefined, locale: string` | `string` | |
|
|
36
|
+
| `_getMessageForKeys` | protected | | `keys: string \| string[], locale: string` | `string \| undefined` | |
|
|
39
37
|
| `_getNamespaceLoader` | protected | | `namespaceObj: NamespaceObject, isDynamicImport: boolean, namespace: string` | | |
|
|
40
38
|
| `_getNamespaceLoaderPromise` | protected | | `loader: function, locale: string, namespace: string, fallbackLocale: string` | `Promise<any>` | |
|
|
41
|
-
| `
|
|
39
|
+
| `_isNamespaceInCache` | protected | | `locale: string, namespace: string` | | |
|
|
40
|
+
| `_loadAllMissing` | protected | | `newLocale: string, oldLocale: string` | | |
|
|
41
|
+
| `_loadNamespaceData` | protected | | `locale: string, namespaceObj: NamespaceObject, isDynamicImport: boolean, namespace: string` | `Promise<Object\|void>` | |
|
|
42
42
|
| `_lookupNamespaceLoader` | protected | | `namespace: string` | `function\|null` | |
|
|
43
|
-
| `_getLangFromLocale` | protected | | `locale: string` | `string` | |
|
|
44
43
|
| `_onLocaleChanged` | protected | | `newLocale: string, oldLocale: string` | `undefined` | |
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
44
|
+
| `_setHtmlLangAttribute` | protected | | `locale: string` | | |
|
|
45
|
+
| `_setupHtmlLangAttributeObserver` | protected | | | | |
|
|
46
|
+
| `_setupTranslationToolSupport` | protected | This value allows for support for Google Translate (or other 3rd parties taking control
of the html\[lang] attribute).

Have the following scenario in mind:
1\. locale is initialized by developer via html\[data-localize-lang="en-US"] and
html\[lang="en-US"]. When localize is loaded (note that this also can be after step 2 below),
it will sync its initial state from html\[data-localize-lang]
2\. Google Translate kicks in for the French language. It will set html\[lang="fr"].
This new language is not one known by us, so we most likely don't have translations for
this file. Therefore, we do NOT sync this value to LocalizeManager. The manager should
still ask for known resources (in this case for locale 'en-US')
3\. locale is changed (think of a language dropdown)
It's a bit of a weird case, because we would not expect an end user to do this. If he/she
does, make sure that we do not go against Google Translate, so we maintain accessibility
(by not altering html\[lang]). We detect this by reading #localeSetByTranslationTool:
when its value is null, we consider Google translate 'not active'.

When Google Translate is turned off by the user (html\[lang=auto]),
\`localize.locale\` will be synced to html\[lang] again

Keep in mind that all of the above also works with other tools than Google Translate,
but this is the most widely used tool and therefore used as an example. | | | |
|
|
47
|
+
| `_teardownHtmlLangAttributeObserver` | protected | | | | |
|
|
48
48
|
|
|
49
49
|
### Events
|
|
50
50
|
|
|
@@ -9,15 +9,15 @@ In it's simplest form it is a function that returns the translated text for a na
|
|
|
9
9
|
- Formatting of numbers, amounts
|
|
10
10
|
- Formatting of dates
|
|
11
11
|
|
|
12
|
-
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/localize/use-cases.md).
|
|
13
13
|
|
|
14
14
|
## Content
|
|
15
15
|
|
|
16
16
|
| Feature | Description |
|
|
17
17
|
| ---------------------------------------- | --------------------------------------------- |
|
|
18
|
-
| [Translate Text](https://github.com/ing-bank/lion/blob/
|
|
19
|
-
| [Format Numbers](https://github.com/ing-bank/lion/blob/
|
|
20
|
-
| [Format Dates](https://github.com/ing-bank/lion/blob/
|
|
18
|
+
| [Translate Text](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/localize/text.md) | Load and translate text in multiple languages |
|
|
19
|
+
| [Format Numbers](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/localize/numbers.md) | Format numbers in multiple languages |
|
|
20
|
+
| [Format Dates](https://github.com/ing-bank/lion/blob/593b753f0f99acb36ea6009677bc7fdda9184184/docs/fundamentals/systems/localize/dates.md) | Format dates in multiple languages |
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|