@lion/ui 0.2.2 → 0.3.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 +23 -72
- package/components/button/src/LionButton.js +1 -1
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +2 -2
- package/components/checkbox-group/test/lion-checkbox-indeterminate-integrations.test.js +6 -0
- package/components/checkbox-group/{test/lion-checkbox-indeterminate.test.js → test-suites/CheckboxIndeterminate.suite.js} +209 -187
- package/components/combobox/src/LionCombobox.js +3 -1
- package/components/combobox/test/lion-combobox.test.js +52 -0
- package/components/core/src/SlotMixin.js +3 -2
- package/components/core/test/SlotMixin.test.js +1 -1
- package/components/core/types/SlotMixinTypes.ts +4 -1
- package/components/dialog/test/lion-dialog.test.js +56 -0
- package/components/form-core/src/FocusMixin.js +33 -2
- package/components/form-core/src/LionField.js +3 -1
- package/components/form-core/src/validate/LionValidationFeedback.js +2 -5
- package/components/form-core/src/validate/ResultValidator.js +1 -1
- package/components/form-core/test/FocusMixin.test.js +33 -0
- package/components/form-core/types/validate/ValidateMixinTypes.ts +2 -2
- package/components/form-integrations/test/dialog-integrations.test.js +19 -0
- package/components/form-integrations/test/form-group-methods.test.js +11 -37
- package/components/form-integrations/test/form-integrations.test.js +4 -0
- package/components/form-integrations/test/helpers/umbrella-form.js +21 -18
- package/components/input-amount/src/LionInputAmount.js +13 -4
- package/components/input-amount/test/lion-input-amount.test.js +19 -20
- package/components/input-date/src/LionInputDate.js +2 -11
- package/components/input-datepicker/src/LionInputDatepicker.js +5 -2
- package/components/input-datepicker/test/lion-input-datepicker.test.js +20 -0
- package/components/input-file/src/FileHandle.js +98 -0
- package/components/input-file/src/LionInputFile.js +892 -0
- package/components/input-file/src/LionSelectedFileList.js +232 -0
- package/components/input-file/src/localizeNamespaceLoader.js +75 -0
- package/components/input-file/src/validators.js +114 -0
- package/components/input-file/test/FileValidators.test.js +170 -0
- package/components/input-file/test/lion-input-file.test.js +1168 -0
- package/components/input-file/test/lion-selected-file-list.test.js +207 -0
- package/components/input-file/translations/bg-BG.js +5 -0
- package/components/input-file/translations/bg.js +12 -0
- package/components/input-file/translations/cs-CZ.js +5 -0
- package/components/input-file/translations/cs.js +13 -0
- package/components/input-file/translations/de-DE.js +5 -0
- package/components/input-file/translations/de.js +12 -0
- package/components/input-file/translations/en-AU.js +5 -0
- package/components/input-file/translations/en-GB.js +5 -0
- package/components/input-file/translations/en-PH.js +5 -0
- package/components/input-file/translations/en-US.js +5 -0
- package/components/input-file/translations/en.js +12 -0
- package/components/input-file/translations/es-ES.js +5 -0
- package/components/input-file/translations/es.js +12 -0
- package/components/input-file/translations/fr-BE.js +5 -0
- package/components/input-file/translations/fr-FR.js +5 -0
- package/components/input-file/translations/fr.js +13 -0
- package/components/input-file/translations/hu-HU.js +5 -0
- package/components/input-file/translations/hu.js +12 -0
- package/components/input-file/translations/it-IT.js +5 -0
- package/components/input-file/translations/it.js +12 -0
- package/components/input-file/translations/nl-BE.js +5 -0
- package/components/input-file/translations/nl-NL.js +5 -0
- package/components/input-file/translations/nl.js +12 -0
- package/components/input-file/translations/pl-PL.js +5 -0
- package/components/input-file/translations/pl.js +12 -0
- package/components/input-file/translations/ro-RO.js +5 -0
- package/components/input-file/translations/ro.js +12 -0
- package/components/input-file/translations/ru-RU.js +5 -0
- package/components/input-file/translations/ru.js +12 -0
- package/components/input-file/translations/sk-SK.js +5 -0
- package/components/input-file/translations/sk.js +12 -0
- package/components/input-file/translations/uk-UA.js +5 -0
- package/components/input-file/translations/uk.js +12 -0
- package/components/input-file/translations/zh-CN.js +5 -0
- package/components/input-file/translations/zh.js +12 -0
- package/components/input-file/types/input-file.d.ts +32 -0
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +1 -4
- package/components/listbox/src/ListboxMixin.js +3 -2
- package/components/listbox/test-suites/ListboxMixin.suite.js +31 -1
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.js +22 -0
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.js +64 -0
- package/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js +13 -7
- package/components/localize/test/number/formatNumber.test.js +6 -28
- package/custom-elements.json +13822 -9246
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts +12 -0
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/combobox/test/lion-combobox.test.d.ts.map +1 -1
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts +4 -0
- package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
- package/dist-types/components/dialog/test/lion-dialog.test.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FocusMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/LionField.d.ts +2 -1
- package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -11
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ResultValidator.d.ts +1 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +5 -0
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/dialog-integrations.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts +1 -0
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts +2 -4
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts +0 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts.map +1 -1
- package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-file/src/FileHandle.d.ts +55 -0
- package/dist-types/components/input-file/src/FileHandle.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts +230 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts +69 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts.map +1 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts +2 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts.map +1 -0
- package/dist-types/components/input-file/src/validators.d.ts +58 -0
- package/dist-types/components/input-file/src/validators.d.ts.map +1 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts +2 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts +5 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts +4 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts +13 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de.d.ts +13 -0
- package/dist-types/components/input-file/translations/de.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-US.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-US.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en.d.ts +13 -0
- package/dist-types/components/input-file/translations/en.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts +13 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es.d.ts +13 -0
- package/dist-types/components/input-file/translations/es.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts +13 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it.d.ts +13 -0
- package/dist-types/components/input-file/translations/it.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh.d.ts.map +1 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +6 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +0 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/listbox/src/ListboxMixin.d.ts.map +1 -1
- package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.d.ts +14 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.d.ts.map +1 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.d.ts +20 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.d.ts.map +1 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.d.ts.map +1 -1
- package/dist-types/exports/checkbox-group-test-suites.d.ts +2 -0
- package/dist-types/exports/checkbox-group-test-suites.d.ts.map +1 -0
- package/dist-types/exports/define/lion-input-file.d.ts +2 -0
- package/dist-types/exports/define/lion-input-file.d.ts.map +1 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts +2 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts.map +1 -0
- package/dist-types/exports/input-file.d.ts +4 -0
- package/dist-types/exports/input-file.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/extensions/bootstrap-button.mjs +240 -0
- package/docs/components/button/extensions.md +30 -0
- package/docs/components/checkbox-group/overview.md +9 -10
- package/docs/components/checkbox-group/use-cases.md +110 -142
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/{examples.md → extensions.md} +51 -43
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/src/google-combobox/google-combobox.js +4 -1
- package/docs/components/combobox/src/md-combobox/md-combobox.js +40 -38
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +204 -209
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount/use-cases.md +4 -2
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +11 -0
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/index.md +3 -0
- package/docs/components/input-file/overview.md +32 -0
- package/docs/components/input-file/use-cases.md +424 -0
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/{examples.md → extensions.md} +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +28 -0
- package/docs/fundamentals/systems/core/SlotMixin.md +148 -0
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/use-cases.md +2 -0
- package/docs/fundamentals/systems/form/validate.md +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +116 -0
- package/docs/fundamentals/systems/overlays/_edge-cases.md +145 -0
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +21 -0
- package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +19 -0
- package/docs/fundamentals/tools/singleton-manager/example-success/index.md +18 -0
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +88 -0
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/how-to/get-started.md +28 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/exports/checkbox-group-test-suites.js +1 -0
- package/exports/define/lion-input-file.js +3 -0
- package/exports/define/lion-selected-file-list.js +3 -0
- package/exports/input-file.js +3 -0
- package/package.json +3 -2
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js +0 -25
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js +0 -15
- package/dist-types/components/checkbox-group/test/lion-checkbox-indeterminate.test.d.ts +0 -4
- package/dist-types/components/checkbox-group/test/lion-checkbox-indeterminate.test.d.ts.map +0 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.d.ts +0 -14
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.d.ts.map +0 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.d.ts +0 -9
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.d.ts.map +0 -1
- package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
- package/docs/components/dialog/src/demo-dialog-style.js +0 -3
- package/docs/components/select-rich/src/flags.png +0 -0
- package/docs/components/select-rich/src/flags@2x.png +0 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +0 -84
- package/docs/fundamentals/tools/ajax/assets/naga.json +0 -9
- package/docs/fundamentals/tools/ajax/assets/pabu.json +0 -9
- package/docs/fundamentals/tools/singleton-manager/.gitignore +0 -1
- package/docs/override.js +0 -15
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import '@lion/ui/define/lion-selected-file-list.js';
|
|
2
|
+
import { expect, fixture as _fixture, html, oneEvent } from '@open-wc/testing';
|
|
3
|
+
import sinon from 'sinon';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('../src/LionSelectedFileList.js').LionSelectedFileList} LionSelectedFileList
|
|
7
|
+
* @typedef {import('../types/input-file.js').InputFile} InputFile
|
|
8
|
+
* @typedef {import('lit').TemplateResult} TemplateResult
|
|
9
|
+
*/
|
|
10
|
+
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionSelectedFileList>} */ (
|
|
11
|
+
_fixture
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
describe('lion-selected-file-list', () => {
|
|
15
|
+
/**
|
|
16
|
+
* @type {Partial<InputFile>}
|
|
17
|
+
*/
|
|
18
|
+
const fileSuccess = {
|
|
19
|
+
name: 'foo.txt',
|
|
20
|
+
status: 'SUCCESS',
|
|
21
|
+
downloadUrl: '#foo',
|
|
22
|
+
systemFile: {
|
|
23
|
+
name: 'foo.txt',
|
|
24
|
+
type: 'text/plain',
|
|
25
|
+
size: 1000,
|
|
26
|
+
status: 'SUCCESS',
|
|
27
|
+
},
|
|
28
|
+
response: {
|
|
29
|
+
name: 'foo',
|
|
30
|
+
type: 'text/plain',
|
|
31
|
+
size: 1000,
|
|
32
|
+
status: 'SUCCESS',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @type {Partial<InputFile>}
|
|
38
|
+
*/
|
|
39
|
+
const fileLoading = {
|
|
40
|
+
status: 'LOADING',
|
|
41
|
+
systemFile: {
|
|
42
|
+
name: 'bar.txt',
|
|
43
|
+
type: 'text/plain',
|
|
44
|
+
size: 100,
|
|
45
|
+
status: 'LOADING',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @type {Partial<InputFile>}
|
|
51
|
+
*/
|
|
52
|
+
const fileFail = {
|
|
53
|
+
systemFile: {
|
|
54
|
+
name: 'foobar.txt',
|
|
55
|
+
type: 'text/plain',
|
|
56
|
+
size: 1000,
|
|
57
|
+
status: 'FAIL',
|
|
58
|
+
},
|
|
59
|
+
status: 'FAIL',
|
|
60
|
+
validationFeedback: [{ message: 'foobar', type: 'error' }],
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
it('when empty show nothing', async () => {
|
|
64
|
+
const el = await fixture(html`<lion-selected-file-list></lion-selected-file-list>`);
|
|
65
|
+
expect(el.children.length).to.equal(0);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('can have 1 item', async () => {
|
|
69
|
+
const el = await fixture(html`
|
|
70
|
+
<lion-selected-file-list .fileList="${[fileSuccess]}"></lion-selected-file-list>
|
|
71
|
+
`);
|
|
72
|
+
const fileItems = el.shadowRoot?.querySelectorAll('.selected__list__item');
|
|
73
|
+
expect(fileItems?.length).to.equal(1);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('shows a list when multiple', async () => {
|
|
77
|
+
const el = await fixture(html`
|
|
78
|
+
<lion-selected-file-list
|
|
79
|
+
.fileList="${[fileSuccess, fileLoading]}"
|
|
80
|
+
.multiple="${true}"
|
|
81
|
+
></lion-selected-file-list>
|
|
82
|
+
`);
|
|
83
|
+
const fileItems = el.shadowRoot?.querySelectorAll('.selected__list__item');
|
|
84
|
+
expect(fileItems?.length).to.equal(2);
|
|
85
|
+
const fileList = el.shadowRoot?.querySelector('.selected__list');
|
|
86
|
+
expect(fileList?.tagName).to.equal('UL');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('displays an anchor when status="SUCCESS" and a downloadUrl is available', async () => {
|
|
90
|
+
const el = await fixture(html`
|
|
91
|
+
<lion-selected-file-list
|
|
92
|
+
.fileList="${[fileSuccess, fileLoading, fileFail]}"
|
|
93
|
+
.multiple="${true}"
|
|
94
|
+
></lion-selected-file-list>
|
|
95
|
+
`);
|
|
96
|
+
const fileItems = el.shadowRoot?.querySelectorAll('.selected__list__item');
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
expect(fileItems[0].querySelector('.selected__list__item__label__link')).to.exist;
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
expect(fileItems[1].querySelector('.selected__list__item__label__link')).to.not.exist;
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
expect(fileItems[2].querySelector('.selected__list__item__label__link')).to.not.exist;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('displays a feedback message when status="FAIL"', async () => {
|
|
106
|
+
const el = await fixture(html`
|
|
107
|
+
<lion-selected-file-list .fileList="${[fileFail]}"></lion-selected-file-list>
|
|
108
|
+
`);
|
|
109
|
+
const fileItems = el.shadowRoot?.querySelectorAll('.selected__list__item');
|
|
110
|
+
const feedback = fileItems ? fileItems[0].querySelector('lion-validation-feedback') : undefined;
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
expect(feedback).to.exist;
|
|
113
|
+
expect(feedback).shadowDom.to.equal('foobar');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should call removeFile method on click of remove button', async () => {
|
|
117
|
+
const el = await fixture(html`
|
|
118
|
+
<lion-selected-file-list .fileList="${[fileSuccess, fileLoading]}"></lion-selected-file-list>
|
|
119
|
+
`);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @type {HTMLButtonElement | null | undefined}
|
|
123
|
+
*/
|
|
124
|
+
const removeButton = el.shadowRoot?.querySelector('.selected__list__item__remove-button');
|
|
125
|
+
const removeFileSpy = sinon.spy(el, /** @type {keyof LionSelectedFileList} */ ('_removeFile'));
|
|
126
|
+
removeButton?.click();
|
|
127
|
+
expect(removeFileSpy).have.been.calledOnce;
|
|
128
|
+
removeFileSpy.restore();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('should fire file-remove-requested event with removed file data', async () => {
|
|
132
|
+
const el = await fixture(html`
|
|
133
|
+
<lion-selected-file-list .fileList="${[fileSuccess, fileLoading]}"></lion-selected-file-list>
|
|
134
|
+
`);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @type {Partial<InputFile>}
|
|
138
|
+
*/
|
|
139
|
+
const removedFile = {
|
|
140
|
+
name: el.fileList[0].name,
|
|
141
|
+
status: el.fileList[0].status,
|
|
142
|
+
systemFile: {
|
|
143
|
+
name: el.fileList[0].name,
|
|
144
|
+
},
|
|
145
|
+
response: {
|
|
146
|
+
name: el.fileList[0].name,
|
|
147
|
+
status: el.fileList[0].status,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
// @ts-ignore ignore file typing
|
|
153
|
+
el._removeFile(removedFile);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const removeFileEvent = await oneEvent(el, 'file-remove-requested');
|
|
157
|
+
expect(removeFileEvent).to.exist;
|
|
158
|
+
expect(removeFileEvent.detail.removedFile).to.deep.equal({
|
|
159
|
+
name: 'foo.txt',
|
|
160
|
+
status: 'SUCCESS',
|
|
161
|
+
systemFile: {
|
|
162
|
+
name: 'foo.txt',
|
|
163
|
+
},
|
|
164
|
+
response: {
|
|
165
|
+
name: 'foo.txt',
|
|
166
|
+
status: 'SUCCESS',
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
expect(removeFileEvent.detail.status).to.deep.equal('SUCCESS');
|
|
170
|
+
expect(removeFileEvent.detail.uploadResponse).to.deep.equal({
|
|
171
|
+
name: 'foo.txt',
|
|
172
|
+
status: 'SUCCESS',
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe('Accessibility', async () => {
|
|
177
|
+
it('is accessible', async () => {
|
|
178
|
+
const el = await fixture(
|
|
179
|
+
html`<lion-selected-file-list
|
|
180
|
+
.fileList="${[fileSuccess, fileLoading, fileFail]}"
|
|
181
|
+
></lion-selected-file-list>`,
|
|
182
|
+
);
|
|
183
|
+
await expect(el).to.be.accessible();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it(`adds aria-live="polite" to the feedback slot on focus, aria-live="assertive" to the feedback slot on blur,
|
|
187
|
+
so error messages appearing on blur will be read before those of the next input`, async () => {
|
|
188
|
+
const el = await fixture(html`
|
|
189
|
+
<lion-selected-file-list .fileList="${[fileFail]}"></lion-selected-file-list>
|
|
190
|
+
`);
|
|
191
|
+
const fileFeedback = el?.shadowRoot?.querySelectorAll('[id^="file-feedback"]')[0];
|
|
192
|
+
const removeButton = /** @type {HTMLButtonElement} */ (
|
|
193
|
+
el.shadowRoot?.querySelector('.selected__list__item__remove-button')
|
|
194
|
+
);
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
expect(fileFeedback.getAttribute('aria-live')).to.equal('assertive');
|
|
197
|
+
|
|
198
|
+
removeButton?.focus();
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
expect(fileFeedback.getAttribute('aria-live')).to.equal('polite');
|
|
201
|
+
|
|
202
|
+
removeButton?.blur();
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
expect(fileFeedback.getAttribute('aria-live')).to.equal('assertive');
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Моля, качете файл с макс. размер {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Моля, качете файл от тип {allowedType} с макс. размер {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Моля, качете файл от тип {allowedTypesArray} или {allowedTypesLastItem} с макс. размер {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Плъзнете и пуснете Вашите файлове тук или',
|
|
7
|
+
fileNameDescriptionLabel: 'Име на файл: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Отстраняване на файла {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Файл със същото име на файл вече е налице.',
|
|
10
|
+
selectTextMultipleFile: 'Избор на файлове',
|
|
11
|
+
selectTextSingleFile: 'Избор на файл',
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Nahrajte soubor s max. velikostí {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple:
|
|
4
|
+
'Nahrajte soubor typu {allowedTypesLastItem} s max. velikostí {maxSize}.',
|
|
5
|
+
allowedFileValidatorComplex:
|
|
6
|
+
'Nahrajte soubor typu {allowedTypesArray} nebo {allowedTypesLastItem} s max. velikostí {maxSize}.',
|
|
7
|
+
dragAndDropText: 'Přetáhněte soubory sem nebo',
|
|
8
|
+
fileNameDescriptionLabel: 'Název souboru: {fileName}',
|
|
9
|
+
removeButtonLabel: 'Odebrat soubor {fileName}',
|
|
10
|
+
selectTextDuplicateFileName: 'Soubor se stejným názvem byl již přítomen.',
|
|
11
|
+
selectTextMultipleFile: 'Vybrat soubory',
|
|
12
|
+
selectTextSingleFile: 'Vybrat soubor',
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Laden Sie eine Datei mit max. {maxSize} hoch.',
|
|
3
|
+
allowedFileValidatorSimple: 'Laden Sie eine {allowedType}-Datei mit max. {maxSize} hoch.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Laden Sie eine {allowedTypesArray} oder {allowedTypesLastItem}-Datei mit max. {maxSize} hoch.',
|
|
6
|
+
dragAndDropText: 'Ziehen Sie Ihre Dateien per Drag & Drop hierher oder',
|
|
7
|
+
fileNameDescriptionLabel: 'Dateiname: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Datei {fileName} entfernen',
|
|
9
|
+
selectTextDuplicateFileName: 'Eine Datei mit demselben Dateinamen war bereits vorhanden.',
|
|
10
|
+
selectTextMultipleFile: 'Dateien auswählen',
|
|
11
|
+
selectTextSingleFile: 'Datei auswählen',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Please select a file with max {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Please select a(n) {allowedType} file with max {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Please select a {allowedTypesArray} or {allowedTypesLastItem} file with max {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Drag & Drop your files here or', // TODO: or what? Why is Drag & Drop capitalized?
|
|
7
|
+
fileNameDescriptionLabel: 'File name: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Remove {fileName} file',
|
|
9
|
+
selectTextDuplicateFileName: 'A file with same filename was already present.',
|
|
10
|
+
selectTextMultipleFile: 'Select files',
|
|
11
|
+
selectTextSingleFile: 'Select file',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Cargue un archivo de {maxSize} como máximo.',
|
|
3
|
+
allowedFileValidatorSimple: 'Cargue un archivo {allowedType} de {maxSize} como máximo.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Cargue un archivo {allowedTypesArray} o {allowedTypesLastItem} de {maxSize} como máximo.',
|
|
6
|
+
dragAndDropText: 'Arrastre y suelte los archivos aquí o',
|
|
7
|
+
fileNameDescriptionLabel: 'Nombre de archivo: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Elimine el archivo: {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Ya había un archivo con el mismo nombre de archivo.',
|
|
10
|
+
selectTextMultipleFile: 'Seleccionar archivos',
|
|
11
|
+
selectTextSingleFile: 'Seleccionar archivo',
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Veuillez télécharger un fichier avec une taille maximale de {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple:
|
|
4
|
+
'Veuillez télécharger un fichier {allowedType} avec une taille maximale de {maxSize}.',
|
|
5
|
+
allowedFileValidatorComplex:
|
|
6
|
+
'Veuillez télécharger un fichier {allowedTypesArray} ou {allowedTypesLastItem} avec une taille maximale de {maxSize}.',
|
|
7
|
+
dragAndDropText: 'Glissez et déposez vos fichiers ici ou',
|
|
8
|
+
fileNameDescriptionLabel: 'Nom de fichier: {fileName}',
|
|
9
|
+
removeButtonLabel: 'Supprimer le fichier {fileName}',
|
|
10
|
+
selectTextDuplicateFileName: 'Un fichier portant le même nom de fichier était déjà présent.',
|
|
11
|
+
selectTextMultipleFile: 'Sélectionnez des fichiers',
|
|
12
|
+
selectTextSingleFile: 'Sélectionnez un fichier',
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Töltsön fel egy legfeljebb {maxSize} méretű fájlt.',
|
|
3
|
+
allowedFileValidatorSimple: 'Töltsön fel egy legfeljebb {maxSize} méretű {allowedType} fájlt.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Töltsön fel egy legfeljebb {maxSize} méretű {allowedTypesArray} vagy {allowedTypesLastItem} fájlt.',
|
|
6
|
+
dragAndDropText: 'Húzza át a fájlokat ide vagy',
|
|
7
|
+
fileNameDescriptionLabel: 'Fájlnév: {fileName}',
|
|
8
|
+
removeButtonLabel: 'A(z) {fileName} fájl eltávolítása',
|
|
9
|
+
selectTextDuplicateFileName: 'Már volt ilyen nevű fájl.',
|
|
10
|
+
selectTextMultipleFile: 'Fájl(ok) kiválasztása',
|
|
11
|
+
selectTextSingleFile: 'Fájl kiválasztása',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Caricare un file di {maxSize} max.',
|
|
3
|
+
allowedFileValidatorSimple: 'Caricare un file {allowedType} di {maxSize} max.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Caricare un file {allowedTypesArray} o {allowedTypesLastItem} di {maxSize} max.',
|
|
6
|
+
dragAndDropText: 'Trascinare i file qui o',
|
|
7
|
+
fileNameDescriptionLabel: 'Nome file: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Rimuovere il file {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Un file con lo stesso nome file era già presente.',
|
|
10
|
+
selectTextMultipleFile: 'Seleziona file',
|
|
11
|
+
selectTextSingleFile: 'Seleziona file',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Upload een bestand van maximaal {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Upload een {allowedType}-bestand van maximaal {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Upload een {allowedTypesArray} of {allowedTypesLastItem}-bestand van maximaal {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Sleep uw bestanden hierheen of',
|
|
7
|
+
fileNameDescriptionLabel: 'Bestandsnaam: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Verwijder het bestand {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Er bestaat al een bestand met dezelfde bestandsnaam.',
|
|
10
|
+
selectTextMultipleFile: 'Selecteer bestanden',
|
|
11
|
+
selectTextSingleFile: 'Selecteer bestand',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Prześlij plik o maks. rozmiarze {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Prześlij plik {allowedType} o maks. rozmiarze {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Prześlij plik {allowedTypesArray} lub {allowedTypesLastItem} o maks. rozmiarze {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Przeciągnij i upuść pliki tutaj lub',
|
|
7
|
+
fileNameDescriptionLabel: 'Nazwa pliku: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Usuń plik {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Plik o tej samej nazwie już istnieje.',
|
|
10
|
+
selectTextMultipleFile: 'Wybierz pliki',
|
|
11
|
+
selectTextSingleFile: 'Wybierz plik',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Încărcaţi un fişier de max. {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Încărcaţi un fişier {allowedType} de max. {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Încărcaţi un fişier {allowedTypesArray} sau {allowedTypesLastItem} de max. {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Glisaţi şi fixaţi fişierele aici sau',
|
|
7
|
+
fileNameDescriptionLabel: 'Nume fişier: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Eliminaţi fişierul {filename}',
|
|
9
|
+
selectTextDuplicateFileName: 'Există deja un fişier cu acelaşi nume de fişier.',
|
|
10
|
+
selectTextMultipleFile: 'Selectare fișiere',
|
|
11
|
+
selectTextSingleFile: 'Selectare fișier',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Загрузите файл размером не более {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Загрузите файл {allowedType} размером не более {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Загрузите файл {allowedTypesArray} или {allowedTypesLastItem} размером не более {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Перетащите файлы сюда или',
|
|
7
|
+
fileNameDescriptionLabel: 'Название файла: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Удалить файл {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Файл с таким названием уже существует.',
|
|
10
|
+
selectTextMultipleFile: 'Выберите файлы',
|
|
11
|
+
selectTextSingleFile: 'Выберите файл',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Nahrajte súbor s maximálnou veľkosťou {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Nahrajte súbor {allowedType} s maximálnou veľkosťou {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Nahrajte súbor {allowedTypesArray} alebo {allowedTypesLastItem} s maximálnou veľkosťou {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Súbory presuňte sem alebo',
|
|
7
|
+
fileNameDescriptionLabel: 'Názov súboru: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Odstrániť súbor {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Súbor s rovnakým názvom súboru už existoval.',
|
|
10
|
+
selectTextMultipleFile: 'Vybrať súbory',
|
|
11
|
+
selectTextSingleFile: 'Vybrať súbor',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Завантажте файл розміром до {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Завантажте файл {allowedType} розміром до {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Завантажте файл {allowedTypesArray} або {allowedTypesLastItem} розміром до {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Перетягніть файли сюди або',
|
|
7
|
+
fileNameDescriptionLabel: 'Ім’я файлу: {fileName}',
|
|
8
|
+
removeButtonLabel: 'Видалення файлу {fileName}',
|
|
9
|
+
selectTextDuplicateFileName: 'Файл із такою назвою вже існував.',
|
|
10
|
+
selectTextMultipleFile: 'Виберіть файли',
|
|
11
|
+
selectTextSingleFile: 'Виберіть файл',
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: '请上传最大 {maxSize} 的文件。',
|
|
3
|
+
allowedFileValidatorSimple: '请上传最大 {maxSize} 的 {allowedType} 文件。',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'请上传最大 {maxSize} 的 {allowedTypesArray} 或 {allowedTypesLastItem} 文件。',
|
|
6
|
+
dragAndDropText: '将您的文件拖放到此处,或',
|
|
7
|
+
fileNameDescriptionLabel: '文件名: {fileName}',
|
|
8
|
+
removeButtonLabel: '删除 {fileName} 文件',
|
|
9
|
+
selectTextDuplicateFileName: '已存在具有相同文件名的文件。',
|
|
10
|
+
selectTextMultipleFile: '选择多个文件',
|
|
11
|
+
selectTextSingleFile: '选择文件',
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FeedbackMessage } from "../../form-core/types/validate/ValidateMixinTypes.js";
|
|
2
|
+
|
|
3
|
+
type FileBasics = {
|
|
4
|
+
name: string;
|
|
5
|
+
/** size in bytes */
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
status?: 'SUCCESS' | 'FAIL' | 'LOADING';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type InputFile = {
|
|
12
|
+
downloadUrl?: string;
|
|
13
|
+
errorMessage?: FeedbackMessage.message;
|
|
14
|
+
failedProp?: Array<string|number>;
|
|
15
|
+
response?: UploadResponse;
|
|
16
|
+
systemFile: Partial<SystemFile>;
|
|
17
|
+
validationFeedback?: Array<FeedbackMessage>;
|
|
18
|
+
} & FileBasics & Partial<File>;
|
|
19
|
+
|
|
20
|
+
export type SystemFile = {
|
|
21
|
+
downloadUrl?: string;
|
|
22
|
+
errorMessage?: FeedbackMessage.message;
|
|
23
|
+
failedProp?: Array<string|number>;
|
|
24
|
+
response?: UploadResponse;
|
|
25
|
+
} & FileBasics & Partial<File>;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export type UploadResponse = {
|
|
29
|
+
downloadUrl?: string;
|
|
30
|
+
errorMessage?: FeedbackMessage.message;
|
|
31
|
+
id?: string;
|
|
32
|
+
} & Partial<FileBasics>;
|
|
@@ -180,7 +180,6 @@ export class LionInputTelDropdown extends LionInputTel {
|
|
|
180
180
|
|
|
181
181
|
return {
|
|
182
182
|
template: templates.dropdown(this._templateDataDropdown),
|
|
183
|
-
afterRender: this.__syncRegionWithDropdown,
|
|
184
183
|
};
|
|
185
184
|
},
|
|
186
185
|
};
|
|
@@ -274,9 +273,7 @@ export class LionInputTelDropdown extends LionInputTel {
|
|
|
274
273
|
updated(changedProperties) {
|
|
275
274
|
super.updated(changedProperties);
|
|
276
275
|
|
|
277
|
-
|
|
278
|
-
this.__syncRegionWithDropdown();
|
|
279
|
-
}
|
|
276
|
+
this.__syncRegionWithDropdown();
|
|
280
277
|
|
|
281
278
|
if (changedProperties.has('disabled') || changedProperties.has('readOnly')) {
|
|
282
279
|
if (this.disabled || this.readOnly) {
|
|
@@ -294,7 +294,6 @@ const ListboxMixinImplementation = superclass =>
|
|
|
294
294
|
* @protected
|
|
295
295
|
*/
|
|
296
296
|
this._repropagationRole = 'choice-group'; // configures FormControlMixin
|
|
297
|
-
|
|
298
297
|
/**
|
|
299
298
|
* When listbox is coupled to a textbox (in case we are dealing with a combobox),
|
|
300
299
|
* spaces should not select an element (they need to be put in the textbox)
|
|
@@ -612,7 +611,9 @@ const ListboxMixinImplementation = superclass =>
|
|
|
612
611
|
if (key === ' ' && this._listboxReceivesNoFocus) {
|
|
613
612
|
return;
|
|
614
613
|
}
|
|
615
|
-
|
|
614
|
+
if (key === ' ') {
|
|
615
|
+
ev.preventDefault();
|
|
616
|
+
}
|
|
616
617
|
if (!this.formElements[this.activeIndex]) {
|
|
617
618
|
return;
|
|
618
619
|
}
|