@lion/ui 0.7.3 → 0.7.4
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/combobox/src/LionCombobox.js +35 -22
- package/components/combobox/test/lion-combobox.test.js +109 -66
- package/components/form-core/src/FormControlMixin.js +0 -9
- package/components/form-core/src/localizeNamespaceLoader.js +75 -0
- package/components/form-core/src/registration/FormRegisteringMixin.js +28 -0
- package/components/form-core/src/validate/LionValidationFeedback.js +36 -2
- package/components/form-core/test/validate/lion-validation-feedback.test.js +30 -2
- package/components/form-core/test-suites/FormRegistrationMixins.suite.js +17 -0
- package/components/form-core/test-suites/ValidateMixin.suite.js +1 -1
- package/components/form-core/translations/bg-BG.js +5 -0
- package/components/form-core/translations/bg.js +6 -0
- package/components/form-core/translations/cs-CZ.js +5 -0
- package/components/form-core/translations/cs.js +6 -0
- package/components/form-core/translations/de-DE.js +5 -0
- package/components/form-core/translations/de.js +6 -0
- package/components/form-core/translations/en-AU.js +5 -0
- package/components/form-core/translations/en-GB.js +5 -0
- package/components/form-core/translations/en-US.js +5 -0
- package/components/form-core/translations/en.js +6 -0
- package/components/form-core/translations/es-ES.js +5 -0
- package/components/form-core/translations/es.js +6 -0
- package/components/form-core/translations/fr-BE.js +5 -0
- package/components/form-core/translations/fr-FR.js +5 -0
- package/components/form-core/translations/fr.js +6 -0
- package/components/form-core/translations/hu-HU.js +5 -0
- package/components/form-core/translations/hu.js +6 -0
- package/components/form-core/translations/it-IT.js +5 -0
- package/components/form-core/translations/it.js +6 -0
- package/components/form-core/translations/nl-BE.js +5 -0
- package/components/form-core/translations/nl-NL.js +5 -0
- package/components/form-core/translations/nl.js +6 -0
- package/components/form-core/translations/pl-PL.js +5 -0
- package/components/form-core/translations/pl.js +6 -0
- package/components/form-core/translations/ro-RO.js +5 -0
- package/components/form-core/translations/ro.js +6 -0
- package/components/form-core/translations/ru-RU.js +5 -0
- package/components/form-core/translations/ru.js +6 -0
- package/components/form-core/translations/sk-SK.js +5 -0
- package/components/form-core/translations/sk.js +6 -0
- package/components/form-core/translations/uk-UA.js +5 -0
- package/components/form-core/translations/uk.js +6 -0
- package/components/form-core/translations/zh.js +6 -0
- package/components/form-core/types/FormControlMixinTypes.ts +0 -4
- package/components/form-core/types/registration/FormRegisteringMixinTypes.ts +17 -4
- package/components/input-amount/test/lion-input-amount.test.js +3 -0
- package/components/input-file/src/LionInputFile.js +88 -30
- package/components/input-file/test/lion-input-file.test.js +102 -6
- package/components/input-file/test/lion-selected-file-list.test.js +2 -1
- package/components/input-file/translations/bg.js +3 -0
- package/components/input-file/translations/cs.js +3 -0
- package/components/input-file/translations/de.js +3 -0
- package/components/input-file/translations/en.js +3 -0
- package/components/input-file/translations/es.js +3 -0
- package/components/input-file/translations/fr.js +3 -0
- package/components/input-file/translations/hu.js +3 -0
- package/components/input-file/translations/it.js +3 -0
- package/components/input-file/translations/nl.js +3 -0
- package/components/input-file/translations/pl.js +3 -0
- package/components/input-file/translations/ro.js +3 -0
- package/components/input-file/translations/ru.js +3 -0
- package/components/input-file/translations/sk.js +3 -0
- package/components/input-file/translations/uk.js +3 -0
- package/components/input-file/translations/zh.js +3 -0
- package/components/overlays/src/OverlayMixin.js +8 -1
- package/components/switch/src/LionSwitch.js +10 -0
- package/components/tabs/src/LionTabs.js +10 -0
- package/components/tabs/test/lion-tabs.test.js +49 -38
- package/custom-elements.json +85400 -74702
- package/dist-types/components/combobox/src/LionCombobox.d.ts +12 -8
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FormControlMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/LionField.d.ts +1 -1
- package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts +2 -0
- package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts.map +1 -0
- package/dist-types/components/form-core/src/registration/FormRegisteringMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +5 -6
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/FormRegistrationMixins.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/translations/bg-BG.d.ts +8 -0
- package/dist-types/components/form-core/translations/bg-BG.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/bg.d.ts +8 -0
- package/dist-types/components/form-core/translations/bg.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/cs-CZ.d.ts +8 -0
- package/dist-types/components/form-core/translations/cs-CZ.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/cs.d.ts +8 -0
- package/dist-types/components/form-core/translations/cs.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/de-DE.d.ts +8 -0
- package/dist-types/components/form-core/translations/de-DE.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/de.d.ts +8 -0
- package/dist-types/components/form-core/translations/de.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/en-AU.d.ts +8 -0
- package/dist-types/components/form-core/translations/en-AU.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/en-GB.d.ts +8 -0
- package/dist-types/components/form-core/translations/en-GB.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/en-US.d.ts +8 -0
- package/dist-types/components/form-core/translations/en-US.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/en.d.ts +8 -0
- package/dist-types/components/form-core/translations/en.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/es-ES.d.ts +8 -0
- package/dist-types/components/form-core/translations/es-ES.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/es.d.ts +8 -0
- package/dist-types/components/form-core/translations/es.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/fr-BE.d.ts +8 -0
- package/dist-types/components/form-core/translations/fr-BE.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/fr-FR.d.ts +8 -0
- package/dist-types/components/form-core/translations/fr-FR.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/fr.d.ts +8 -0
- package/dist-types/components/form-core/translations/fr.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/hu-HU.d.ts +8 -0
- package/dist-types/components/form-core/translations/hu-HU.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/hu.d.ts +8 -0
- package/dist-types/components/form-core/translations/hu.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/it-IT.d.ts +8 -0
- package/dist-types/components/form-core/translations/it-IT.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/it.d.ts +8 -0
- package/dist-types/components/form-core/translations/it.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/nl-BE.d.ts +8 -0
- package/dist-types/components/form-core/translations/nl-BE.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/nl-NL.d.ts +8 -0
- package/dist-types/components/form-core/translations/nl-NL.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/nl.d.ts +8 -0
- package/dist-types/components/form-core/translations/nl.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/pl-PL.d.ts +8 -0
- package/dist-types/components/form-core/translations/pl-PL.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/pl.d.ts +8 -0
- package/dist-types/components/form-core/translations/pl.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/ro-RO.d.ts +8 -0
- package/dist-types/components/form-core/translations/ro-RO.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/ro.d.ts +8 -0
- package/dist-types/components/form-core/translations/ro.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/ru-RU.d.ts +8 -0
- package/dist-types/components/form-core/translations/ru-RU.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/ru.d.ts +8 -0
- package/dist-types/components/form-core/translations/ru.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/sk-SK.d.ts +8 -0
- package/dist-types/components/form-core/translations/sk-SK.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/sk.d.ts +8 -0
- package/dist-types/components/form-core/translations/sk.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/uk-UA.d.ts +8 -0
- package/dist-types/components/form-core/translations/uk-UA.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/uk.d.ts +8 -0
- package/dist-types/components/form-core/translations/uk.d.ts.map +1 -0
- package/dist-types/components/form-core/translations/zh.d.ts +8 -0
- package/dist-types/components/form-core/translations/zh.d.ts.map +1 -0
- package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts +0 -4
- package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts +14 -4
- package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts +12 -6
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/input-file/translations/bg-BG.d.ts +3 -0
- package/dist-types/components/input-file/translations/bg.d.ts +3 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts +3 -0
- package/dist-types/components/input-file/translations/cs.d.ts +3 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts +3 -0
- package/dist-types/components/input-file/translations/de.d.ts +3 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts +3 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts +3 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts +3 -0
- package/dist-types/components/input-file/translations/en-US.d.ts +3 -0
- package/dist-types/components/input-file/translations/en.d.ts +3 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts +3 -0
- package/dist-types/components/input-file/translations/es.d.ts +3 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts +3 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts +3 -0
- package/dist-types/components/input-file/translations/fr.d.ts +3 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts +3 -0
- package/dist-types/components/input-file/translations/hu.d.ts +3 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts +3 -0
- package/dist-types/components/input-file/translations/it.d.ts +3 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts +3 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts +3 -0
- package/dist-types/components/input-file/translations/nl.d.ts +3 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts +3 -0
- package/dist-types/components/input-file/translations/pl.d.ts +3 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts +3 -0
- package/dist-types/components/input-file/translations/ro.d.ts +3 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts +3 -0
- package/dist-types/components/input-file/translations/ru.d.ts +3 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts +3 -0
- package/dist-types/components/input-file/translations/sk.d.ts +3 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts +3 -0
- package/dist-types/components/input-file/translations/uk.d.ts +3 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts +3 -0
- package/dist-types/components/input-file/translations/zh.d.ts +3 -0
- package/dist-types/components/listbox/src/LionOption.d.ts +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
- package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +31 -0
- package/docs/components/button/api-table.md +104 -0
- package/docs/components/calendar/api-table.md +44 -0
- package/docs/components/checkbox-group/api-table.md +564 -0
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +36 -0
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +256 -0
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +45 -0
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +45 -0
- package/docs/components/fieldset/api-table.md +163 -0
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/api-table.md +1 -0
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/api-table.md +29 -0
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/api-table.md +187 -0
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +196 -0
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +188 -0
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +234 -0
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +187 -0
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +272 -0
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +187 -0
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +198 -0
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +205 -0
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +202 -0
- 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 +213 -0
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +293 -0
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/pagination/api-table.md +33 -0
- package/docs/components/progress-indicator/api-table.md +36 -0
- package/docs/components/radio-group/api-table.md +378 -0
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +181 -0
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +288 -0
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/steps/api-table.md +80 -0
- package/docs/components/switch/api-table.md +229 -0
- package/docs/components/tabs/api-table.md +32 -0
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +192 -0
- package/docs/components/tooltip/api-table.md +53 -0
- 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/api-table.md +34 -0
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/api-table.md +166 -0
- 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 +65 -0
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +168 -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/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 +5 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@lion/ui/define/lion-input-file.js';
|
|
2
2
|
import { Required } from '@lion/ui/form-core.js';
|
|
3
3
|
import { getInputMembers } from '@lion/ui/input-test-helpers.js';
|
|
4
|
-
import { expect, fixture as _fixture, html, oneEvent } from '@open-wc/testing';
|
|
4
|
+
import { expect, fixture as _fixture, html, oneEvent, elementUpdated } from '@open-wc/testing';
|
|
5
5
|
import sinon from 'sinon';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -556,19 +556,22 @@ describe('lion-input-file', () => {
|
|
|
556
556
|
});
|
|
557
557
|
const fileListChangedEvent = await oneEvent(el, 'file-list-changed');
|
|
558
558
|
filesListChanged(el, fileListChangedEvent);
|
|
559
|
-
await el
|
|
559
|
+
await elementUpdated(el);
|
|
560
560
|
|
|
561
561
|
// @ts-expect-error [allow-protected-in-test]
|
|
562
562
|
expect(el._selectedFilesMetaData.length).to.equal(2);
|
|
563
|
+
expect(el.modelValue.length).to.equal(2);
|
|
563
564
|
|
|
564
565
|
setTimeout(() => {
|
|
565
566
|
mimicSelectFile(el, [file3, file4]);
|
|
566
567
|
});
|
|
567
568
|
const fileListChangedEvent1 = await oneEvent(el, 'file-list-changed');
|
|
568
569
|
filesListChanged(el, fileListChangedEvent1);
|
|
569
|
-
await el
|
|
570
|
+
await elementUpdated(el);
|
|
571
|
+
|
|
570
572
|
// @ts-expect-error [allow-protected-in-test]
|
|
571
573
|
expect(el._selectedFilesMetaData.length).to.equal(4);
|
|
574
|
+
expect(el.modelValue.length).to.equal(4);
|
|
572
575
|
});
|
|
573
576
|
|
|
574
577
|
it('should add multiple files and dispatch file-list-changed event ONLY with newly added file', async () => {
|
|
@@ -958,6 +961,37 @@ describe('lion-input-file', () => {
|
|
|
958
961
|
expect(el.hasAttribute('is-dragging')).to.equal(false);
|
|
959
962
|
});
|
|
960
963
|
|
|
964
|
+
it('should update modelValue on drop', async () => {
|
|
965
|
+
const list = new DataTransfer();
|
|
966
|
+
// @ts-ignore
|
|
967
|
+
list.items.add(file);
|
|
968
|
+
const droppedFiles = list.files;
|
|
969
|
+
|
|
970
|
+
// @ts-expect-error [allow-protected-in-test]
|
|
971
|
+
await el._processDroppedFiles({
|
|
972
|
+
// @ts-ignore
|
|
973
|
+
dataTransfer: { files: droppedFiles, items: [{ name: 'test.txt' }] },
|
|
974
|
+
preventDefault: () => {},
|
|
975
|
+
});
|
|
976
|
+
await el.updateComplete;
|
|
977
|
+
|
|
978
|
+
expect(el.modelValue.length).to.equal(1);
|
|
979
|
+
|
|
980
|
+
const list2 = new DataTransfer();
|
|
981
|
+
// @ts-ignore
|
|
982
|
+
list2.items.add(file2);
|
|
983
|
+
|
|
984
|
+
// @ts-expect-error [allow-protected-in-test]
|
|
985
|
+
await el._processDroppedFiles({
|
|
986
|
+
// @ts-ignore
|
|
987
|
+
dataTransfer: { files: list2.files, items: [{ name: 'test2.txt' }] },
|
|
988
|
+
preventDefault: () => {},
|
|
989
|
+
});
|
|
990
|
+
await el.updateComplete;
|
|
991
|
+
|
|
992
|
+
expect(el.modelValue.length).to.equal(2);
|
|
993
|
+
});
|
|
994
|
+
|
|
961
995
|
it('should call _processFiles method', async () => {
|
|
962
996
|
const list = new DataTransfer();
|
|
963
997
|
// @ts-ignore
|
|
@@ -1133,7 +1167,7 @@ describe('lion-input-file', () => {
|
|
|
1133
1167
|
);
|
|
1134
1168
|
});
|
|
1135
1169
|
|
|
1136
|
-
it('select-button has aria-describedby set to the help-text,
|
|
1170
|
+
it('select-button has aria-describedby set to the help-text, after and the feedback message', async () => {
|
|
1137
1171
|
const uploadResponse = [
|
|
1138
1172
|
{
|
|
1139
1173
|
name: 'file1.txt',
|
|
@@ -1159,11 +1193,73 @@ describe('lion-input-file', () => {
|
|
|
1159
1193
|
// @ts-expect-error [allow-protected-in-test]
|
|
1160
1194
|
`feedback-${el._inputId}`,
|
|
1161
1195
|
);
|
|
1162
|
-
await el.updateComplete;
|
|
1163
1196
|
// @ts-expect-error [allow-protected-in-test]
|
|
1164
1197
|
expect(el._buttonNode?.getAttribute('aria-describedby')).to.contain(
|
|
1165
1198
|
// @ts-expect-error [allow-protected-in-test]
|
|
1166
|
-
`
|
|
1199
|
+
`after-${el._inputId}`,
|
|
1200
|
+
);
|
|
1201
|
+
});
|
|
1202
|
+
|
|
1203
|
+
it('after contains upload name of file when SUCCESS', async () => {
|
|
1204
|
+
const uploadResponse = [
|
|
1205
|
+
{
|
|
1206
|
+
name: 'file1.txt',
|
|
1207
|
+
status: 'SUCCESS',
|
|
1208
|
+
errorMessage: '',
|
|
1209
|
+
downloadUrl: '/downloadFile',
|
|
1210
|
+
},
|
|
1211
|
+
];
|
|
1212
|
+
const el = await fixture(html` <lion-input-file label="Select"></lion-input-file> `);
|
|
1213
|
+
|
|
1214
|
+
expect(el.querySelector('[slot="after"]')?.textContent).to.equal('No files selected.');
|
|
1215
|
+
// @ts-expect-error
|
|
1216
|
+
el.uploadResponse = uploadResponse;
|
|
1217
|
+
await el.updateComplete;
|
|
1218
|
+
expect(el.querySelector('[slot="after"]')?.textContent).to.equal('file1.txt');
|
|
1219
|
+
});
|
|
1220
|
+
|
|
1221
|
+
it('after contains upload validator message of file when FAIL', async () => {
|
|
1222
|
+
const uploadResponse = [
|
|
1223
|
+
{
|
|
1224
|
+
name: 'file1.txt',
|
|
1225
|
+
status: 'FAIL',
|
|
1226
|
+
errorMessage: 'something went wrong',
|
|
1227
|
+
downloadUrl: '/downloadFile',
|
|
1228
|
+
},
|
|
1229
|
+
];
|
|
1230
|
+
const el = await fixture(html` <lion-input-file label="Select"></lion-input-file> `);
|
|
1231
|
+
|
|
1232
|
+
expect(el.querySelector('[slot="after"]')?.textContent).to.equal('No files selected.');
|
|
1233
|
+
// @ts-expect-error
|
|
1234
|
+
el.uploadResponse = uploadResponse;
|
|
1235
|
+
await el.updateComplete;
|
|
1236
|
+
expect(el.querySelector('[slot="after"]')?.textContent).to.equal('something went wrong');
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1239
|
+
it('after contains upload status of files when multiple files have been uploaded', async () => {
|
|
1240
|
+
const uploadResponse = [
|
|
1241
|
+
{
|
|
1242
|
+
name: 'file1.txt',
|
|
1243
|
+
status: 'SUCCESS',
|
|
1244
|
+
errorMessage: '',
|
|
1245
|
+
downloadUrl: '/downloadFile',
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
name: 'file2.txt',
|
|
1249
|
+
status: 'FAIL',
|
|
1250
|
+
errorMessage: 'something went wrong',
|
|
1251
|
+
downloadUrl: '/downloadFile',
|
|
1252
|
+
},
|
|
1253
|
+
];
|
|
1254
|
+
const el = await fixture(html`
|
|
1255
|
+
<lion-input-file label="Select" multiple></lion-input-file>
|
|
1256
|
+
`);
|
|
1257
|
+
// @ts-expect-error
|
|
1258
|
+
el.uploadResponse = uploadResponse;
|
|
1259
|
+
|
|
1260
|
+
await el.updateComplete;
|
|
1261
|
+
expect(el.querySelector('[slot="after"]')?.textContent?.trim()).to.equal(
|
|
1262
|
+
'2 files. "something went wrong", for file2.txt.',
|
|
1167
1263
|
);
|
|
1168
1264
|
});
|
|
1169
1265
|
});
|
|
@@ -108,9 +108,10 @@ describe('lion-selected-file-list', () => {
|
|
|
108
108
|
`);
|
|
109
109
|
const fileItems = el.shadowRoot?.querySelectorAll('.selected__list__item');
|
|
110
110
|
const feedback = fileItems ? fileItems[0].querySelector('lion-validation-feedback') : undefined;
|
|
111
|
+
|
|
111
112
|
// @ts-ignore
|
|
112
113
|
expect(feedback).to.exist;
|
|
113
|
-
expect(
|
|
114
|
+
expect(el.shadowRoot?.textContent).to.include('foobar');
|
|
114
115
|
});
|
|
115
116
|
|
|
116
117
|
it('should call removeFile method on click of remove button', async () => {
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Моля, качете файл от тип {allowedTypesArray} или {allowedTypesLastItem} с макс. размер {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Плъзнете и пуснете Вашите файлове тук или',
|
|
7
7
|
fileNameDescriptionLabel: 'Име на файл: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", за {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Не са избрани файлове.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} файла.',
|
|
8
11
|
removeButtonLabel: 'Отстраняване на файла {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Файл със същото име на файл вече е налице.',
|
|
10
13
|
selectTextMultipleFile: 'Избор на файлове',
|
|
@@ -6,6 +6,9 @@ export default {
|
|
|
6
6
|
'Nahrajte soubor typu {allowedTypesArray} nebo {allowedTypesLastItem} s max. velikostí {maxSize}.',
|
|
7
7
|
dragAndDropText: 'Přetáhněte soubory sem nebo',
|
|
8
8
|
fileNameDescriptionLabel: 'Název souboru: {fileName}',
|
|
9
|
+
generalValidatorMessage: '"{validatorMessage}", pro {listOfErroneousFiles}.',
|
|
10
|
+
noFilesSelected: 'Nebyly vybrány žádné soubory.',
|
|
11
|
+
numberOfFiles: '{numberOfFiles} soubory/souborů.',
|
|
9
12
|
removeButtonLabel: 'Odebrat soubor {fileName}',
|
|
10
13
|
selectTextDuplicateFileName: 'Soubor se stejným názvem byl již přítomen.',
|
|
11
14
|
selectTextMultipleFile: 'Vybrat soubory',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Laden Sie eine {allowedTypesArray} oder {allowedTypesLastItem}-Datei mit max. {maxSize} hoch.',
|
|
6
6
|
dragAndDropText: 'Ziehen Sie Ihre Dateien per Drag & Drop hierher oder',
|
|
7
7
|
fileNameDescriptionLabel: 'Dateiname: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", für {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Keine Dateien ausgewählt.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} Dateien.',
|
|
8
11
|
removeButtonLabel: 'Datei {fileName} entfernen',
|
|
9
12
|
selectTextDuplicateFileName: 'Eine Datei mit demselben Dateinamen war bereits vorhanden.',
|
|
10
13
|
selectTextMultipleFile: 'Dateien auswählen',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Please select a {allowedTypesArray} or {allowedTypesLastItem} file with max {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Drag & Drop your files here or', // TODO: or what? Why is Drag & Drop capitalized?
|
|
7
7
|
fileNameDescriptionLabel: 'File name: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", for {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'No files selected.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} files.',
|
|
8
11
|
removeButtonLabel: 'Remove {fileName} file',
|
|
9
12
|
selectTextDuplicateFileName: 'A file with same filename was already present.',
|
|
10
13
|
selectTextMultipleFile: 'Select files',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Cargue un archivo {allowedTypesArray} o {allowedTypesLastItem} de {maxSize} como máximo.',
|
|
6
6
|
dragAndDropText: 'Arrastre y suelte los archivos aquí o',
|
|
7
7
|
fileNameDescriptionLabel: 'Nombre de archivo: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", para {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'No se han seleccionado archivos.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} archivos.',
|
|
8
11
|
removeButtonLabel: 'Elimine el archivo: {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Ya había un archivo con el mismo nombre de archivo.',
|
|
10
13
|
selectTextMultipleFile: 'Seleccionar archivos',
|
|
@@ -6,6 +6,9 @@ export default {
|
|
|
6
6
|
'Veuillez télécharger un fichier {allowedTypesArray} ou {allowedTypesLastItem} avec une taille maximale de {maxSize}.',
|
|
7
7
|
dragAndDropText: 'Glissez et déposez vos fichiers ici ou',
|
|
8
8
|
fileNameDescriptionLabel: 'Nom de fichier: {fileName}',
|
|
9
|
+
generalValidatorMessage: '"{validatorMessage}", pour {listOfErroneousFiles}.',
|
|
10
|
+
noFilesSelected: 'Aucun fichier sélectionné.',
|
|
11
|
+
numberOfFiles: '{numberOfFiles} fichiers.',
|
|
9
12
|
removeButtonLabel: 'Supprimer le fichier {fileName}',
|
|
10
13
|
selectTextDuplicateFileName: 'Un fichier portant le même nom de fichier était déjà présent.',
|
|
11
14
|
selectTextMultipleFile: 'Sélectionnez des fichiers',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Töltsön fel egy legfeljebb {maxSize} méretű {allowedTypesArray} vagy {allowedTypesLastItem} fájlt.',
|
|
6
6
|
dragAndDropText: 'Húzza át a fájlokat ide vagy',
|
|
7
7
|
fileNameDescriptionLabel: 'Fájlnév: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", ehhez: {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Nincs fájl kiválasztva.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} fájl.',
|
|
8
11
|
removeButtonLabel: 'A(z) {fileName} fájl eltávolítása',
|
|
9
12
|
selectTextDuplicateFileName: 'Már volt ilyen nevű fájl.',
|
|
10
13
|
selectTextMultipleFile: 'Fájl(ok) kiválasztása',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Caricare un file {allowedTypesArray} o {allowedTypesLastItem} di {maxSize} max.',
|
|
6
6
|
dragAndDropText: 'Trascinare i file qui o',
|
|
7
7
|
fileNameDescriptionLabel: 'Nome file: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", per {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Nessun file selezionato.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} file.',
|
|
8
11
|
removeButtonLabel: 'Rimuovere il file {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Un file con lo stesso nome file era già presente.',
|
|
10
13
|
selectTextMultipleFile: 'Seleziona file',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Upload een {allowedTypesArray} of {allowedTypesLastItem}-bestand van maximaal {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Sleep uw bestanden hierheen of',
|
|
7
7
|
fileNameDescriptionLabel: 'Bestandsnaam: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", voor {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Geen bestanden geselecteerd.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} bestanden.',
|
|
8
11
|
removeButtonLabel: 'Verwijder het bestand {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Er bestaat al een bestand met dezelfde bestandsnaam.',
|
|
10
13
|
selectTextMultipleFile: 'Selecteer bestanden',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Prześlij plik {allowedTypesArray} lub {allowedTypesLastItem} o maks. rozmiarze {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Przeciągnij i upuść pliki tutaj lub',
|
|
7
7
|
fileNameDescriptionLabel: 'Nazwa pliku: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", dla {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Nie wybrano żadnych plików.',
|
|
10
|
+
numberOfFiles: 'Liczba plików: {numberOfFiles}.',
|
|
8
11
|
removeButtonLabel: 'Usuń plik {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Plik o tej samej nazwie już istnieje.',
|
|
10
13
|
selectTextMultipleFile: 'Wybierz pliki',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Încărcaţi un fişier {allowedTypesArray} sau {allowedTypesLastItem} de max. {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Glisaţi şi fixaţi fişierele aici sau',
|
|
7
7
|
fileNameDescriptionLabel: 'Nume fişier: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", pentru {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Niciun fișier selectat.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} fișiere.',
|
|
8
11
|
removeButtonLabel: 'Eliminaţi fişierul {filename}',
|
|
9
12
|
selectTextDuplicateFileName: 'Există deja un fişier cu acelaşi nume de fişier.',
|
|
10
13
|
selectTextMultipleFile: 'Selectare fișiere',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Загрузите файл {allowedTypesArray} или {allowedTypesLastItem} размером не более {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Перетащите файлы сюда или',
|
|
7
7
|
fileNameDescriptionLabel: 'Название файла: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", для {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Файлы не выбраны.',
|
|
10
|
+
numberOfFiles: 'Файлов: {numberOfFiles}.',
|
|
8
11
|
removeButtonLabel: 'Удалить файл {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Файл с таким названием уже существует.',
|
|
10
13
|
selectTextMultipleFile: 'Выберите файлы',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Nahrajte súbor {allowedTypesArray} alebo {allowedTypesLastItem} s maximálnou veľkosťou {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Súbory presuňte sem alebo',
|
|
7
7
|
fileNameDescriptionLabel: 'Názov súboru: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", pre {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Neboli vybrané žiadne súbory.',
|
|
10
|
+
numberOfFiles: 'Počet súborov: {numberOfFiles}.',
|
|
8
11
|
removeButtonLabel: 'Odstrániť súbor {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Súbor s rovnakým názvom súboru už existoval.',
|
|
10
13
|
selectTextMultipleFile: 'Vybrať súbory',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'Завантажте файл {allowedTypesArray} або {allowedTypesLastItem} розміром до {maxSize}.',
|
|
6
6
|
dragAndDropText: 'Перетягніть файли сюди або',
|
|
7
7
|
fileNameDescriptionLabel: 'Ім’я файлу: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", для {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Не вибрано жодного файлу.',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} файли(-ів).',
|
|
8
11
|
removeButtonLabel: 'Видалення файлу {fileName}',
|
|
9
12
|
selectTextDuplicateFileName: 'Файл із такою назвою вже існував.',
|
|
10
13
|
selectTextMultipleFile: 'Виберіть файли',
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
'请上传最大 {maxSize} 的 {allowedTypesArray} 或 {allowedTypesLastItem} 文件。',
|
|
6
6
|
dragAndDropText: '将您的文件拖放到此处,或',
|
|
7
7
|
fileNameDescriptionLabel: '文件名: {fileName}',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", 例如 {listOfErroneousFiles}。',
|
|
9
|
+
noFilesSelected: '未选择任何文件。',
|
|
10
|
+
numberOfFiles: '{numberOfFiles} 个文件。',
|
|
8
11
|
removeButtonLabel: '删除 {fileName} 文件',
|
|
9
12
|
selectTextDuplicateFileName: '已存在具有相同文件名的文件。',
|
|
10
13
|
selectTextMultipleFile: '选择多个文件',
|
|
@@ -26,9 +26,16 @@ export const OverlayMixinImplementation = superclass =>
|
|
|
26
26
|
|
|
27
27
|
constructor() {
|
|
28
28
|
super();
|
|
29
|
+
/**
|
|
30
|
+
* If you add the opened attribute a dialog will be opened on page load. The invoker can be left out
|
|
31
|
+
* in case the user does not need to be able to reopen the dialog.
|
|
32
|
+
*/
|
|
29
33
|
this.opened = false;
|
|
30
34
|
|
|
31
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Configure the many options of the `OverlayController`
|
|
37
|
+
* @type {Partial<OverlayConfig>}
|
|
38
|
+
*/
|
|
32
39
|
this.config = {};
|
|
33
40
|
|
|
34
41
|
/** @type {EventListener} */
|
|
@@ -105,6 +105,16 @@ export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField))
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Override this function from ChoiceInputMixin.
|
|
110
|
+
* @param {Event} ev
|
|
111
|
+
* @protected
|
|
112
|
+
*/
|
|
113
|
+
_toggleChecked(ev) {
|
|
114
|
+
ev.preventDefault();
|
|
115
|
+
super._toggleChecked(ev);
|
|
116
|
+
}
|
|
117
|
+
|
|
108
118
|
/**
|
|
109
119
|
* Override this function from ChoiceInputMixin.
|
|
110
120
|
* @protected
|
|
@@ -19,6 +19,16 @@ function setupPanel({ el, uid }) {
|
|
|
19
19
|
el.setAttribute('id', `panel-${uid}`);
|
|
20
20
|
el.setAttribute('role', 'tabpanel');
|
|
21
21
|
el.setAttribute('aria-labelledby', `button-${uid}`);
|
|
22
|
+
/**
|
|
23
|
+
* Facilitates navigation to panel content for assistive technology users.
|
|
24
|
+
*
|
|
25
|
+
* Focusable tab panel elements are recommended if any panels in a set contain
|
|
26
|
+
* content where the first element in the panel is not focusable.
|
|
27
|
+
* https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/
|
|
28
|
+
*/
|
|
29
|
+
if (!el.hasAttribute('tabindex')) {
|
|
30
|
+
el.setAttribute('tabindex', '0');
|
|
31
|
+
}
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
/**
|
|
@@ -452,45 +452,26 @@ describe('<lion-tabs>', () => {
|
|
|
452
452
|
});
|
|
453
453
|
|
|
454
454
|
describe('Accessibility', () => {
|
|
455
|
-
it('does not make panels focusable', async () => {
|
|
456
|
-
const el = /** @type {LionTabs} */ (
|
|
457
|
-
await fixture(html`
|
|
458
|
-
<lion-tabs>
|
|
459
|
-
<button slot="tab">tab 1</button>
|
|
460
|
-
<div slot="panel">panel 1</div>
|
|
461
|
-
<button slot="tab">tab 2</button>
|
|
462
|
-
<div slot="panel">panel 2</div>
|
|
463
|
-
</lion-tabs>
|
|
464
|
-
`)
|
|
465
|
-
);
|
|
466
|
-
expect(Array.from(el.children).find(child => child.slot === 'panel')).to.not.have.attribute(
|
|
467
|
-
'tabindex',
|
|
468
|
-
);
|
|
469
|
-
expect(Array.from(el.children).find(child => child.slot === 'panel')).to.not.have.attribute(
|
|
470
|
-
'tabindex',
|
|
471
|
-
);
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
it('makes selected tab focusable (other tabs are unfocusable)', async () => {
|
|
475
|
-
const el = /** @type {LionTabs} */ (
|
|
476
|
-
await fixture(html`
|
|
477
|
-
<lion-tabs>
|
|
478
|
-
<button slot="tab">tab 1</button>
|
|
479
|
-
<div slot="panel">panel 1</div>
|
|
480
|
-
<button slot="tab">tab 2</button>
|
|
481
|
-
<div slot="panel">panel 2</div>
|
|
482
|
-
<button slot="tab">tab 3</button>
|
|
483
|
-
<div slot="panel">panel 3</div>
|
|
484
|
-
</lion-tabs>
|
|
485
|
-
`)
|
|
486
|
-
);
|
|
487
|
-
const tabs = el.querySelectorAll('[slot=tab]');
|
|
488
|
-
expect(tabs[0]).to.have.attribute('tabindex', '0');
|
|
489
|
-
expect(tabs[1]).to.have.attribute('tabindex', '-1');
|
|
490
|
-
expect(tabs[2]).to.have.attribute('tabindex', '-1');
|
|
491
|
-
});
|
|
492
|
-
|
|
493
455
|
describe('Tabs', () => {
|
|
456
|
+
it('makes selected tab focusable (other tabs are unfocusable)', async () => {
|
|
457
|
+
const el = /** @type {LionTabs} */ (
|
|
458
|
+
await fixture(html`
|
|
459
|
+
<lion-tabs>
|
|
460
|
+
<button slot="tab">tab 1</button>
|
|
461
|
+
<div slot="panel">panel 1</div>
|
|
462
|
+
<button slot="tab">tab 2</button>
|
|
463
|
+
<div slot="panel">panel 2</div>
|
|
464
|
+
<button slot="tab">tab 3</button>
|
|
465
|
+
<div slot="panel">panel 3</div>
|
|
466
|
+
</lion-tabs>
|
|
467
|
+
`)
|
|
468
|
+
);
|
|
469
|
+
const tabs = el.querySelectorAll('[slot=tab]');
|
|
470
|
+
expect(tabs[0]).to.have.attribute('tabindex', '0');
|
|
471
|
+
expect(tabs[1]).to.have.attribute('tabindex', '-1');
|
|
472
|
+
expect(tabs[2]).to.have.attribute('tabindex', '-1');
|
|
473
|
+
});
|
|
474
|
+
|
|
494
475
|
it('links ids of content items to tab via [aria-controls]', async () => {
|
|
495
476
|
const el = /** @type {LionTabs} */ (
|
|
496
477
|
await fixture(html`
|
|
@@ -562,6 +543,36 @@ describe('<lion-tabs>', () => {
|
|
|
562
543
|
expect(panels[0]).to.have.attribute('aria-labelledby', tabs[0].id);
|
|
563
544
|
expect(panels[1]).to.have.attribute('aria-labelledby', tabs[1].id);
|
|
564
545
|
});
|
|
546
|
+
|
|
547
|
+
it('makes panel focusable', async () => {
|
|
548
|
+
const el = /** @type {LionTabs} */ (
|
|
549
|
+
await fixture(html`
|
|
550
|
+
<lion-tabs>
|
|
551
|
+
<button slot="tab">tab 1</button>
|
|
552
|
+
<div slot="panel">panel 1</div>
|
|
553
|
+
<button slot="tab">tab 2</button>
|
|
554
|
+
<div slot="panel">panel 2</div>
|
|
555
|
+
</lion-tabs>
|
|
556
|
+
`)
|
|
557
|
+
);
|
|
558
|
+
const panels = el.querySelectorAll('[slot=panel]');
|
|
559
|
+
expect(panels[0]).to.have.attribute('tabindex', '0');
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
it('does not override the tabindex already set on the panel', async () => {
|
|
563
|
+
const el = /** @type {LionTabs} */ (
|
|
564
|
+
await fixture(html`
|
|
565
|
+
<lion-tabs>
|
|
566
|
+
<button slot="tab">tab 1</button>
|
|
567
|
+
<div slot="panel" tabindex="-1">panel 1</div>
|
|
568
|
+
<button slot="tab">tab 2</button>
|
|
569
|
+
<div slot="panel">panel 2</div>
|
|
570
|
+
</lion-tabs>
|
|
571
|
+
`)
|
|
572
|
+
);
|
|
573
|
+
const panels = el.querySelectorAll('[slot=panel]');
|
|
574
|
+
expect(panels[0]).to.have.attribute('tabindex', '-1');
|
|
575
|
+
});
|
|
565
576
|
});
|
|
566
577
|
});
|
|
567
578
|
|