@lion/ui 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +39 -16
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +189 -1
- package/components/form-core/src/FocusMixin.js +4 -4
- package/components/form-core/src/LionField.js +1 -1
- package/components/input-amount/test/lion-input-amount.test.js +48 -1
- package/components/input-amount/test/parsers.test.js +1 -1
- package/components/localize/src/number/parseNumber.js +21 -12
- package/components/localize/test/number/parseNumber.test.js +1 -1
- package/components/localize/types/LocalizeMixinTypes.ts +0 -5
- package/components/select-rich/src/LionSelectRich.js +18 -2
- package/components/select-rich/test/lion-select-rich-interaction.test.js +139 -20
- package/components/select-rich/test/lion-select-rich.test.js +13 -1
- package/components/validate-messages/translations/pl.js +4 -4
- package/custom-elements.json +47661 -47626
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +10 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +0 -4
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +6 -6
- package/docs/components/button/api-table.md +27 -30
- package/docs/components/calendar/api-table.md +13 -13
- package/docs/components/checkbox-group/api-table.md +305 -329
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +5 -5
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +150 -154
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +12 -12
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +9 -10
- package/docs/components/fieldset/api-table.md +104 -118
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/form/use-cases.md +2 -2
- package/docs/components/icon/api-table.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/api-table.md +110 -120
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +129 -142
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +110 -120
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +148 -160
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +110 -120
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +132 -143
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +110 -120
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +116 -126
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +123 -133
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +118 -128
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/api-table.md +125 -135
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +126 -131
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/pagination/api-table.md +5 -5
- package/docs/components/progress-indicator/api-table.md +9 -10
- package/docs/components/radio-group/api-table.md +234 -258
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +106 -116
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +169 -178
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/steps/api-table.md +6 -6
- package/docs/components/switch/api-table.md +117 -128
- package/docs/components/tabs/api-table.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +114 -124
- package/docs/components/tooltip/api-table.md +13 -13
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/api-table.md +8 -11
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/api-table.md +77 -82
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +2 -2
- package/docs/fundamentals/systems/localize/api-table.md +19 -19
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +45 -46
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,24 @@ function mimicKeyPress(el, key, code = '') {
|
|
|
24
24
|
el.dispatchEvent(new KeyboardEvent('keyup', { key, code }));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* @param {LionOption[]} options
|
|
29
|
+
* @param {number} selectedIndex
|
|
30
|
+
*/
|
|
31
|
+
function expectOnlyGivenOneOptionToBeChecked(options, selectedIndex) {
|
|
32
|
+
/**
|
|
33
|
+
* @param {{ checked: any; }} option
|
|
34
|
+
* @param {any} i
|
|
35
|
+
*/
|
|
36
|
+
options.forEach((option, i) => {
|
|
37
|
+
if (i === selectedIndex) {
|
|
38
|
+
expect(option.checked).to.be.true;
|
|
39
|
+
} else {
|
|
40
|
+
expect(option.checked).to.be.false;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
describe('lion-select-rich interactions', () => {
|
|
28
46
|
describe('Interaction mode', () => {
|
|
29
47
|
it('autodetects interactionMode if not defined', async () => {
|
|
@@ -86,26 +104,91 @@ describe('lion-select-rich interactions', () => {
|
|
|
86
104
|
});
|
|
87
105
|
});
|
|
88
106
|
|
|
89
|
-
describe('Invoker Keyboard navigation
|
|
90
|
-
it('
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
107
|
+
describe('Invoker Keyboard navigation Mac', () => {
|
|
108
|
+
it('opens dropdown with [ArrowDown] [ArrowUp] keys or navigates through the listbox options', async () => {
|
|
109
|
+
const el = /** @type {LionSelectRich} */ (
|
|
110
|
+
await fixture(html`
|
|
111
|
+
<lion-select-rich interaction-mode="mac">
|
|
112
|
+
<lion-options slot="input">
|
|
113
|
+
<lion-option .choiceValue=${10}>Item 1</lion-option>
|
|
114
|
+
<lion-option .choiceValue=${20}>Item 2</lion-option>
|
|
115
|
+
<lion-option .choiceValue=${30}>Item 3</lion-option>
|
|
116
|
+
</lion-options>
|
|
117
|
+
</lion-select-rich>
|
|
118
|
+
`)
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const options = el.formElements;
|
|
122
|
+
expect(el.checkedIndex).to.equal(0);
|
|
123
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
124
|
+
|
|
125
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowDown' }));
|
|
126
|
+
|
|
127
|
+
expect(el.opened).to.be.true;
|
|
128
|
+
expect(el.checkedIndex).to.equal(0);
|
|
129
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
130
|
+
|
|
131
|
+
el.opened = false;
|
|
132
|
+
|
|
133
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowUp' }));
|
|
134
|
+
expect(el.opened).to.be.true;
|
|
135
|
+
expect(el.checkedIndex).to.equal(0);
|
|
136
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('does not open dropdown with [ArrowLeft] [ArrowRight] keys or navigates through the listbox options', async () => {
|
|
140
|
+
const el = /** @type {LionSelectRich} */ (
|
|
141
|
+
await fixture(html`
|
|
142
|
+
<lion-select-rich interaction-mode="mac">
|
|
143
|
+
<lion-options slot="input">
|
|
144
|
+
<lion-option .choiceValue=${10}>Item 1</lion-option>
|
|
145
|
+
<lion-option .choiceValue=${20}>Item 2</lion-option>
|
|
146
|
+
<lion-option .choiceValue=${30}>Item 3</lion-option>
|
|
147
|
+
</lion-options>
|
|
148
|
+
</lion-select-rich>
|
|
149
|
+
`)
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const options = el.formElements;
|
|
153
|
+
expect(el.checkedIndex).to.equal(0);
|
|
154
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
155
|
+
|
|
156
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowLeft' }));
|
|
157
|
+
|
|
158
|
+
expect(el.opened).to.be.false;
|
|
159
|
+
expect(el.checkedIndex).to.equal(0);
|
|
160
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
161
|
+
|
|
162
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowRight' }));
|
|
163
|
+
expect(el.opened).to.be.false;
|
|
164
|
+
expect(el.checkedIndex).to.equal(0);
|
|
165
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('checks a value with [character] keys while listbox unopened', async () => {
|
|
169
|
+
const el = /** @type {LionSelectRich} */ (
|
|
170
|
+
await fixture(html`
|
|
171
|
+
<lion-select-rich interaction-mode="mac">
|
|
172
|
+
<lion-options slot="input">
|
|
173
|
+
<lion-option .choiceValue=${'red'}>Red</lion-option>
|
|
174
|
+
<lion-option .choiceValue=${'teal'}>Teal</lion-option>
|
|
175
|
+
<lion-option .choiceValue=${'turquoise'}>Turquoise</lion-option>
|
|
176
|
+
</lion-options>
|
|
177
|
+
</lion-select-rich>
|
|
178
|
+
`)
|
|
179
|
+
);
|
|
108
180
|
|
|
181
|
+
// @ts-ignore [allow-private] in test
|
|
182
|
+
mimicKeyPress(el, 't', 'KeyT');
|
|
183
|
+
expect(el.checkedIndex).to.equal(1);
|
|
184
|
+
|
|
185
|
+
mimicKeyPress(el, 'u', 'KeyU');
|
|
186
|
+
expect(el.checkedIndex).to.equal(2);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
describe('Invoker Keyboard navigation Windows/Linux', () => {
|
|
191
|
+
it('navigation through list with [ArrowDown] [ArrowUp] keys checks the option while listbox unopened', async () => {
|
|
109
192
|
let isTriggeredByUser;
|
|
110
193
|
const el = /** @type {LionSelectRich} */ (
|
|
111
194
|
await fixture(html`
|
|
@@ -141,7 +224,43 @@ describe('lion-select-rich interactions', () => {
|
|
|
141
224
|
expect(isTriggeredByUser).to.be.true;
|
|
142
225
|
});
|
|
143
226
|
|
|
144
|
-
it('
|
|
227
|
+
it('navigation through list with [ArrowLeft] [ArrowRight] keys checks the option while listbox unopened', async () => {
|
|
228
|
+
let isTriggeredByUser;
|
|
229
|
+
const el = /** @type {LionSelectRich} */ (
|
|
230
|
+
await fixture(html`
|
|
231
|
+
<lion-select-rich
|
|
232
|
+
interaction-mode="windows/linux"
|
|
233
|
+
@model-value-changed="${(/** @type {CustomEvent} */ event) => {
|
|
234
|
+
isTriggeredByUser = event.detail.isTriggeredByUser;
|
|
235
|
+
}}"
|
|
236
|
+
>
|
|
237
|
+
<lion-options slot="input">
|
|
238
|
+
<lion-option .choiceValue=${10}>Item 1</lion-option>
|
|
239
|
+
<lion-option .choiceValue=${20}>Item 2</lion-option>
|
|
240
|
+
<lion-option .choiceValue=${30}>Item 3</lion-option>
|
|
241
|
+
</lion-options>
|
|
242
|
+
</lion-select-rich>
|
|
243
|
+
`)
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
const options = el.formElements;
|
|
247
|
+
expect(el.checkedIndex).to.equal(0);
|
|
248
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
249
|
+
|
|
250
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowRight' }));
|
|
251
|
+
expect(el.checkedIndex).to.equal(1);
|
|
252
|
+
expectOnlyGivenOneOptionToBeChecked(options, 1);
|
|
253
|
+
expect(isTriggeredByUser).to.be.true;
|
|
254
|
+
|
|
255
|
+
isTriggeredByUser = false;
|
|
256
|
+
|
|
257
|
+
el.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowLeft' }));
|
|
258
|
+
expect(el.checkedIndex).to.equal(0);
|
|
259
|
+
expectOnlyGivenOneOptionToBeChecked(options, 0);
|
|
260
|
+
expect(isTriggeredByUser).to.be.true;
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('checks a value with [character] keys while listbox unopened', async () => {
|
|
145
264
|
const el = /** @type {LionSelectRich} */ (
|
|
146
265
|
await fixture(html`
|
|
147
266
|
<lion-select-rich interaction-mode="windows/linux">
|
|
@@ -342,7 +342,7 @@ describe('lion-select-rich', () => {
|
|
|
342
342
|
expect(elSingleoption.opened).to.be.false;
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
it('stays closed with [ArrowUp] or [ArrowDown] key in readonly mode', async () => {
|
|
345
|
+
it('stays closed with [ArrowUp] or [ArrowDown] key in readonly mode or has a single option', async () => {
|
|
346
346
|
const elReadOnly = await fixture(html`
|
|
347
347
|
<lion-select-rich readonly>
|
|
348
348
|
<lion-option .choiceValue=${10}>Item 1</lion-option>
|
|
@@ -350,11 +350,23 @@ describe('lion-select-rich', () => {
|
|
|
350
350
|
</lion-select-rich>
|
|
351
351
|
`);
|
|
352
352
|
|
|
353
|
+
const elSingleOption = await fixture(html`
|
|
354
|
+
<lion-select-rich>
|
|
355
|
+
<lion-option .choiceValue=${10}>Item 1</lion-option>
|
|
356
|
+
</lion-select-rich>
|
|
357
|
+
`);
|
|
358
|
+
|
|
353
359
|
elReadOnly.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowDown' }));
|
|
354
360
|
expect(elReadOnly.opened).to.be.false;
|
|
355
361
|
|
|
356
362
|
elReadOnly.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowUp' }));
|
|
357
363
|
expect(elReadOnly.opened).to.be.false;
|
|
364
|
+
|
|
365
|
+
elSingleOption.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowDown' }));
|
|
366
|
+
expect(elSingleOption.opened).to.be.false;
|
|
367
|
+
|
|
368
|
+
elSingleOption.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowUp' }));
|
|
369
|
+
expect(elSingleOption.opened).to.be.false;
|
|
358
370
|
});
|
|
359
371
|
|
|
360
372
|
it('sets inheritsReferenceWidth to min by default', async () => {
|
|
@@ -10,8 +10,8 @@ export default {
|
|
|
10
10
|
'Proszę podać prawidłową wartość {fieldName} (od {params.min} do {params.max} znaków).',
|
|
11
11
|
Pattern: 'Wprowadź prawidłową wartość w polu {fieldName}.',
|
|
12
12
|
IsNumber: 'Wprowadź prawidłową wartość w polu {fieldName}.',
|
|
13
|
-
MinNumber: 'Proszę podać wartość {fieldName} większą niż {params}.',
|
|
14
|
-
MaxNumber: 'Proszę podać wartość {fieldName} mniejszą niż {params}.',
|
|
13
|
+
MinNumber: 'Proszę podać wartość {fieldName} większą niż lub równą {params}.',
|
|
14
|
+
MaxNumber: 'Proszę podać wartość {fieldName} mniejszą niż lub równą {params}.',
|
|
15
15
|
MinMaxNumber: 'Proszę podać wartość {fieldName} o długości od {params.min} do {params.max}.',
|
|
16
16
|
IsDate: 'Wprowadź datę (DD MM RRRR).',
|
|
17
17
|
MinDate: 'Proszę podać wartość {fieldName} przypadającą po {params, date, YYYYMMDD}.',
|
|
@@ -32,8 +32,8 @@ export default {
|
|
|
32
32
|
MinMaxLength:
|
|
33
33
|
'Proszę podać prawidłową wartość {fieldName} (od {params.min} do {params.max} znaków).',
|
|
34
34
|
IsNumber: 'Wprowadź prawidłową wartość w polu {fieldName}.',
|
|
35
|
-
MinNumber: 'Proszę podać wartość {fieldName} większą niż {params}.',
|
|
36
|
-
MaxNumber: 'Proszę podać wartość {fieldName} mniejszą niż {params}.',
|
|
35
|
+
MinNumber: 'Proszę podać wartość {fieldName} większą niż lub równą {params}.',
|
|
36
|
+
MaxNumber: 'Proszę podać wartość {fieldName} mniejszą niż lub równą {params}.',
|
|
37
37
|
MinMaxNumber: 'Proszę podać wartość {fieldName} o długości od {params.min} do {params.max}.',
|
|
38
38
|
IsDate: 'Wprowadź datę (DD MM RRRR).',
|
|
39
39
|
MinDate: 'Proszę podać wartość {fieldName} przypadającą po {params, date, YYYYMMDD}.',
|