@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.8
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 +1 -1
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-32L2QYWQ.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/chunk-55PUDL7D.js +109 -0
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-AH2SKZ7T.js} +14 -1
- package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
- package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
- package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
- package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-LD35BFNK.js} +18 -17
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
- package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
- package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +6 -6
- package/dist/cdn/components/eun-badge.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +2 -2
- package/dist/cdn/components/eun-card.js +4 -4
- package/dist/cdn/components/eun-carousel.js +26 -22
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +11 -8
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +74 -69
- package/dist/cdn/components/eun-counter.js +16 -14
- package/dist/cdn/components/eun-date-picker.js +67 -63
- package/dist/cdn/components/eun-description-list.js +2 -2
- package/dist/cdn/components/eun-divider.js +3 -3
- package/dist/cdn/components/eun-drawer.js +21 -22
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +2 -2
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +10 -10
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +21 -21
- package/dist/cdn/components/eun-input-phone.js +16 -12
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +33 -23
- package/dist/cdn/components/eun-pagination.js +16 -16
- package/dist/cdn/components/eun-password-strength.js +14 -10
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +11 -8
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +276 -0
- package/dist/cdn/components/eun-scheduler-event-editor.js +11 -11
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +28 -28
- package/dist/cdn/components/eun-search.js +36 -32
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +73 -26
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +3 -3
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +5 -4
- package/dist/cdn/components/eun-stepper.js +30 -30
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +4 -4
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +36 -28
- package/dist/cdn/components/eun-time-picker.js +31 -28
- package/dist/cdn/components/eun-toast.js +24 -15
- package/dist/cdn/components/eun-toggle-group.js +75 -37
- package/dist/cdn/components/eun-toggle-item.js +9 -9
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +22 -22
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +4 -3
- package/dist/components/action/button/button.js +6 -9
- package/dist/components/action/button/button.styles.js +13 -8
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +16 -13
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +18 -3
- package/dist/components/action/toggle/toggle-group.styles.js +58 -20
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/alert/alert/alert.d.ts +9 -7
- package/dist/components/alert/alert/alert.js +11 -14
- package/dist/components/alert/alert/alert.styles.js +9 -2
- package/dist/components/alert/drawer/drawer.d.ts +30 -5
- package/dist/components/alert/drawer/drawer.js +48 -13
- package/dist/components/alert/drawer/drawer.styles.js +7 -7
- package/dist/components/alert/modal/modal.d.ts +35 -10
- package/dist/components/alert/modal/modal.js +55 -28
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +12 -15
- package/dist/components/alert/toast/toast.styles.js +18 -9
- package/dist/components/content/badge/badge.js +2 -2
- package/dist/components/content/card/card.js +1 -1
- package/dist/components/content/card/card.styles.js +2 -2
- package/dist/components/content/chip/chip.d.ts +4 -4
- package/dist/components/content/chip/chip.js +11 -10
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/description-list/description-list.js +3 -3
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.js +3 -0
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -0
- package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
- package/dist/components/content/image-carousel/image-carousel.js +29 -28
- package/dist/components/content/password-strength/password-strength.d.ts +21 -6
- package/dist/components/content/password-strength/password-strength.js +37 -16
- package/dist/components/content/password-strength/password-strength.styles.js +4 -0
- package/dist/components/content/tag/tag.js +2 -2
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +31 -15
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/checkbox/check-card.d.ts +1 -0
- package/dist/components/form/checkbox/check-card.js +1 -0
- package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
- package/dist/components/form/checkbox/checkbox-list.js +39 -10
- package/dist/components/form/checkbox/checkbox.d.ts +1 -0
- package/dist/components/form/checkbox/checkbox.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +3 -2
- package/dist/components/form/color-picker/color-picker.d.ts +47 -28
- package/dist/components/form/color-picker/color-picker.js +73 -51
- package/dist/components/form/color-picker/color-picker.styles.js +14 -1
- package/dist/components/form/counter/counter.d.ts +24 -18
- package/dist/components/form/counter/counter.js +61 -61
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +33 -7
- package/dist/components/form/date-picker/date-picker.js +82 -56
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +43 -39
- package/dist/components/form/input/input.js +91 -110
- package/dist/components/form/input-file/input-file.d.ts +26 -13
- package/dist/components/form/input-file/input-file.js +35 -35
- package/dist/components/form/input-file/input-file.styles.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +28 -5
- package/dist/components/form/input-phone/input-phone.js +47 -13
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/radio/radio-card.d.ts +1 -0
- package/dist/components/form/radio/radio-card.js +1 -0
- package/dist/components/form/radio/radio-list.d.ts +23 -7
- package/dist/components/form/radio/radio-list.js +47 -22
- package/dist/components/form/radio/radio.d.ts +1 -0
- package/dist/components/form/radio/radio.js +1 -0
- package/dist/components/form/rating/rating.d.ts +349 -0
- package/dist/components/form/rating/rating.js +665 -0
- package/dist/components/form/rating/rating.styles.d.ts +1 -0
- package/dist/components/form/rating/rating.styles.js +213 -0
- package/dist/components/form/search/search.d.ts +72 -18
- package/dist/components/form/search/search.js +135 -72
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +29 -10
- package/dist/components/form/select/select.js +65 -41
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +15 -1
- package/dist/components/form/slider/slider.d.ts +7 -8
- package/dist/components/form/slider/slider.js +9 -12
- package/dist/components/form/switch/switch.d.ts +1 -0
- package/dist/components/form/switch/switch.js +1 -0
- package/dist/components/form/textarea/textarea.d.ts +90 -23
- package/dist/components/form/textarea/textarea.js +194 -44
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
- package/dist/components/form/time-picker/time-picker-columns.js +8 -8
- package/dist/components/form/time-picker/time-picker.d.ts +30 -9
- package/dist/components/form/time-picker/time-picker.js +66 -40
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +3 -2
- package/dist/components/layout/animate/animate.styles.js +2 -2
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.styles.js +1 -1
- package/dist/components/loader/loader/loader.js +2 -2
- package/dist/components/loader/loader/loader.styles.js +14 -12
- package/dist/components/loader/skeleton/skeleton.js +1 -1
- package/dist/components/navigation/carousel/carousel.d.ts +32 -9
- package/dist/components/navigation/carousel/carousel.js +88 -41
- package/dist/components/navigation/carousel/carousel.styles.js +10 -6
- package/dist/components/navigation/pagination/pagination.d.ts +23 -21
- package/dist/components/navigation/pagination/pagination.js +30 -53
- package/dist/components/navigation/sidebar/sidebar.d.ts +113 -65
- package/dist/components/navigation/sidebar/sidebar.js +161 -118
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +74 -24
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +15 -26
- package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
- package/dist/components/navigation/toolbar/toolbar.d.ts +23 -13
- package/dist/components/navigation/toolbar/toolbar.js +28 -35
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/calendar/calendar.js +1 -1
- package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
- package/dist/features/scheduler/scheduler/scheduler.js +15 -24
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +7 -8
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/i18n/en.d.ts +68 -0
- package/dist/i18n/en.js +68 -0
- package/dist/i18n/fr.js +68 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +9 -6
- package/dist/mixins/check.mixin.js +11 -10
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/disabled.mixin.d.ts +5 -0
- package/dist/mixins/disabled.mixin.js +21 -1
- package/dist/mixins/editable.mixin.js +28 -5
- package/dist/mixins/field-appearance.mixin.js +3 -2
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/form.mixin.d.ts +4 -0
- package/dist/mixins/form.mixin.js +87 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -1
- package/dist/mixins/localizable.mixin.js +1 -1
- package/dist/mixins/radio.mixin.js +11 -10
- package/dist/mixins/readonly.mixin.d.ts +2 -1
- package/dist/mixins/readonly.mixin.js +10 -3
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/alert-ssr.css +187 -0
- package/dist/ssr/badge-ssr.css +67 -0
- package/dist/ssr/breadcrumb-ssr.css +41 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +247 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +250 -0
- package/dist/ssr/collapse-ssr.css +180 -0
- package/dist/ssr/field-ssr.css +202 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +34 -0
- package/dist/ssr/links-ssr.css +44 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +102 -3
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +233 -0
- package/dist/ssr/toolbar-ssr.css +81 -2
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +26 -7
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
- package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
- package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
- package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
- package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
- package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
- package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
|
@@ -17,6 +17,7 @@ import { ChangeEvent } from "../../../events/change.event.js";
|
|
|
17
17
|
import { FileRejectEvent, } from "../../../events/file-reject.event.js";
|
|
18
18
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
19
19
|
import { inputFileStyles } from "./input-file.styles.js";
|
|
20
|
+
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
20
21
|
/**
|
|
21
22
|
* Tag name of the input-file component.
|
|
22
23
|
*/
|
|
@@ -26,7 +27,7 @@ export const EunomiaInputFileTagName = "eun-input-file";
|
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
29
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
29
|
-
const EunomiaInputFileMixinBase = FormLabelMixin(ReadonlyMixin(FormMixin(Base)));
|
|
30
|
+
const EunomiaInputFileMixinBase = LocalizableMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))));
|
|
30
31
|
/**
|
|
31
32
|
* A file upload field with a dropzone, showing image thumbnails or generic
|
|
32
33
|
* file rows for the selected files.
|
|
@@ -45,24 +46,25 @@ const EunomiaInputFileMixinBase = FormLabelMixin(ReadonlyMixin(FormMixin(Base)))
|
|
|
45
46
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
46
47
|
* @prop {boolean} [required=false] - Whether at least one file is required
|
|
47
48
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
49
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
48
50
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
49
51
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<File[]>>} validators - The list of validation rules applied to the field value
|
|
50
52
|
* @prop {string} [dropLabel='Drag and drop files here, or'] - Static text displayed in the dropzone
|
|
51
53
|
* @attr {string} [drop-label='Drag and drop files here, or'] - Static text displayed in the dropzone
|
|
52
54
|
* @prop {string} [browseLabel='browse files'] - The visible text of the dropzone's browse link
|
|
53
55
|
* @attr {string} [browse-label='browse files'] - The visible text of the dropzone's browse link
|
|
54
|
-
* @prop {string} [
|
|
55
|
-
* @attr {string} [
|
|
56
|
-
* @prop {string} [
|
|
57
|
-
* @attr {string} [
|
|
56
|
+
* @prop {string} [removeLabel] - The accessible label of each item's remove button. Defaults to the localized string for the current locale (English: "Remove file")
|
|
57
|
+
* @attr {string} [remove-label] - The accessible label of each item's remove button. Defaults to the localized string for the current locale (English: "Remove file")
|
|
58
|
+
* @prop {string} [selectLabel] - The accessible label prefix of each item's checkbox. Defaults to the localized string for the current locale (English: "Select file")
|
|
59
|
+
* @attr {string} [select-label] - The accessible label prefix of each item's checkbox. Defaults to the localized string for the current locale (English: "Select file")
|
|
58
60
|
* @prop {string} [removeAllLabel='Remove all'] - The label of the always-available bulk clear action
|
|
59
61
|
* @attr {string} [remove-all-label='Remove all'] - The label of the always-available bulk clear action
|
|
60
62
|
* @prop {string} [selectAllLabel='Select all'] - The label of the selection toolbar's select-all checkbox
|
|
61
63
|
* @attr {string} [select-all-label='Select all'] - The label of the selection toolbar's select-all checkbox
|
|
62
64
|
* @prop {string} [deleteSelectedLabel='Delete selected'] - The label of the selection toolbar's bulk delete button
|
|
63
65
|
* @attr {string} [delete-selected-label='Delete selected'] - The label of the selection toolbar's bulk delete button
|
|
64
|
-
* @prop {string} [
|
|
65
|
-
* @attr {string} [
|
|
66
|
+
* @prop {string} [openLabel] - Appended to each item's accessible name. Defaults to the localized string for the current locale (English: "Open in a new tab")
|
|
67
|
+
* @attr {string} [open-label] - Appended to each item's accessible name. Defaults to the localized string for the current locale (English: "Open in a new tab")
|
|
66
68
|
* @fires {ChangeEvent} eunchange - Fired whenever the selected files change
|
|
67
69
|
* @fires {FileRejectEvent} eunfilereject - Fired whenever one or more offered files are rejected, for the wrong type or exceeding the size or count limit
|
|
68
70
|
* @cssprop [--input-file-border-color] - Sets the border color of the dropzone
|
|
@@ -87,6 +89,11 @@ const EunomiaInputFileMixinBase = FormLabelMixin(ReadonlyMixin(FormMixin(Base)))
|
|
|
87
89
|
let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase {
|
|
88
90
|
constructor() {
|
|
89
91
|
super(...arguments);
|
|
92
|
+
/**
|
|
93
|
+
* Every change is a complete choice, so its error shows right away.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
this.errorOnChange = true;
|
|
90
97
|
/**
|
|
91
98
|
* Accepted content kind: image thumbnails vs. generic file rows.
|
|
92
99
|
* @default image
|
|
@@ -113,18 +120,6 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
113
120
|
* @default browse files
|
|
114
121
|
*/
|
|
115
122
|
this.browseLabel = "browse files";
|
|
116
|
-
/**
|
|
117
|
-
* Accessible label prefix of each item's remove button (suffixed with the
|
|
118
|
-
* file name).
|
|
119
|
-
* @default Remove file
|
|
120
|
-
*/
|
|
121
|
-
this.ariaLabelRemove = "Remove file";
|
|
122
|
-
/**
|
|
123
|
-
* Accessible label prefix of each item's checkbox (suffixed with the file
|
|
124
|
-
* name), when `selectable`.
|
|
125
|
-
* @default Select file
|
|
126
|
-
*/
|
|
127
|
-
this.ariaLabelSelect = "Select file";
|
|
128
123
|
/**
|
|
129
124
|
* Label of the always-available bulk clear action, shown once at least one
|
|
130
125
|
* file is present.
|
|
@@ -142,12 +137,6 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
142
137
|
* @default Delete selected
|
|
143
138
|
*/
|
|
144
139
|
this.deleteSelectedLabel = "Delete selected";
|
|
145
|
-
/**
|
|
146
|
-
* Appended to each item's accessible name (its primary action is opening
|
|
147
|
-
* the file in a new tab).
|
|
148
|
-
* @default Open in a new tab
|
|
149
|
-
*/
|
|
150
|
-
this.ariaLabelOpen = "Open in a new tab";
|
|
151
140
|
/**
|
|
152
141
|
* Whether a drag carrying files is currently over the host — reflected so
|
|
153
142
|
* `:host([dragging])` can drive the dropzone's highlight.
|
|
@@ -293,6 +282,14 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
293
282
|
}
|
|
294
283
|
}
|
|
295
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
287
|
+
* straight to the controls inside, in both directions, and
|
|
288
|
+
* {@link focus} covers a direct call on the host.
|
|
289
|
+
*/
|
|
290
|
+
get hostTabStop() {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
296
293
|
/**
|
|
297
294
|
* Returns the element to focus/anchor on validation errors.
|
|
298
295
|
*
|
|
@@ -622,7 +619,8 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
622
619
|
class="item"
|
|
623
620
|
role="button"
|
|
624
621
|
tabindex=${this.disabled ? "-1" : "0"}
|
|
625
|
-
aria-label="${file.name} — ${this.
|
|
622
|
+
aria-label="${file.name} — ${this.openLabel ??
|
|
623
|
+
this.dictionary.inputFile.open}"
|
|
626
624
|
@click=${() => !this.disabled && this.openFile(file)}
|
|
627
625
|
@keydown=${(event) => this.handleItemKeydown(event, file)}
|
|
628
626
|
>
|
|
@@ -630,7 +628,8 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
630
628
|
<input
|
|
631
629
|
type="checkbox"
|
|
632
630
|
class="item-checkbox"
|
|
633
|
-
aria-label="${this.
|
|
631
|
+
aria-label="${this.selectLabel ??
|
|
632
|
+
this.dictionary.inputFile.select} ${file.name}"
|
|
634
633
|
.checked=${isSelected}
|
|
635
634
|
?disabled=${this.disabled || this.readonly}
|
|
636
635
|
@click=${(event) => event.stopPropagation()}
|
|
@@ -653,7 +652,8 @@ let EunomiaInputFile = class EunomiaInputFile extends EunomiaInputFileMixinBase
|
|
|
653
652
|
<button
|
|
654
653
|
type="button"
|
|
655
654
|
class="item-remove"
|
|
656
|
-
aria-label="${this.
|
|
655
|
+
aria-label="${this.removeLabel ??
|
|
656
|
+
this.dictionary.inputFile.remove} ${file.name}"
|
|
657
657
|
?disabled=${this.disabled || this.readonly}
|
|
658
658
|
@click=${(event) => {
|
|
659
659
|
event.stopPropagation();
|
|
@@ -742,7 +742,7 @@ EunomiaInputFile.styles = [
|
|
|
742
742
|
formLabelsStyles.hintMessages,
|
|
743
743
|
];
|
|
744
744
|
__decorate([
|
|
745
|
-
property({ reflect: true })
|
|
745
|
+
property({ reflect: true, useDefault: true })
|
|
746
746
|
], EunomiaInputFile.prototype, "kind", void 0);
|
|
747
747
|
__decorate([
|
|
748
748
|
property()
|
|
@@ -766,11 +766,11 @@ __decorate([
|
|
|
766
766
|
property({ attribute: "browse-label" })
|
|
767
767
|
], EunomiaInputFile.prototype, "browseLabel", void 0);
|
|
768
768
|
__decorate([
|
|
769
|
-
property({ attribute: "
|
|
770
|
-
], EunomiaInputFile.prototype, "
|
|
769
|
+
property({ attribute: "remove-label" })
|
|
770
|
+
], EunomiaInputFile.prototype, "removeLabel", void 0);
|
|
771
771
|
__decorate([
|
|
772
|
-
property({ attribute: "
|
|
773
|
-
], EunomiaInputFile.prototype, "
|
|
772
|
+
property({ attribute: "select-label" })
|
|
773
|
+
], EunomiaInputFile.prototype, "selectLabel", void 0);
|
|
774
774
|
__decorate([
|
|
775
775
|
property({ attribute: "remove-all-label" })
|
|
776
776
|
], EunomiaInputFile.prototype, "removeAllLabel", void 0);
|
|
@@ -781,8 +781,8 @@ __decorate([
|
|
|
781
781
|
property({ attribute: "delete-selected-label" })
|
|
782
782
|
], EunomiaInputFile.prototype, "deleteSelectedLabel", void 0);
|
|
783
783
|
__decorate([
|
|
784
|
-
property({ attribute: "
|
|
785
|
-
], EunomiaInputFile.prototype, "
|
|
784
|
+
property({ attribute: "open-label" })
|
|
785
|
+
], EunomiaInputFile.prototype, "openLabel", void 0);
|
|
786
786
|
__decorate([
|
|
787
787
|
property({ type: Boolean, reflect: true })
|
|
788
788
|
], EunomiaInputFile.prototype, "dragging", void 0);
|
|
@@ -196,7 +196,7 @@ const base = css `
|
|
|
196
196
|
display: grid;
|
|
197
197
|
gap: var(--_gap);
|
|
198
198
|
}
|
|
199
|
-
:host([kind="image"]) #items {
|
|
199
|
+
:host(:is([kind="image"], :not([kind]))) #items {
|
|
200
200
|
grid-template-columns: repeat(
|
|
201
201
|
auto-fill,
|
|
202
202
|
minmax(var(--_thumbnailSize), 1fr)
|
|
@@ -219,7 +219,7 @@ const base = css `
|
|
|
219
219
|
.item:focus-visible {
|
|
220
220
|
outline: 1px solid var(--_focusIndicator);
|
|
221
221
|
}
|
|
222
|
-
:host([kind="image"]) .item {
|
|
222
|
+
:host(:is([kind="image"], :not([kind]))) .item {
|
|
223
223
|
aspect-ratio: 1 / 1;
|
|
224
224
|
overflow: hidden;
|
|
225
225
|
align-items: stretch;
|
|
@@ -258,7 +258,7 @@ const base = css `
|
|
|
258
258
|
.item-checkbox {
|
|
259
259
|
flex: none;
|
|
260
260
|
}
|
|
261
|
-
:host([kind="image"]) .item-checkbox {
|
|
261
|
+
:host(:is([kind="image"], :not([kind]))) .item-checkbox {
|
|
262
262
|
position: absolute;
|
|
263
263
|
top: var(--eun-space-xs, 4px);
|
|
264
264
|
left: var(--eun-space-xs, 4px);
|
|
@@ -284,7 +284,7 @@ const base = css `
|
|
|
284
284
|
:host([kind="file"]) .item-remove:hover {
|
|
285
285
|
color: var(--_textColor);
|
|
286
286
|
}
|
|
287
|
-
:host([kind="image"]) .item-remove {
|
|
287
|
+
:host(:is([kind="image"], :not([kind]))) .item-remove {
|
|
288
288
|
position: absolute;
|
|
289
289
|
top: var(--eun-space-xs, 4px);
|
|
290
290
|
right: var(--eun-space-xs, 4px);
|
|
@@ -5,8 +5,11 @@ import { ValidatorsMixinInterface } from "../../../mixins/validators.mixin.js";
|
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
9
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
8
10
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
9
11
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
12
|
+
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
10
13
|
/**
|
|
11
14
|
* Tag name of the phone input component.
|
|
12
15
|
*/
|
|
@@ -16,7 +19,7 @@ export declare const EunomiaInputPhoneTagName = "eun-input-phone";
|
|
|
16
19
|
* interface element.
|
|
17
20
|
* @internal
|
|
18
21
|
*/
|
|
19
|
-
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface;
|
|
22
|
+
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
20
23
|
declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
21
24
|
/**
|
|
22
25
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
@@ -39,6 +42,8 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
39
42
|
*
|
|
40
43
|
* @slot [default] - An optional list of option elements restricting which countries appear in the dropdown, such as an option with value FR for France. When omitted, every built-in country is available
|
|
41
44
|
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
45
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
46
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
42
47
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
43
48
|
* @prop {string} instructions - Instructions displayed below the label
|
|
44
49
|
* @prop {string} name - The field name
|
|
@@ -55,6 +60,7 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
55
60
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
56
61
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
57
62
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
63
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
58
64
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
59
65
|
* @prop {Array<Validators<string>>} validators - The list of validation rules applied to the field value
|
|
60
66
|
* @prop {string} [placeholder] - The placeholder shown when the field is empty. Defaults to a generic formatted digit pattern, not a real per-country example, when unset
|
|
@@ -62,8 +68,8 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
62
68
|
* @attr {string} [country-search-placeholder='Search a country…'] - The placeholder of the search field inside the country dropdown
|
|
63
69
|
* @prop {string} [noResultsLabel='No results'] - Text displayed in the dropdown when no country matches the search
|
|
64
70
|
* @attr {string} [no-results-label='No results'] - Text displayed in the dropdown when no country matches the search
|
|
65
|
-
* @prop {string} [
|
|
66
|
-
* @attr {string} [
|
|
71
|
+
* @prop {string} [countrySelectorLabel] - The accessible label of the leading country selector button. Defaults to the localized string for the current locale (English: "Select a country")
|
|
72
|
+
* @attr {string} [country-selector-label] - The accessible label of the leading country selector button. Defaults to the localized string for the current locale (English: "Select a country")
|
|
67
73
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
68
74
|
* @cssprop [--field-background] - Sets the background color of the field
|
|
69
75
|
* @cssprop [--field-border-color] - Sets the border color of the field
|
|
@@ -80,10 +86,12 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
80
86
|
* @cssprop [--field-hint-color] - Sets the color of the hint message
|
|
81
87
|
* @cssprop [--field-focus-outline-color] - Sets the color of the focus outline
|
|
82
88
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the country dropdown panel, past which it scrolls
|
|
89
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the country dropdown panel, independent of the field's own radius
|
|
83
90
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close height transition, disabled entirely under reduced motion settings
|
|
84
91
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport. Set on the root or an ancestor rather than on the field itself
|
|
85
92
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport, such as for a sticky footer
|
|
86
93
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
94
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
87
95
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
88
96
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
89
97
|
* @element eun-input-phone
|
|
@@ -139,9 +147,9 @@ export declare class EunomiaInputPhone extends EunomiaInputPhoneMixinBase {
|
|
|
139
147
|
noResultsLabel: string;
|
|
140
148
|
/**
|
|
141
149
|
* Accessible label of the leading country-selector button.
|
|
142
|
-
*
|
|
150
|
+
* Falls back to the localized string for the current locale when unset.
|
|
143
151
|
*/
|
|
144
|
-
|
|
152
|
+
countrySelectorLabel?: string;
|
|
145
153
|
/**
|
|
146
154
|
* The raw national digits currently typed (no dial code, no separators) —
|
|
147
155
|
* *including* a leading trunk "0" if the user typed one, kept exactly as
|
|
@@ -211,6 +219,15 @@ export declare class EunomiaInputPhone extends EunomiaInputPhoneMixinBase {
|
|
|
211
219
|
* @internal
|
|
212
220
|
*/
|
|
213
221
|
private triggerPointerDownAt?;
|
|
222
|
+
constructor();
|
|
223
|
+
/**
|
|
224
|
+
* Submits the owning form on Enter in the number field, as a native text
|
|
225
|
+
* input does, since the browser never does it from a shadow root.
|
|
226
|
+
* Listened to on the host so the country list's own Enter handling is
|
|
227
|
+
* never mistaken for it.
|
|
228
|
+
* @private
|
|
229
|
+
*/
|
|
230
|
+
private readonly handleImplicitSubmission;
|
|
214
231
|
connectedCallback(): void;
|
|
215
232
|
/**
|
|
216
233
|
* Lifecycle hook called when the element is disconnected from the DOM.
|
|
@@ -268,6 +285,12 @@ export declare class EunomiaInputPhone extends EunomiaInputPhoneMixinBase {
|
|
|
268
285
|
* @param _changedProperties - Map of changed properties
|
|
269
286
|
*/
|
|
270
287
|
protected updated(_changedProperties: PropertyValues): void;
|
|
288
|
+
/**
|
|
289
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
290
|
+
* straight to the controls inside, in both directions, and
|
|
291
|
+
* {@link focus} covers a direct call on the host.
|
|
292
|
+
*/
|
|
293
|
+
protected get hostTabStop(): boolean;
|
|
271
294
|
/**
|
|
272
295
|
* Returns the field element to focus/anchor on validation errors.
|
|
273
296
|
*
|
|
@@ -8,12 +8,15 @@ var EunomiaInputPhone_1;
|
|
|
8
8
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { html, LitElement, nothing } from "lit";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
12
|
import { DisabledMixin, } from "../../../mixins/disabled.mixin.js";
|
|
12
13
|
import { ReadonlyMixin, } from "../../../mixins/readonly.mixin.js";
|
|
13
14
|
import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
14
15
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
15
16
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
16
17
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
18
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
19
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
17
20
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
18
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
19
22
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -21,6 +24,8 @@ import { inputPhoneStyles } from "./input-phone.styles.js";
|
|
|
21
24
|
import { isWebKit } from "../../../utils/browser.utils.js";
|
|
22
25
|
import { COUNTRY_DIAL_CODES, formatNationalNumber, fromE164, getCountryName, getDialCode, getNationalLength, stripTrunkPrefix, getFlagEmoji, toE164, } from "./input-phone.type.js";
|
|
23
26
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
27
|
+
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
28
|
+
import { isImplicitSubmissionKey, submitImplicitly, } from "../../../utils/implicit-submission.utils.js";
|
|
24
29
|
/**
|
|
25
30
|
* Tag name of the phone input component.
|
|
26
31
|
*/
|
|
@@ -63,7 +68,7 @@ const TRIGGER_POINTER_DOWN_WINDOW_MS = 100;
|
|
|
63
68
|
* @internal
|
|
64
69
|
*/
|
|
65
70
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
66
|
-
const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base)))));
|
|
71
|
+
const EunomiaInputPhoneMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))))));
|
|
67
72
|
/**
|
|
68
73
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
69
74
|
* selector, showing only the flag, on the leading side, and the phone
|
|
@@ -85,6 +90,8 @@ const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(Form
|
|
|
85
90
|
*
|
|
86
91
|
* @slot [default] - An optional list of option elements restricting which countries appear in the dropdown, such as an option with value FR for France. When omitted, every built-in country is available
|
|
87
92
|
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
93
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
94
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
88
95
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
89
96
|
* @prop {string} instructions - Instructions displayed below the label
|
|
90
97
|
* @prop {string} name - The field name
|
|
@@ -101,6 +108,7 @@ const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(Form
|
|
|
101
108
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
102
109
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
103
110
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
111
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
104
112
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
105
113
|
* @prop {Array<Validators<string>>} validators - The list of validation rules applied to the field value
|
|
106
114
|
* @prop {string} [placeholder] - The placeholder shown when the field is empty. Defaults to a generic formatted digit pattern, not a real per-country example, when unset
|
|
@@ -108,8 +116,8 @@ const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(Form
|
|
|
108
116
|
* @attr {string} [country-search-placeholder='Search a country…'] - The placeholder of the search field inside the country dropdown
|
|
109
117
|
* @prop {string} [noResultsLabel='No results'] - Text displayed in the dropdown when no country matches the search
|
|
110
118
|
* @attr {string} [no-results-label='No results'] - Text displayed in the dropdown when no country matches the search
|
|
111
|
-
* @prop {string} [
|
|
112
|
-
* @attr {string} [
|
|
119
|
+
* @prop {string} [countrySelectorLabel] - The accessible label of the leading country selector button. Defaults to the localized string for the current locale (English: "Select a country")
|
|
120
|
+
* @attr {string} [country-selector-label] - The accessible label of the leading country selector button. Defaults to the localized string for the current locale (English: "Select a country")
|
|
113
121
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
114
122
|
* @cssprop [--field-background] - Sets the background color of the field
|
|
115
123
|
* @cssprop [--field-border-color] - Sets the border color of the field
|
|
@@ -126,17 +134,19 @@ const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(Form
|
|
|
126
134
|
* @cssprop [--field-hint-color] - Sets the color of the hint message
|
|
127
135
|
* @cssprop [--field-focus-outline-color] - Sets the color of the focus outline
|
|
128
136
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the country dropdown panel, past which it scrolls
|
|
137
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the country dropdown panel, independent of the field's own radius
|
|
129
138
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close height transition, disabled entirely under reduced motion settings
|
|
130
139
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport. Set on the root or an ancestor rather than on the field itself
|
|
131
140
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport, such as for a sticky footer
|
|
132
141
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
142
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
133
143
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
134
144
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
135
145
|
* @element eun-input-phone
|
|
136
146
|
*/
|
|
137
147
|
let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends EunomiaInputPhoneMixinBase {
|
|
138
148
|
constructor() {
|
|
139
|
-
super(
|
|
149
|
+
super();
|
|
140
150
|
/**
|
|
141
151
|
* Hides the leading country-selector part entirely. `country` can still
|
|
142
152
|
* be set programmatically, with no picker UI to change it.
|
|
@@ -158,11 +168,6 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
158
168
|
* @default No results
|
|
159
169
|
*/
|
|
160
170
|
this.noResultsLabel = "No results";
|
|
161
|
-
/**
|
|
162
|
-
* Accessible label of the leading country-selector button.
|
|
163
|
-
* @default Select a country
|
|
164
|
-
*/
|
|
165
|
-
this.ariaLabelCountrySelector = "Select a country";
|
|
166
171
|
/**
|
|
167
172
|
* The raw national digits currently typed (no dial code, no separators) —
|
|
168
173
|
* *including* a leading trunk "0" if the user typed one, kept exactly as
|
|
@@ -189,6 +194,23 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
189
194
|
* @internal
|
|
190
195
|
*/
|
|
191
196
|
this.highlightedIndex = -1;
|
|
197
|
+
/**
|
|
198
|
+
* Submits the owning form on Enter in the number field, as a native text
|
|
199
|
+
* input does, since the browser never does it from a shadow root.
|
|
200
|
+
* Listened to on the host so the country list's own Enter handling is
|
|
201
|
+
* never mistaken for it.
|
|
202
|
+
* @private
|
|
203
|
+
*/
|
|
204
|
+
this.handleImplicitSubmission = (event) => {
|
|
205
|
+
const form = this.internals.form;
|
|
206
|
+
if (!form ||
|
|
207
|
+
event.composedPath()[0] !== this.fieldEl ||
|
|
208
|
+
!isImplicitSubmissionKey(event)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
submitImplicitly(form);
|
|
213
|
+
};
|
|
192
214
|
/**
|
|
193
215
|
* Closes the dropdown when the browser window itself loses focus (e.g.
|
|
194
216
|
* Alt-Tab to another application). The Popover API's own light-dismiss
|
|
@@ -267,6 +289,7 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
267
289
|
this.unanchorFloatingElement();
|
|
268
290
|
this.unobserveAnchorVisibility();
|
|
269
291
|
};
|
|
292
|
+
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
270
293
|
}
|
|
271
294
|
connectedCallback() {
|
|
272
295
|
super.connectedCallback?.();
|
|
@@ -341,6 +364,14 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
341
364
|
?.scrollIntoView({ block: "nearest" });
|
|
342
365
|
}
|
|
343
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
369
|
+
* straight to the controls inside, in both directions, and
|
|
370
|
+
* {@link focus} covers a direct call on the host.
|
|
371
|
+
*/
|
|
372
|
+
get hostTabStop() {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
344
375
|
/**
|
|
345
376
|
* Returns the field element to focus/anchor on validation errors.
|
|
346
377
|
*
|
|
@@ -635,7 +666,8 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
635
666
|
aria-haspopup="listbox"
|
|
636
667
|
aria-expanded=${this.isOpen}
|
|
637
668
|
aria-controls="listbox"
|
|
638
|
-
aria-label=${this.
|
|
669
|
+
aria-label=${this.countrySelectorLabel ??
|
|
670
|
+
this.dictionary.inputPhone.selectCountry}
|
|
639
671
|
?disabled=${this.disabled || this.readonly}
|
|
640
672
|
@pointerdown=${this.handleTriggerPointerDown}
|
|
641
673
|
@click=${this.handleTriggerClick}
|
|
@@ -662,7 +694,8 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
662
694
|
<ul
|
|
663
695
|
id="listbox"
|
|
664
696
|
role="listbox"
|
|
665
|
-
aria-label=${this.
|
|
697
|
+
aria-label=${this.countrySelectorLabel ??
|
|
698
|
+
this.dictionary.inputPhone.selectCountry}
|
|
666
699
|
popover="auto"
|
|
667
700
|
@toggle=${this.handlePopoverToggle}
|
|
668
701
|
>
|
|
@@ -739,6 +772,7 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
739
772
|
placeholder=${this.effectivePlaceholder}
|
|
740
773
|
?disabled=${this.disabled}
|
|
741
774
|
?readonly=${this.readonly}
|
|
775
|
+
aria-label=${ifDefined(this.label)}
|
|
742
776
|
aria-describedby=${hasDescription ? "description" : nothing}
|
|
743
777
|
aria-invalid=${this.showError}
|
|
744
778
|
@input=${this.handlePhoneInput}
|
|
@@ -793,8 +827,8 @@ __decorate([
|
|
|
793
827
|
property({ attribute: "no-results-label" })
|
|
794
828
|
], EunomiaInputPhone.prototype, "noResultsLabel", void 0);
|
|
795
829
|
__decorate([
|
|
796
|
-
property({ attribute: "
|
|
797
|
-
], EunomiaInputPhone.prototype, "
|
|
830
|
+
property({ attribute: "country-selector-label" })
|
|
831
|
+
], EunomiaInputPhone.prototype, "countrySelectorLabel", void 0);
|
|
798
832
|
__decorate([
|
|
799
833
|
state()
|
|
800
834
|
], EunomiaInputPhone.prototype, "nationalDigits", void 0);
|
|
@@ -41,7 +41,7 @@ const inputPhone = css `
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: center;
|
|
43
43
|
flex-shrink: 0;
|
|
44
|
-
padding:
|
|
44
|
+
padding: 0 var(--_defaultPaddingInline);
|
|
45
45
|
background-color: var(--_background);
|
|
46
46
|
border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
47
47
|
border-inline-end: none;
|
|
@@ -64,7 +64,7 @@ const inputPhone = css `
|
|
|
64
64
|
outline-offset: 0;
|
|
65
65
|
}
|
|
66
66
|
.flag {
|
|
67
|
-
font-size: var(--eun-font-size-m, 16px);
|
|
67
|
+
font-size: min(var(--eun-font-size-m, 16px), var(--_lineHeight));
|
|
68
68
|
line-height: 1;
|
|
69
69
|
}
|
|
70
70
|
#field-wrapper {
|
|
@@ -178,7 +178,10 @@ const inputPhone = css `
|
|
|
178
178
|
background: none;
|
|
179
179
|
border: none;
|
|
180
180
|
outline: none;
|
|
181
|
-
|
|
181
|
+
box-sizing: content-box;
|
|
182
|
+
height: var(--_lineHeight);
|
|
183
|
+
line-height: var(--_lineHeight);
|
|
184
|
+
padding: var(--_paddingBlock) var(--_defaultPaddingInline);
|
|
182
185
|
}
|
|
183
186
|
#phone-field::placeholder {
|
|
184
187
|
color: var(--_placeholderColor);
|
|
@@ -23,6 +23,7 @@ export declare const EunomiaRadioCardTagName = "eun-radio-card";
|
|
|
23
23
|
* @prop {boolean} [disabled=false] - Whether the card is disabled
|
|
24
24
|
* @prop {boolean} [readonly=false] - Whether the card is read only
|
|
25
25
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
26
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
26
27
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
27
28
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden. The hint stays visible
|
|
28
29
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -34,6 +34,7 @@ export const EunomiaRadioCardTagName = "eun-radio-card";
|
|
|
34
34
|
* @prop {boolean} [disabled=false] - Whether the card is disabled
|
|
35
35
|
* @prop {boolean} [readonly=false] - Whether the card is read only
|
|
36
36
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
37
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
37
38
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
38
39
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden. The hint stays visible
|
|
39
40
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -33,6 +33,7 @@ declare const EunomiaRadioList_base: import("../../../utils/constructor.type.js"
|
|
|
33
33
|
* @prop {string} [defaultValue] - The value reselected when the list connects, and restored on form reset
|
|
34
34
|
* @attr {string} [default-value] - The value reselected when the list connects, and restored on form reset
|
|
35
35
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
36
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
36
37
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
37
38
|
* @attr {boolean} [hide-error=false] - Whether the errors are hidden. The hint stays visible
|
|
38
39
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<string | undefined>>} validators - A list of validation rules applied to the group's selected value
|
|
@@ -53,6 +54,11 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
53
54
|
* @readonly
|
|
54
55
|
*/
|
|
55
56
|
static readonly styles: import("lit").CSSResult[];
|
|
57
|
+
/**
|
|
58
|
+
* Every change is a complete choice, so its error shows right away.
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
errorOnChange: boolean;
|
|
56
62
|
/**
|
|
57
63
|
* Configuration options for the component Shadow DOM
|
|
58
64
|
* @internal
|
|
@@ -110,8 +116,7 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
110
116
|
* Assigns `name`/`id` to every child, applies a `default-value` selection
|
|
111
117
|
* once the slotted children actually exist (see `handleSlotChange` for
|
|
112
118
|
* why this can't rely on `FormMixin`'s own `defaultValue` setter alone),
|
|
113
|
-
*
|
|
114
|
-
* markup, and sets up the initial roving `tabindex`.
|
|
119
|
+
* and sets up the initial roving `tabindex`.
|
|
115
120
|
*
|
|
116
121
|
* The roving `tabindex` is applied only once every child's own first
|
|
117
122
|
* update has settled — each `eun-radio` is itself a `DisabledMixin` user,
|
|
@@ -130,6 +135,17 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
130
135
|
* Cleans up event listeners.
|
|
131
136
|
*/
|
|
132
137
|
disconnectedCallback(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the group's own `disabled`/`readonly` changed in a way to pass
|
|
140
|
+
* on to every child : always once set, but not for the initial `false`,
|
|
141
|
+
* which would otherwise re-enable a child disabled on its own.
|
|
142
|
+
*
|
|
143
|
+
* @param changed - The changed properties of the update.
|
|
144
|
+
* @param name - The property to check.
|
|
145
|
+
* @returns true when the children should take the group's value.
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
private isGroupChange;
|
|
133
149
|
/**
|
|
134
150
|
* Lifecycle hook called whenever reactive properties change.
|
|
135
151
|
* @param _changedProperties - Map of changed properties
|
|
@@ -155,8 +171,8 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
155
171
|
*/
|
|
156
172
|
private handleKeydown;
|
|
157
173
|
/**
|
|
158
|
-
* Applies the roving `tabindex` : the checked child (or the first
|
|
159
|
-
* none is checked yet) is the group's single tab stop, matching a native
|
|
174
|
+
* Applies the roving `tabindex` : the checked child (or the first enabled
|
|
175
|
+
* one, if none is checked yet) is the group's single tab stop, matching a native
|
|
160
176
|
* `radiogroup`'s "one tab stop, arrows move focus" behavior.
|
|
161
177
|
* @private
|
|
162
178
|
*/
|
|
@@ -170,7 +186,7 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
170
186
|
private readonly handleChangeEvent;
|
|
171
187
|
/**
|
|
172
188
|
* Checks the given child, unchecking every other one, updates the roving
|
|
173
|
-
* `tabindex
|
|
189
|
+
* `tabindex`, and re-validates the group.
|
|
174
190
|
*
|
|
175
191
|
* @param item the child to activate
|
|
176
192
|
* @param focus whether to also move DOM focus onto it (arrow-key navigation)
|
|
@@ -190,8 +206,8 @@ export declare class EunomiaRadioList extends EunomiaRadioList_base {
|
|
|
190
206
|
private sendChangeEvent;
|
|
191
207
|
/**
|
|
192
208
|
* Handler called when slot content changes.
|
|
193
|
-
* Propagates the group `name` and assigns a stable `id`
|
|
194
|
-
*
|
|
209
|
+
* Propagates the group `name` and assigns a stable `id` to every child
|
|
210
|
+
* radio.
|
|
195
211
|
*
|
|
196
212
|
* @private
|
|
197
213
|
*/
|