@lion/ui 0.7.2 → 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/button/test-suites/LionButtonReset.suite.js +7 -9
- package/components/calendar/test/lion-calendar.test.js +26 -30
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +3 -0
- package/components/combobox/src/LionCombobox.js +35 -22
- package/components/combobox/test/lion-combobox.test.js +141 -98
- package/components/core/src/SlotMixin.js +7 -1
- package/components/form/test/lion-form.test.js +4 -4
- 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 +2 -1
- package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +18 -18
- 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/form-integrations/test/dialog-integrations.test.js +6 -4
- package/components/helpers/src/SbActionLogger.js +11 -2
- package/components/icon/test/lion-icon.test.js +12 -14
- package/components/input-amount/test/lion-input-amount.test.js +13 -14
- package/components/input-datepicker/test/lion-input-datepicker.test.js +4 -4
- package/components/input-file/src/LionInputFile.js +88 -30
- package/components/input-file/test/lion-input-file.test.js +105 -9
- 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/input-tel-dropdown/test/LionInputTelDropdown.test.js +23 -23
- package/components/listbox/test-suites/ListboxMixin.suite.js +10 -3
- package/components/localize/src/date/utils/normalizeIntlDate.js +13 -2
- package/components/overlays/src/OverlayMixin.js +8 -1
- package/components/progress-indicator/test/lion-progress-indicator.test.js +42 -46
- package/components/select-rich/test/lion-select-rich.test.js +6 -8
- package/components/steps/test/lion-step.test.js +5 -7
- package/components/switch/src/LionSwitch.js +10 -0
- package/components/switch/test/lion-switch.test.js +5 -7
- package/components/tabs/src/LionTabs.js +10 -0
- package/components/tabs/test/lion-tabs.test.js +49 -38
- package/custom-elements.json +83073 -76992
- package/dist-types/components/button/test-suites/LionButtonReset.suite.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- 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/core/src/SlotMixin.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/test-suites/ValidateMixin.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/helpers/src/SbActionLogger.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/input-tel-dropdown/test/LionInputTelDropdown.test.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionOption.d.ts +1 -1
- package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/date/utils/normalizeIntlDate.d.ts.map +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/button/use-cases.md +11 -10
- 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/assets/applyDemoCollapsibleStyles.js +6 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +256 -0
- package/docs/components/combobox/overview.md +4 -3
- package/docs/components/combobox/src/gh-combobox/gh-button.js +3 -1
- package/docs/components/combobox/src/gh-combobox/gh-combobox.js +9 -2
- package/docs/components/combobox/src/google-combobox/google-combobox.js +6 -8
- package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +7 -3
- package/docs/components/combobox/src/md-combobox/style/md-ripple.js +1 -0
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +15 -3
- package/docs/components/combobox/use-cases.md +19 -17
- 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/use-cases.md +3 -2
- 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/input-tel-dropdown/src/intl-input-tel-dropdown.js +15 -5
- 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/progress-indicator/examples.md +11 -11
- 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/tabs/src/lea-tab-panel.js +3 -1
- package/docs/components/tabs/src/lea-tab.js +7 -2
- 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/assets/_mermaid.svg.js +32 -8
- 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 +3 -3
- package/docs/fundamentals/systems/localize/api-table.md +65 -0
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +0 -9
- package/docs/fundamentals/systems/overlays/_edge-cases.md +74 -80
- 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 +5 -8
- package/docs/fundamentals/tools/helpers/action-logger.md +3 -6
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +3 -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 +6 -5
|
@@ -43,10 +43,6 @@ export declare interface HTMLElementWithValue extends HTMLElement {
|
|
|
43
43
|
export declare class FormControlHost {
|
|
44
44
|
static get styles(): CSSResultArray;
|
|
45
45
|
static get properties(): {
|
|
46
|
-
name: {
|
|
47
|
-
type: StringConstructor;
|
|
48
|
-
reflect: boolean;
|
|
49
|
-
};
|
|
50
46
|
readOnly: {
|
|
51
47
|
type: BooleanConstructor;
|
|
52
48
|
attribute: string;
|
|
@@ -4,10 +4,13 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
import { FormRegistrarHost } from './FormRegistrarMixinTypes.js';
|
|
5
5
|
|
|
6
6
|
export declare class FormRegisteringHost {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
static get properties(): {
|
|
8
|
+
name: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
reflect: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* To encourage accessibility best practices, `form-element-register` events
|
|
13
16
|
* do not pierce through shadow roots. This forces the developer to create form groups and fieldsets that
|
|
@@ -17,12 +20,22 @@ export declare class FormRegisteringHost {
|
|
|
17
20
|
*/
|
|
18
21
|
allowCrossRootRegistration: boolean;
|
|
19
22
|
|
|
23
|
+
/**
|
|
24
|
+
* The name the element will be registered with to the .formElements collection
|
|
25
|
+
* of the parent. Also, it serves as the key of key/value pairs in
|
|
26
|
+
* modelValue/serializedValue objects
|
|
27
|
+
*/
|
|
28
|
+
get name(): string;
|
|
29
|
+
set name(arg: any);
|
|
30
|
+
|
|
20
31
|
/**
|
|
21
32
|
* The registrar this FormControl registers to, Usually a descendant of FormGroup or
|
|
22
33
|
* ChoiceGroup
|
|
23
34
|
*/
|
|
24
35
|
protected _parentFormGroup: FormRegistrarHost | undefined;
|
|
25
36
|
|
|
37
|
+
private __name: string;
|
|
38
|
+
|
|
26
39
|
private __unregisterFormElement: void;
|
|
27
40
|
}
|
|
28
41
|
|
|
@@ -17,10 +17,12 @@ import '@lion/ui/define/lion-radio.js';
|
|
|
17
17
|
// Test umbrella form inside dialog
|
|
18
18
|
describe('Form inside dialog Integrations', () => {
|
|
19
19
|
it('Successfully registers all form components inside a dialog', async () => {
|
|
20
|
-
const el = /** @type {LionDialog} */ await fixture(
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const el = /** @type {LionDialog} */ await fixture(
|
|
21
|
+
html` <lion-dialog>
|
|
22
|
+
<button slot="invoker">Open Dialog</button>
|
|
23
|
+
<umbrella-form slot="content"></umbrella-form>
|
|
24
|
+
</lion-dialog>`,
|
|
25
|
+
);
|
|
24
26
|
|
|
25
27
|
// @ts-ignore
|
|
26
28
|
const formEl = /** @type {LionForm} */ (el._overlayCtrl.contentNode._lionFormNode);
|
|
@@ -25,8 +25,17 @@ export class SbActionLogger extends LitElement {
|
|
|
25
25
|
|
|
26
26
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
27
27
|
display: block;
|
|
28
|
-
font-family:
|
|
29
|
-
|
|
28
|
+
font-family:
|
|
29
|
+
'Nunito Sans',
|
|
30
|
+
-apple-system,
|
|
31
|
+
'.SFNSText-Regular',
|
|
32
|
+
'San Francisco',
|
|
33
|
+
BlinkMacSystemFont,
|
|
34
|
+
'Segoe UI',
|
|
35
|
+
'Helvetica Neue',
|
|
36
|
+
Helvetica,
|
|
37
|
+
Arial,
|
|
38
|
+
sans-serif;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
.header__info {
|
|
@@ -118,20 +118,18 @@ describe('lion-icon', () => {
|
|
|
118
118
|
window.addEventListener('importDone', resolve);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
const el = await fixture(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.svg
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
`,
|
|
134
|
-
);
|
|
121
|
+
const el = await fixture(html`
|
|
122
|
+
<lion-icon
|
|
123
|
+
.svg=${until(
|
|
124
|
+
import('./heart.svg.js').then(e => {
|
|
125
|
+
dispatchEvent(new CustomEvent('importDone'));
|
|
126
|
+
return e.default;
|
|
127
|
+
}),
|
|
128
|
+
html``,
|
|
129
|
+
)}
|
|
130
|
+
aria-label="Love"
|
|
131
|
+
></lion-icon>
|
|
132
|
+
`);
|
|
135
133
|
|
|
136
134
|
await svgLoading;
|
|
137
135
|
// We need to await the until directive is resolved and rendered to the dom
|
|
@@ -36,24 +36,20 @@ describe('<lion-input-amount>', () => {
|
|
|
36
36
|
|
|
37
37
|
it('formatAmount uses locale provided in formatOptions', async () => {
|
|
38
38
|
let el = /** @type {LionInputAmount} */ (
|
|
39
|
-
await fixture(
|
|
40
|
-
html`
|
|
41
|
-
<lion-input-amount
|
|
42
|
-
.formatOptions="${{ locale: 'en-GB' }}"
|
|
43
|
-
.modelValue="${123}"
|
|
44
|
-
></lion-input-amount>
|
|
45
|
-
`,
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
expect(el.formattedValue).to.equal('123.00');
|
|
49
|
-
el = await fixture(
|
|
50
|
-
html`
|
|
39
|
+
await fixture(html`
|
|
51
40
|
<lion-input-amount
|
|
52
|
-
.formatOptions="${{ locale: '
|
|
41
|
+
.formatOptions="${{ locale: 'en-GB' }}"
|
|
53
42
|
.modelValue="${123}"
|
|
54
43
|
></lion-input-amount>
|
|
55
|
-
|
|
44
|
+
`)
|
|
56
45
|
);
|
|
46
|
+
expect(el.formattedValue).to.equal('123.00');
|
|
47
|
+
el = await fixture(html`
|
|
48
|
+
<lion-input-amount
|
|
49
|
+
.formatOptions="${{ locale: 'nl-NL' }}"
|
|
50
|
+
.modelValue="${123}"
|
|
51
|
+
></lion-input-amount>
|
|
52
|
+
`);
|
|
57
53
|
expect(el.formattedValue).to.equal('123,00');
|
|
58
54
|
});
|
|
59
55
|
|
|
@@ -199,6 +195,9 @@ describe('<lion-input-amount>', () => {
|
|
|
199
195
|
expect(el.formattedValue).to.equal('123.45');
|
|
200
196
|
localize.locale = 'nl-NL';
|
|
201
197
|
await el.updateComplete;
|
|
198
|
+
// TODO find out why the localize needs to be loaded for the feedbackNode
|
|
199
|
+
// @ts-ignore [allow-protected] in test
|
|
200
|
+
await el._feedbackNode.localizeNamespacesLoaded;
|
|
202
201
|
expect(el.formattedValue).to.equal('123,45');
|
|
203
202
|
});
|
|
204
203
|
|
|
@@ -286,10 +286,10 @@ describe('<lion-input-datepicker>', () => {
|
|
|
286
286
|
|
|
287
287
|
it('converts MinDate validator to "minDate" property', async () => {
|
|
288
288
|
const myMinDate = new Date('2019/06/15');
|
|
289
|
-
const el = await fixture(
|
|
290
|
-
.validators="${[new MinDate(myMinDate)]}"
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
const el = await fixture(
|
|
290
|
+
html` <lion-input-datepicker .validators="${[new MinDate(myMinDate)]}">
|
|
291
|
+
</lion-input-datepicker>`,
|
|
292
|
+
);
|
|
293
293
|
const elObj = new DatepickerInputObject(el);
|
|
294
294
|
await elObj.openCalendar();
|
|
295
295
|
|
|
@@ -77,6 +77,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
77
77
|
>
|
|
78
78
|
${this.buttonLabel}
|
|
79
79
|
</button>`,
|
|
80
|
+
after: () => html`<div data-description></div>`,
|
|
80
81
|
'selected-file-list': () => ({
|
|
81
82
|
template: html`
|
|
82
83
|
<lion-selected-file-list
|
|
@@ -105,8 +106,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/**
|
|
108
|
-
* The
|
|
109
|
-
* When no light dom defined via [slot=help-text], this value will be used
|
|
109
|
+
* The label of the button
|
|
110
110
|
* @type {string}
|
|
111
111
|
*/
|
|
112
112
|
get buttonLabel() {
|
|
@@ -176,6 +176,11 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
176
176
|
|
|
177
177
|
/** @private */
|
|
178
178
|
this.__duplicateFileNamesValidator = new DuplicateFileNames({ show: false });
|
|
179
|
+
/**
|
|
180
|
+
* @private
|
|
181
|
+
* @type {FileList | null}
|
|
182
|
+
*/
|
|
183
|
+
this.__previouslyParsedFiles = null;
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
/**
|
|
@@ -283,8 +288,20 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
283
288
|
* @returns {InputFile[]} parsedValue
|
|
284
289
|
*/
|
|
285
290
|
parser() {
|
|
286
|
-
//
|
|
287
|
-
|
|
291
|
+
// parser is called twice for one user event; one for 'user-input-change', another for 'change'
|
|
292
|
+
if (this.__previouslyParsedFiles === this._inputNode.files) {
|
|
293
|
+
return this.modelValue;
|
|
294
|
+
}
|
|
295
|
+
this.__previouslyParsedFiles = this._inputNode.files;
|
|
296
|
+
|
|
297
|
+
const files = this._inputNode.files
|
|
298
|
+
? /** @type {InputFile[]} */ (Array.from(this._inputNode.files))
|
|
299
|
+
: [];
|
|
300
|
+
if (this.multiple) {
|
|
301
|
+
return [...(this.modelValue ?? []), ...files];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return files;
|
|
288
305
|
}
|
|
289
306
|
|
|
290
307
|
/**
|
|
@@ -332,8 +349,6 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
332
349
|
super.firstUpdated(changedProperties);
|
|
333
350
|
|
|
334
351
|
this.__setupFileValidators();
|
|
335
|
-
// We need to update our light dom
|
|
336
|
-
this._enhanceSelectedList();
|
|
337
352
|
|
|
338
353
|
// TODO: if there's no inputNode by now, we should either throw an error or add a slot change listener
|
|
339
354
|
if (this._inputNode) {
|
|
@@ -443,6 +458,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
443
458
|
this._selectedFilesMetaData = [...this._selectedFilesMetaData];
|
|
444
459
|
}
|
|
445
460
|
});
|
|
461
|
+
this._updateUploadButtonDescription();
|
|
446
462
|
}
|
|
447
463
|
}
|
|
448
464
|
|
|
@@ -482,16 +498,17 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
482
498
|
}
|
|
483
499
|
|
|
484
500
|
this._inputNode.files = ev.dataTransfer.files;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
501
|
+
|
|
502
|
+
if (this.multiple) {
|
|
503
|
+
const computedFiles = this.__computeNewAddedFiles(
|
|
504
|
+
/** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files)),
|
|
505
|
+
);
|
|
506
|
+
this.modelValue = [...(this.modelValue ?? []), ...computedFiles];
|
|
507
|
+
} else {
|
|
508
|
+
this.modelValue = /** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files));
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
this._processFiles(/** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files)));
|
|
495
512
|
}
|
|
496
513
|
|
|
497
514
|
/**
|
|
@@ -521,20 +538,6 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
521
538
|
ev.target.value = ''; // eslint-disable-line no-param-reassign
|
|
522
539
|
}
|
|
523
540
|
|
|
524
|
-
/**
|
|
525
|
-
* @protected
|
|
526
|
-
*/
|
|
527
|
-
_enhanceSelectedList() {
|
|
528
|
-
/**
|
|
529
|
-
* @type {LionSelectedFileList | null}
|
|
530
|
-
*/
|
|
531
|
-
const selectedFileList = this.querySelector('[slot="selected-file-list"]');
|
|
532
|
-
if (selectedFileList) {
|
|
533
|
-
selectedFileList.setAttribute('id', `selected-file-list-${this._inputId}`);
|
|
534
|
-
this.addToAriaDescribedBy(selectedFileList, { idPrefix: 'selected-file-list' });
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
541
|
/**
|
|
539
542
|
* @protected
|
|
540
543
|
*/
|
|
@@ -739,6 +742,46 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
739
742
|
fileObj.validationFeedback?.push(errorObj);
|
|
740
743
|
}
|
|
741
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Description for screen readers connected to the button about how many files have been updated
|
|
747
|
+
* @protected
|
|
748
|
+
*/
|
|
749
|
+
_updateUploadButtonDescription() {
|
|
750
|
+
const erroneousFilesNames = /** @type {string[]} */ ([]);
|
|
751
|
+
let errorMessage;
|
|
752
|
+
|
|
753
|
+
this._selectedFilesMetaData.forEach(file => {
|
|
754
|
+
if (file.status === 'FAIL') {
|
|
755
|
+
errorMessage = file.validationFeedback ? file.validationFeedback[0].message.toString() : '';
|
|
756
|
+
erroneousFilesNames.push(/** @type {string} */ (file.systemFile.name));
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
const selectedFiles = this.querySelector('[slot="after"]');
|
|
761
|
+
if (selectedFiles) {
|
|
762
|
+
if (!this._selectedFilesMetaData || this._selectedFilesMetaData.length === 0) {
|
|
763
|
+
selectedFiles.textContent = /** @type {string} */ (
|
|
764
|
+
this.msgLit('lion-input-file:noFilesSelected')
|
|
765
|
+
);
|
|
766
|
+
} else if (this._selectedFilesMetaData.length === 1) {
|
|
767
|
+
selectedFiles.textContent = /** @type {string} */ (
|
|
768
|
+
errorMessage || this._selectedFilesMetaData[0].systemFile.name
|
|
769
|
+
);
|
|
770
|
+
} else {
|
|
771
|
+
selectedFiles.textContent = `${this.msgLit('lion-input-file:numberOfFiles', {
|
|
772
|
+
numberOfFiles: this._selectedFilesMetaData.length,
|
|
773
|
+
})} ${
|
|
774
|
+
errorMessage
|
|
775
|
+
? this.msgLit('lion-input-file:generalValidatorMessage', {
|
|
776
|
+
validatorMessage: errorMessage,
|
|
777
|
+
listOfErroneousFiles: erroneousFilesNames.join(', '),
|
|
778
|
+
})
|
|
779
|
+
: ''
|
|
780
|
+
}`;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
742
785
|
/**
|
|
743
786
|
* @private
|
|
744
787
|
* @param {InputFile} removedFile
|
|
@@ -755,6 +798,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
755
798
|
}
|
|
756
799
|
this._inputNode.value = '';
|
|
757
800
|
this._handleErrors();
|
|
801
|
+
this._updateUploadButtonDescription();
|
|
758
802
|
}
|
|
759
803
|
|
|
760
804
|
/**
|
|
@@ -847,6 +891,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
847
891
|
_inputGroupInputTemplate() {
|
|
848
892
|
return html`
|
|
849
893
|
<slot name="input"> </slot>
|
|
894
|
+
<slot name="after"> </slot>
|
|
850
895
|
${this.enableDropZone && this._isDragAndDropSupported
|
|
851
896
|
? this._dropZoneTemplate()
|
|
852
897
|
: html`
|
|
@@ -891,6 +936,19 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|
|
891
936
|
border: dashed 2px black;
|
|
892
937
|
padding: 24px 0;
|
|
893
938
|
}
|
|
939
|
+
|
|
940
|
+
.input-group__container ::slotted([slot='after']) {
|
|
941
|
+
position: absolute;
|
|
942
|
+
width: 1px;
|
|
943
|
+
height: 1px;
|
|
944
|
+
overflow: hidden;
|
|
945
|
+
clip-path: inset(100%);
|
|
946
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
947
|
+
white-space: nowrap;
|
|
948
|
+
border: 0;
|
|
949
|
+
margin: 0;
|
|
950
|
+
padding: 0;
|
|
951
|
+
}
|
|
894
952
|
`,
|
|
895
953
|
];
|
|
896
954
|
}
|
|
@@ -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 () => {
|
|
@@ -637,9 +640,9 @@ describe('lion-input-file', () => {
|
|
|
637
640
|
})
|
|
638
641
|
);
|
|
639
642
|
|
|
640
|
-
const el = await fixture(
|
|
641
|
-
|
|
642
|
-
);
|
|
643
|
+
const el = await fixture(html`
|
|
644
|
+
<lion-input-file multiple max-file-size="3" accept=".txt"></lion-input-file>
|
|
645
|
+
`);
|
|
643
646
|
|
|
644
647
|
setTimeout(() => {
|
|
645
648
|
mimicSelectFile(el, [file, fileWrongSize, file2, fileWrongType]);
|
|
@@ -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',
|