@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
|
@@ -31,15 +31,15 @@ const datePicker = css `
|
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
gap: var(--eun-space-xs, 4px);
|
|
34
|
-
width: 100%;
|
|
35
34
|
color: var(--_textColor);
|
|
36
35
|
background-color: var(--_background);
|
|
37
36
|
border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
38
37
|
border-radius: var(--_borderRadius);
|
|
39
|
-
padding: var(--
|
|
40
|
-
var(--
|
|
38
|
+
padding: var(--_paddingBlock) calc(var(--_defaultPaddingInline) / 2)
|
|
39
|
+
var(--_paddingBlock) var(--_defaultPaddingInline);
|
|
41
40
|
outline: 1px solid transparent;
|
|
42
|
-
box-sizing:
|
|
41
|
+
box-sizing: content-box;
|
|
42
|
+
height: var(--_lineHeight);
|
|
43
43
|
transition:
|
|
44
44
|
border-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease),
|
|
45
45
|
outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
|
|
@@ -94,9 +94,10 @@ const datePicker = css `
|
|
|
94
94
|
box-sizing: content-box;
|
|
95
95
|
border: none;
|
|
96
96
|
background: none;
|
|
97
|
-
padding:
|
|
97
|
+
padding: 0 1px;
|
|
98
98
|
color: inherit;
|
|
99
99
|
font: inherit;
|
|
100
|
+
line-height: var(--_lineHeight);
|
|
100
101
|
text-align: center;
|
|
101
102
|
outline: none;
|
|
102
103
|
overflow: visible;
|
|
@@ -124,10 +125,11 @@ const datePicker = css `
|
|
|
124
125
|
box-sizing: content-box;
|
|
125
126
|
border: none;
|
|
126
127
|
background: none;
|
|
127
|
-
padding:
|
|
128
|
+
padding: 0 1px;
|
|
128
129
|
width: 2.5ch;
|
|
129
130
|
color: inherit;
|
|
130
131
|
font: inherit;
|
|
132
|
+
line-height: var(--_lineHeight);
|
|
131
133
|
text-align: center;
|
|
132
134
|
outline: none;
|
|
133
135
|
cursor: pointer;
|
|
@@ -143,6 +145,7 @@ const datePicker = css `
|
|
|
143
145
|
padding-inline: 2px;
|
|
144
146
|
}
|
|
145
147
|
#calendar-trigger {
|
|
148
|
+
--icon-size: min(16px, var(--_lineHeight));
|
|
146
149
|
display: flex;
|
|
147
150
|
align-items: center;
|
|
148
151
|
justify-content: center;
|
|
@@ -6,8 +6,11 @@ import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { EditableMixinInterface } from "../../../mixins/editable.mixin.js";
|
|
8
8
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
10
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
9
11
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
10
12
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
13
|
+
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
11
14
|
/**
|
|
12
15
|
* Tag name of the input component.
|
|
13
16
|
*/
|
|
@@ -20,7 +23,7 @@ export type EunomiaInputType = "text" | "email" | "number" | "tel" | "url" | "se
|
|
|
20
23
|
* Type of the input base used to declare every necessary Mixin interface elements.
|
|
21
24
|
* @internal
|
|
22
25
|
*/
|
|
23
|
-
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface;
|
|
26
|
+
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & LocalizableMixinInterface;
|
|
24
27
|
declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
25
28
|
/**
|
|
26
29
|
* A single-line text field, supporting several native input types.
|
|
@@ -28,6 +31,8 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
28
31
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
29
32
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
30
33
|
* @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
|
|
34
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
35
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
31
36
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
32
37
|
* @prop {string} instructions - Instructions displayed below the label
|
|
33
38
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -38,6 +43,7 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
38
43
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
39
44
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
40
45
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
46
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
41
47
|
* @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
|
|
42
48
|
* @prop {Array<Validators<string>>} validators - The list of validation rules applied to the field value
|
|
43
49
|
* @prop {EunomiaIconName} icon - An optional leading icon
|
|
@@ -51,12 +57,12 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
51
57
|
* @prop {string} min - The native minimum constraint forwarded to the field
|
|
52
58
|
* @prop {string} max - The native maximum constraint forwarded to the field
|
|
53
59
|
* @prop {string} step - The native step constraint forwarded to the field
|
|
54
|
-
* @prop {string} [emptyValueLabel
|
|
55
|
-
* @prop {string} [confirmLabel
|
|
56
|
-
* @prop {string} [cancelLabel
|
|
57
|
-
* @prop {string} [
|
|
58
|
-
* @prop {string} [
|
|
59
|
-
* @prop {string} [
|
|
60
|
+
* @prop {string} [emptyValueLabel] - Text displayed in place of the value when readonly and empty. Defaults to the localized string for the current locale (English: "No value set")
|
|
61
|
+
* @prop {string} [confirmLabel] - The label of the confirm button in edit mode. Defaults to the localized string for the current locale (English: "Save")
|
|
62
|
+
* @prop {string} [cancelLabel] - The label of the cancel button in edit mode. Defaults to the localized string for the current locale (English: "Cancel")
|
|
63
|
+
* @prop {string} [clearLabel] - The accessible label of the clear button. Defaults to the localized string for the current locale (English: "Clear field")
|
|
64
|
+
* @prop {string} [showPasswordLabel] - The accessible label of the show password button. Defaults to the localized string for the current locale (English: "Show password")
|
|
65
|
+
* @prop {string} [hidePasswordLabel] - The accessible label of the hide password button. Defaults to the localized string for the current locale (English: "Hide password")
|
|
60
66
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
61
67
|
* @fires {CommitEvent} euncommit - Fired when an edit is confirmed in readonlyAvailable mode
|
|
62
68
|
* @cssprop [--field-background] - Sets the background color of the field
|
|
@@ -76,6 +82,7 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
76
82
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
77
83
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
78
84
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
85
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
79
86
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
80
87
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
81
88
|
* @element eun-input
|
|
@@ -149,34 +156,34 @@ export declare class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
149
156
|
step?: string;
|
|
150
157
|
/**
|
|
151
158
|
* Text displayed in place of the value when readonly and empty.
|
|
152
|
-
*
|
|
159
|
+
* Falls back to the localized string for the current locale when unset.
|
|
153
160
|
*/
|
|
154
|
-
emptyValueLabel
|
|
161
|
+
emptyValueLabel?: string;
|
|
155
162
|
/**
|
|
156
163
|
* Label of the confirm button in edit mode.
|
|
157
|
-
*
|
|
164
|
+
* Falls back to the localized string for the current locale when unset.
|
|
158
165
|
*/
|
|
159
|
-
confirmLabel
|
|
166
|
+
confirmLabel?: string;
|
|
160
167
|
/**
|
|
161
168
|
* Label of the cancel button in edit mode.
|
|
162
|
-
*
|
|
169
|
+
* Falls back to the localized string for the current locale when unset.
|
|
163
170
|
*/
|
|
164
|
-
cancelLabel
|
|
171
|
+
cancelLabel?: string;
|
|
165
172
|
/**
|
|
166
173
|
* Accessible label of the clear button.
|
|
167
|
-
*
|
|
174
|
+
* Falls back to the localized string for the current locale when unset.
|
|
168
175
|
*/
|
|
169
|
-
|
|
176
|
+
clearLabel?: string;
|
|
170
177
|
/**
|
|
171
178
|
* Accessible label of the show-password button.
|
|
172
|
-
*
|
|
179
|
+
* Falls back to the localized string for the current locale when unset.
|
|
173
180
|
*/
|
|
174
|
-
|
|
181
|
+
showPasswordLabel?: string;
|
|
175
182
|
/**
|
|
176
183
|
* Accessible label of the hide-password button.
|
|
177
|
-
*
|
|
184
|
+
* Falls back to the localized string for the current locale when unset.
|
|
178
185
|
*/
|
|
179
|
-
|
|
186
|
+
hidePasswordLabel?: string;
|
|
180
187
|
/**
|
|
181
188
|
* Whether the password's plain value is currently revealed.
|
|
182
189
|
* @internal
|
|
@@ -213,28 +220,25 @@ export declare class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
213
220
|
* @protected
|
|
214
221
|
*/
|
|
215
222
|
protected focusTarget(): HTMLElement | undefined;
|
|
223
|
+
constructor();
|
|
224
|
+
/**
|
|
225
|
+
* Submits the owning form on Enter in the field, as a native text input
|
|
226
|
+
* does, since the browser never does it from a shadow root. Listened to
|
|
227
|
+
* on the host so a handler inside, such as `eun-search` picking a
|
|
228
|
+
* suggestion, can claim the key first. Skipped while editing in
|
|
229
|
+
* `readonlyAvailable` mode, whose own buttons confirm the edit.
|
|
230
|
+
* @private
|
|
231
|
+
*/
|
|
232
|
+
private readonly handleImplicitSubmission;
|
|
233
|
+
/**
|
|
234
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
235
|
+
* straight to the native field inside, in both directions, and
|
|
236
|
+
* {@link focus} covers a direct call on the host.
|
|
237
|
+
*/
|
|
238
|
+
protected get hostTabStop(): boolean;
|
|
216
239
|
/**
|
|
217
240
|
* Lifecycle hook called whenever reactive properties change. Focuses the
|
|
218
|
-
* field when entering edit mode
|
|
219
|
-
* after every `disabled` change.
|
|
220
|
-
*
|
|
221
|
-
* `DisabledMixin` puts a real `tabindex="0"` on the host so Tab still
|
|
222
|
-
* reaches it while enabled — appropriate for a component whose host
|
|
223
|
-
* *is* the sole interactive surface, but this one always has its own
|
|
224
|
-
* focusable native field nested inside instead, and keeping the host
|
|
225
|
-
* itself as a *second*, independent tab stop right next to it broke
|
|
226
|
-
* Shift+Tab : landing back on the host is a genuine stop of its own as
|
|
227
|
-
* far as the browser's own backward sequential-navigation is concerned,
|
|
228
|
-
* and redirecting focus straight back into the field from there (this
|
|
229
|
-
* class's previous approach) fights that navigation mid-flight, leaving
|
|
230
|
-
* focus stranded on the host with nothing focused inside it. Removing
|
|
231
|
-
* the attribute instead lets sequential focus navigation descend
|
|
232
|
-
* straight into the field on its own, correctly in both directions, with
|
|
233
|
-
* no separate host stop and no redirect involved at all — this class's
|
|
234
|
-
* own `focus()` method (see below) covers a direct, explicit call on the
|
|
235
|
-
* host, the one case that genuinely still needs one. The disabled case
|
|
236
|
-
* still gets an explicit `-1` so a disabled field is skipped entirely
|
|
237
|
-
* rather than becoming its own (empty) stop.
|
|
241
|
+
* field when entering edit mode.
|
|
238
242
|
*
|
|
239
243
|
* @param _changedProperties - Map of changed properties
|
|
240
244
|
*/
|
|
@@ -16,10 +16,14 @@ import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
|
16
16
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
17
17
|
import { EditableMixin, } from "../../../mixins/editable.mixin.js";
|
|
18
18
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
20
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
19
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
20
22
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
21
23
|
import { inputStyles } from "./input.styles.js";
|
|
22
24
|
import { pickValidity } from "../../../utils/validity.utils.js";
|
|
25
|
+
import { isImplicitSubmissionKey, submitImplicitly, } from "../../../utils/implicit-submission.utils.js";
|
|
26
|
+
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
23
27
|
/**
|
|
24
28
|
* Tag name of the input component.
|
|
25
29
|
*/
|
|
@@ -29,13 +33,15 @@ export const EunomiaInputTagName = "eun-input";
|
|
|
29
33
|
* @internal
|
|
30
34
|
*/
|
|
31
35
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
32
|
-
const EunomiaInputMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base)))));
|
|
36
|
+
const EunomiaInputMixinBase = LocalizableMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base))))))));
|
|
33
37
|
/**
|
|
34
38
|
* A single-line text field, supporting several native input types.
|
|
35
39
|
*
|
|
36
40
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
37
41
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
38
42
|
* @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
|
|
43
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
44
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
39
45
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
40
46
|
* @prop {string} instructions - Instructions displayed below the label
|
|
41
47
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -46,6 +52,7 @@ const EunomiaInputMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(
|
|
|
46
52
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
47
53
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
48
54
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
55
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
49
56
|
* @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
|
|
50
57
|
* @prop {Array<Validators<string>>} validators - The list of validation rules applied to the field value
|
|
51
58
|
* @prop {EunomiaIconName} icon - An optional leading icon
|
|
@@ -59,12 +66,12 @@ const EunomiaInputMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(
|
|
|
59
66
|
* @prop {string} min - The native minimum constraint forwarded to the field
|
|
60
67
|
* @prop {string} max - The native maximum constraint forwarded to the field
|
|
61
68
|
* @prop {string} step - The native step constraint forwarded to the field
|
|
62
|
-
* @prop {string} [emptyValueLabel
|
|
63
|
-
* @prop {string} [confirmLabel
|
|
64
|
-
* @prop {string} [cancelLabel
|
|
65
|
-
* @prop {string} [
|
|
66
|
-
* @prop {string} [
|
|
67
|
-
* @prop {string} [
|
|
69
|
+
* @prop {string} [emptyValueLabel] - Text displayed in place of the value when readonly and empty. Defaults to the localized string for the current locale (English: "No value set")
|
|
70
|
+
* @prop {string} [confirmLabel] - The label of the confirm button in edit mode. Defaults to the localized string for the current locale (English: "Save")
|
|
71
|
+
* @prop {string} [cancelLabel] - The label of the cancel button in edit mode. Defaults to the localized string for the current locale (English: "Cancel")
|
|
72
|
+
* @prop {string} [clearLabel] - The accessible label of the clear button. Defaults to the localized string for the current locale (English: "Clear field")
|
|
73
|
+
* @prop {string} [showPasswordLabel] - The accessible label of the show password button. Defaults to the localized string for the current locale (English: "Show password")
|
|
74
|
+
* @prop {string} [hidePasswordLabel] - The accessible label of the hide password button. Defaults to the localized string for the current locale (English: "Hide password")
|
|
68
75
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
69
76
|
* @fires {CommitEvent} euncommit - Fired when an edit is confirmed in readonlyAvailable mode
|
|
70
77
|
* @cssprop [--field-background] - Sets the background color of the field
|
|
@@ -84,13 +91,46 @@ const EunomiaInputMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(
|
|
|
84
91
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
85
92
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
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
|
|
90
98
|
*/
|
|
91
99
|
let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
100
|
+
/**
|
|
101
|
+
* The default value applied on connection and form reset. Overrides the
|
|
102
|
+
* `defaultValue` accessor inherited from `FormMixin` only to drop its
|
|
103
|
+
* generic attribute converter, which always splits `default-value` on
|
|
104
|
+
* commas (appropriate for an array-valued field, not this component's
|
|
105
|
+
* plain `string` value) — `default-value="foo,bar"` would otherwise be
|
|
106
|
+
* parsed as `['foo', 'bar']` and silently assigned to a `string`-typed
|
|
107
|
+
* `value`. The actual get/set logic still comes from `FormMixin` itself,
|
|
108
|
+
* via `super`.
|
|
109
|
+
*/
|
|
110
|
+
get defaultValue() {
|
|
111
|
+
return super.defaultValue;
|
|
112
|
+
}
|
|
113
|
+
set defaultValue(value) {
|
|
114
|
+
// `FormMixinInterface.defaultValue` is declared getter-only (the
|
|
115
|
+
// mixin's real class has a working setter too — the interface used to
|
|
116
|
+
// type this component's base just omits it), so TS treats this as
|
|
117
|
+
// read-only even though it's correct and necessary at runtime.
|
|
118
|
+
// @ts-expect-error — see comment above ; FormMixin's real setter exists.
|
|
119
|
+
super.defaultValue = value;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The element a direct `.focus()` call on the host actually focuses.
|
|
123
|
+
* Defaults to the native field ; overridden by a subclass whose real,
|
|
124
|
+
* visible focusable proxy is something else — e.g. `eun-search`'s
|
|
125
|
+
* `panel` mode, whose native field lives inside a closed modal and isn't
|
|
126
|
+
* a valid focus target until it's open.
|
|
127
|
+
* @protected
|
|
128
|
+
*/
|
|
129
|
+
focusTarget() {
|
|
130
|
+
return this.fieldEl;
|
|
131
|
+
}
|
|
92
132
|
constructor() {
|
|
93
|
-
super(
|
|
133
|
+
super();
|
|
94
134
|
/**
|
|
95
135
|
* The native input type to apply.
|
|
96
136
|
* @default text
|
|
@@ -106,36 +146,6 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
106
146
|
* @default off
|
|
107
147
|
*/
|
|
108
148
|
this.autocomplete = "off";
|
|
109
|
-
/**
|
|
110
|
-
* Text displayed in place of the value when readonly and empty.
|
|
111
|
-
* @default No value set
|
|
112
|
-
*/
|
|
113
|
-
this.emptyValueLabel = "No value set";
|
|
114
|
-
/**
|
|
115
|
-
* Label of the confirm button in edit mode.
|
|
116
|
-
* @default Save
|
|
117
|
-
*/
|
|
118
|
-
this.confirmLabel = "Save";
|
|
119
|
-
/**
|
|
120
|
-
* Label of the cancel button in edit mode.
|
|
121
|
-
* @default Cancel
|
|
122
|
-
*/
|
|
123
|
-
this.cancelLabel = "Cancel";
|
|
124
|
-
/**
|
|
125
|
-
* Accessible label of the clear button.
|
|
126
|
-
* @default Clear field
|
|
127
|
-
*/
|
|
128
|
-
this.ariaLabelClear = "Clear field";
|
|
129
|
-
/**
|
|
130
|
-
* Accessible label of the show-password button.
|
|
131
|
-
* @default Show password
|
|
132
|
-
*/
|
|
133
|
-
this.ariaLabelShowPassword = "Show password";
|
|
134
|
-
/**
|
|
135
|
-
* Accessible label of the hide-password button.
|
|
136
|
-
* @default Hide password
|
|
137
|
-
*/
|
|
138
|
-
this.ariaLabelHidePassword = "Hide password";
|
|
139
149
|
/**
|
|
140
150
|
* Whether the password's plain value is currently revealed.
|
|
141
151
|
* @internal
|
|
@@ -150,6 +160,25 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
150
160
|
this.handleIconSlotChange = () => {
|
|
151
161
|
this.requestUpdate();
|
|
152
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Submits the owning form on Enter in the field, as a native text input
|
|
165
|
+
* does, since the browser never does it from a shadow root. Listened to
|
|
166
|
+
* on the host so a handler inside, such as `eun-search` picking a
|
|
167
|
+
* suggestion, can claim the key first. Skipped while editing in
|
|
168
|
+
* `readonlyAvailable` mode, whose own buttons confirm the edit.
|
|
169
|
+
* @private
|
|
170
|
+
*/
|
|
171
|
+
this.handleImplicitSubmission = (event) => {
|
|
172
|
+
const form = this.internals.form;
|
|
173
|
+
if (!form ||
|
|
174
|
+
event.composedPath()[0] !== this.fieldEl ||
|
|
175
|
+
!isImplicitSubmissionKey(event) ||
|
|
176
|
+
(this.readonlyAvailable && this.editing)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
submitImplicitly(form);
|
|
181
|
+
};
|
|
153
182
|
/**
|
|
154
183
|
* Reads native HTML constraint validation from the underlying field element
|
|
155
184
|
* (`required`, `minlength`, `maxlength`, `pattern`, `min`, `max`, `type="email"`, etc.).
|
|
@@ -169,61 +198,19 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
169
198
|
"badInput",
|
|
170
199
|
]);
|
|
171
200
|
};
|
|
201
|
+
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
172
202
|
}
|
|
173
203
|
/**
|
|
174
|
-
* The
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* commas (appropriate for an array-valued field, not this component's
|
|
178
|
-
* plain `string` value) — `default-value="foo,bar"` would otherwise be
|
|
179
|
-
* parsed as `['foo', 'bar']` and silently assigned to a `string`-typed
|
|
180
|
-
* `value`. The actual get/set logic still comes from `FormMixin` itself,
|
|
181
|
-
* via `super`.
|
|
204
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
205
|
+
* straight to the native field inside, in both directions, and
|
|
206
|
+
* {@link focus} covers a direct call on the host.
|
|
182
207
|
*/
|
|
183
|
-
get
|
|
184
|
-
return
|
|
185
|
-
}
|
|
186
|
-
set defaultValue(value) {
|
|
187
|
-
// `FormMixinInterface.defaultValue` is declared getter-only (the
|
|
188
|
-
// mixin's real class has a working setter too — the interface used to
|
|
189
|
-
// type this component's base just omits it), so TS treats this as
|
|
190
|
-
// read-only even though it's correct and necessary at runtime.
|
|
191
|
-
// @ts-expect-error — see comment above ; FormMixin's real setter exists.
|
|
192
|
-
super.defaultValue = value;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* The element a direct `.focus()` call on the host actually focuses.
|
|
196
|
-
* Defaults to the native field ; overridden by a subclass whose real,
|
|
197
|
-
* visible focusable proxy is something else — e.g. `eun-search`'s
|
|
198
|
-
* `panel` mode, whose native field lives inside a closed modal and isn't
|
|
199
|
-
* a valid focus target until it's open.
|
|
200
|
-
* @protected
|
|
201
|
-
*/
|
|
202
|
-
focusTarget() {
|
|
203
|
-
return this.fieldEl;
|
|
208
|
+
get hostTabStop() {
|
|
209
|
+
return false;
|
|
204
210
|
}
|
|
205
211
|
/**
|
|
206
212
|
* Lifecycle hook called whenever reactive properties change. Focuses the
|
|
207
|
-
* field when entering edit mode
|
|
208
|
-
* after every `disabled` change.
|
|
209
|
-
*
|
|
210
|
-
* `DisabledMixin` puts a real `tabindex="0"` on the host so Tab still
|
|
211
|
-
* reaches it while enabled — appropriate for a component whose host
|
|
212
|
-
* *is* the sole interactive surface, but this one always has its own
|
|
213
|
-
* focusable native field nested inside instead, and keeping the host
|
|
214
|
-
* itself as a *second*, independent tab stop right next to it broke
|
|
215
|
-
* Shift+Tab : landing back on the host is a genuine stop of its own as
|
|
216
|
-
* far as the browser's own backward sequential-navigation is concerned,
|
|
217
|
-
* and redirecting focus straight back into the field from there (this
|
|
218
|
-
* class's previous approach) fights that navigation mid-flight, leaving
|
|
219
|
-
* focus stranded on the host with nothing focused inside it. Removing
|
|
220
|
-
* the attribute instead lets sequential focus navigation descend
|
|
221
|
-
* straight into the field on its own, correctly in both directions, with
|
|
222
|
-
* no separate host stop and no redirect involved at all — this class's
|
|
223
|
-
* own `focus()` method (see below) covers a direct, explicit call on the
|
|
224
|
-
* host, the one case that genuinely still needs one. The disabled case
|
|
225
|
-
* still gets an explicit `-1` so a disabled field is skipped entirely
|
|
226
|
-
* rather than becoming its own (empty) stop.
|
|
213
|
+
* field when entering edit mode.
|
|
227
214
|
*
|
|
228
215
|
* @param _changedProperties - Map of changed properties
|
|
229
216
|
*/
|
|
@@ -232,14 +219,6 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
232
219
|
if (_changedProperties.has("editing") && this.editing) {
|
|
233
220
|
this.fieldEl?.focus();
|
|
234
221
|
}
|
|
235
|
-
if (_changedProperties.has("disabled")) {
|
|
236
|
-
if (this.disabled) {
|
|
237
|
-
this.setAttribute("tabindex", "-1");
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
this.removeAttribute("tabindex");
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
222
|
}
|
|
244
223
|
/**
|
|
245
224
|
* Returns the field element to focus/anchor on validation errors.
|
|
@@ -304,7 +283,9 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
304
283
|
@keydown=${(event) => (event.key === "Enter" || event.key === " ") && this.startEdit()}
|
|
305
284
|
>
|
|
306
285
|
<span class=${classMap({ empty: !hasValue })}
|
|
307
|
-
>${hasValue
|
|
286
|
+
>${hasValue
|
|
287
|
+
? this.value
|
|
288
|
+
: (this.emptyValueLabel ?? this.dictionary.common.noValue)}</span
|
|
308
289
|
>
|
|
309
290
|
</div>
|
|
310
291
|
`;
|
|
@@ -397,7 +378,7 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
397
378
|
type="button"
|
|
398
379
|
id="clear"
|
|
399
380
|
@click=${this.handleClear}
|
|
400
|
-
aria-label=${this.
|
|
381
|
+
aria-label=${this.clearLabel ?? this.dictionary.input.clear}
|
|
401
382
|
tabindex="-1"
|
|
402
383
|
>
|
|
403
384
|
<eun-icon name="cancel" size="16"></eun-icon>
|
|
@@ -409,10 +390,10 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
409
390
|
id="password-toggle"
|
|
410
391
|
@click=${this.togglePasswordVisibility}
|
|
411
392
|
aria-label=${this.showPassword
|
|
412
|
-
? this.
|
|
413
|
-
: this.
|
|
393
|
+
? (this.hidePasswordLabel ?? this.dictionary.input.hidePassword)
|
|
394
|
+
: (this.showPasswordLabel ??
|
|
395
|
+
this.dictionary.input.showPassword)}
|
|
414
396
|
aria-pressed=${this.showPassword}
|
|
415
|
-
tabindex="-1"
|
|
416
397
|
>
|
|
417
398
|
<eun-icon
|
|
418
399
|
name=${this.showPassword ? "visibility_off" : "visibility"}
|
|
@@ -428,11 +409,11 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
428
409
|
class="confirm"
|
|
429
410
|
size="s"
|
|
430
411
|
color="primary"
|
|
431
|
-
appearance="
|
|
412
|
+
appearance="soft"
|
|
432
413
|
rounded
|
|
433
414
|
type="button"
|
|
434
415
|
@click=${this.confirmEdit}
|
|
435
|
-
>${this.confirmLabel}</eun-button
|
|
416
|
+
>${this.confirmLabel ?? this.dictionary.common.save}</eun-button
|
|
436
417
|
>
|
|
437
418
|
<eun-button
|
|
438
419
|
class="cancel"
|
|
@@ -441,7 +422,7 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
441
422
|
rounded
|
|
442
423
|
type="button"
|
|
443
424
|
@click=${this.cancelEdit}
|
|
444
|
-
>${this.cancelLabel}</eun-button
|
|
425
|
+
>${this.cancelLabel ?? this.dictionary.common.cancel}</eun-button
|
|
445
426
|
>
|
|
446
427
|
</div>
|
|
447
428
|
`)}
|
|
@@ -483,7 +464,7 @@ EunomiaInput.styles = [
|
|
|
483
464
|
formLabelsStyles.hintMessages,
|
|
484
465
|
];
|
|
485
466
|
__decorate([
|
|
486
|
-
property({ reflect: true })
|
|
467
|
+
property({ reflect: true, useDefault: true })
|
|
487
468
|
], EunomiaInput.prototype, "type", void 0);
|
|
488
469
|
__decorate([
|
|
489
470
|
property({ attribute: "default-value" })
|
|
@@ -528,14 +509,14 @@ __decorate([
|
|
|
528
509
|
property({ attribute: "cancel-label" })
|
|
529
510
|
], EunomiaInput.prototype, "cancelLabel", void 0);
|
|
530
511
|
__decorate([
|
|
531
|
-
property({ attribute: "
|
|
532
|
-
], EunomiaInput.prototype, "
|
|
512
|
+
property({ attribute: "clear-label" })
|
|
513
|
+
], EunomiaInput.prototype, "clearLabel", void 0);
|
|
533
514
|
__decorate([
|
|
534
|
-
property({ attribute: "
|
|
535
|
-
], EunomiaInput.prototype, "
|
|
515
|
+
property({ attribute: "show-password-label" })
|
|
516
|
+
], EunomiaInput.prototype, "showPasswordLabel", void 0);
|
|
536
517
|
__decorate([
|
|
537
|
-
property({ attribute: "
|
|
538
|
-
], EunomiaInput.prototype, "
|
|
518
|
+
property({ attribute: "hide-password-label" })
|
|
519
|
+
], EunomiaInput.prototype, "hidePasswordLabel", void 0);
|
|
539
520
|
__decorate([
|
|
540
521
|
state()
|
|
541
522
|
], EunomiaInput.prototype, "showPassword", void 0);
|
|
@@ -5,6 +5,7 @@ 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 { Constructor } from "../../../utils/constructor.type.js";
|
|
8
|
+
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
8
9
|
/**
|
|
9
10
|
* Tag name of the input-file component.
|
|
10
11
|
*/
|
|
@@ -18,7 +19,7 @@ export type EunomiaInputFileKind = "image" | "file";
|
|
|
18
19
|
* Type of the input-file base used to declare every necessary Mixin interface elements.
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
21
|
-
type EunomiaInputFileBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<File[]> & FormMixinInterface<File[]> & FormLabelMixinInterface;
|
|
22
|
+
type EunomiaInputFileBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<File[]> & FormMixinInterface<File[]> & FormLabelMixinInterface & LocalizableMixinInterface;
|
|
22
23
|
declare const EunomiaInputFileMixinBase: Constructor<EunomiaInputFileBase>;
|
|
23
24
|
/**
|
|
24
25
|
* A file upload field with a dropzone, showing image thumbnails or generic
|
|
@@ -38,24 +39,25 @@ declare const EunomiaInputFileMixinBase: Constructor<EunomiaInputFileBase>;
|
|
|
38
39
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
39
40
|
* @prop {boolean} [required=false] - Whether at least one file is required
|
|
40
41
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
42
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
41
43
|
* @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
|
|
42
44
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<File[]>>} validators - The list of validation rules applied to the field value
|
|
43
45
|
* @prop {string} [dropLabel='Drag and drop files here, or'] - Static text displayed in the dropzone
|
|
44
46
|
* @attr {string} [drop-label='Drag and drop files here, or'] - Static text displayed in the dropzone
|
|
45
47
|
* @prop {string} [browseLabel='browse files'] - The visible text of the dropzone's browse link
|
|
46
48
|
* @attr {string} [browse-label='browse files'] - The visible text of the dropzone's browse link
|
|
47
|
-
* @prop {string} [
|
|
48
|
-
* @attr {string} [
|
|
49
|
-
* @prop {string} [
|
|
50
|
-
* @attr {string} [
|
|
49
|
+
* @prop {string} [removeLabel] - The accessible label of each item's remove button. Defaults to the localized string for the current locale (English: "Remove file")
|
|
50
|
+
* @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")
|
|
51
|
+
* @prop {string} [selectLabel] - The accessible label prefix of each item's checkbox. Defaults to the localized string for the current locale (English: "Select file")
|
|
52
|
+
* @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")
|
|
51
53
|
* @prop {string} [removeAllLabel='Remove all'] - The label of the always-available bulk clear action
|
|
52
54
|
* @attr {string} [remove-all-label='Remove all'] - The label of the always-available bulk clear action
|
|
53
55
|
* @prop {string} [selectAllLabel='Select all'] - The label of the selection toolbar's select-all checkbox
|
|
54
56
|
* @attr {string} [select-all-label='Select all'] - The label of the selection toolbar's select-all checkbox
|
|
55
57
|
* @prop {string} [deleteSelectedLabel='Delete selected'] - The label of the selection toolbar's bulk delete button
|
|
56
58
|
* @attr {string} [delete-selected-label='Delete selected'] - The label of the selection toolbar's bulk delete button
|
|
57
|
-
* @prop {string} [
|
|
58
|
-
* @attr {string} [
|
|
59
|
+
* @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")
|
|
60
|
+
* @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")
|
|
59
61
|
* @fires {ChangeEvent} eunchange - Fired whenever the selected files change
|
|
60
62
|
* @fires {FileRejectEvent} eunfilereject - Fired whenever one or more offered files are rejected, for the wrong type or exceeding the size or count limit
|
|
61
63
|
* @cssprop [--input-file-border-color] - Sets the border color of the dropzone
|
|
@@ -85,6 +87,11 @@ export declare class EunomiaInputFile extends EunomiaInputFileMixinBase {
|
|
|
85
87
|
* @internal
|
|
86
88
|
*/
|
|
87
89
|
static styles: CSSResultGroup;
|
|
90
|
+
/**
|
|
91
|
+
* Every change is a complete choice, so its error shows right away.
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
errorOnChange: boolean;
|
|
88
95
|
/**
|
|
89
96
|
* Accepted content kind: image thumbnails vs. generic file rows.
|
|
90
97
|
* @default image
|
|
@@ -128,15 +135,15 @@ export declare class EunomiaInputFile extends EunomiaInputFileMixinBase {
|
|
|
128
135
|
/**
|
|
129
136
|
* Accessible label prefix of each item's remove button (suffixed with the
|
|
130
137
|
* file name).
|
|
131
|
-
*
|
|
138
|
+
* Falls back to the localized string for the current locale when unset.
|
|
132
139
|
*/
|
|
133
|
-
|
|
140
|
+
removeLabel?: string;
|
|
134
141
|
/**
|
|
135
142
|
* Accessible label prefix of each item's checkbox (suffixed with the file
|
|
136
143
|
* name), when `selectable`.
|
|
137
|
-
*
|
|
144
|
+
* Falls back to the localized string for the current locale when unset.
|
|
138
145
|
*/
|
|
139
|
-
|
|
146
|
+
selectLabel?: string;
|
|
140
147
|
/**
|
|
141
148
|
* Label of the always-available bulk clear action, shown once at least one
|
|
142
149
|
* file is present.
|
|
@@ -157,9 +164,9 @@ export declare class EunomiaInputFile extends EunomiaInputFileMixinBase {
|
|
|
157
164
|
/**
|
|
158
165
|
* Appended to each item's accessible name (its primary action is opening
|
|
159
166
|
* the file in a new tab).
|
|
160
|
-
*
|
|
167
|
+
* Falls back to the localized string for the current locale when unset.
|
|
161
168
|
*/
|
|
162
|
-
|
|
169
|
+
openLabel?: string;
|
|
163
170
|
/**
|
|
164
171
|
* Whether a drag carrying files is currently over the host — reflected so
|
|
165
172
|
* `:host([dragging])` can drive the dropzone's highlight.
|
|
@@ -223,6 +230,12 @@ export declare class EunomiaInputFile extends EunomiaInputFileMixinBase {
|
|
|
223
230
|
* @param changedProperties - Map of changed properties
|
|
224
231
|
*/
|
|
225
232
|
protected updated(changedProperties: PropertyValues): void;
|
|
233
|
+
/**
|
|
234
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
235
|
+
* straight to the controls inside, in both directions, and
|
|
236
|
+
* {@link focus} covers a direct call on the host.
|
|
237
|
+
*/
|
|
238
|
+
protected get hostTabStop(): boolean;
|
|
226
239
|
/**
|
|
227
240
|
* Returns the element to focus/anchor on validation errors.
|
|
228
241
|
*
|