@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
|
@@ -13,10 +13,13 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
13
13
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
14
14
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
15
15
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
16
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
16
17
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
17
18
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
18
19
|
import { counterStyles } from "./counter.styles.js";
|
|
19
20
|
import { pickValidity } from "../../../utils/validity.utils.js";
|
|
21
|
+
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
22
|
+
import { isImplicitSubmissionKey, submitImplicitly, } from "../../../utils/implicit-submission.utils.js";
|
|
20
23
|
/**
|
|
21
24
|
* Tag name of the counter component.
|
|
22
25
|
*/
|
|
@@ -26,12 +29,13 @@ export const EunomiaCounterTagName = "eun-counter";
|
|
|
26
29
|
* @internal
|
|
27
30
|
*/
|
|
28
31
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
29
|
-
const EunomiaCounterMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))));
|
|
32
|
+
const EunomiaCounterMixinBase = LocalizableMixin(RoundedMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
30
33
|
/**
|
|
31
34
|
* A numeric field with increment and decrement buttons, built on a native
|
|
32
35
|
* number input.
|
|
33
36
|
*
|
|
34
37
|
* @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
|
|
38
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
35
39
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
36
40
|
* @prop {string} instructions - Instructions displayed below the label
|
|
37
41
|
* @prop {string} name - The field name
|
|
@@ -45,13 +49,14 @@ const EunomiaCounterMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixi
|
|
|
45
49
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
46
50
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
47
51
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
52
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
48
53
|
* @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
54
|
* @attr {boolean} [hide-error=false] - Whether the errors are hidden
|
|
50
55
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<number>>} validators - The list of validation rules applied to the field value
|
|
51
|
-
* @prop {string} [
|
|
52
|
-
* @attr {string} [
|
|
53
|
-
* @prop {string} [
|
|
54
|
-
* @attr {string} [
|
|
56
|
+
* @prop {string} [incrementLabel] - The accessible label of the increment button. Defaults to the localized string for the current locale (English: "Increase value")
|
|
57
|
+
* @attr {string} [increment-label] - The accessible label of the increment button. Defaults to the localized string for the current locale (English: "Increase value")
|
|
58
|
+
* @prop {string} [decrementLabel] - The accessible label of the decrement button. Defaults to the localized string for the current locale (English: "Decrease value")
|
|
59
|
+
* @attr {string} [decrement-label] - The accessible label of the decrement button. Defaults to the localized string for the current locale (English: "Decrease value")
|
|
55
60
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
56
61
|
* @cssprop [--counter-background] - Sets the background color of the field
|
|
57
62
|
* @cssprop [--counter-border-color] - Sets the border color of the field
|
|
@@ -70,50 +75,6 @@ const EunomiaCounterMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixi
|
|
|
70
75
|
* @element eun-counter
|
|
71
76
|
*/
|
|
72
77
|
let EunomiaCounter = class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
73
|
-
constructor() {
|
|
74
|
-
super(...arguments);
|
|
75
|
-
/**
|
|
76
|
-
* The amount the value changes on every increment/decrement.
|
|
77
|
-
* @default 1
|
|
78
|
-
*/
|
|
79
|
-
this.step = 1;
|
|
80
|
-
/**
|
|
81
|
-
* Accessible label of the increment button.
|
|
82
|
-
* @default Increase value
|
|
83
|
-
*/
|
|
84
|
-
this.ariaLabelIncrement = "Increase value";
|
|
85
|
-
/**
|
|
86
|
-
* Accessible label of the decrement button.
|
|
87
|
-
* @default Decrease value
|
|
88
|
-
*/
|
|
89
|
-
this.ariaLabelDecrement = "Decrease value";
|
|
90
|
-
/**
|
|
91
|
-
* Redirects focus to the native field whenever the host itself receives
|
|
92
|
-
* it. See `eun-input`'s identical pattern : the host stays in the tab
|
|
93
|
-
* order (`DisabledMixin`) rather than being excluded via `tabindex="-1"`,
|
|
94
|
-
* which broke Tab from reaching the field entirely for this
|
|
95
|
-
* form-associated component, instead of just skipping the host.
|
|
96
|
-
* @private
|
|
97
|
-
*/
|
|
98
|
-
this.handleHostFocus = () => {
|
|
99
|
-
this.fieldEl?.focus();
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Reads native HTML constraint validation from the underlying field
|
|
103
|
-
* element (`required`, `min`, `max`, `step`, `badInput`).
|
|
104
|
-
*
|
|
105
|
-
* @returns validity state and optional message.
|
|
106
|
-
*/
|
|
107
|
-
this.checkLocalValidators = () => {
|
|
108
|
-
return pickValidity(this.fieldEl, [
|
|
109
|
-
"valueMissing",
|
|
110
|
-
"rangeUnderflow",
|
|
111
|
-
"rangeOverflow",
|
|
112
|
-
"stepMismatch",
|
|
113
|
-
"badInput",
|
|
114
|
-
]);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
78
|
/**
|
|
118
79
|
* The current numeric value, `undefined` while empty (e.g. after the
|
|
119
80
|
* field is cleared by the user). Overrides the `value` accessor
|
|
@@ -151,13 +112,52 @@ let EunomiaCounter = class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
151
112
|
// @ts-expect-error — see comment above ; FormMixin's real setter exists.
|
|
152
113
|
super.defaultValue = value;
|
|
153
114
|
}
|
|
154
|
-
|
|
155
|
-
super
|
|
156
|
-
|
|
115
|
+
constructor() {
|
|
116
|
+
super();
|
|
117
|
+
/**
|
|
118
|
+
* The amount the value changes on every increment/decrement.
|
|
119
|
+
* @default 1
|
|
120
|
+
*/
|
|
121
|
+
this.step = 1;
|
|
122
|
+
/**
|
|
123
|
+
* Submits the owning form on Enter in the field, as a native number
|
|
124
|
+
* input does, since the browser never does it from a shadow root.
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
this.handleImplicitSubmission = (event) => {
|
|
128
|
+
const form = this.internals.form;
|
|
129
|
+
if (!form ||
|
|
130
|
+
event.composedPath()[0] !== this.fieldEl ||
|
|
131
|
+
!isImplicitSubmissionKey(event)) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
submitImplicitly(form);
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Reads native HTML constraint validation from the underlying field
|
|
139
|
+
* element (`required`, `min`, `max`, `step`, `badInput`).
|
|
140
|
+
*
|
|
141
|
+
* @returns validity state and optional message.
|
|
142
|
+
*/
|
|
143
|
+
this.checkLocalValidators = () => {
|
|
144
|
+
return pickValidity(this.fieldEl, [
|
|
145
|
+
"valueMissing",
|
|
146
|
+
"rangeUnderflow",
|
|
147
|
+
"rangeOverflow",
|
|
148
|
+
"stepMismatch",
|
|
149
|
+
"badInput",
|
|
150
|
+
]);
|
|
151
|
+
};
|
|
152
|
+
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
157
153
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
/**
|
|
155
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
156
|
+
* straight to the controls inside, in both directions, and
|
|
157
|
+
* {@link focus} covers a direct call on the host.
|
|
158
|
+
*/
|
|
159
|
+
get hostTabStop() {
|
|
160
|
+
return false;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Returns the field element to focus/anchor on validation errors.
|
|
@@ -299,7 +299,7 @@ let EunomiaCounter = class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
299
299
|
type="button"
|
|
300
300
|
id="decrement"
|
|
301
301
|
tabindex="-1"
|
|
302
|
-
aria-label=${this.
|
|
302
|
+
aria-label=${this.decrementLabel ?? this.dictionary.counter.decrement}
|
|
303
303
|
?disabled=${!canDecrement}
|
|
304
304
|
@click=${() => this.stepBy(-1)}
|
|
305
305
|
>
|
|
@@ -326,7 +326,7 @@ let EunomiaCounter = class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
326
326
|
type="button"
|
|
327
327
|
id="increment"
|
|
328
328
|
tabindex="-1"
|
|
329
|
-
aria-label=${this.
|
|
329
|
+
aria-label=${this.incrementLabel ?? this.dictionary.counter.increment}
|
|
330
330
|
?disabled=${!canIncrement}
|
|
331
331
|
@click=${() => this.stepBy(1)}
|
|
332
332
|
>
|
|
@@ -371,11 +371,11 @@ __decorate([
|
|
|
371
371
|
property({ type: Number })
|
|
372
372
|
], EunomiaCounter.prototype, "step", void 0);
|
|
373
373
|
__decorate([
|
|
374
|
-
property({ attribute: "
|
|
375
|
-
], EunomiaCounter.prototype, "
|
|
374
|
+
property({ attribute: "increment-label" })
|
|
375
|
+
], EunomiaCounter.prototype, "incrementLabel", void 0);
|
|
376
376
|
__decorate([
|
|
377
|
-
property({ attribute: "
|
|
378
|
-
], EunomiaCounter.prototype, "
|
|
377
|
+
property({ attribute: "decrement-label" })
|
|
378
|
+
], EunomiaCounter.prototype, "decrementLabel", void 0);
|
|
379
379
|
__decorate([
|
|
380
380
|
property({ type: Number })
|
|
381
381
|
// @ts-expect-error — see comment above ; real getter returns `U | undefined`.
|
|
@@ -37,10 +37,8 @@ const base = css `
|
|
|
37
37
|
--counter-focus-outline-color,
|
|
38
38
|
var(--eun-color-primary-500, #3d6fff)
|
|
39
39
|
);
|
|
40
|
-
--
|
|
41
|
-
|
|
42
|
-
var(--eun-border-radius-m, 8px)
|
|
43
|
-
);
|
|
40
|
+
--_defaultBorderRadius: var(--eun-border-radius-m, 8px);
|
|
41
|
+
--_borderRadius: var(--counter-border-radius, var(--_defaultBorderRadius));
|
|
44
42
|
--_fieldWidth: var(--counter-field-width, 3.5rem);
|
|
45
43
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
46
44
|
font-size: var(--eun-font-size-s, 14px);
|
|
@@ -50,6 +48,10 @@ const base = css `
|
|
|
50
48
|
outline: none;
|
|
51
49
|
}
|
|
52
50
|
|
|
51
|
+
:host([rounded]) {
|
|
52
|
+
--_defaultBorderRadius: var(--eun-border-radius-xl, 999px);
|
|
53
|
+
}
|
|
54
|
+
|
|
53
55
|
#wrapper {
|
|
54
56
|
display: flex;
|
|
55
57
|
flex-direction: column;
|
|
@@ -5,6 +5,8 @@ import { ValidatorsMixinInterface, Validity } from "../../../mixins/validators.m
|
|
|
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 { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
10
12
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
@@ -21,7 +23,7 @@ export declare const EunomiaDatePickerTagName = "eun-date-picker";
|
|
|
21
23
|
* interface element.
|
|
22
24
|
* @internal
|
|
23
25
|
*/
|
|
24
|
-
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
26
|
+
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
25
27
|
declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
26
28
|
/**
|
|
27
29
|
* A date field entered across segmented numeric day, month, and year
|
|
@@ -45,6 +47,8 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
45
47
|
* composes with all three.
|
|
46
48
|
*
|
|
47
49
|
* @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
|
|
50
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
51
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
48
52
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
49
53
|
* @prop {'day' | 'month' | 'year'} [granularity='day'] - How precise the picked value is. Controls both the number of segments rendered and which calendar surface opens
|
|
50
54
|
* @prop {Date | null} value - The picked value, in single mode. Normalized to the first of the month or January first of the year outside day granularity
|
|
@@ -64,12 +68,13 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
64
68
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
65
69
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
66
70
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
71
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
67
72
|
* @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
|
|
68
73
|
* @prop {Array<Validators<Date | null>>} validators - The list of custom validation rules applied to the value
|
|
69
74
|
* @prop {string} [todayLabel='Today'] - The label of the day grid's jump to today shortcut. Only shown with day granularity
|
|
70
75
|
* @prop {string} [applyLabel='Apply'] - The label of the mobile modal's confirm button
|
|
71
|
-
* @prop {string} [cancelLabel
|
|
72
|
-
* @prop {string} [
|
|
76
|
+
* @prop {string} [cancelLabel] - The label of the mobile modal's cancel button. Defaults to the localized string for the current locale (English: "Cancel")
|
|
77
|
+
* @prop {string} [calendarLabel] - The accessible label of the trailing calendar button. Defaults to the localized string for the current locale (English: "Open calendar")
|
|
73
78
|
* @prop {string} [dayPlaceholder='jj'] - The placeholder shown in the empty day segment
|
|
74
79
|
* @prop {string} [monthPlaceholder='mm'] - The placeholder shown in the empty month segment
|
|
75
80
|
* @prop {string} [yearPlaceholder='yyyy'] - The placeholder shown in the empty year segment
|
|
@@ -108,6 +113,7 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
108
113
|
* @cssprop [--date-picker-panel-background] - Sets the background color of the popover panel
|
|
109
114
|
* @cssprop [--date-picker-panel-transition-duration=200ms] - Sets the duration of the popover panel's open and close transition, disabled entirely by the no-animation attribute or reduced motion settings
|
|
110
115
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
116
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
111
117
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
112
118
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
113
119
|
* @element eun-date-picker
|
|
@@ -121,6 +127,11 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
121
127
|
* @readonly
|
|
122
128
|
*/
|
|
123
129
|
static readonly styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
130
|
+
/**
|
|
131
|
+
* Every change is a complete choice, so its error shows right away.
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
errorOnChange: boolean;
|
|
124
135
|
/**
|
|
125
136
|
* Whether a single value or a start/end range is picked.
|
|
126
137
|
* @default single
|
|
@@ -254,14 +265,14 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
254
265
|
applyLabel: string;
|
|
255
266
|
/**
|
|
256
267
|
* Label of the mobile modal's cancel button.
|
|
257
|
-
*
|
|
268
|
+
* Falls back to the localized string for the current locale when unset.
|
|
258
269
|
*/
|
|
259
|
-
cancelLabel
|
|
270
|
+
cancelLabel?: string;
|
|
260
271
|
/**
|
|
261
272
|
* Accessible label of the trailing calendar button.
|
|
262
|
-
*
|
|
273
|
+
* Falls back to the localized string for the current locale when unset.
|
|
263
274
|
*/
|
|
264
|
-
|
|
275
|
+
calendarLabel?: string;
|
|
265
276
|
/**
|
|
266
277
|
* Placeholder shown in the empty day segment.
|
|
267
278
|
* @default jj
|
|
@@ -443,6 +454,15 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
443
454
|
* {@link defaultRangeValue} to `rangeValue` the same way for
|
|
444
455
|
* `mode="range"`, which `FormMixin` has no knowledge of.
|
|
445
456
|
*/
|
|
457
|
+
constructor();
|
|
458
|
+
/**
|
|
459
|
+
* Submits the owning form on Enter in one of the field's segments, as a
|
|
460
|
+
* native date input does, since the browser never does it from a
|
|
461
|
+
* shadow root. Left alone while the panel is open, and on keys a
|
|
462
|
+
* segment already handles, such as Enter toggling the AM/PM segment.
|
|
463
|
+
* @private
|
|
464
|
+
*/
|
|
465
|
+
private readonly handleImplicitSubmission;
|
|
446
466
|
connectedCallback(): void;
|
|
447
467
|
/**
|
|
448
468
|
* Resets the field to its default on a native form `reset()`.
|
|
@@ -513,6 +533,12 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
513
533
|
* @returns validity state and optional message.
|
|
514
534
|
*/
|
|
515
535
|
buildCommonValidators: () => Validity;
|
|
536
|
+
/**
|
|
537
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
538
|
+
* straight to the controls inside, in both directions, and
|
|
539
|
+
* {@link focus} covers a direct call on the host.
|
|
540
|
+
*/
|
|
541
|
+
protected get hostTabStop(): boolean;
|
|
516
542
|
/**
|
|
517
543
|
* Returns the first segment field to focus/anchor on validation errors.
|
|
518
544
|
*
|
|
@@ -14,6 +14,8 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
14
14
|
import { FormMixin, hasErrorDisplayChange, } from "../../../mixins/form.mixin.js";
|
|
15
15
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
16
16
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
17
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
18
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
17
19
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
18
20
|
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
19
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
@@ -35,6 +37,7 @@ import { isDisabledDay, renderDatePickerDayGrid, } from "./date-picker-day-grid.
|
|
|
35
37
|
import { isDisabledMonth, renderDatePickerMonthGrid, } from "./date-picker-month-grid.js";
|
|
36
38
|
import { getYearPageStart, isDisabledYear, renderDatePickerYearGrid, } from "./date-picker-year-grid.js";
|
|
37
39
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
40
|
+
import { isImplicitSubmissionKey, submitImplicitly, } from "../../../utils/implicit-submission.utils.js";
|
|
38
41
|
/**
|
|
39
42
|
* Tag name of the date-picker component.
|
|
40
43
|
*/
|
|
@@ -57,7 +60,7 @@ const SEGMENT_SPIN_BOUNDS = {
|
|
|
57
60
|
* @internal
|
|
58
61
|
*/
|
|
59
62
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
60
|
-
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
63
|
+
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))))));
|
|
61
64
|
/**
|
|
62
65
|
* A date field entered across segmented numeric day, month, and year
|
|
63
66
|
* inputs, following the same accessible pattern used by several
|
|
@@ -80,6 +83,8 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
80
83
|
* composes with all three.
|
|
81
84
|
*
|
|
82
85
|
* @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
|
|
86
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
87
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
83
88
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
84
89
|
* @prop {'day' | 'month' | 'year'} [granularity='day'] - How precise the picked value is. Controls both the number of segments rendered and which calendar surface opens
|
|
85
90
|
* @prop {Date | null} value - The picked value, in single mode. Normalized to the first of the month or January first of the year outside day granularity
|
|
@@ -99,12 +104,13 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
99
104
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
100
105
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
101
106
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
107
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
102
108
|
* @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
|
|
103
109
|
* @prop {Array<Validators<Date | null>>} validators - The list of custom validation rules applied to the value
|
|
104
110
|
* @prop {string} [todayLabel='Today'] - The label of the day grid's jump to today shortcut. Only shown with day granularity
|
|
105
111
|
* @prop {string} [applyLabel='Apply'] - The label of the mobile modal's confirm button
|
|
106
|
-
* @prop {string} [cancelLabel
|
|
107
|
-
* @prop {string} [
|
|
112
|
+
* @prop {string} [cancelLabel] - The label of the mobile modal's cancel button. Defaults to the localized string for the current locale (English: "Cancel")
|
|
113
|
+
* @prop {string} [calendarLabel] - The accessible label of the trailing calendar button. Defaults to the localized string for the current locale (English: "Open calendar")
|
|
108
114
|
* @prop {string} [dayPlaceholder='jj'] - The placeholder shown in the empty day segment
|
|
109
115
|
* @prop {string} [monthPlaceholder='mm'] - The placeholder shown in the empty month segment
|
|
110
116
|
* @prop {string} [yearPlaceholder='yyyy'] - The placeholder shown in the empty year segment
|
|
@@ -143,13 +149,43 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
143
149
|
* @cssprop [--date-picker-panel-background] - Sets the background color of the popover panel
|
|
144
150
|
* @cssprop [--date-picker-panel-transition-duration=200ms] - Sets the duration of the popover panel's open and close transition, disabled entirely by the no-animation attribute or reduced motion settings
|
|
145
151
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
152
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
146
153
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
147
154
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
148
155
|
* @element eun-date-picker
|
|
149
156
|
*/
|
|
150
157
|
let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
158
|
+
/**
|
|
159
|
+
* The default value applied on connection and form reset, in `single`
|
|
160
|
+
* mode. Overrides the `defaultValue` accessor inherited from `FormMixin`
|
|
161
|
+
* only to swap its attribute converter : the mixin's generic one always
|
|
162
|
+
* splits `default-value` on commas (appropriate for e.g. a multi-select's
|
|
163
|
+
* array value), which would silently produce the wrong thing for a
|
|
164
|
+
* `Date`. The actual get/set logic (applying the default when the field
|
|
165
|
+
* resets) still comes from `FormMixin` itself, via `super`.
|
|
166
|
+
* @default-value-format yyyy-mm-dd
|
|
167
|
+
*/
|
|
168
|
+
get defaultValue() {
|
|
169
|
+
return super.defaultValue;
|
|
170
|
+
}
|
|
171
|
+
set defaultValue(value) {
|
|
172
|
+
// @ts-expect-error — see comment above ; FormMixin's real setter exists.
|
|
173
|
+
super.defaultValue = value;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Lifecycle callback triggered when the component is connected to the
|
|
177
|
+
* DOM. `FormMixin`'s own `connectedCallback` already applies
|
|
178
|
+
* `defaultValue` to `value` for `mode="single"` ; this applies
|
|
179
|
+
* {@link defaultRangeValue} to `rangeValue` the same way for
|
|
180
|
+
* `mode="range"`, which `FormMixin` has no knowledge of.
|
|
181
|
+
*/
|
|
151
182
|
constructor() {
|
|
152
|
-
super(
|
|
183
|
+
super();
|
|
184
|
+
/**
|
|
185
|
+
* Every change is a complete choice, so its error shows right away.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
188
|
+
this.errorOnChange = true;
|
|
153
189
|
/**
|
|
154
190
|
* Whether a single value or a start/end range is picked.
|
|
155
191
|
* @default single
|
|
@@ -229,16 +265,6 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
229
265
|
* @default Apply
|
|
230
266
|
*/
|
|
231
267
|
this.applyLabel = "Apply";
|
|
232
|
-
/**
|
|
233
|
-
* Label of the mobile modal's cancel button.
|
|
234
|
-
* @default Cancel
|
|
235
|
-
*/
|
|
236
|
-
this.cancelLabel = "Cancel";
|
|
237
|
-
/**
|
|
238
|
-
* Accessible label of the trailing calendar button.
|
|
239
|
-
* @default Open calendar
|
|
240
|
-
*/
|
|
241
|
-
this.ariaLabelCalendar = "Open calendar";
|
|
242
268
|
/**
|
|
243
269
|
* Placeholder shown in the empty day segment.
|
|
244
270
|
* @default jj
|
|
@@ -360,6 +386,25 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
360
386
|
minute: "",
|
|
361
387
|
period: "",
|
|
362
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Submits the owning form on Enter in one of the field's segments, as a
|
|
391
|
+
* native date input does, since the browser never does it from a
|
|
392
|
+
* shadow root. Left alone while the panel is open, and on keys a
|
|
393
|
+
* segment already handles, such as Enter toggling the AM/PM segment.
|
|
394
|
+
* @private
|
|
395
|
+
*/
|
|
396
|
+
this.handleImplicitSubmission = (event) => {
|
|
397
|
+
const form = this.internals.form;
|
|
398
|
+
const origin = event.composedPath()[0];
|
|
399
|
+
if (!form ||
|
|
400
|
+
this.isOpen ||
|
|
401
|
+
!(origin instanceof Element && origin.matches(".segment")) ||
|
|
402
|
+
!isImplicitSubmissionKey(event)) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
event.preventDefault();
|
|
406
|
+
submitImplicitly(form);
|
|
407
|
+
};
|
|
363
408
|
/**
|
|
364
409
|
* Reads local validation state : a partially/invalidly typed segment
|
|
365
410
|
* group reports as invalid, matching native constraint validation's
|
|
@@ -978,31 +1023,8 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
978
1023
|
break;
|
|
979
1024
|
}
|
|
980
1025
|
};
|
|
1026
|
+
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
981
1027
|
}
|
|
982
|
-
/**
|
|
983
|
-
* The default value applied on connection and form reset, in `single`
|
|
984
|
-
* mode. Overrides the `defaultValue` accessor inherited from `FormMixin`
|
|
985
|
-
* only to swap its attribute converter : the mixin's generic one always
|
|
986
|
-
* splits `default-value` on commas (appropriate for e.g. a multi-select's
|
|
987
|
-
* array value), which would silently produce the wrong thing for a
|
|
988
|
-
* `Date`. The actual get/set logic (applying the default when the field
|
|
989
|
-
* resets) still comes from `FormMixin` itself, via `super`.
|
|
990
|
-
* @default-value-format yyyy-mm-dd
|
|
991
|
-
*/
|
|
992
|
-
get defaultValue() {
|
|
993
|
-
return super.defaultValue;
|
|
994
|
-
}
|
|
995
|
-
set defaultValue(value) {
|
|
996
|
-
// @ts-expect-error — see comment above ; FormMixin's real setter exists.
|
|
997
|
-
super.defaultValue = value;
|
|
998
|
-
}
|
|
999
|
-
/**
|
|
1000
|
-
* Lifecycle callback triggered when the component is connected to the
|
|
1001
|
-
* DOM. `FormMixin`'s own `connectedCallback` already applies
|
|
1002
|
-
* `defaultValue` to `value` for `mode="single"` ; this applies
|
|
1003
|
-
* {@link defaultRangeValue} to `rangeValue` the same way for
|
|
1004
|
-
* `mode="range"`, which `FormMixin` has no knowledge of.
|
|
1005
|
-
*/
|
|
1006
1028
|
connectedCallback() {
|
|
1007
1029
|
super.connectedCallback?.();
|
|
1008
1030
|
if (this.mode === "range" && this.defaultRangeValue) {
|
|
@@ -1096,6 +1118,14 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1096
1118
|
this.setAttribute("aria-invalid", String(this.showError));
|
|
1097
1119
|
}
|
|
1098
1120
|
}
|
|
1121
|
+
/**
|
|
1122
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
1123
|
+
* straight to the controls inside, in both directions, and
|
|
1124
|
+
* {@link focus} covers a direct call on the host.
|
|
1125
|
+
*/
|
|
1126
|
+
get hostTabStop() {
|
|
1127
|
+
return false;
|
|
1128
|
+
}
|
|
1099
1129
|
/**
|
|
1100
1130
|
* Returns the first segment field to focus/anchor on validation errors.
|
|
1101
1131
|
*
|
|
@@ -2033,6 +2063,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2033
2063
|
data-target=${target}
|
|
2034
2064
|
role="group"
|
|
2035
2065
|
aria-label=${groupLabel}
|
|
2066
|
+
aria-describedby=${this.description?.length ? "description" : nothing}
|
|
2036
2067
|
>
|
|
2037
2068
|
${order.map((kind, index) => html `
|
|
2038
2069
|
${index > 0
|
|
@@ -2073,7 +2104,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2073
2104
|
maxlength=${maxLength}
|
|
2074
2105
|
size=${maxLength}
|
|
2075
2106
|
placeholder=${this.placeholderFor(kind)}
|
|
2076
|
-
aria-label=${
|
|
2107
|
+
aria-label=${this.dictionary.datePicker[kind]}
|
|
2077
2108
|
.value=${values[kind]}
|
|
2078
2109
|
?disabled=${this.disabled}
|
|
2079
2110
|
?readonly=${this.readonly}
|
|
@@ -2232,21 +2263,22 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2232
2263
|
${this.mode === "single"
|
|
2233
2264
|
? this.renderSegmentGroup("value", this.label ?? this.headingFor())
|
|
2234
2265
|
: html `
|
|
2235
|
-
${this.renderSegmentGroup("start",
|
|
2266
|
+
${this.renderSegmentGroup("start", this.dictionary.datePicker.startDate)}
|
|
2236
2267
|
<span class="range-separator" aria-hidden="true">–</span>
|
|
2237
|
-
${this.renderSegmentGroup("end",
|
|
2268
|
+
${this.renderSegmentGroup("end", this.dictionary.datePicker.endDate)}
|
|
2238
2269
|
`}
|
|
2239
2270
|
${this.isWithTimeActive() ? this.renderTimeSegmentGroup() : nothing}
|
|
2240
2271
|
<button
|
|
2241
2272
|
type="button"
|
|
2242
2273
|
id="calendar-trigger"
|
|
2243
|
-
aria-label=${this.
|
|
2274
|
+
aria-label=${this.calendarLabel ??
|
|
2275
|
+
this.dictionary.datePicker.openCalendar}
|
|
2244
2276
|
aria-haspopup="dialog"
|
|
2245
2277
|
aria-expanded=${this.isOpen || this.isModalOpen ? "true" : "false"}
|
|
2246
2278
|
?disabled=${this.disabled}
|
|
2247
2279
|
@click=${this.handleTriggerClick}
|
|
2248
2280
|
>
|
|
2249
|
-
<eun-icon name="calendar_today"
|
|
2281
|
+
<eun-icon name="calendar_today"></eun-icon>
|
|
2250
2282
|
</button>
|
|
2251
2283
|
</div>
|
|
2252
2284
|
`;
|
|
@@ -2389,7 +2421,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2389
2421
|
id="popover-cancel"
|
|
2390
2422
|
@click=${this.handlePopoverCancel}
|
|
2391
2423
|
>
|
|
2392
|
-
${this.cancelLabel}
|
|
2424
|
+
${this.cancelLabel ?? this.dictionary.common.cancel}
|
|
2393
2425
|
</eun-button>
|
|
2394
2426
|
<eun-button id="popover-apply" @click=${this.handlePopoverApply}>
|
|
2395
2427
|
${this.applyLabel}
|
|
@@ -2415,7 +2447,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2415
2447
|
?open=${this.isModalOpen}
|
|
2416
2448
|
.closeable=${false}
|
|
2417
2449
|
confirm-label=${this.applyLabel}
|
|
2418
|
-
cancel-label=${this.cancelLabel}
|
|
2450
|
+
cancel-label=${this.cancelLabel ?? this.dictionary.common.cancel}
|
|
2419
2451
|
aria-label=${this.label ?? this.headingFor()}
|
|
2420
2452
|
@eunconfirm=${this.handleModalConfirm}
|
|
2421
2453
|
@euncancel=${this.handleModalCancel}
|
|
@@ -2441,7 +2473,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2441
2473
|
id="cancel"
|
|
2442
2474
|
@click=${() => this.modalEl?.cancel()}
|
|
2443
2475
|
>
|
|
2444
|
-
${this.cancelLabel}
|
|
2476
|
+
${this.cancelLabel ?? this.dictionary.common.cancel}
|
|
2445
2477
|
</eun-button>
|
|
2446
2478
|
<eun-button id="confirm" @click=${() => this.modalEl?.confirm()}>
|
|
2447
2479
|
${this.applyLabel}
|
|
@@ -2478,10 +2510,10 @@ EunomiaDatePicker.styles = [
|
|
|
2478
2510
|
*/
|
|
2479
2511
|
EunomiaDatePicker.SWIPE_THRESHOLD_PX = 40;
|
|
2480
2512
|
__decorate([
|
|
2481
|
-
property({ reflect: true })
|
|
2513
|
+
property({ reflect: true, useDefault: true })
|
|
2482
2514
|
], EunomiaDatePicker.prototype, "mode", void 0);
|
|
2483
2515
|
__decorate([
|
|
2484
|
-
property({ reflect: true })
|
|
2516
|
+
property({ reflect: true, useDefault: true })
|
|
2485
2517
|
], EunomiaDatePicker.prototype, "granularity", void 0);
|
|
2486
2518
|
__decorate([
|
|
2487
2519
|
property({
|
|
@@ -2541,8 +2573,8 @@ __decorate([
|
|
|
2541
2573
|
property({ attribute: "cancel-label" })
|
|
2542
2574
|
], EunomiaDatePicker.prototype, "cancelLabel", void 0);
|
|
2543
2575
|
__decorate([
|
|
2544
|
-
property({ attribute: "
|
|
2545
|
-
], EunomiaDatePicker.prototype, "
|
|
2576
|
+
property({ attribute: "calendar-label" })
|
|
2577
|
+
], EunomiaDatePicker.prototype, "calendarLabel", void 0);
|
|
2546
2578
|
__decorate([
|
|
2547
2579
|
property({ attribute: "day-placeholder" })
|
|
2548
2580
|
], EunomiaDatePicker.prototype, "dayPlaceholder", void 0);
|
|
@@ -2668,12 +2700,6 @@ function todaysSegmentPart(kind) {
|
|
|
2668
2700
|
return today.getDate();
|
|
2669
2701
|
}
|
|
2670
2702
|
}
|
|
2671
|
-
/**
|
|
2672
|
-
* @private
|
|
2673
|
-
*/
|
|
2674
|
-
function capitalize(value) {
|
|
2675
|
-
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
2676
|
-
}
|
|
2677
2703
|
/**
|
|
2678
2704
|
* Parses an ISO (`yyyy-mm-dd`) date string, as used by the `default-value`
|
|
2679
2705
|
* and `default-range-value` attributes. Returns `null` for an empty or
|