@lion/ui 0.6.0-beta.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/form-core/src/choice-group/ChoiceGroupMixin.js +10 -1
- package/components/form-core/src/validate/ValidateMixin.js +10 -0
- package/components/form-core/src/validate/Validator.js +6 -3
- package/components/form-core/test-suites/FormRegistrationMixins.suite.js +7 -7
- package/components/form-core/types/FormControlMixinTypes.ts +2 -0
- package/components/form-core/types/validate/ValidateMixinTypes.ts +2 -0
- package/components/form-core/types/validate/validate.ts +2 -2
- package/components/input-file/src/LionInputFile.js +7 -1
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +11 -3
- package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +110 -2
- package/components/input-tel-dropdown/test-helpers/mimicUserChangingDropdown.js +22 -0
- package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +1 -38
- package/components/localize/src/LocalizeMixin.js +2 -2
- package/components/overlays/src/OverlayController.js +1 -1
- package/components/select/src/LionSelect.js +5 -0
- package/components/validate-messages/src/getLocalizedMessage.js +12 -1
- package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.js +105 -0
- package/components/validate-messages/translations/bg.js +4 -0
- package/components/validate-messages/translations/cs.js +4 -0
- package/components/validate-messages/translations/de.js +4 -0
- package/components/validate-messages/translations/en.js +5 -1
- package/components/validate-messages/translations/es.js +4 -0
- package/components/validate-messages/translations/fr.js +4 -0
- package/components/validate-messages/translations/hu.js +4 -0
- package/components/validate-messages/translations/it.js +4 -0
- package/components/validate-messages/translations/nl.js +4 -0
- package/components/validate-messages/translations/pl.js +4 -0
- package/components/validate-messages/translations/ro.js +4 -0
- package/components/validate-messages/translations/ru.js +4 -0
- package/components/validate-messages/translations/sk.js +4 -0
- package/components/validate-messages/translations/uk.js +4 -0
- package/components/validate-messages/translations/zh.js +4 -0
- package/custom-elements.json +4375 -1693
- package/dist-types/components/form-core/src/choice-group/ChoiceGroupMixin.d.ts +1 -0
- package/dist-types/components/form-core/src/choice-group/ChoiceGroupMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ValidateMixin.d.ts +1 -0
- package/dist-types/components/form-core/src/validate/ValidateMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/Validator.d.ts +5 -2
- package/dist-types/components/form-core/src/validate/Validator.d.ts.map +1 -1
- package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts +1 -0
- package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +1 -0
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-core/types/validate/validate.d.ts +2 -2
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/test-helpers/mimicUserChangingDropdown.d.ts +12 -0
- package/dist-types/components/input-tel-dropdown/test-helpers/mimicUserChangingDropdown.d.ts.map +1 -0
- package/dist-types/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.d.ts.map +1 -1
- package/dist-types/components/select/src/LionSelect.d.ts.map +1 -1
- package/dist-types/components/validate-messages/src/getLocalizedMessage.d.ts.map +1 -1
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.d.ts +4 -0
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.d.ts.map +1 -0
- package/dist-types/components/validate-messages/translations/bg-BG.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/bg.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/cs-CZ.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/cs.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/de-DE.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/de.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/en-AU.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/en-GB.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/en-PH.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/en-US.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/en.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/es-ES.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/es.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/fr-BE.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/fr-FR.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/fr.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/hu-HU.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/hu.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/it-IT.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/it.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/nl-BE.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/nl-NL.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/nl.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/pl-PL.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/pl.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/ro-RO.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/ro.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/ru-RU.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/ru.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/sk-SK.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/sk.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/uk-UA.d.ts +4 -0
- package/dist-types/components/validate-messages/translations/uk.d.ts +6 -0
- package/dist-types/components/validate-messages/translations/zh.d.ts +6 -0
- package/dist-types/exports/input-tel-dropdown-test-helpers.d.ts +2 -0
- package/dist-types/exports/input-tel-dropdown-test-helpers.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/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-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-file/use-cases.md +8 -8
- 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/overview.md +1 -1
- package/docs/components/listbox/use-cases.md +90 -95
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/use-cases.md +34 -33
- 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 +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/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 +34 -39
- package/docs/fundamentals/systems/form/validate.md +7 -4
- 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/ajax/overview.md +2 -1
- 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/exports/input-tel-dropdown-test-helpers.js +1 -0
- package/input-tel-dropdown-test-helpers.js +1 -0
- package/package.json +1 -1
- package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.js +0 -51
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts +0 -2
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts.map +0 -1
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
```js script
|
|
4
4
|
import { html } from '@mdjs/mdjs-preview';
|
|
5
5
|
import { listboxData } from './src/listboxData.js';
|
|
6
|
+
import { Required } from '@lion/ui/form-core.js';
|
|
7
|
+
import { loadDefaultFeedbackMessages } from '@lion/ui/validate-messages.js';
|
|
6
8
|
import '@lion/ui/define/lion-listbox.js';
|
|
7
9
|
import '@lion/ui/define/lion-option.js';
|
|
10
|
+
loadDefaultFeedbackMessages();
|
|
8
11
|
```
|
|
9
12
|
|
|
10
13
|
## Multiple choice
|
|
@@ -16,21 +19,19 @@ This will:
|
|
|
16
19
|
- display a list of selected option representations next to the text box
|
|
17
20
|
- make the value of type `Array` instead of `String`
|
|
18
21
|
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
<lion-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</lion-listbox>
|
|
33
|
-
`;
|
|
22
|
+
```html preview-story
|
|
23
|
+
<lion-listbox name="combo" label="Multiple" multiple-choice>
|
|
24
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
25
|
+
<lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
|
|
26
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
27
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
28
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
29
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
30
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
31
|
+
<lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
|
|
32
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
33
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
34
|
+
</lion-listbox>
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
## Orientation
|
|
@@ -39,45 +40,41 @@ When `orientation="horizontal"`, left and right arrow keys will be enabled, plus
|
|
|
39
40
|
will be informed about the direction of the options.
|
|
40
41
|
By default, `orientation="vertical"` is set, which enables up and down arrow keys.
|
|
41
42
|
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
<lion-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</lion-listbox>
|
|
56
|
-
`;
|
|
43
|
+
```html preview-story
|
|
44
|
+
<lion-listbox name="combo" label="Orientation horizontal" orientation="horizontal">
|
|
45
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
46
|
+
<lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
|
|
47
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
48
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
49
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
50
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
51
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
52
|
+
<lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
|
|
53
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
54
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
55
|
+
</lion-listbox>
|
|
57
56
|
```
|
|
58
57
|
|
|
59
58
|
With `multiple-choice` flag configured, multiple options can be checked.
|
|
60
59
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</lion-listbox>
|
|
80
|
-
`;
|
|
60
|
+
```html preview-story
|
|
61
|
+
<lion-listbox
|
|
62
|
+
name="combo"
|
|
63
|
+
label="Orientation horizontal multiple"
|
|
64
|
+
orientation="horizontal"
|
|
65
|
+
multiple-choice
|
|
66
|
+
>
|
|
67
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
68
|
+
<lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
|
|
69
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
70
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
71
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
72
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
73
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
74
|
+
<lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
|
|
75
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
76
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
77
|
+
</lion-listbox>
|
|
81
78
|
```
|
|
82
79
|
|
|
83
80
|
## Selection-follows-focus
|
|
@@ -87,61 +84,59 @@ This behavior can usually be seen in `<select>` on the Windows platform.
|
|
|
87
84
|
Note that this behavior cannot be used when multiple-choice is true.
|
|
88
85
|
See [wai aria spec](https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus)
|
|
89
86
|
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
<lion-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</lion-listbox>
|
|
104
|
-
`;
|
|
87
|
+
```html preview-story
|
|
88
|
+
<lion-listbox name="combo" label="Selection follows focus" selection-follows-focus>
|
|
89
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
90
|
+
<lion-option .choiceValue=${'Artichoke'} disabled>Artichoke</lion-option>
|
|
91
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
92
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
93
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
94
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
95
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
96
|
+
<lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
|
|
97
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
98
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
99
|
+
</lion-listbox>
|
|
105
100
|
```
|
|
106
101
|
|
|
107
102
|
## Rotate keyboard navigation
|
|
108
103
|
|
|
109
104
|
`rotate-keyboard-navigation` attribute on the listbox will give the first option active state when navigated to the next option from last option.
|
|
110
105
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
<lion-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</lion-listbox>
|
|
125
|
-
`;
|
|
106
|
+
```html preview-story
|
|
107
|
+
<lion-listbox name="combo" label="Rotate keyboard navigation" rotate-keyboard-navigation>
|
|
108
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
109
|
+
<lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
|
|
110
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
111
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
112
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
113
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
114
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
115
|
+
<lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
|
|
116
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
117
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
118
|
+
</lion-listbox>
|
|
126
119
|
```
|
|
127
120
|
|
|
128
121
|
## Disabled options
|
|
129
122
|
|
|
130
123
|
Navigation will skip over disabled options. Let's disable Artichoke and Brussel sprout, because they're gross.
|
|
131
124
|
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
<lion-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</lion-listbox>
|
|
146
|
-
`;
|
|
125
|
+
```html preview-story
|
|
126
|
+
<lion-listbox name="combo" label="Rotate with disabled options" rotate-keyboard-navigation>
|
|
127
|
+
<lion-option .choiceValue=${'Apple'}>Apple</lion-option>
|
|
128
|
+
<lion-option .choiceValue=${'Artichoke'} disabled>Artichoke</lion-option>
|
|
129
|
+
<lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
|
|
130
|
+
<lion-option .choiceValue=${'Banana'}>Banana</lion-option>
|
|
131
|
+
<lion-option .choiceValue=${'Beets'}>Beets</lion-option>
|
|
132
|
+
<lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
|
|
133
|
+
<lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
|
|
134
|
+
<lion-option .choiceValue=${'Brussels sprout'} disabled>Brussels sprout</lion-option>
|
|
135
|
+
<lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
|
|
136
|
+
<lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
|
|
137
|
+
</lion-listbox>
|
|
147
138
|
```
|
|
139
|
+
|
|
140
|
+
## Validation
|
|
141
|
+
|
|
142
|
+
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/systems/form/validate.md).
|
|
@@ -20,12 +20,12 @@ export const main = () => html`
|
|
|
20
20
|
`;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
24
|
-
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- Make sure that to use a name attribute as it is necessary for our [form](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/components/form/overview.md)'s serialization result.
|
|
24
|
+
- If you have many options for a user to pick from, consider using our [select](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/components/select/overview.md) instead.
|
|
25
25
|
|
|
26
26
|
## Features
|
|
27
27
|
|
|
28
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/components/fieldset/overview.md), it has all the features a fieldset has.
|
|
29
29
|
|
|
30
30
|
- Get or set the checked value of the group:
|
|
31
31
|
- modelValue (default) - `checkedValue()`
|
|
@@ -2,54 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
```js script
|
|
4
4
|
import { html } from '@mdjs/mdjs-preview';
|
|
5
|
+
import { Required } from '@lion/ui/form-core.js';
|
|
6
|
+
import { loadDefaultFeedbackMessages } from '@lion/ui/validate-messages.js';
|
|
5
7
|
import '@lion/ui/define/lion-select.js';
|
|
8
|
+
loadDefaultFeedbackMessages();
|
|
6
9
|
```
|
|
7
10
|
|
|
8
11
|
## Pre-select
|
|
9
12
|
|
|
10
13
|
You can preselect an option by setting the property modelValue.
|
|
11
14
|
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</lion-select>
|
|
22
|
-
`;
|
|
15
|
+
```html preview-story
|
|
16
|
+
<lion-select name="favoriteColor" label="Favorite color" .modelValue=${'hotpink'}>
|
|
17
|
+
<select slot="input">
|
|
18
|
+
<option selected hidden value>Please select</option>
|
|
19
|
+
<option value="red">Red</option>
|
|
20
|
+
<option value="hotpink">Hotpink</option>
|
|
21
|
+
<option value="teal">Teal</option>
|
|
22
|
+
</select>
|
|
23
|
+
</lion-select>
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
## Disabled
|
|
26
27
|
|
|
27
28
|
You can disable an option by adding the `disabled` attribute to an option.
|
|
28
29
|
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</lion-select>
|
|
39
|
-
`;
|
|
30
|
+
```html preview-story
|
|
31
|
+
<lion-select name="favoriteColor" label="Favorite color">
|
|
32
|
+
<select slot="input">
|
|
33
|
+
<option selected hidden value>Please select</option>
|
|
34
|
+
<option value="red">Red</option>
|
|
35
|
+
<option value="hotpink" disabled>Hotpink</option>
|
|
36
|
+
<option value="teal">Teal</option>
|
|
37
|
+
</select>
|
|
38
|
+
</lion-select>
|
|
40
39
|
```
|
|
41
40
|
|
|
42
41
|
Or by setting the `disabled` attribute on the entire `lion-select` field.
|
|
43
42
|
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</lion-select>
|
|
54
|
-
`;
|
|
43
|
+
```html preview-story
|
|
44
|
+
<lion-select name="favoriteColor" label="Favorite color" disabled>
|
|
45
|
+
<select slot="input">
|
|
46
|
+
<option selected hidden value>Please select</option>
|
|
47
|
+
<option value="red">Red</option>
|
|
48
|
+
<option value="hotpink">Hotpink</option>
|
|
49
|
+
<option value="teal">Teal</option>
|
|
50
|
+
</select>
|
|
51
|
+
</lion-select>
|
|
55
52
|
```
|
|
53
|
+
|
|
54
|
+
## Validation
|
|
55
|
+
|
|
56
|
+
A validator can be used to make it e.g. `required`. If you want to know how to do that, please take a look at our [validation examples](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/systems/form/validate.md).
|
|
@@ -302,7 +302,7 @@ LionSelectRich will give it acces to:
|
|
|
302
302
|
- LionSelectRich itself, via `.hostElement`
|
|
303
303
|
|
|
304
304
|
Code of an advanced custom invoker is shown below (this is the code for the
|
|
305
|
-
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/
|
|
305
|
+
invoker used in [IntlSelectRich](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/components/select-rich/examples.md)).
|
|
306
306
|
The invoker is usually added in the invoker slot of the LionSelectRich subclass.
|
|
307
307
|
However, it would also be possible for an application developer to provide the invoker
|
|
308
308
|
by putting it in light dom:
|
|
@@ -9,7 +9,7 @@ import './src/lea-tab-panel.js';
|
|
|
9
9
|
|
|
10
10
|
## Lea Tabs
|
|
11
11
|
|
|
12
|
-
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
Learn how to create the `lea tabs` in our ["introducing lion" blogpost](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/blog/ing-open-sources-lion.md).
|
|
13
13
|
|
|
14
14
|
```js preview-story
|
|
15
15
|
export const main = () => html`
|
|
@@ -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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/rationales/side-effects.md) <br>
|
|
19
19
|
The reasoning behind some of our decisions.
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
### referenceCollections
|
|
46
46
|
|
|
47
47
|
A list of file system paths. They can be defined relative from the current project root or they can be full paths.
|
|
48
|
-
When a [MatchAnalyzer](https://github.com/ing-bank/lion/blob/
|
|
48
|
+
When a [MatchAnalyzer](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/node-tools/providence-analytics/analyzer.md) like `match-imports` or `match-subclasses` is used, the default reference(s) can be configured here. For instance: ['/path/to/@lion/ui/form.js']
|
|
49
49
|
|
|
50
50
|
An example:
|
|
51
51
|
|
|
@@ -108,4 +108,4 @@ QueryOutput structure could be simplified in the future.
|
|
|
108
108
|
|
|
109
109
|
The output files stored in the file system always need to be machine independent:
|
|
110
110
|
this means that all machine specific information, like a complete filepath, needs to be removed from a QueryOutput (paths relative from project root are still allowed).
|
|
111
|
-
In that way, the caching mechanism (based on hash comparisons) as described in [Analyzer](https://github.com/ing-bank/lion/blob/
|
|
111
|
+
In that way, the caching mechanism (based on hash comparisons) as described in [Analyzer](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/node-tools/providence-analytics/analyzer.md) is guaranteed to work across different machines.
|
|
@@ -7,7 +7,7 @@ A few examples are:
|
|
|
7
7
|
- find-exports
|
|
8
8
|
- match-imports
|
|
9
9
|
|
|
10
|
-
An analyzer will give back a [QueryResult](https://github.com/ing-bank/lion/blob/
|
|
10
|
+
An analyzer will give back a [QueryResult](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/node-tools/providence-analytics/QueryResult.md) that will be written to the file system by Providence.
|
|
11
11
|
All analyzers need to extend from the `Analyzer` base class, found in `src/program/analyzers/helpers`.
|
|
12
12
|
|
|
13
13
|
## Public api
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Node Tools >> Providence Analytics >> Dashboard ||30
|
|
2
2
|
|
|
3
|
-
An interactive overview of all aggregated [QueryResults](https://github.com/ing-bank/lion/blob/
|
|
3
|
+
An interactive overview of all aggregated [QueryResults](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/node-tools/providence-analytics/QueryResult.md) can be found in the dashboard.
|
|
4
4
|
The dashboard is a small nodejs server (based on es-dev-server + middleware) and a frontend
|
|
5
5
|
application.
|
|
6
6
|
|
|
@@ -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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/node-tools/remark-extend/overview.md).
|
|
42
42
|
|
|
43
43
|
As an example you can create `docs/components/tabs/overview.md`.
|
|
44
44
|
|
|
@@ -25,4 +25,4 @@ Internally, we delegate all intricacies involved in managing light dom to SlotMi
|
|
|
25
25
|
SlotMixin automatically mediates between light dom provided by the user ('public slots') and light dom provided by the component author ('private slots').
|
|
26
26
|
Also, SlotMixin allows to hook into the reactive update loop of LitElement (automatically rerendering on property changes) and it automatically respects
|
|
27
27
|
the scoped registry belonging to the shadow root.
|
|
28
|
-
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/
|
|
28
|
+
More details about SlotMixin can be found in the [SlotMixin documentation](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/systems/core/SlotMixin.md)
|
|
@@ -152,4 +152,4 @@ This will make sure that the slot provided by the user always takes precedence a
|
|
|
152
152
|
|
|
153
153
|
### Default slot
|
|
154
154
|
|
|
155
|
-
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/
|
|
155
|
+
As can be seen in the example of [SlotFunctionResults](https://github.com/ing-bank/lion/blob/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/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/79a64674f8f644efe0468e5518c8cd5499c8a7cd/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
25
25
|
|
|
26
26
|
### Event meta
|
|
27
27
|
|