@lion/ui 0.2.1 → 0.3.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/README.md +23 -72
- package/components/button/src/LionButton.js +1 -1
- package/components/core/src/SlotMixin.js +3 -2
- package/components/core/test/SlotMixin.test.js +1 -1
- package/components/core/types/SlotMixinTypes.ts +4 -1
- package/components/dialog/test/lion-dialog.test.js +56 -0
- package/components/form-core/src/FocusMixin.js +33 -2
- package/components/form-core/src/LionField.js +3 -1
- package/components/form-core/src/validate/LionValidationFeedback.js +2 -5
- package/components/form-core/src/validate/ResultValidator.js +1 -1
- package/components/form-core/test/FocusMixin.test.js +33 -0
- package/components/form-core/types/validate/ValidateMixinTypes.ts +2 -2
- package/components/form-integrations/test/dialog-integrations.test.js +19 -0
- package/components/form-integrations/test/form-group-methods.test.js +11 -37
- package/components/form-integrations/test/form-integrations.test.js +4 -0
- package/components/form-integrations/test/helpers/umbrella-form.js +21 -18
- package/components/input-amount/src/LionInputAmount.js +13 -4
- package/components/input-amount/test/lion-input-amount.test.js +19 -20
- package/components/input-date/src/LionInputDate.js +2 -11
- package/components/input-datepicker/src/LionInputDatepicker.js +5 -2
- package/components/input-datepicker/test/lion-input-datepicker.test.js +20 -0
- package/components/input-file/src/FileHandle.js +98 -0
- package/components/input-file/src/LionInputFile.js +892 -0
- package/components/input-file/src/LionSelectedFileList.js +232 -0
- package/components/input-file/src/localizeNamespaceLoader.js +75 -0
- package/components/input-file/src/validators.js +114 -0
- package/components/input-file/test/FileValidators.test.js +170 -0
- package/components/input-file/test/lion-input-file.test.js +1168 -0
- package/components/input-file/test/lion-selected-file-list.test.js +207 -0
- package/components/input-file/translations/bg-BG.js +5 -0
- package/components/input-file/translations/bg.js +12 -0
- package/components/input-file/translations/cs-CZ.js +5 -0
- package/components/input-file/translations/cs.js +13 -0
- package/components/input-file/translations/de-DE.js +5 -0
- package/components/input-file/translations/de.js +12 -0
- package/components/input-file/translations/en-AU.js +5 -0
- package/components/input-file/translations/en-GB.js +5 -0
- package/components/input-file/translations/en-PH.js +5 -0
- package/components/input-file/translations/en-US.js +5 -0
- package/components/input-file/translations/en.js +12 -0
- package/components/input-file/translations/es-ES.js +5 -0
- package/components/input-file/translations/es.js +12 -0
- package/components/input-file/translations/fr-BE.js +5 -0
- package/components/input-file/translations/fr-FR.js +5 -0
- package/components/input-file/translations/fr.js +13 -0
- package/components/input-file/translations/hu-HU.js +5 -0
- package/components/input-file/translations/hu.js +12 -0
- package/components/input-file/translations/it-IT.js +5 -0
- package/components/input-file/translations/it.js +12 -0
- package/components/input-file/translations/nl-BE.js +5 -0
- package/components/input-file/translations/nl-NL.js +5 -0
- package/components/input-file/translations/nl.js +12 -0
- package/components/input-file/translations/pl-PL.js +5 -0
- package/components/input-file/translations/pl.js +12 -0
- package/components/input-file/translations/ro-RO.js +5 -0
- package/components/input-file/translations/ro.js +12 -0
- package/components/input-file/translations/ru-RU.js +5 -0
- package/components/input-file/translations/ru.js +12 -0
- package/components/input-file/translations/sk-SK.js +5 -0
- package/components/input-file/translations/sk.js +12 -0
- package/components/input-file/translations/uk-UA.js +5 -0
- package/components/input-file/translations/uk.js +12 -0
- package/components/input-file/translations/zh-CN.js +5 -0
- package/components/input-file/translations/zh.js +12 -0
- package/components/input-file/types/input-file.d.ts +32 -0
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +1 -4
- package/components/localize/src/number/parseNumber.js +7 -1
- package/components/localize/test/number/parseNumber.test.js +18 -4
- package/custom-elements.json +21949 -17530
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts +4 -0
- package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
- package/dist-types/components/dialog/test/lion-dialog.test.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/LionField.d.ts +2 -1
- package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -11
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ResultValidator.d.ts +1 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +5 -0
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/dialog-integrations.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts +1 -0
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts +2 -4
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts +0 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts.map +1 -1
- package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-file/src/FileHandle.d.ts +55 -0
- package/dist-types/components/input-file/src/FileHandle.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts +230 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts +69 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts.map +1 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts +2 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts.map +1 -0
- package/dist-types/components/input-file/src/validators.d.ts +58 -0
- package/dist-types/components/input-file/src/validators.d.ts.map +1 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts +2 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts +5 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts +4 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts +13 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de.d.ts +13 -0
- package/dist-types/components/input-file/translations/de.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-US.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-US.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en.d.ts +13 -0
- package/dist-types/components/input-file/translations/en.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts +13 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es.d.ts +13 -0
- package/dist-types/components/input-file/translations/es.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts +13 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it.d.ts +13 -0
- package/dist-types/components/input-file/translations/it.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh.d.ts.map +1 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +6 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +0 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
- package/dist-types/exports/define/lion-input-file.d.ts +2 -0
- package/dist-types/exports/define/lion-input-file.d.ts.map +1 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts +2 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts.map +1 -0
- package/dist-types/exports/input-file.d.ts +4 -0
- package/dist-types/exports/input-file.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/extensions/bootstrap-button.mjs +240 -0
- package/docs/components/button/extensions.md +30 -0
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/{examples.md → extensions.md} +51 -43
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/src/google-combobox/google-combobox.js +4 -1
- package/docs/components/combobox/src/md-combobox/md-combobox.js +40 -38
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +204 -209
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount/use-cases.md +4 -2
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +11 -0
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/index.md +3 -0
- package/docs/components/input-file/overview.md +32 -0
- package/docs/components/input-file/use-cases.md +424 -0
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.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/{examples.md → extensions.md} +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- 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 +28 -0
- package/docs/fundamentals/systems/core/SlotMixin.md +148 -0
- package/docs/fundamentals/systems/core/overview.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/use-cases.md +2 -0
- package/docs/fundamentals/systems/form/validate.md +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +116 -0
- package/docs/fundamentals/systems/overlays/_edge-cases.md +145 -0
- 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/example-complex/index.md +21 -0
- package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +19 -0
- package/docs/fundamentals/tools/singleton-manager/example-success/index.md +18 -0
- 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 +88 -0
- 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/exports/define/lion-input-file.js +3 -0
- package/exports/define/lion-selected-file-list.js +3 -0
- package/exports/input-file.js +3 -0
- package/package.json +3 -2
- package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
- package/docs/components/dialog/src/demo-dialog-style.js +0 -3
- package/docs/components/select-rich/src/flags.png +0 -0
- package/docs/components/select-rich/src/flags@2x.png +0 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +0 -84
- package/docs/fundamentals/tools/ajax/assets/naga.json +0 -9
- package/docs/fundamentals/tools/ajax/assets/pabu.json +0 -9
- package/docs/fundamentals/tools/singleton-manager/.gitignore +0 -1
- package/docs/override.js +0 -15
|
@@ -47,7 +47,7 @@ npm i --save-dev providence-analytics
|
|
|
47
47
|
You are now ready to use providence in your project. All
|
|
48
48
|
data will be stored in json files in the folder `./providence-output`
|
|
49
49
|
|
|
50
|
-

|
|
51
51
|
|
|
52
52
|
## Setup: Dashboard
|
|
53
53
|
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
|
|
77
77
|
Run `npm run providence:dashboard`
|
|
78
78
|
|
|
79
|
-

|
|
80
80
|
|
|
81
81
|
## Setup: about result output
|
|
82
82
|
|
|
@@ -153,7 +153,7 @@ Now you will get a list of all predefined analyzers:
|
|
|
153
153
|
- match-subclasses
|
|
154
154
|
- etc...
|
|
155
155
|
|
|
156
|
-

|
|
157
157
|
|
|
158
158
|
<!--
|
|
159
159
|
## Running providence from its own repo
|
|
@@ -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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Rationales >> Accessibility ||5
|
|
2
|
+
|
|
3
|
+
In Lion accessibility is a first class citizen. That means accessibility is never an afterthought.
|
|
4
|
+
|
|
5
|
+
Whenever we create a component, we do some thorough research first. Experience from past web component libraries learned us that when accessibility was dealt with in hindsight, a lot of concessions needed to be made. It made us want to go back to the drawing board. Lion was started with this 'fresh drawing board'.
|
|
6
|
+
In general, we try to leverage out of the box accessible platform solutions as much as possible. When no platform solutions are available, we try to map our components to [aria patterns and widgets as defined by W3C](https://www.w3.org/WAI/ARIA/apg/) where possible.
|
|
7
|
+
Building accessible components takes a lot of time, practice and knowledge about screen reader and browser implementations. Then, it takes many testing iterations to finetune a component.
|
|
8
|
+
|
|
9
|
+
More on this topic can be found in the online panel discussion [Web Components, Design Systems and Accessibility](https://www.youtube.com/watch?v=xz8yRVJMP2k&t=1190s). The discussion also contains a [dedicated section about accessible form components](https://www.youtube.com/watch?v=xz8yRVJMP2k&t=1917s)
|
|
10
|
+
|
|
11
|
+
## Shadow roots and accessibility
|
|
12
|
+
|
|
13
|
+
Since our components and applications consist of multiple shadow roots that need to be able to reference each other, designing accessible components takes extra strategy and planning.
|
|
14
|
+
A practical example: all form components inside a form need to be able to lay accessible relations for presenting feedback messages via the screen reader. For this, they need consistent designs so that all form components are interoperable. So, light dom needs to be leveraged until the [AOM specification](https://wicg.github.io/aom/explainer.html) is implemented.
|
|
15
|
+
|
|
16
|
+
## Some details about the form system
|
|
17
|
+
|
|
18
|
+
A huge part of Lion consists of its form system and components.
|
|
19
|
+
|
|
20
|
+
This [presentation about accessible form components](https://github.com/home/runner/work/lion/lion/_merged_assets/_static/theoryOfFormsLion.pdf) explains how accesibility is built-in in all form components.
|
|
21
|
+
|
|
22
|
+
## SlotMixin
|
|
23
|
+
|
|
24
|
+
Internally, we delegate all intricacies involved in managing light dom to SlotMixin.
|
|
25
|
+
SlotMixin automatically mediates between light dom provided by the user ('public slots') and light dom provided by the component author ('private slots').
|
|
26
|
+
Also, SlotMixin allows to hook into the reactive update loop of LitElement (automatically rerendering on property changes) and it automatically respects
|
|
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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/core/SlotMixin.md)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Systems >> Core >> SlotMixin ||20
|
|
2
|
+
|
|
3
|
+
The SlotMixin is made for solving accessibility challenges that inherently come with the usage of shadow dom.
|
|
4
|
+
Until [AOM](https://wicg.github.io/aom/explainer.html) is in place, it is not possible to create relations between different shadow doms.
|
|
5
|
+
The need for this can occur in the following situations:
|
|
6
|
+
|
|
7
|
+
- A user-defined slot. For instance:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<my-input>
|
|
11
|
+
<div slot="help-text">Input description</div>
|
|
12
|
+
</my-input>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The help text here needs to be connected to the input element that may live in shadow dom. The input needs to have `aria-describedby="help-text-id".`
|
|
16
|
+
|
|
17
|
+
- An interplay of multiple nested web components. For instance:
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<my-fieldset>
|
|
21
|
+
<my-input><input aria-describedby="parent-msg" /></my-input>
|
|
22
|
+
<my-input><input aria-describedby="parent-msg" /></my-input>
|
|
23
|
+
<div id="parent-msg">Group errror message</div>
|
|
24
|
+
</my-fieldset>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
In the case above, all inputs need to be able to refer the error message of their parent.
|
|
28
|
+
|
|
29
|
+
**In a nutshell**: SlotMixin helps you with everything related to rendering light dom (i.e. rendering to slots).
|
|
30
|
+
You can build accessible ui components with ease, while delegating all edge cases to SlotMixin.
|
|
31
|
+
|
|
32
|
+
Edge cases that SlotMixin solves:
|
|
33
|
+
|
|
34
|
+
- **mediates** between light dom provided by the user ('public slots') and light dom provided by the component author ('private slots').
|
|
35
|
+
- allows to hook into the reactive update loop of LitElement (**rerendering** on property changes)
|
|
36
|
+
- respects the **scoped registry** belonging to the shadow root.
|
|
37
|
+
|
|
38
|
+
## The api
|
|
39
|
+
|
|
40
|
+
So, what does the api look like? SlotMixin can be used like this:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
class MyAccessibleControl extends SlotMixin(LitElement) {
|
|
44
|
+
get slots() {
|
|
45
|
+
return {
|
|
46
|
+
...super.slots,
|
|
47
|
+
'public-element-slot': () => document.createElement('input'),
|
|
48
|
+
'_private-template-slot': () => html`<wc-rendered-to-light-dom></wc-rendered-to-light-dom>`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## SlotFunctionResults
|
|
55
|
+
|
|
56
|
+
The `SlotFunctionResult` is the output of the functions provided in `get slots()`. It can output these four types, which are explained in detail below:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
Element | TemplateResult | SlotRerenderObject | undefined;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Below configuration gives an example of all of them, after which we explain when each type should be used
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
class MyAccessibleControl extends SlotMixin(LitElement) {
|
|
66
|
+
get slots() {
|
|
67
|
+
return {
|
|
68
|
+
...super.slots,
|
|
69
|
+
// Element
|
|
70
|
+
'public-element-slot': () => document.createElement('input'),
|
|
71
|
+
// TemplateResult
|
|
72
|
+
'_private-template-slot': () => html`<wc-rendered-to-light-dom></wc-rendered-to-light-dom>`,
|
|
73
|
+
// SlotRerenderObject
|
|
74
|
+
'rerenderable-slot': () => {
|
|
75
|
+
return {
|
|
76
|
+
template: html`<w-c>${this.litProperty}</w-c>`,
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
// undefined (conditional slot)
|
|
80
|
+
'' => () => {
|
|
81
|
+
if (conditionApplies) {
|
|
82
|
+
return html`<div>default slot</div>`;
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Element
|
|
92
|
+
|
|
93
|
+
For simple cases, an element can be returned. Use this when no web component is needed.
|
|
94
|
+
|
|
95
|
+
### TemplateResult
|
|
96
|
+
|
|
97
|
+
Return a TemplateResult when you need web components in your light dom. They will be automatically scoped correctly (to the scoped registry belonging to your shadowRoot)
|
|
98
|
+
If your template needs to rerender as well, use a `SlotRerenderObject`.
|
|
99
|
+
|
|
100
|
+
### SlotRerenderObject
|
|
101
|
+
|
|
102
|
+
A `SlotRerenderObject` looks like this:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
{
|
|
106
|
+
template: TemplateResult;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
It is meant for complex templates that need rerenders and are bound to the [reactive update cycle](https://lit.dev/docs/components/lifecycle/#reactive-update-cycle). The same lifecycle hooks (for instance `updated`) can be used as with templates rendered to the shadow root (via the regular render function).
|
|
111
|
+
For rerendering to work predictably (no focus and other interaction issues), the slot will be created within a wrapper div.
|
|
112
|
+
|
|
113
|
+
### Undefined
|
|
114
|
+
|
|
115
|
+
Whether the slot should be rendered can be dependent on a global or instance configuration.
|
|
116
|
+
When `undefined` or nothing (implicitly `undefined`) is returned, SlotMixin will not render the slot
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
if (this.conditionApplies) {
|
|
120
|
+
// Here we can return `Element | TemplateResult | SlotRerenderObject`
|
|
121
|
+
return html`<div>default slot</div>`;
|
|
122
|
+
}
|
|
123
|
+
return undefined;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Private and public slots
|
|
127
|
+
|
|
128
|
+
Some elements provide a property/attribute api with a fallback to content projection as a means to provide more advanced html.
|
|
129
|
+
For instance, a simple text label is provided like this:
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<my-input label="My label"></my-input>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
A more advanced label (using html that can't be provided via a string) can be provided like this:
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<my-input>
|
|
139
|
+
<label slot="label"><my-icon aria-hidden="true"></my-icon>My label</label>
|
|
140
|
+
</my-input>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
In the property/attribute case, SlotMixin adds the `<label slot="label">` under the hood, **unless** the developer already provided the slot.
|
|
144
|
+
This will make sure that the slot provided by the user always takes precedence and only one slot instance will be available in light dom per slot.
|
|
145
|
+
|
|
146
|
+
### Default slot
|
|
147
|
+
|
|
148
|
+
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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)
|
|
@@ -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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/formatting-and-parsing.md) of view values.
|
|
24
|
+
- Advanced [validation](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/validate.md) possibilities.
|
|
25
|
+
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input/overview.md), a wrapper for `<input>`.
|
|
35
|
+
- [LionTextarea](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/textarea/overview.md), a wrapper for `<textarea>`.
|
|
36
|
+
- [LionSelect](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/combobox/overview.md), a custom implementation of a combobox.
|
|
43
|
+
- [LionDate](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-date/overview.md), an alternative for `<input type="date">`.
|
|
44
|
+
- [LionDatepicker](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/listbox/overview.md), a custom implementation of a listbox.
|
|
46
|
+
- [LionInputAmount](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-amount/overview.md), an alternative for `<input type="number">` special for amounts.
|
|
47
|
+
- [LionInputEmail](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-email/overview.md), an alternative for `<input type="email">`.
|
|
48
|
+
- [LionInputIban](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-iban/overview.md), an ING specific for an input with IBAN numbers.
|
|
49
|
+
- [LionInputRange](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-range/overview.md), an alternative for `<input type="range">`.
|
|
50
|
+
- [LionInputStepper](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/input-stepper/overview.md), an alternative for `<input type="number">`.
|
|
51
|
+
- [LionSelectRich](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/radio-group/overview.md), a wrapper for `<input type="radio">`.
|
|
60
|
+
- [LionSwitch](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/fieldset/overview.md), a wrapper around multiple input fields or other fieldsets.
|
|
73
|
+
- [LionForm](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/form/overview.md), enhances the functionality of the native `<form>` component.
|
|
74
|
+
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/components/checkbox-group/overview.md), a wrapper component for multiple checkboxes.
|
|
75
|
+
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/model-value.md)
|
|
80
|
+
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
81
|
+
- [Interaction states](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/interaction-states.md)
|
|
82
|
+
- [Validation System](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/validate.md)
|
|
@@ -16,6 +16,7 @@ import '@lion/ui/define/lion-input-amount.js';
|
|
|
16
16
|
import '@lion/ui/define/lion-input-date.js';
|
|
17
17
|
import '@lion/ui/define/lion-input-datepicker.js';
|
|
18
18
|
import '@lion/ui/define/lion-input-email.js';
|
|
19
|
+
import '@lion/ui/define/lion-input-file.js';
|
|
19
20
|
import '@lion/ui/define/lion-input-tel.js';
|
|
20
21
|
import '@lion/ui/define/lion-input-tel-dropdown.js';
|
|
21
22
|
import '@lion/ui/define/lion-input-iban.js';
|
|
@@ -75,6 +76,7 @@ export const main = () => {
|
|
|
75
76
|
<lion-input-amount name="money" label="Money"></lion-input-amount>
|
|
76
77
|
<lion-input-iban name="iban" label="Iban"></lion-input-iban>
|
|
77
78
|
<lion-input-email name="email" label="Email"></lion-input-email>
|
|
79
|
+
<lion-input-file name="file" label="File"></lion-input-file>
|
|
78
80
|
<lion-input-tel name="tel" label="Telephone number"></lion-input-tel>
|
|
79
81
|
<lion-checkbox-group
|
|
80
82
|
label="What do you like?"
|
|
@@ -58,7 +58,7 @@ Validation happens on every change of `modelValue`. A change in modelValue can b
|
|
|
58
58
|
|
|
59
59
|
## When validation feedback will be shown
|
|
60
60
|
|
|
61
|
-
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/
|
|
61
|
+
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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/form/interaction-states.md),
|
|
62
62
|
validity states can determine whether a validation message should be shown along the input field.
|
|
63
63
|
|
|
64
64
|
## Assessing field validation state programmatically
|
|
@@ -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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/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/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/localize/text.md) | Load and translate text in multiple languages |
|
|
19
|
+
| [Format Numbers](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/localize/numbers.md) | Format numbers in multiple languages |
|
|
20
|
+
| [Format Dates](https://github.com/ing-bank/lion/blob/951de3e9b282ce8b8797f9aae890f125f96ee5ce/docs/fundamentals/systems/localize/dates.md) | Format dates in multiple languages |
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
eleventyExcludeFromCollections: true
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Systems >> Overlays >> Configuration >> Positioning ||40
|
|
6
|
+
|
|
7
|
+
```js script
|
|
8
|
+
import { html, render, LitElement } from '@mdjs/mdjs-preview';
|
|
9
|
+
import { ref, createRef } from 'lit/directives/ref.js';
|
|
10
|
+
import './assets/demo-el-using-overlaymixin.mjs';
|
|
11
|
+
import './assets/applyDemoOverlayStyles.mjs';
|
|
12
|
+
import './assets/demo-overlay-positioning.mjs';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Overlays can have two different placement modes: relative to their anchor element and relative to the viewport.
|
|
16
|
+
Depending on screen size and viewing device, one placement mode might be suited better than the other.
|
|
17
|
+
|
|
18
|
+
> Note that, the placementMode option has the values 'local' (anchor) and 'global' (viewport). These refer to their
|
|
19
|
+
> legacy position in dom (global overlays were put in the body of the page). Since overlays are built with the native `<dialog>` element,
|
|
20
|
+
> no content is moved around anymore, so their names are a bit less intuitive.
|
|
21
|
+
|
|
22
|
+
## Relative to anchor
|
|
23
|
+
|
|
24
|
+
An anchor is usually the invoker button, it can also be a non interactive reference element.
|
|
25
|
+
Anchor placement uses Popper under the hood. It supports 9 positions:
|
|
26
|
+
`top-start`, `top`, `top-end`, `right-start`, `right`, `right-end`, `bottom-start`, `bottom`, `bottom-end`, `left-start`,`left`,`left-end`
|
|
27
|
+
|
|
28
|
+
```js story
|
|
29
|
+
export const localPositioning = () => html`<demo-overlay-positioning></demo-overlay-positioning>`;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Relative to viewport
|
|
33
|
+
|
|
34
|
+
Viewport placement uses the flexbox layout mode, leveraging the best browser capabilities when
|
|
35
|
+
the content or screen size updates.
|
|
36
|
+
Supported modes:
|
|
37
|
+
`center`, `top-left`, `top`, `top-right`, `right`, `bottom-right`, `bottom`, `bottom-left`, `left`
|
|
38
|
+
|
|
39
|
+
```js story
|
|
40
|
+
export const globalPositioning = () =>
|
|
41
|
+
html`<demo-overlay-positioning
|
|
42
|
+
placement-mode="global"
|
|
43
|
+
simulate-viewport
|
|
44
|
+
></demo-overlay-positioning>`;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## placementMode
|
|
48
|
+
|
|
49
|
+
The `placementMode` property determines the positioning of the `contentNode`:
|
|
50
|
+
|
|
51
|
+
- next to its reference node: `local`
|
|
52
|
+
- relative to the viewport: `global`
|
|
53
|
+
|
|
54
|
+
### Local
|
|
55
|
+
|
|
56
|
+
<!-- By default, the [`referenceNode`](./configuration-elements#referencenode) is the [invokerNode](https://github.com/home/runner/work/lion/lion/configuration-elements#invokernode). -->
|
|
57
|
+
|
|
58
|
+
```js story
|
|
59
|
+
export const placementLocal = () => {
|
|
60
|
+
const placementModeLocalConfig = { placementMode: 'local' };
|
|
61
|
+
return html`
|
|
62
|
+
<demo-el-using-overlaymixin .config=${placementModeLocalConfig}>
|
|
63
|
+
<button slot="invoker">Click me to open the local overlay!</button>
|
|
64
|
+
<div slot="content" class="demo-overlay">
|
|
65
|
+
Hello! You can close this notification here:
|
|
66
|
+
<button
|
|
67
|
+
class="close-button"
|
|
68
|
+
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
69
|
+
>
|
|
70
|
+
⨯
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</demo-el-using-overlaymixin>
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Global
|
|
79
|
+
|
|
80
|
+
```js story
|
|
81
|
+
export const placementGlobal = () => {
|
|
82
|
+
const placementModeGlobalConfig = { placementMode: 'global' };
|
|
83
|
+
return html`
|
|
84
|
+
<demo-el-using-overlaymixin .config=${placementModeGlobalConfig}>
|
|
85
|
+
<button slot="invoker">Click me to open the global overlay!</button>
|
|
86
|
+
<div slot="content" class="demo-overlay">
|
|
87
|
+
Hello! You can close this notification here:
|
|
88
|
+
<button
|
|
89
|
+
class="close-button"
|
|
90
|
+
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
91
|
+
>
|
|
92
|
+
⨯
|
|
93
|
+
</button>
|
|
94
|
+
</div>
|
|
95
|
+
</demo-el-using-overlaymixin>
|
|
96
|
+
`;
|
|
97
|
+
};
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## popperConfig
|
|
101
|
+
|
|
102
|
+
/** Viewport configuration. Will be used when placementMode is 'global' \*/
|
|
103
|
+
viewportConfig?: ViewportConfig;
|
|
104
|
+
/** Hides other overlays when multiple are opened (currently exclusive to globalOverlayController) _/
|
|
105
|
+
isBlocking?: boolean;
|
|
106
|
+
/\*\* Will align contentNode with referenceNode (invokerNode by default) for local overlays. Usually needed for dropdowns. 'max' will prevent contentNode from exceeding width of referenceNode, 'min' guarantees that contentNode will be at least as wide as referenceNode. 'full' will make sure that the invoker width always is the same. _/
|
|
107
|
+
inheritsReferenceWidth?: 'max' | 'full' | 'min' | 'none';
|
|
108
|
+
/\*_ Change the default of 9999 _/
|
|
109
|
+
zIndex?: number;
|
|
110
|
+
|
|
111
|
+
| Prop | Description | Type | | | |
|
|
112
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | --- | --- | --- |
|
|
113
|
+
| placementMode | Determines the positioning anchor (viewport vs invokerNode/referenceNode) | 'global'\|'local' | | | |
|
|
114
|
+
| viewportConfig | Viewport positioning configuration. Will be used when placementMode is 'global' | {placement: ViewportPlacement} | | | |
|
|
115
|
+
| popperConfig | Anchor positioning configuration. Will be used when placementMode is 'local' | | | | |
|
|
116
|
+
| inheritsReferenceWidth | Will align contentNode with referenceNode for local overlays. Usually needed for dropdowns. 'max' will prevent contentNode from exceeding width of referenceNode, 'min' guarantees that contentNode will be at least as wide as referenceNode. 'full' will make sure that the invoker width always is the same. | 'max' \| 'full' \| 'min' \| 'none' | | | |
|