@lion/ui 0.12.0 → 0.13.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/components/accordion/src/LionAccordion.js +3 -2
- package/components/button/src/LionButton.js +6 -10
- package/components/button/src/LionButtonReset.js +2 -0
- package/components/button/src/LionButtonSubmit.js +2 -0
- package/components/button/test-suites/LionButton.suite.js +0 -14
- package/components/checkbox-group/src/LionCheckbox.js +3 -0
- package/components/checkbox-group/src/LionCheckboxGroup.js +2 -0
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +3 -0
- package/components/collapsible/src/LionCollapsible.js +4 -1
- package/components/combobox/src/LionCombobox.js +31 -8
- package/components/combobox/test/lion-combobox.test.js +206 -57
- package/components/dialog/src/LionDialog.js +3 -0
- package/components/drawer/src/LionDrawer.js +9 -0
- package/components/fieldset/src/LionFieldset.js +1 -1
- package/components/form/src/LionForm.js +0 -1
- package/components/form-core/src/FocusMixin.js +1 -0
- package/components/form-core/src/FormControlMixin.js +33 -18
- package/components/form-core/src/FormatMixin.js +1 -1
- package/components/form-core/src/validate/LionValidationFeedback.js +8 -10
- package/components/form-core/src/validate/ValidateMixin.js +40 -4
- package/components/form-core/test/FormControlMixin.test.js +68 -0
- package/components/form-core/test/validate/lion-validation-feedback.test.js +0 -22
- package/components/form-core/test-suites/ValidateMixin.suite.js +19 -3
- package/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +119 -0
- package/components/form-core/types/validate/validate.ts +1 -0
- package/components/icon/src/LionIcon.js +2 -0
- package/components/input-file/src/LionInputFile.js +9 -0
- package/components/input-tel/src/LionInputTel.js +3 -0
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +2 -0
- package/components/listbox/src/LionListbox.js +2 -0
- package/components/overlays/src/OverlayController.js +32 -5
- package/components/overlays/src/OverlayMixin.js +5 -0
- package/components/overlays/src/configurations/withDropdownConfig.js +0 -1
- package/components/overlays/src/configurations/withTooltipConfig.js +0 -1
- package/components/overlays/test/OverlayController.test.js +16 -4
- package/components/overlays/test-suites/OverlayMixin.suite.js +71 -0
- package/components/progress-indicator/src/LionProgressIndicator.js +4 -0
- package/components/radio-group/src/LionRadioGroup.js +3 -1
- package/components/select/src/LionSelect.js +4 -0
- package/components/select-rich/src/LionSelectInvoker.js +2 -0
- package/components/select-rich/src/LionSelectRich.js +2 -0
- package/components/steps/src/LionStep.js +0 -1
- package/components/steps/src/LionSteps.js +0 -1
- package/components/switch/src/LionSwitch.js +3 -0
- package/components/switch/src/LionSwitchButton.js +5 -0
- package/components/tabs/src/LionTabs.js +8 -0
- package/custom-elements.json +1271 -406
- package/dist-types/components/accordion/src/LionAccordion.d.ts +3 -2
- package/dist-types/components/accordion/src/LionAccordion.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButton.d.ts +2 -1
- package/dist-types/components/button/src/LionButton.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButtonReset.d.ts +2 -0
- package/dist-types/components/button/src/LionButtonReset.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButtonSubmit.d.ts +2 -0
- package/dist-types/components/button/src/LionButtonSubmit.d.ts.map +1 -1
- package/dist-types/components/button/test-suites/LionButton.suite.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckbox.d.ts +3 -0
- package/dist-types/components/checkbox-group/src/LionCheckbox.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckboxGroup.d.ts +2 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxGroup.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +3 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
- package/dist-types/components/collapsible/src/LionCollapsible.d.ts +3 -1
- package/dist-types/components/collapsible/src/LionCollapsible.d.ts.map +1 -1
- package/dist-types/components/combobox/src/LionCombobox.d.ts +5 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/core/src/ScopedElementsMixin.d.ts.map +1 -1
- package/dist-types/components/dialog/src/LionDialog.d.ts +3 -0
- package/dist-types/components/dialog/src/LionDialog.d.ts.map +1 -1
- package/dist-types/components/drawer/src/LionDrawer.d.ts +9 -0
- package/dist-types/components/drawer/src/LionDrawer.d.ts.map +1 -1
- package/dist-types/components/fieldset/src/LionFieldset.d.ts +1 -1
- package/dist-types/components/form/src/LionForm.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FocusMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FormControlMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -3
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ValidateMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/types/validate/validate.d.ts +1 -0
- package/dist-types/components/form-core/types/validate/validate.d.ts.map +1 -1
- package/dist-types/components/icon/src/LionIcon.d.ts +2 -0
- package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts +9 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/LionInputTel.d.ts +3 -0
- package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +2 -0
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionListbox.d.ts +2 -0
- package/dist-types/components/listbox/src/LionListbox.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 +4 -0
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withDropdownConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withTooltipConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/test/OverlayController.test.d.ts.map +1 -1
- package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts.map +1 -1
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts +3 -0
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts.map +1 -1
- package/dist-types/components/radio-group/src/LionRadioGroup.d.ts +3 -1
- package/dist-types/components/radio-group/src/LionRadioGroup.d.ts.map +1 -1
- package/dist-types/components/select/src/LionSelect.d.ts +3 -0
- package/dist-types/components/select/src/LionSelect.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +2 -0
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +3 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/steps/src/LionStep.d.ts +0 -1
- package/dist-types/components/steps/src/LionStep.d.ts.map +1 -1
- package/dist-types/components/steps/src/LionSteps.d.ts +0 -1
- package/dist-types/components/steps/src/LionSteps.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitch.d.ts +3 -0
- package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitchButton.d.ts +5 -0
- package/dist-types/components/switch/src/LionSwitchButton.d.ts.map +1 -1
- package/dist-types/components/tabs/src/LionTabs.d.ts +8 -0
- package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +8 -0
- package/docs/components/button/api-table.md +0 -3
- package/docs/components/checkbox-group/api-table.md +6 -6
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +7 -0
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +9 -2
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +90 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +8 -0
- package/docs/components/fieldset/api-table.md +2 -2
- 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 -2
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +2 -2
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +2 -2
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +2 -2
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +2 -2
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +9 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +2 -2
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +2 -2
- 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 -2
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +2 -2
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/api-table.md +4 -4
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +2 -2
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +2 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/switch/api-table.md +2 -2
- package/docs/components/tabs/api-table.md +7 -0
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +2 -2
- 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 -2
- 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/styling.md +3 -20
- package/docs/fundamentals/systems/form/validate.md +19 -3
- 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 +3 -3
|
@@ -26,7 +26,6 @@ eleventyNavigation:
|
|
|
26
26
|
| `singleOption` | public | `boolean` | `false` | When the connected LionSelectRich instance has only one option,
this should be reflected in the invoker as well | |
|
|
27
27
|
| `tabIndex` | public | `number` | | | LionButton |
|
|
28
28
|
| `type` | public | `string` | `'button'` | | LionButton |
|
|
29
|
-
| `_buttonId` | protected | | | | LionButton |
|
|
30
29
|
| `_contentWrapperNode` | protected | | | | |
|
|
31
30
|
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | LionButton |
|
|
32
31
|
|
|
@@ -80,11 +79,11 @@ eleventyNavigation:
|
|
|
80
79
|
| `formElements` | public | `FormControlsCollection` | `new FormControlsCollection()` | Closely mimics the natively supported HTMLFormControlsCollection. It can be accessed
both like an array and an object (based on control/element names). | LionListbox |
|
|
81
80
|
| `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | LionListbox |
|
|
82
81
|
| `hasNoDefaultSelected` | public | `boolean` | `false` | When setting this to true, on initial render, no option will be selected.
It is advisable to override \`\_noSelectionTemplate\` method in the select-invoker
to render some kind of placeholder initially | LionListbox |
|
|
83
|
-
| `helpText` | public | `string` |
|
|
82
|
+
| `helpText` | public | `string` | | The helpt text for the input node.
When no light dom defined via \[slot=help-text], this value will be used | LionListbox |
|
|
84
83
|
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => { this.__resolveInitComplete = resolve; this.__rejectInitComplete = reject; })` | initComplete resolves after all pending initialization logic
(for instance \`\<form-group .serializedValue=${{ child1: 'a', child2: 'b' }}>\`)
is executed | LionListbox |
|
|
85
84
|
| `interactionMode` | public | `'windows/linux'\|'mac'\|'auto'` | `'auto'` | Aligns behavior for 'selectionFollowFocus' and 'navigateWithinInvoker' with
platform. When 'auto' (default), platform is automatically detected | |
|
|
86
85
|
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | LionListbox |
|
|
87
|
-
| `label` | public | `string` |
|
|
86
|
+
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionListbox |
|
|
88
87
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionListbox |
|
|
89
88
|
| `modelValue` | public | | | | LionListbox |
|
|
90
89
|
| `multipleChoice` | public | `boolean` | `false` | When false (default), modelValue and serializedValue will reflect the
currently selected choice (usually a string). When true, modelValue will and
serializedValue will be an array of strings. | LionListbox |
|
|
@@ -314,7 +314,7 @@ LionSelectRich will give it acces to:
|
|
|
314
314
|
- LionSelectRich itself, via `.hostElement`
|
|
315
315
|
|
|
316
316
|
Code of an advanced custom invoker is shown below (this is the code for the
|
|
317
|
-
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/
|
|
317
|
+
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/select-rich/examples.md)).
|
|
318
318
|
The invoker is usually added in the invoker slot of the LionSelectRich subclass.
|
|
319
319
|
However, it would also be possible for an application developer to provide the invoker
|
|
320
320
|
by putting it in light dom:
|
|
@@ -33,9 +33,9 @@ eleventyNavigation:
|
|
|
33
33
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
34
34
|
| `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 |
|
|
35
35
|
| `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | LionField |
|
|
36
|
-
| `helpText` | public | `string` |
|
|
36
|
+
| `helpText` | public | `string` | | The helpt text for the input node.
When no light dom defined via \[slot=help-text], this value will be used | LionField |
|
|
37
37
|
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | LionField |
|
|
38
|
-
| `label` | public | `string` |
|
|
38
|
+
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionField |
|
|
39
39
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField |
|
|
40
40
|
| `modelValue` | public | `{value:string\|any,checked:boolean}` | `{ value: '', checked: false }` | Whereas 'normal' \`.modelValue\`s usually store a complex/typed version
of a view value, choice inputs have a slightly different approach.
In order to remain their Single Source of Truth characteristic, choice inputs
store both the value and 'checkedness', in the format { value: 'x', checked: true }
Different from the platform, this also allows to serialize the 'non checkedness',
allowing to restore form state easily and inform the server about unchecked options. | LionField |
|
|
41
41
|
| `name` | public | `string` | `''` | The name the element will be registered with to the .formElements collection
of the parent. Also, it serves as the key of key/value pairs in
 modelValue/serializedValue objects | LionField |
|
|
@@ -41,4 +41,11 @@ eleventyNavigation:
|
|
|
41
41
|
| ---------------- | ------------- | -------------- |
|
|
42
42
|
| `selected-index` | selectedIndex | |
|
|
43
43
|
|
|
44
|
+
### Slots
|
|
45
|
+
|
|
46
|
+
| Name | Description |
|
|
47
|
+
| ------- | ------------------------------- |
|
|
48
|
+
| `tab` | The tab elements for the tabs |
|
|
49
|
+
| `panel` | The panel elements for the tabs |
|
|
50
|
+
|
|
44
51
|
<hr/>
|
|
@@ -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/5f1d7166273cc724458c0239822cd454e16253fa/docs/blog/ing-open-sources-lion.md).
|
|
25
25
|
|
|
26
26
|
```js preview-story
|
|
27
27
|
export const main = () => html`
|
|
@@ -32,9 +32,9 @@ eleventyNavigation:
|
|
|
32
32
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField |
|
|
33
33
|
| `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 |
|
|
34
34
|
| `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | LionField |
|
|
35
|
-
| `helpText` | public | `string` |
|
|
35
|
+
| `helpText` | public | `string` | | The helpt text for the input node.
When no light dom defined via \[slot=help-text], this value will be used | LionField |
|
|
36
36
|
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | LionField |
|
|
37
|
-
| `label` | public | `string` |
|
|
37
|
+
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | LionField |
|
|
38
38
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField |
|
|
39
39
|
| `maxRows` | public | `number` | `6` | | |
|
|
40
40
|
| `modelValue` | public | | | | 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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/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)
|
|
@@ -32,9 +32,9 @@ eleventyNavigation:
|
|
|
32
32
|
| `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | FormatMixin |
|
|
33
33
|
| `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 |
|
|
34
34
|
| `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | ValidateMixin |
|
|
35
|
-
| `helpText` | public | `string` |
|
|
35
|
+
| `helpText` | public | `string` | | The helpt text for the input node.
When no light dom defined via \[slot=help-text], this value will be used | FormControlMixin |
|
|
36
36
|
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
37
|
-
| `label` | public | `string` |
|
|
37
|
+
| `label` | public | `string` | | The label text for the input node.
When no light dom defined via \[slot=label], this value will be used. | FormControlMixin |
|
|
38
38
|
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
39
39
|
| `modelValue` | public | | | | FormControlMixin |
|
|
40
40
|
| `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 |
|
|
@@ -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/5f1d7166273cc724458c0239822cd454e16253fa/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/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
38
38
|
|
|
39
39
|
### Event meta
|
|
40
40
|
|
|
@@ -33,9 +33,9 @@ Fields (think of an input, textarea, select) are the actual form controls the en
|
|
|
33
33
|
|
|
34
34
|
On top of this, they feature:
|
|
35
35
|
|
|
36
|
-
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/
|
|
37
|
-
- Advanced [validation](https://github.com/ing-bank/lion/blob/
|
|
38
|
-
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
36
|
+
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/formatting-and-parsing.md) of view values.
|
|
37
|
+
- Advanced [validation](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/validate.md) possibilities.
|
|
38
|
+
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/interaction-states.md).
|
|
39
39
|
- Provision of labels and help texts in an easy, declarative manner.
|
|
40
40
|
- Accessibility out of the box.
|
|
41
41
|
- Advanced styling possibilities: map your own Design System to the internal HTML structure.
|
|
@@ -44,33 +44,33 @@ On top of this, they feature:
|
|
|
44
44
|
|
|
45
45
|
### Platform fields (wrappers)
|
|
46
46
|
|
|
47
|
-
- [LionInput](https://github.com/ing-bank/lion/blob/
|
|
48
|
-
- [LionTextarea](https://github.com/ing-bank/lion/blob/
|
|
49
|
-
- [LionSelect](https://github.com/ing-bank/lion/blob/
|
|
47
|
+
- [LionInput](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input/overview.md), a wrapper for `<input>`.
|
|
48
|
+
- [LionTextarea](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/textarea/overview.md), a wrapper for `<textarea>`.
|
|
49
|
+
- [LionSelect](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/select/overview.md), a wrapper for `<select>`.
|
|
50
50
|
|
|
51
51
|
### Custom fields (wrappers)
|
|
52
52
|
|
|
53
|
-
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/
|
|
53
|
+
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/guides/how-to/create-a-custom-field.md) should be created. One could think of components like:
|
|
54
54
|
|
|
55
|
-
- [LionCombobox](https://github.com/ing-bank/lion/blob/
|
|
56
|
-
- [LionDate](https://github.com/ing-bank/lion/blob/
|
|
57
|
-
- [LionDatepicker](https://github.com/ing-bank/lion/blob/
|
|
58
|
-
- [LionListbox](https://github.com/ing-bank/lion/blob/
|
|
59
|
-
- [LionInputAmount](https://github.com/ing-bank/lion/blob/
|
|
60
|
-
- [LionInputEmail](https://github.com/ing-bank/lion/blob/
|
|
61
|
-
- [LionInputIban](https://github.com/ing-bank/lion/blob/
|
|
62
|
-
- [LionInputRange](https://github.com/ing-bank/lion/blob/
|
|
63
|
-
- [LionInputStepper](https://github.com/ing-bank/lion/blob/
|
|
64
|
-
- [LionSelectRich](https://github.com/ing-bank/lion/blob/
|
|
55
|
+
- [LionCombobox](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/combobox/overview.md), a custom implementation of a combobox.
|
|
56
|
+
- [LionDate](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-date/overview.md), an alternative for `<input type="date">`.
|
|
57
|
+
- [LionDatepicker](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-datepicker/overview.md), an alternative for `<input type="date">` including a calendar dropdown.
|
|
58
|
+
- [LionListbox](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/listbox/overview.md), a custom implementation of a listbox.
|
|
59
|
+
- [LionInputAmount](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-amount/overview.md), an alternative for `<input type="number">` special for amounts.
|
|
60
|
+
- [LionInputEmail](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-email/overview.md), an alternative for `<input type="email">`.
|
|
61
|
+
- [LionInputIban](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-iban/overview.md), an ING specific for an input with IBAN numbers.
|
|
62
|
+
- [LionInputRange](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-range/overview.md), an alternative for `<input type="range">`.
|
|
63
|
+
- [LionInputStepper](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input-stepper/overview.md), an alternative for `<input type="number">`.
|
|
64
|
+
- [LionSelectRich](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/select-rich/overview.md), an alternative for `<select>` with multiline options.
|
|
65
65
|
|
|
66
66
|
### Choice Input Fields
|
|
67
67
|
|
|
68
68
|
For form controls which return a `checked-state` you can use the `lion-choice-input` mixin. It is used in:
|
|
69
69
|
|
|
70
|
-
- [LionCheckbox](https://github.com/ing-bank/lion/blob/
|
|
70
|
+
- [LionCheckbox](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/checkbox-group/overview.md), a wrapper for `<input type="checkbox">`.
|
|
71
71
|
- LionOption, an alternative for `<option>`.
|
|
72
|
-
- [LionRadio](https://github.com/ing-bank/lion/blob/
|
|
73
|
-
- [LionSwitch](https://github.com/ing-bank/lion/blob/
|
|
72
|
+
- [LionRadio](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/radio-group/overview.md), a wrapper for `<input type="radio">`.
|
|
73
|
+
- [LionSwitch](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/switch/overview.md), a custom implementation of a switch.
|
|
74
74
|
|
|
75
75
|
Which contains the following features:
|
|
76
76
|
|
|
@@ -82,14 +82,14 @@ Which contains the following features:
|
|
|
82
82
|
|
|
83
83
|
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:
|
|
84
84
|
|
|
85
|
-
- [LionFieldset](https://github.com/ing-bank/lion/blob/
|
|
86
|
-
- [LionForm](https://github.com/ing-bank/lion/blob/
|
|
87
|
-
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/
|
|
88
|
-
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/
|
|
85
|
+
- [LionFieldset](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/fieldset/overview.md), a wrapper around multiple input fields or other fieldsets.
|
|
86
|
+
- [LionForm](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/form/overview.md), enhances the functionality of the native `<form>` component.
|
|
87
|
+
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/checkbox-group/overview.md), a wrapper component for multiple checkboxes.
|
|
88
|
+
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/radio-group/overview.md), a wrapper component for multiple radio inputs.
|
|
89
89
|
|
|
90
90
|
## Other Resources
|
|
91
91
|
|
|
92
|
-
- [Model Value](https://github.com/ing-bank/lion/blob/
|
|
93
|
-
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/
|
|
94
|
-
- [Interaction states](https://github.com/ing-bank/lion/blob/
|
|
95
|
-
- [Validation System](https://github.com/ing-bank/lion/blob/
|
|
92
|
+
- [Model Value](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/model-value.md)
|
|
93
|
+
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
94
|
+
- [Interaction states](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/interaction-states.md)
|
|
95
|
+
- [Validation System](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/validate.md)
|
|
@@ -21,30 +21,13 @@ import '@lion/ui/define/lion-button.js';
|
|
|
21
21
|
|
|
22
22
|
## Label
|
|
23
23
|
|
|
24
|
-
Can be provided via the `label` attribute, but the slot can be used to change the
|
|
25
|
-
|
|
26
|
-
A label is always needed for accessibility reasons.
|
|
24
|
+
Can be provided via the `label` attribute, but the slot can be used to change the html and css of the label.
|
|
25
|
+
A label is always needed to provide an accessible user experience.
|
|
27
26
|
|
|
28
27
|
```js preview-story
|
|
29
28
|
export const label = () => html`
|
|
30
|
-
<style>
|
|
31
|
-
.u-sr-only {
|
|
32
|
-
position: absolute;
|
|
33
|
-
width: 1px;
|
|
34
|
-
height: 1px;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
clip-path: inset(100%);
|
|
37
|
-
clip: rect(1px, 1px, 1px, 1px);
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
border: 0;
|
|
40
|
-
margin: 0;
|
|
41
|
-
padding: 0;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
29
|
<lion-input>
|
|
45
|
-
<label slot="label"
|
|
46
|
-
>Label <span class="u-sr-only">partially only visible for screen-readers</span></label
|
|
47
|
-
>
|
|
30
|
+
<label slot="label"> Label with <b>html tag</b> inside </label>
|
|
48
31
|
</lion-input>
|
|
49
32
|
`;
|
|
50
33
|
```
|
|
@@ -70,7 +70,7 @@ Validation happens on every change of `modelValue`. A change in modelValue can b
|
|
|
70
70
|
|
|
71
71
|
## When validation feedback will be shown
|
|
72
72
|
|
|
73
|
-
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/
|
|
73
|
+
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/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/interaction-states.md),
|
|
74
74
|
validity states can determine whether a validation message should be shown along the input field.
|
|
75
75
|
|
|
76
76
|
## Assessing field validation state programmatically
|
|
@@ -245,7 +245,7 @@ export const requiredValidator = () => html`
|
|
|
245
245
|
`;
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
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/
|
|
248
|
+
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/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/#override-fieldname) for more information.
|
|
249
249
|
|
|
250
250
|
Specific required messages for a select and file-upload are created.
|
|
251
251
|
|
|
@@ -684,10 +684,26 @@ export const validationTypes = () => {
|
|
|
684
684
|
};
|
|
685
685
|
```
|
|
686
686
|
|
|
687
|
+
### Success
|
|
688
|
+
|
|
687
689
|
Success validators work a bit differently. Their success state is defined by the lack of a previously existing erroneous state (which can be an error or warning state).
|
|
688
690
|
|
|
689
691
|
So, an error validator going from invalid (true) state to invalid(false) state, will trigger the success validator.
|
|
690
692
|
|
|
693
|
+
By default the success message will disappear, both the duration and the removal can be configured by passing `displayOptions` to the validator configuration:
|
|
694
|
+
|
|
695
|
+
The `duration` property overwrites the default 3000ms timer.
|
|
696
|
+
|
|
697
|
+
```js
|
|
698
|
+
new DefaultSuccess({}, { visibilityDuration: 4000 });
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
`Infinity` can be added to the `duration` property to allow the success message to stay on screen, like the behaviour of the other validation types' messages.
|
|
702
|
+
|
|
703
|
+
```js
|
|
704
|
+
new DefaultSuccess({}, visibilityDuration: Infinity });
|
|
705
|
+
```
|
|
706
|
+
|
|
691
707
|
## Asynchronous validation
|
|
692
708
|
|
|
693
709
|
By default, all validations are run synchronously. However, for instance when validation can only take place on server level, asynchronous validation will be needed.
|
|
@@ -873,7 +889,7 @@ export const backendValidation = () => {
|
|
|
873
889
|
|
|
874
890
|
## Multiple field validation
|
|
875
891
|
|
|
876
|
-
When validation is dependent on
|
|
892
|
+
When validation is dependent on multiple fields, two approaches can be considered:
|
|
877
893
|
|
|
878
894
|
- Fieldset validation
|
|
879
895
|
- Validators with knowledge about context
|
|
@@ -22,15 +22,15 @@ In it's simplest form it is a function that returns the translated text for a na
|
|
|
22
22
|
- Formatting of numbers, amounts
|
|
23
23
|
- Formatting of dates
|
|
24
24
|
|
|
25
|
-
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/localize/use-cases.md).
|
|
26
26
|
|
|
27
27
|
## Content
|
|
28
28
|
|
|
29
29
|
| Feature | Description |
|
|
30
30
|
| ---------------------------------------- | --------------------------------------------- |
|
|
31
|
-
| [Translate Text](https://github.com/ing-bank/lion/blob/
|
|
32
|
-
| [Format Numbers](https://github.com/ing-bank/lion/blob/
|
|
33
|
-
| [Format Dates](https://github.com/ing-bank/lion/blob/
|
|
31
|
+
| [Translate Text](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/localize/text.md) | Load and translate text in multiple languages |
|
|
32
|
+
| [Format Numbers](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/localize/numbers.md) | Format numbers in multiple languages |
|
|
33
|
+
| [Format Dates](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/localize/dates.md) | Format dates in multiple languages |
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
@@ -112,7 +112,7 @@ export const alertDialog = () => {
|
|
|
112
112
|
|
|
113
113
|
## isTooltip (placementMode: 'local')
|
|
114
114
|
|
|
115
|
-
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/
|
|
115
|
+
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/rationale.md) there are only two official types of overlays: dialogs and tooltips. And their main differences are:
|
|
116
116
|
|
|
117
117
|
- Dialogs have a modal option, tooltips don’t
|
|
118
118
|
- Dialogs have interactive content, tooltips don’t
|
|
@@ -443,7 +443,7 @@ Features:
|
|
|
443
443
|
|
|
444
444
|
> Popper strictly is scoped on positioning. **It does not change the dimensions of the content node nor the invoker node**.
|
|
445
445
|
> This also means that if you use the arrow feature, you are in charge of styling it properly, use the data-popper-placement attribute for this.
|
|
446
|
-
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/
|
|
446
|
+
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/tooltip/overview.md), where an arrow is set by default.
|
|
447
447
|
|
|
448
448
|
To override the default options we set for local mode, you add a `popperConfig` object to the config passed to the OverlayController.
|
|
449
449
|
Here's a succinct overview of some often used popper properties:
|
|
@@ -19,7 +19,7 @@ Manages their position on the screen relative to other elements, including other
|
|
|
19
19
|
|
|
20
20
|
Its purpose is to make it easy to use our Overlay System declaratively. It can be easily extended where needed, to override event listeners and more.
|
|
21
21
|
|
|
22
|
-
See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](https://github.com/ing-bank/lion/blob/
|
|
22
|
+
See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/tooltip/overview.md) for example Web Component implementations using the Overlay System.
|
|
23
23
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
@@ -31,9 +31,9 @@ See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](htt
|
|
|
31
31
|
- lion-overlay web component:
|
|
32
32
|
- Show content when clicking the invoker
|
|
33
33
|
- Have a `.config` object to set or update the OverlayController's configuration
|
|
34
|
-
- [**OverlaysManager**](https://github.com/ing-bank/lion/blob/
|
|
35
|
-
- [**OverlayController**](https://github.com/ing-bank/lion/blob/
|
|
36
|
-
- [**OverlayMixin**](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
- [**OverlaysManager**](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/use-cases.md#overlaysmanager), a global repository keeping track of all different types of overlays
|
|
35
|
+
- [**OverlayController**](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/use-cases.md#overlaycontroller), a single controller class for handling overlays
|
|
36
|
+
- [**OverlayMixin**](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/use-cases.md#overlaymixin), a mixin that can be used to create webcomponents that use the OverlayController under the hood
|
|
37
37
|
|
|
38
38
|
Usually you will use `lion-dialog` (or `lion-tooltip` if this makes more sense).
|
|
39
39
|
|
|
@@ -123,4 +123,4 @@ class MyOverlayComponent extends OverlayMixin(LitElement) {
|
|
|
123
123
|
|
|
124
124
|
## Rationales
|
|
125
125
|
|
|
126
|
-
Please check the [system rationals](https://github.com/ing-bank/lion/blob/
|
|
126
|
+
Please check the [system rationals](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/rationale.md) folder, where we go more in-depth.
|
|
@@ -34,7 +34,7 @@ The overlay system allows to create different types of overlays like dialogs, to
|
|
|
34
34
|
It's designed to be highly flexible, while still delivering sensible defaults.
|
|
35
35
|
On top of this, the system was built having accessibility in mind.
|
|
36
36
|
|
|
37
|
-
For a detailed rationale, please consult [Rationale](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
For a detailed rationale, please consult [Rationale](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/rationale.md).
|
|
38
38
|
|
|
39
39
|
```js preview-story
|
|
40
40
|
export const main = () => html`
|
|
@@ -82,7 +82,7 @@ Global refers to overlays where the content is positioned in a global root node
|
|
|
82
82
|
|
|
83
83
|
Overlays can be configured in many ways to suit your needs. We go in-depth into each option in the Overlay System - Configuration chapter.
|
|
84
84
|
|
|
85
|
-
We also export a few [preset configuration objects](https://github.com/ing-bank/lion/blob/
|
|
85
|
+
We also export a few [preset configuration objects](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/overlays/configuration.md).
|
|
86
86
|
|
|
87
87
|
- withModalDialogConfig
|
|
88
88
|
- withDropdownConfig
|
|
@@ -22,7 +22,7 @@ Therefore, they may not have the same quality standards as our other packages.
|
|
|
22
22
|
|
|
23
23
|
| Package | Description |
|
|
24
24
|
| -------------------------------------- | ----------------------- |
|
|
25
|
-
| [sb-action-logger](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
| [sb-action-logger](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/tools/helpers/action-logger.md) | Storybook action logger |
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|