@lion/ui 0.15.2 → 0.15.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/README.md +46 -11
- package/components/combobox/src/LionCombobox.js +4 -1
- package/components/combobox/test/lion-combobox-integrations.test.js +23 -0
- package/components/combobox/test/lion-combobox.test.js +20 -0
- package/components/core/src/ScopedStylesController.js +7 -10
- package/components/core/test-helpers/getCachedFixture.js +55 -0
- package/components/form-core/src/validate/LionValidationFeedback.js +2 -2
- package/components/form-core/src/validate/ValidateMixin.js +3 -3
- package/components/form-core/test/validate/lion-validation-feedback.test.js +2 -2
- package/components/form-core/test-suites/ValidateMixin.suite.js +23 -11
- package/components/form-core/translations/bg.js +4 -4
- package/components/form-core/translations/cs.js +4 -4
- package/components/form-core/translations/de.js +4 -4
- package/components/form-core/translations/en.js +4 -4
- package/components/form-core/translations/es.js +4 -4
- package/components/form-core/translations/fr.js +4 -4
- package/components/form-core/translations/hu.js +4 -4
- package/components/form-core/translations/it.js +4 -4
- package/components/form-core/translations/nl.js +4 -4
- package/components/form-core/translations/pl.js +4 -4
- package/components/form-core/translations/ro.js +4 -4
- package/components/form-core/translations/ru.js +4 -4
- package/components/form-core/translations/sk.js +4 -4
- package/components/form-core/translations/uk.js +4 -4
- package/components/form-core/translations/zh.js +4 -4
- package/components/input-amount/src/parsers.js +3 -2
- package/components/input-amount/test/parsers.test.js +6 -0
- package/components/input-amount-dropdown/src/currencyUtil.js +1 -1
- package/components/input-file/src/localizeNamespaceLoader.js +4 -0
- package/components/input-file/translations/bg.js +5 -0
- package/components/input-file/translations/cs.js +5 -0
- package/components/input-file/translations/es.js +5 -0
- package/components/input-file/translations/fr.js +5 -0
- package/components/input-file/translations/hu.js +5 -0
- package/components/input-file/translations/id-ID.js +5 -0
- package/components/input-file/translations/id.js +19 -0
- package/components/input-file/translations/it.js +5 -0
- package/components/input-file/translations/pl.js +5 -0
- package/components/input-file/translations/ro.js +5 -0
- package/components/input-file/translations/sk.js +5 -0
- package/components/input-file/translations/uk.js +5 -0
- package/components/input-file/translations/zh.js +5 -0
- package/components/input-stepper/src/LionInputStepper.js +48 -52
- package/components/input-stepper/test/lion-input-stepper-integrations.test.js +2 -19
- package/components/input-stepper/test/lion-input-stepper.test.js +2 -476
- package/components/input-stepper/test-suites/lion-input-stepper.integration.suite.js +19 -0
- package/components/input-stepper/test-suites/lion-input-stepper.suite.js +673 -0
- package/components/listbox/src/ListboxMixin.js +0 -1
- package/components/listbox/test-suites/ListboxMixin.suite.js +71 -2
- package/components/overlays/src/OverlayController.js +3 -0
- package/components/overlays/src/OverlaysManager.js +9 -2
- package/components/overlays/test/OverlayController.test.js +22 -9
- package/components/overlays/test/OverlaysManager.test.js +16 -0
- package/components/pagination/src/LionPagination.js +2 -1
- package/components/pagination/test/lion-pagination.test.js +41 -0
- package/components/validate-messages/translations/it.js +2 -2
- package/custom-elements.json +281 -179
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/core/src/ScopedStylesController.d.ts +1 -2
- package/dist-types/components/core/src/ScopedStylesController.d.ts.map +1 -1
- package/dist-types/components/core/test-helpers/getCachedFixture.d.ts +14 -0
- package/dist-types/components/core/test-helpers/getCachedFixture.d.ts.map +1 -0
- package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/helpers/helpers.d.ts +3 -3
- package/dist-types/components/form-integrations/test/helpers/helpers.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/parsers.d.ts.map +1 -1
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts +1 -1
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts.map +1 -1
- package/dist-types/components/input-file/translations/bg-BG.d.ts +5 -0
- package/dist-types/components/input-file/translations/bg.d.ts +5 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts +5 -0
- package/dist-types/components/input-file/translations/cs.d.ts +5 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts +5 -0
- package/dist-types/components/input-file/translations/es.d.ts +5 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts +5 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts +5 -0
- package/dist-types/components/input-file/translations/fr.d.ts +5 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts +5 -0
- package/dist-types/components/input-file/translations/hu.d.ts +5 -0
- package/dist-types/components/input-file/translations/id-ID.d.ts +20 -0
- package/dist-types/components/input-file/translations/id-ID.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/id.d.ts +20 -0
- package/dist-types/components/input-file/translations/id.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts +5 -0
- package/dist-types/components/input-file/translations/it.d.ts +5 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts +5 -0
- package/dist-types/components/input-file/translations/pl.d.ts +5 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts +5 -0
- package/dist-types/components/input-file/translations/ro.d.ts +5 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts +5 -0
- package/dist-types/components/input-file/translations/sk.d.ts +5 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts +5 -0
- package/dist-types/components/input-file/translations/uk.d.ts +5 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts +5 -0
- package/dist-types/components/input-file/translations/zh.d.ts +5 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +4 -20
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
- package/dist-types/components/input-stepper/test/lion-input-stepper.test.d.ts +1 -2
- package/dist-types/components/input-stepper/test/lion-input-stepper.test.d.ts.map +1 -1
- package/dist-types/components/input-stepper/test-suites/lion-input-stepper.integration.suite.d.ts +3 -0
- package/dist-types/components/input-stepper/test-suites/lion-input-stepper.integration.suite.d.ts.map +1 -0
- package/dist-types/components/input-stepper/test-suites/lion-input-stepper.suite.d.ts +4 -0
- package/dist-types/components/input-stepper/test-suites/lion-input-stepper.suite.d.ts.map +1 -0
- 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/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlaysManager.d.ts +4 -1
- package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
- package/dist-types/components/pagination/src/LionPagination.d.ts.map +1 -1
- package/dist-types/exports/input-stepper-suites.d.ts +6 -0
- package/dist-types/exports/input-stepper-suites.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/checkbox-group/use-cases.md +3 -9
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- 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/form/use-cases.md +2 -2
- 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-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +2 -3
- 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/overview.md +1 -1
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/radio-group/use-cases.md +3 -9
- package/docs/components/select/overview.md +1 -1
- package/docs/components/select/use-cases.md +6 -6
- package/docs/components/select-rich/use-cases.md +2 -2
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +2 -2
- package/docs/fundamentals/systems/core/api-table.md +3 -4
- 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/validate.md +38 -30
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +1 -1
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/exports/input-stepper-suites.js +11 -0
- package/input-stepper-suites.js +11 -0
- package/package.json +1 -1
|
@@ -8,6 +8,11 @@ export default {
|
|
|
8
8
|
fileNameDescriptionLabel: 'Název souboru: ',
|
|
9
9
|
generalValidatorMessage: '"{validatorMessage}", pro {listOfErroneousFiles}.',
|
|
10
10
|
noFilesSelected: 'Nebyly vybrány žádné soubory.',
|
|
11
|
+
noFilesUploaded: 'Nebyly nahrány žádné soubory.',
|
|
12
|
+
fileSelected: 'Zvolené soubor: ',
|
|
13
|
+
fileUploaded: 'Nahraný soubor: ',
|
|
14
|
+
filesSelected: 'Zvolené soubory: {numberOfFiles} souborů.',
|
|
15
|
+
filesUploaded: 'Nahrané soubory: {numberOfFiles} souborů.',
|
|
11
16
|
numberOfFiles: '{numberOfFiles} soubory/souborů.',
|
|
12
17
|
removeButtonLabel: 'Odebrat soubor {fileName}',
|
|
13
18
|
selectTextDuplicateFileName: 'Soubor se stejným názvem byl již přítomen.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Nombre de archivo: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", para {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'No se han seleccionado archivos.',
|
|
10
|
+
noFilesUploaded: 'No se han cargado archivos.',
|
|
11
|
+
fileSelected: 'Archivo seleccionado: ',
|
|
12
|
+
fileUploaded: 'Archivo cargado: ',
|
|
13
|
+
filesSelected: 'Archivos seleccionados: {numberOfFiles} archivos.',
|
|
14
|
+
filesUploaded: 'Archivos cargados: {numberOfFiles} archivos.',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} archivos.',
|
|
11
16
|
removeButtonLabel: 'Elimine el archivo: {fileName}',
|
|
12
17
|
selectTextDuplicateFileName: 'Ya había un archivo con el mismo nombre de archivo.',
|
|
@@ -8,6 +8,11 @@ export default {
|
|
|
8
8
|
fileNameDescriptionLabel: 'Nom de fichier: ',
|
|
9
9
|
generalValidatorMessage: '"{validatorMessage}", pour {listOfErroneousFiles}.',
|
|
10
10
|
noFilesSelected: 'Aucun fichier sélectionné.',
|
|
11
|
+
noFilesUploaded: 'Aucun fichier téléchargé.',
|
|
12
|
+
fileSelected: 'Fichier sélectionnés : ',
|
|
13
|
+
fileUploaded: 'Fichier téléchargé : ',
|
|
14
|
+
filesSelected: 'Fichiers sélectionnés : {numberOfFiles} fichiers.',
|
|
15
|
+
filesUploaded: 'Fichiers téléchargés : {numberOfFiles} fichiers.',
|
|
11
16
|
numberOfFiles: '{numberOfFiles} fichiers.',
|
|
12
17
|
removeButtonLabel: 'Supprimer le fichier {fileName}',
|
|
13
18
|
selectTextDuplicateFileName: 'Un fichier portant le même nom de fichier était déjà présent.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Fájlnév: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", ehhez: {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Nincs fájl kiválasztva.',
|
|
10
|
+
noFilesUploaded: 'Nincs feltöltött fájl.',
|
|
11
|
+
fileSelected: 'Kiválasztott fájl: ',
|
|
12
|
+
fileUploaded: 'Feltöltött fájl: ',
|
|
13
|
+
filesSelected: 'Kiválasztott fájlok: {numberOfFiles} fájl.',
|
|
14
|
+
filesUploaded: 'Feltöltött fájlok: {numberOfFiles} fájl.',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} fájl.',
|
|
11
16
|
removeButtonLabel: 'A(z) {fileName} fájl eltávolítása',
|
|
12
17
|
selectTextDuplicateFileName: 'Már volt ilyen nevű fájl.',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
allowedFileSize: 'Unggah file dengan ukuran maks. {maxSize}.',
|
|
3
|
+
allowedFileValidatorSimple: 'Unggah file {allowedType} dengan ukuran maks. {maxSize}.',
|
|
4
|
+
allowedFileValidatorComplex:
|
|
5
|
+
'Unggah file {allowedTypesArray}, atau {allowedTypesLastItem} dengan ukuran maks. {maxSize}.',
|
|
6
|
+
dragAndDropText: 'Seret & Jatuhkan file di sini atau', // TODO: or what? Why is Drag & Drop capitalized?
|
|
7
|
+
fileNameDescriptionLabel: 'Nama file: ',
|
|
8
|
+
generalValidatorMessage: '"{validatorMessage}", untuk {listOfErroneousFiles}.',
|
|
9
|
+
noFilesSelected: 'Tidak ada file yang dipilih.',
|
|
10
|
+
noFilesUploaded: 'Tidak ada file yang diunggah.',
|
|
11
|
+
fileSelected: 'File yang dipilih: ',
|
|
12
|
+
fileUploaded: 'File yang diunggah: ',
|
|
13
|
+
filesSelected: 'File yang dipilih: {numberOfFiles} file.',
|
|
14
|
+
filesUploaded: 'File yang diunggah: {numberOfFiles} file.',
|
|
15
|
+
removeButtonLabel: 'Hapus file {fileName}',
|
|
16
|
+
selectTextDuplicateFileName: 'File dengan nama file yang sama sudah ada.',
|
|
17
|
+
selectTextMultipleFile: 'Pilih beberapa file',
|
|
18
|
+
selectTextSingleFile: 'Pilih berkas',
|
|
19
|
+
};
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Nome file: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", per {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Nessun file selezionato.',
|
|
10
|
+
noFilesUploaded: 'Nessun file caricato.',
|
|
11
|
+
fileSelected: 'File selezionati: ',
|
|
12
|
+
fileUploaded: 'File caricato: ',
|
|
13
|
+
filesSelected: 'File selezionati: {numberOfFiles} file.',
|
|
14
|
+
filesUploaded: 'File caricati: {numberOfFiles} file.',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} file.',
|
|
11
16
|
removeButtonLabel: 'Rimuovere il file {fileName}',
|
|
12
17
|
selectTextDuplicateFileName: 'Un file con lo stesso nome file era già presente.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Nazwa pliku: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", dla {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Nie wybrano żadnych plików.',
|
|
10
|
+
noFilesUploaded: 'Nie przesłano plików.',
|
|
11
|
+
fileSelected: 'Wybrane plik: ',
|
|
12
|
+
fileUploaded: 'Przesłany plik: ',
|
|
13
|
+
filesSelected: 'Wybrane pliki: Liczba plików: {numberOfFiles}.',
|
|
14
|
+
filesUploaded: 'Przesłane pliki: Liczba plików: {numberOfFiles}.',
|
|
10
15
|
numberOfFiles: 'Liczba plików: {numberOfFiles}.',
|
|
11
16
|
removeButtonLabel: 'Usuń plik {fileName}',
|
|
12
17
|
selectTextDuplicateFileName: 'Plik o tej samej nazwie już istnieje.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Nume fişier: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", pentru {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Niciun fișier selectat.',
|
|
10
|
+
noFilesUploaded: 'Nu au fost încărcate fișiere.',
|
|
11
|
+
fileSelected: 'Fișier selectate: ',
|
|
12
|
+
fileUploaded: 'Fișier încărcat: ',
|
|
13
|
+
filesSelected: 'Fișiere selectate: {numberOfFiles} fișiere.',
|
|
14
|
+
filesUploaded: 'Fișiere încărcate: {numberOfFiles} fișiere.',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} fișiere.',
|
|
11
16
|
removeButtonLabel: 'Eliminaţi fişierul {filename}',
|
|
12
17
|
selectTextDuplicateFileName: 'Există deja un fişier cu acelaşi nume de fişier.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Názov súboru: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", pre {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Neboli vybrané žiadne súbory.',
|
|
10
|
+
noFilesUploaded: 'Nenahrali sa žiadne súbory.',
|
|
11
|
+
fileSelected: 'Zvolené súbor: ',
|
|
12
|
+
fileUploaded: 'Nahratý súbor: ',
|
|
13
|
+
filesSelected: 'Zvolené súbory: {numberOfFiles} súbory/-ov.',
|
|
14
|
+
filesUploaded: 'Nahraté súbory: {numberOfFiles} súbory/-ov.',
|
|
10
15
|
numberOfFiles: 'Počet súborov: {numberOfFiles}.',
|
|
11
16
|
removeButtonLabel: 'Odstrániť súbor {fileName}',
|
|
12
17
|
selectTextDuplicateFileName: 'Súbor s rovnakým názvom súboru už existoval.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: 'Ім’я файлу: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", для {listOfErroneousFiles}.',
|
|
9
9
|
noFilesSelected: 'Не вибрано жодного файлу.',
|
|
10
|
+
noFilesUploaded: 'Файли не завантажено.',
|
|
11
|
+
fileSelected: 'Вибрані файл: ',
|
|
12
|
+
fileUploaded: 'Завантажений файл: ',
|
|
13
|
+
filesSelected: 'Вибрані файли: {numberOfFiles} файли(-ів).',
|
|
14
|
+
filesUploaded: 'Завантажені файли: {numberOfFiles} файли(-ів).',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} файли(-ів).',
|
|
11
16
|
removeButtonLabel: 'Видалення файлу {fileName}',
|
|
12
17
|
selectTextDuplicateFileName: 'Файл із такою назвою вже існував.',
|
|
@@ -7,6 +7,11 @@ export default {
|
|
|
7
7
|
fileNameDescriptionLabel: '文件名: ',
|
|
8
8
|
generalValidatorMessage: '"{validatorMessage}", 例如 {listOfErroneousFiles}。',
|
|
9
9
|
noFilesSelected: '未选择任何文件。',
|
|
10
|
+
noFilesUploaded: '未上传任何文件。',
|
|
11
|
+
fileSelected: '已选择文件: ',
|
|
12
|
+
fileUploaded: '已上传文件: ',
|
|
13
|
+
filesSelected: '已选择文件:{numberOfFiles} 个文件。',
|
|
14
|
+
filesUploaded: '已上传文件:{numberOfFiles} 个文件。',
|
|
10
15
|
numberOfFiles: '{numberOfFiles} 个文件。',
|
|
11
16
|
removeButtonLabel: '删除 {fileName} 文件',
|
|
12
17
|
selectTextDuplicateFileName: '已存在具有相同文件名的文件。',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, css, render } from 'lit';
|
|
1
|
+
import { html, css, render, nothing } from 'lit';
|
|
2
2
|
import { formatNumber, LocalizeMixin, parseNumber } from '@lion/ui/localize-no-side-effects.js';
|
|
3
3
|
import { LionInput } from '@lion/ui/input.js';
|
|
4
4
|
import { IsNumber, MinNumber, MaxNumber } from '@lion/ui/form-core.js';
|
|
@@ -96,8 +96,6 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
96
96
|
|
|
97
97
|
this._increment = this._increment.bind(this);
|
|
98
98
|
this._decrement = this._decrement.bind(this);
|
|
99
|
-
this._onEnterButton = this._onEnterButton.bind(this);
|
|
100
|
-
this._onLeaveButton = this._onLeaveButton.bind(this);
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
connectedCallback() {
|
|
@@ -244,6 +242,26 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
244
242
|
this._inputNode.removeAttribute('aria-valuenow');
|
|
245
243
|
this._inputNode.removeAttribute('aria-valuetext');
|
|
246
244
|
}
|
|
245
|
+
this._destroyOutputContent();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
_destroyOutputContent() {
|
|
249
|
+
const outputElement = /** @type {HTMLElement} */ (
|
|
250
|
+
this.shadowRoot?.querySelector('.input-stepper__value')
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
const timeoutValue = outputElement?.dataset?.selfDestruct
|
|
254
|
+
? Number(outputElement.dataset.selfDestruct)
|
|
255
|
+
: 2000;
|
|
256
|
+
clearTimeout(this.timer);
|
|
257
|
+
if (outputElement) {
|
|
258
|
+
this.timer = setTimeout(() => {
|
|
259
|
+
if (outputElement.parentNode) {
|
|
260
|
+
this.__valueText = nothing;
|
|
261
|
+
this.requestUpdate();
|
|
262
|
+
}
|
|
263
|
+
}, timeoutValue);
|
|
264
|
+
}
|
|
247
265
|
}
|
|
248
266
|
|
|
249
267
|
/**
|
|
@@ -267,12 +285,19 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
267
285
|
_increment() {
|
|
268
286
|
const { step, min, max } = this.values;
|
|
269
287
|
const stepMin = min !== Infinity ? min : 0;
|
|
288
|
+
const epsilon = 1e-10; // Tolerance for floating-point comparison
|
|
270
289
|
|
|
271
|
-
let newValue
|
|
290
|
+
let newValue;
|
|
272
291
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
292
|
+
const remainder = (this.currentValue - stepMin) % step;
|
|
293
|
+
const isAligned = Math.abs(remainder) < epsilon || Math.abs(remainder - step) < epsilon;
|
|
294
|
+
|
|
295
|
+
if (!isAligned) {
|
|
296
|
+
// If the value is not aligned to step, align it to the next valid step
|
|
297
|
+
newValue = Math.ceil((this.currentValue - stepMin) / step) * step + stepMin;
|
|
298
|
+
} else {
|
|
299
|
+
// If the value is aligned, just add the step
|
|
300
|
+
newValue = this.currentValue + step;
|
|
276
301
|
}
|
|
277
302
|
|
|
278
303
|
if (newValue <= max || max === Infinity) {
|
|
@@ -289,12 +314,19 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
289
314
|
_decrement() {
|
|
290
315
|
const { step, max, min } = this.values;
|
|
291
316
|
const stepMin = min !== Infinity ? min : 0;
|
|
317
|
+
const epsilon = 1e-10; // Tolerance for floating-point comparison
|
|
318
|
+
|
|
319
|
+
let newValue;
|
|
292
320
|
|
|
293
|
-
|
|
321
|
+
const remainder = (this.currentValue - stepMin) % step;
|
|
322
|
+
const isAligned = Math.abs(remainder) < epsilon || Math.abs(remainder - step) < epsilon;
|
|
294
323
|
|
|
295
|
-
if (
|
|
296
|
-
// If the value is not aligned to step, align it to the
|
|
297
|
-
newValue = Math.floor(this.currentValue / step) * step +
|
|
324
|
+
if (!isAligned) {
|
|
325
|
+
// If the value is not aligned to step, align it to the previous valid step
|
|
326
|
+
newValue = Math.floor((this.currentValue - stepMin) / step) * step + stepMin;
|
|
327
|
+
} else {
|
|
328
|
+
// If the value is aligned, just subtract the step
|
|
329
|
+
newValue = this.currentValue - step;
|
|
298
330
|
}
|
|
299
331
|
|
|
300
332
|
if (newValue >= min || min === Infinity) {
|
|
@@ -380,10 +412,8 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
380
412
|
<button
|
|
381
413
|
?disabled=${this.disabled || this.readOnly}
|
|
382
414
|
@click=${this._decrement}
|
|
383
|
-
@focus=${this._onEnterButton}
|
|
384
|
-
@blur=${this._onLeaveButton}
|
|
385
415
|
type="button"
|
|
386
|
-
aria-label="${this.msgLit('lion-input-stepper:decrease')}"
|
|
416
|
+
aria-label="${this.msgLit('lion-input-stepper:decrease')} ${this.fieldName}"
|
|
387
417
|
>
|
|
388
418
|
${this._decrementorSignTemplate()}
|
|
389
419
|
</button>
|
|
@@ -400,10 +430,8 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
400
430
|
<button
|
|
401
431
|
?disabled=${this.disabled || this.readOnly}
|
|
402
432
|
@click=${this._increment}
|
|
403
|
-
@focus=${this._onEnterButton}
|
|
404
|
-
@blur=${this._onLeaveButton}
|
|
405
433
|
type="button"
|
|
406
|
-
aria-label="${this.msgLit('lion-input-stepper:increase')}"
|
|
434
|
+
aria-label="${this.msgLit('lion-input-stepper:increase')} ${this.fieldName}"
|
|
407
435
|
>
|
|
408
436
|
${this._incrementorSignTemplate()}
|
|
409
437
|
</button>
|
|
@@ -413,7 +441,9 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
413
441
|
/** @protected */
|
|
414
442
|
_inputGroupTemplate() {
|
|
415
443
|
return html`
|
|
416
|
-
<
|
|
444
|
+
<output for="${this._inputId}" data-self-destruct="2000" class="input-stepper__value"
|
|
445
|
+
>${this.__valueText}</output
|
|
446
|
+
>
|
|
417
447
|
<div class="input-group">
|
|
418
448
|
${this._inputGroupBeforeTemplate()}
|
|
419
449
|
<div class="input-group__container">
|
|
@@ -424,38 +454,4 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
424
454
|
</div>
|
|
425
455
|
`;
|
|
426
456
|
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* @protected
|
|
430
|
-
* @param {Event} ev
|
|
431
|
-
*/
|
|
432
|
-
// eslint-disable-next-line no-unused-vars
|
|
433
|
-
_onEnterButton(ev) {
|
|
434
|
-
const valueNode = /** @type {HTMLElement} */ (
|
|
435
|
-
this.shadowRoot?.querySelector('.input-stepper__value')
|
|
436
|
-
);
|
|
437
|
-
valueNode.setAttribute('aria-live', 'assertive');
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Redispatch leave event on host when catching leave event
|
|
442
|
-
* on the incrementor and decrementor button.
|
|
443
|
-
*
|
|
444
|
-
* This redispatched leave event will be caught by
|
|
445
|
-
* InteractionStateMixin to set "touched" state to true.
|
|
446
|
-
*
|
|
447
|
-
* Interacting with the buttons is "user interactions"
|
|
448
|
-
* the same way as focusing + blurring the field (native input)
|
|
449
|
-
*
|
|
450
|
-
* @protected
|
|
451
|
-
* @param {Event} ev
|
|
452
|
-
*/
|
|
453
|
-
// eslint-disable-next-line no-unused-vars
|
|
454
|
-
_onLeaveButton(ev) {
|
|
455
|
-
const valueNode = /** @type {HTMLElement} */ (
|
|
456
|
-
this.shadowRoot?.querySelector('.input-stepper__value')
|
|
457
|
-
);
|
|
458
|
-
valueNode.removeAttribute('aria-live');
|
|
459
|
-
this.dispatchEvent(new Event(this._leaveEvent));
|
|
460
|
-
}
|
|
461
457
|
}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runInteractionStateMixinSuite,
|
|
3
|
-
runFormatMixinSuite,
|
|
4
|
-
} from '@lion/ui/form-core-test-suites.js';
|
|
1
|
+
import { runInputStepperIntegrationSuite } from '../test-suites/lion-input-stepper.integration.suite.js';
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const tagString = 'lion-input-stepper';
|
|
9
|
-
|
|
10
|
-
describe('<lion-input-stepper> integrations', () => {
|
|
11
|
-
runInteractionStateMixinSuite({
|
|
12
|
-
tagString,
|
|
13
|
-
allowedModelValueTypes: [Number],
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
runFormatMixinSuite({
|
|
17
|
-
tagString,
|
|
18
|
-
modelValueType: Number,
|
|
19
|
-
});
|
|
20
|
-
});
|
|
3
|
+
runInputStepperIntegrationSuite();
|