* feat(input-file): create input-file component
* chore: improvements after review
* chore: update after review
* chore: update translations
* chore: - fixed demo with form submit, submit was not prevented
- fixed checking allowed file extensions
- fixed clicking on select file button in drag and drop area
* chore: since the input-file does not upload files itself but enables user to select files, I replaced "upload" and "upload" with "select" and "selected" where applicable
* chore: - removed unused properties allowedFileTypes and allowedFileExtensions from lion-input-file
- cleaned up docs
* chore: - changed type Array.<type> to Array<type>
- removed redundant type definition
* fix: - FocusMixin: moved registering events for from connectedCallback to firstUpdated since _focusableNode is sometimes not available yet
- SlotMixin: changed updated to update in since slots were rendered too late (related to previous fix in FocusMixin.js)
* fix: renamed lion-uploaded-file-list.js to lion-selected-file-list.js
* fix: fixed test for lion-selected-file-list
* fix: fixed typ
* wip
* fix: - fixed issue with multiple file selection where element would not select valid files after invalid ones
- added getMessage method to FileValidation that returns empty string to prevent message being shown that error message must be configured
- fixed tests
* chore: replaced `uploadOnFormSubmit` with `uploadOnSelect` and flipped the default value to false. When `uploadOnSelect` is set to true, the file will be uploaded as soon as it is selected.
* fix: - replaced `uploadOnFormSubmit` with `uploadOnSelect` and flipped the default value to false. When `uploadOnSelect` is set to true, the file will be uploaded as soon as it is selected.
- fixed issue where a valid file was not selected and added to the file list if it was preceded by an invalid file
* chore: removed redundant README.md
* fix: fixed failing test
* chore: added missing type annotation
* chore: annotated event param as optional
---------
Co-authored-by: Danny Moerkerke <danny.moerkerke@ing.com>
Co-authored-by: Thijs Louisse <Thijs.Louisse@ing.com>
75 lines
2.9 KiB
JavaScript
75 lines
2.9 KiB
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
export const localizeNamespaceLoader = /** @param {string} locale */ locale => {
|
|
switch (locale) {
|
|
case 'bg-BG':
|
|
return import('@lion/ui/input-file-translations/bg-BG.js');
|
|
case 'bg':
|
|
return import('@lion/ui/input-file-translations/bg.js');
|
|
case 'cs-CZ':
|
|
return import('@lion/ui/input-file-translations/cs-CZ.js');
|
|
case 'cs':
|
|
return import('@lion/ui/input-file-translations/cs.js');
|
|
case 'de-DE':
|
|
return import('@lion/ui/input-file-translations/de-DE.js');
|
|
case 'de':
|
|
return import('@lion/ui/input-file-translations/de.js');
|
|
case 'en-AU':
|
|
return import('@lion/ui/input-file-translations/en-AU.js');
|
|
case 'en-GB':
|
|
return import('@lion/ui/input-file-translations/en-GB.js');
|
|
case 'en-US':
|
|
return import('@lion/ui/input-file-translations/en-US.js');
|
|
case 'en-PH':
|
|
case 'en':
|
|
return import('@lion/ui/input-file-translations/en.js');
|
|
case 'es-ES':
|
|
return import('@lion/ui/input-file-translations/es-ES.js');
|
|
case 'es':
|
|
return import('@lion/ui/input-file-translations/es.js');
|
|
case 'fr-FR':
|
|
return import('@lion/ui/input-file-translations/fr-FR.js');
|
|
case 'fr-BE':
|
|
return import('@lion/ui/input-file-translations/fr-BE.js');
|
|
case 'fr':
|
|
return import('@lion/ui/input-file-translations/fr.js');
|
|
case 'hu-HU':
|
|
return import('@lion/ui/input-file-translations/hu-HU.js');
|
|
case 'hu':
|
|
return import('@lion/ui/input-file-translations/hu.js');
|
|
case 'it-IT':
|
|
return import('@lion/ui/input-file-translations/it-IT.js');
|
|
case 'it':
|
|
return import('@lion/ui/input-file-translations/it.js');
|
|
case 'nl-BE':
|
|
return import('@lion/ui/input-file-translations/nl-BE.js');
|
|
case 'nl-NL':
|
|
return import('@lion/ui/input-file-translations/nl-NL.js');
|
|
case 'nl':
|
|
return import('@lion/ui/input-file-translations/nl.js');
|
|
case 'pl-PL':
|
|
return import('@lion/ui/input-file-translations/pl-PL.js');
|
|
case 'pl':
|
|
return import('@lion/ui/input-file-translations/pl.js');
|
|
case 'ro-RO':
|
|
return import('@lion/ui/input-file-translations/ro-RO.js');
|
|
case 'ro':
|
|
return import('@lion/ui/input-file-translations/ro.js');
|
|
case 'ru-RU':
|
|
return import('@lion/ui/input-file-translations/ru-RU.js');
|
|
case 'ru':
|
|
return import('@lion/ui/input-file-translations/ru.js');
|
|
case 'sk-SK':
|
|
return import('@lion/ui/input-file-translations/sk-SK.js');
|
|
case 'sk':
|
|
return import('@lion/ui/input-file-translations/sk.js');
|
|
case 'uk-UA':
|
|
return import('@lion/ui/input-file-translations/uk-UA.js');
|
|
case 'uk':
|
|
return import('@lion/ui/input-file-translations/uk.js');
|
|
case 'zh-CN':
|
|
case 'zh':
|
|
return import('@lion/ui/input-file-translations/zh.js');
|
|
default:
|
|
return import('@lion/ui/input-file-translations/en.js');
|
|
}
|
|
};
|