@eunomia/elements 1.0.0-beta.9 → 1.0.0
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 +28 -6
- package/dist/angular/forms.d.ts +80 -0
- package/dist/angular/forms.js +267 -0
- package/dist/cdn/components/chunks/chunk-2XPIGFBD.js +1 -0
- package/dist/cdn/components/chunks/chunk-5IUNSTM3.js +1 -0
- package/dist/cdn/components/chunks/chunk-7HXPLZ7C.js +1 -0
- package/dist/cdn/components/chunks/{chunk-J3SZBXM6.js → chunk-A2NO4RSF.js} +7 -7
- package/dist/cdn/components/chunks/{chunk-Q34EQ5HZ.js → chunk-A623JJXJ.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-Y3HOIL64.js → chunk-AW7PU43S.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-FF3I7C3C.js → chunk-DWTNRFWW.js} +1 -3
- package/dist/cdn/components/chunks/chunk-FPNWPMHA.js +1 -0
- package/dist/cdn/components/chunks/chunk-GMWUHGNI.js +319 -0
- package/dist/cdn/components/chunks/{chunk-FQUWHNQT.js → chunk-GXOEPXDW.js} +1 -1
- package/dist/cdn/components/chunks/chunk-HXESKTK2.js +1 -0
- package/dist/cdn/components/chunks/chunk-JDUWKPHW.js +46 -0
- package/dist/cdn/components/chunks/{chunk-D3JJBHXN.js → chunk-JLKCBPD2.js} +2 -2
- package/dist/cdn/components/chunks/chunk-M6ZJHL4Q.js +1 -0
- package/dist/cdn/components/chunks/{chunk-TN3HGHQO.js → chunk-MDSUMP3O.js} +4 -4
- package/dist/cdn/components/chunks/chunk-MSQWOKBB.js +1 -0
- package/dist/cdn/components/chunks/{chunk-3UUZM7X2.js → chunk-NPXRQHUN.js} +3 -3
- package/dist/cdn/components/chunks/chunk-OB7DEGNX.js +1 -0
- package/dist/cdn/components/chunks/{chunk-JANNHW4Q.js → chunk-PADHCLBG.js} +4 -4
- package/dist/cdn/components/chunks/chunk-QMXE3KLT.js +1 -0
- package/dist/cdn/components/chunks/chunk-QNWKRPOW.js +1 -0
- package/dist/cdn/components/chunks/{chunk-KQUUMZ7U.js → chunk-RZF7QQDX.js} +7 -7
- package/dist/cdn/components/chunks/chunk-SCAP7J35.js +1 -0
- package/dist/cdn/components/chunks/chunk-TISMX7UL.js +1 -0
- package/dist/cdn/components/chunks/chunk-TWLI2ZOT.js +1 -0
- package/dist/cdn/components/chunks/chunk-W4VCWRY7.js +210 -0
- package/dist/cdn/components/chunks/{chunk-SZZRMJ65.js → chunk-WEG3KO6T.js} +3 -3
- package/dist/cdn/components/chunks/chunk-WP6ZYBAC.js +1 -0
- package/dist/cdn/components/chunks/{chunk-HGX6GPHM.js → chunk-XCBQ4CKH.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-3UW2LJ7T.js → chunk-XZ3LFOQP.js} +2 -2
- package/dist/cdn/components/eun-alert.js +1 -1
- package/dist/cdn/components/eun-animate.js +92 -180
- package/dist/cdn/components/eun-breadcrumb.js +4 -4
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +188 -115
- package/dist/cdn/components/eun-card.js +1 -1
- package/dist/cdn/components/eun-carousel.js +36 -28
- package/dist/cdn/components/eun-check-card.js +3 -3
- package/dist/cdn/components/eun-checkbox-list.js +2 -2
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +11 -15
- package/dist/cdn/components/eun-collapse.js +21 -10
- package/dist/cdn/components/eun-color-picker.js +32 -32
- package/dist/cdn/components/eun-counter.js +8 -8
- package/dist/cdn/components/eun-date-picker.js +83 -79
- package/dist/cdn/components/eun-description-list.js +1 -1
- package/dist/cdn/components/eun-divider.js +9 -8
- package/dist/cdn/components/eun-drawer.js +8 -6
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +4 -4
- package/dist/cdn/components/eun-fab.js +1 -1
- package/dist/cdn/components/eun-image-card.js +2 -2
- package/dist/cdn/components/eun-image-carousel.js +55 -29
- package/dist/cdn/components/eun-infinite-list.js +2 -2
- package/dist/cdn/components/eun-input-file.js +3 -3
- package/dist/cdn/components/eun-input-phone.js +6 -6
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-label.js +1 -1
- package/dist/cdn/components/eun-link.js +18 -329
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +9 -7
- package/dist/cdn/components/eun-nav-menu.js +363 -0
- package/dist/cdn/components/eun-pagination.js +4 -4
- package/dist/cdn/components/eun-password-strength.js +2 -2
- package/dist/cdn/components/eun-progress-bar.js +1 -1
- package/dist/cdn/components/eun-radio-card.js +4 -4
- package/dist/cdn/components/eun-radio-list.js +1 -1
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +9 -9
- package/dist/cdn/components/eun-scheduler-event-editor.js +113 -77
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +137 -79
- package/dist/cdn/components/eun-search.js +6 -6
- package/dist/cdn/components/eun-select.js +1 -1
- package/dist/cdn/components/eun-sidebar.js +23 -14
- package/dist/cdn/components/eun-slider.js +2 -2
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +2 -2
- package/dist/cdn/components/eun-stepper.js +11 -12
- package/dist/cdn/components/eun-switch.js +2 -2
- package/dist/cdn/components/eun-tab-group.js +1 -1
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +13 -10
- package/dist/cdn/components/eun-tag.js +1 -1
- package/dist/cdn/components/eun-textarea.js +4 -4
- package/dist/cdn/components/eun-time-picker.js +28 -25
- package/dist/cdn/components/eun-toast.js +8 -8
- package/dist/cdn/components/eun-toggle-group.js +8 -2
- package/dist/cdn/components/eun-toggle-item.js +8 -2
- package/dist/cdn/components/eun-toggle.js +4 -1
- package/dist/cdn/components/eun-toolbar.js +114 -36
- package/dist/cdn/components/eun-tooltip.js +1 -1
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/eunomia-theme.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/cdn/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
- package/dist/components/action/button/button.styles.js +2 -2
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -0
- package/dist/components/action/dropdown-button/dropdown-button.js +1 -0
- package/dist/components/action/dropdown-button/dropdown-button.styles.js +5 -4
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +1 -0
- package/dist/components/action/dropdown-button/dropdown-item.js +1 -0
- package/dist/components/action/dropdown-button/dropdown-item.styles.js +4 -4
- package/dist/components/action/link/link.d.ts +2 -1
- package/dist/components/action/link/link.js +2 -1
- package/dist/components/action/link/link.styles.d.ts +40 -1
- package/dist/components/action/link/link.styles.js +83 -60
- package/dist/components/action/shared-styles/button-palette.styles.js +1 -1
- package/dist/components/action/toggle/toggle-group.d.ts +1 -0
- package/dist/components/action/toggle/toggle-group.js +1 -0
- package/dist/components/action/toggle/toggle-group.styles.d.ts +1 -0
- package/dist/components/action/toggle/toggle-group.styles.js +9 -2
- package/dist/components/action/toggle/toggle-item.styles.js +8 -2
- package/dist/components/action/toggle/toggle.d.ts +1 -0
- package/dist/components/action/toggle/toggle.js +1 -0
- package/dist/components/action/toggle/toggle.styles.d.ts +1 -0
- package/dist/components/action/toggle/toggle.styles.js +5 -1
- package/dist/components/alert/drawer/drawer.d.ts +14 -13
- package/dist/components/alert/drawer/drawer.js +20 -28
- package/dist/components/alert/modal/modal.d.ts +14 -13
- package/dist/components/alert/modal/modal.js +20 -28
- package/dist/components/alert/modal/modal.styles.js +1 -1
- package/dist/components/alert/toast/toast.d.ts +5 -5
- package/dist/components/alert/toast/toast.js +9 -10
- package/dist/components/alert/toast/toast.styles.js +3 -3
- package/dist/components/content/card/image-card.styles.js +1 -1
- package/dist/components/content/chip/chip.d.ts +7 -9
- package/dist/components/content/chip/chip.js +11 -14
- package/dist/components/content/chip/chip.styles.js +1 -5
- package/dist/components/content/collapse/collapse.d.ts +5 -0
- package/dist/components/content/collapse/collapse.js +7 -0
- package/dist/components/content/collapse/collapse.styles.d.ts +3 -0
- package/dist/components/content/collapse/collapse.styles.js +13 -1
- package/dist/components/content/description-list/description-list.styles.js +1 -1
- package/dist/components/content/image-carousel/image-carousel.d.ts +60 -13
- package/dist/components/content/image-carousel/image-carousel.js +100 -22
- package/dist/components/content/image-carousel/image-carousel.styles.js +32 -6
- package/dist/components/content/password-strength/password-strength.styles.js +1 -1
- package/dist/components/content/progress-bar/progress-bar.styles.js +1 -1
- package/dist/components/content/shared-styles/card-link.styles.js +1 -1
- package/dist/components/content/shared-styles/tone-surface.styles.js +1 -3
- package/dist/components/form/checkbox/check-card.styles.js +2 -2
- package/dist/components/form/checkbox/checkbox-list.d.ts +3 -1
- package/dist/components/form/checkbox/checkbox-list.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +1 -1
- package/dist/components/form/color-picker/color-picker.d.ts +28 -3
- package/dist/components/form/color-picker/color-picker.js +53 -7
- package/dist/components/form/counter/counter.js +1 -1
- package/dist/components/form/counter/counter.styles.js +2 -2
- package/dist/components/form/date-picker/date-picker-day-grid.styles.js +1 -1
- package/dist/components/form/date-picker/date-picker-month-grid.js +1 -1
- package/dist/components/form/date-picker/date-picker.d.ts +50 -13
- package/dist/components/form/date-picker/date-picker.js +178 -43
- package/dist/components/form/input/input.js +1 -4
- package/dist/components/form/input-file/input-file.styles.js +2 -2
- package/dist/components/form/input-phone/input-phone.js +4 -3
- package/dist/components/form/label/label.styles.js +1 -1
- package/dist/components/form/radio/radio-card.styles.js +2 -2
- package/dist/components/form/radio/radio.styles.js +1 -1
- package/dist/components/form/rating/rating.js +3 -5
- package/dist/components/form/rating/rating.styles.js +2 -2
- package/dist/components/form/search/search.d.ts +1 -7
- package/dist/components/form/search/search.js +2 -12
- package/dist/components/form/shared-styles/field.styles.js +2 -2
- package/dist/components/form/slider/slider.styles.js +1 -1
- package/dist/components/form/switch/switch.styles.js +1 -1
- package/dist/components/form/textarea/textarea.js +1 -5
- package/dist/components/form/textarea/textarea.styles.js +2 -2
- package/dist/components/form/time-picker/time-picker-columns.d.ts +4 -1
- package/dist/components/form/time-picker/time-picker-columns.js +64 -15
- package/dist/components/form/time-picker/time-picker-columns.styles.js +5 -1
- package/dist/components/form/time-picker/time-picker-list.d.ts +4 -1
- package/dist/components/form/time-picker/time-picker-list.js +15 -8
- package/dist/components/form/time-picker/time-picker.d.ts +11 -2
- package/dist/components/form/time-picker/time-picker.js +22 -8
- package/dist/components/layout/animate/animate.d.ts +35 -17
- package/dist/components/layout/animate/animate.js +27 -14
- package/dist/components/layout/animate/animate.styles.d.ts +2 -1
- package/dist/components/layout/animate/animate.styles.js +107 -179
- package/dist/components/layout/divider/divider.d.ts +1 -0
- package/dist/components/layout/divider/divider.js +2 -1
- package/dist/components/layout/divider/divider.styles.js +7 -6
- package/dist/components/layout/infinite-list/infinite-list.styles.js +1 -1
- package/dist/components/navigation/breadcrumb/breadcrumb.styles.js +3 -3
- package/dist/components/navigation/carousel/carousel.d.ts +23 -14
- package/dist/components/navigation/carousel/carousel.js +39 -27
- package/dist/components/navigation/carousel/carousel.styles.js +16 -8
- package/dist/components/navigation/nav-menu/nav-menu.d.ts +201 -0
- package/dist/components/navigation/nav-menu/nav-menu.js +673 -0
- package/dist/components/navigation/nav-menu/nav-menu.styles.d.ts +1 -0
- package/dist/components/navigation/nav-menu/nav-menu.styles.js +352 -0
- package/dist/components/navigation/pagination/pagination.d.ts +3 -0
- package/dist/components/navigation/pagination/pagination.styles.js +2 -2
- package/dist/components/navigation/sidebar/sidebar.d.ts +8 -10
- package/dist/components/navigation/sidebar/sidebar.js +12 -15
- package/dist/components/navigation/sidebar/sidebar.styles.js +13 -4
- package/dist/components/navigation/stepper/step.styles.js +2 -2
- package/dist/components/navigation/stepper/stepper.d.ts +24 -13
- package/dist/components/navigation/stepper/stepper.js +36 -23
- package/dist/components/navigation/stepper/stepper.styles.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.js +1 -1
- package/dist/components/navigation/tabs/tab-panel/tab-panel.styles.js +1 -1
- package/dist/components/navigation/toolbar/toolbar.d.ts +121 -20
- package/dist/components/navigation/toolbar/toolbar.js +176 -45
- package/dist/components/navigation/toolbar/toolbar.styles.js +113 -28
- package/dist/events/editor-state-change.event.d.ts +28 -0
- package/dist/events/editor-state-change.event.js +22 -0
- package/dist/events/event-cancel.event.d.ts +20 -0
- package/dist/events/event-cancel.event.js +17 -0
- package/dist/events/period-change.event.d.ts +14 -6
- package/dist/events/period-change.event.js +9 -6
- package/dist/features/scheduler/calendar/calendar.d.ts +52 -20
- package/dist/features/scheduler/calendar/calendar.js +84 -36
- package/dist/features/scheduler/calendar/calendar.styles.js +5 -2
- package/dist/features/scheduler/scheduler/scheduler.d.ts +69 -4
- package/dist/features/scheduler/scheduler/scheduler.js +172 -47
- package/dist/features/scheduler/scheduler/scheduler.styles.js +6 -0
- package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +18 -20
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +29 -38
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +2 -2
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +102 -18
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +249 -112
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.styles.js +11 -1
- package/dist/features/scheduler/shared/scheduler-event-popover.d.ts +9 -1
- package/dist/features/scheduler/shared/scheduler-event-popover.js +77 -42
- package/dist/features/scheduler/shared/scheduler-event-popover.styles.js +14 -3
- package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +3 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.js +53 -46
- package/dist/features/scheduler/shared/scheduler-hour-grid.styles.js +13 -7
- package/dist/features/scheduler/shared/scheduler-month-view.js +1 -1
- package/dist/features/scheduler/shared/scheduler-month-view.styles.js +13 -7
- package/dist/features/scheduler/shared/scheduler-year-view.d.ts +6 -5
- package/dist/features/scheduler/shared/scheduler-year-view.js +11 -7
- package/dist/features/scheduler/shared/scheduler-year-view.styles.js +57 -3
- package/dist/features/scheduler/shared/scheduler.types.d.ts +5 -9
- package/dist/features/scheduler/shared/scheduler.utils.d.ts +61 -0
- package/dist/features/scheduler/shared/scheduler.utils.js +78 -4
- package/dist/features/table/table/table-native.styles.js +8 -4
- package/dist/features/table/table/table.d.ts +2 -1
- package/dist/features/table/table/table.js +2 -1
- package/dist/features/table/table/table.styles.js +6 -4
- package/dist/i18n/en.d.ts +17 -0
- package/dist/i18n/en.js +17 -0
- package/dist/i18n/fr.js +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -0
- package/dist/jsx.d.ts +48 -6
- package/dist/mixins/anchor-position.mixin.d.ts +17 -0
- package/dist/mixins/anchor-position.mixin.js +45 -7
- package/dist/mixins/button.mixin.js +2 -1
- package/dist/mixins/check.mixin.js +14 -5
- package/dist/mixins/dialog-surface.mixin.d.ts +1 -1
- package/dist/mixins/dialog-surface.mixin.js +5 -5
- package/dist/mixins/form.mixin.js +33 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -0
- package/dist/mixins/localizable.mixin.js +9 -2
- package/dist/mixins/radio.mixin.js +14 -5
- package/dist/mixins/validators.mixin.js +4 -3
- package/dist/react.d.ts +59 -0
- package/dist/react.js +42 -0
- package/dist/ssr/animate-ssr.css +35 -0
- package/dist/ssr/breadcrumb-ssr.css +3 -3
- package/dist/ssr/button-ssr.css +8 -2
- package/dist/ssr/card-ssr.css +1 -1
- package/dist/ssr/carousel-ssr.css +15 -4
- package/dist/ssr/chip-ssr.css +3 -3
- package/dist/ssr/collapse-ssr.css +2 -2
- package/dist/ssr/description-list-ssr.css +1 -1
- package/dist/ssr/divider-ssr.css +23 -0
- package/dist/ssr/field-ssr.css +245 -42
- package/dist/ssr/image-carousel-ssr.css +2 -4
- package/dist/ssr/links-ssr.css +17 -3
- package/dist/ssr/nav-menu-ssr.css +82 -0
- package/dist/ssr/overlay-ssr.css +4 -0
- package/dist/ssr/scheduler-ssr.css +182 -0
- package/dist/ssr/stepper-ssr.css +136 -0
- package/dist/ssr/table-ssr.css +7 -4
- package/dist/ssr/tag-ssr.css +1 -1
- package/dist/ssr/toolbar-ssr.css +7 -5
- package/dist/utils/css-length.utils.d.ts +14 -0
- package/dist/utils/css-length.utils.js +32 -0
- package/dist/utils/form-validation.utils.d.ts +36 -0
- package/dist/utils/form-validation.utils.js +113 -0
- package/dist/utils/implicit-submission.utils.js +2 -14
- package/dist/utils/interactive-content.utils.d.ts +10 -0
- package/dist/utils/interactive-content.utils.js +43 -0
- package/dist/utils/popover.utils.js +3 -2
- package/dist/utils/scroll-lock.utils.d.ts +9 -1
- package/dist/utils/scroll-lock.utils.js +21 -2
- package/dist/utils/theme-generator.utils.d.ts +1 -0
- package/dist/utils/theme-generator.utils.js +23 -10
- package/dist/utils/validity.utils.d.ts +18 -4
- package/dist/utils/validity.utils.js +74 -4
- package/package.json +34 -3
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
- package/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
- package/dist/cdn/components/chunks/chunk-4DRU3IYJ.js +0 -1
- package/dist/cdn/components/chunks/chunk-647ISUF4.js +0 -1
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +0 -1
- package/dist/cdn/components/chunks/chunk-E6UOI36Q.js +0 -1
- package/dist/cdn/components/chunks/chunk-GNAUNTS5.js +0 -1
- package/dist/cdn/components/chunks/chunk-IJJ67C66.js +0 -1
- package/dist/cdn/components/chunks/chunk-J7ETIRSK.js +0 -1
- package/dist/cdn/components/chunks/chunk-JGV7LHEI.js +0 -1
- package/dist/cdn/components/chunks/chunk-L74LXUGL.js +0 -1
- package/dist/cdn/components/chunks/chunk-MY6ORZJR.js +0 -46
- package/dist/cdn/components/chunks/chunk-QWTFP56P.js +0 -1
- package/dist/cdn/components/chunks/chunk-SFX2LQ4K.js +0 -205
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +0 -1
- package/dist/utils/boolean.utils.d.ts +0 -14
- package/dist/utils/boolean.utils.js +0 -20
|
@@ -57,7 +57,7 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
57
57
|
* @prop {EunomiaDateRange} defaultRangeValue - The default range applied when the field connects, and restored on form reset, in range mode
|
|
58
58
|
* @prop {0 | 1} [weekStartsOn=1] - Which weekday a week starts on, Sunday or Monday. Only relevant with day granularity
|
|
59
59
|
* @prop {boolean} [workWeek=false] - Whether to drop Saturdays and Sundays entirely from the day grid, as a five-column grid instead of seven. Only relevant with day granularity
|
|
60
|
-
* @prop {string} [locale] - The locale used for month and weekday labels and the segments' field order. Defaults to the
|
|
60
|
+
* @prop {string} [locale] - The locale used for month and weekday labels and the segments' field order. Defaults to the one set with setDefaultLocale, English otherwise
|
|
61
61
|
* @prop {Date} minDate - The earliest selectable value
|
|
62
62
|
* @prop {Date} maxDate - The latest selectable value
|
|
63
63
|
* @prop {(date: Date) => boolean} isDateDisabled - An optional predicate disabling specific days, months, or years on top of minDate and maxDate
|
|
@@ -86,7 +86,7 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
86
86
|
* @attr {12 | 24} [hour-format] - Overrides the time picker panel's hour format
|
|
87
87
|
* @prop {number} [stepMinute=1] - The time picker panel's minute column increment step. Only relevant when withTime is set
|
|
88
88
|
* @attr {number} [step-minute=1] - The time picker panel's minute column increment step
|
|
89
|
-
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string, when withTime is set.
|
|
89
|
+
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string, when withTime is set. The panel greys out the times outside minTime and maxTime, and a typed value outside them reports as invalid
|
|
90
90
|
* @attr {string} [min-time] - The earliest selectable time of day, as an HH:mm string
|
|
91
91
|
* @prop {string} [maxTime] - The latest selectable time of day, as an HH:mm string. When earlier than minTime, the valid range wraps past midnight instead of being empty
|
|
92
92
|
* @attr {string} [max-time] - The latest selectable time of day, as an HH:mm string
|
|
@@ -481,11 +481,12 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
481
481
|
* without this a partially/invalidly typed date (e.g. "31/02/2026", or a
|
|
482
482
|
* segment left empty) never surfaced as `badInput` until the group
|
|
483
483
|
* happened to also complete into a real, committable date. Also keeps
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* {@link
|
|
487
|
-
*
|
|
488
|
-
*
|
|
484
|
+
* the typed segments in sync whenever the committed value/range changes
|
|
485
|
+
* from outside (a direct property assignment, form reset, ...), and
|
|
486
|
+
* {@link timeSegments} whenever the value (or the time zone/format it's
|
|
487
|
+
* read through) changes while {@link withTime} is active — deliberately
|
|
488
|
+
* here rather than in `updated()` : setting a reactive property from
|
|
489
|
+
* `updated()` schedules a *second*,
|
|
489
490
|
* separate update pass (Lit warns about exactly this), which a single
|
|
490
491
|
* `await el.updateComplete` after an external `value`/`timezone` change
|
|
491
492
|
* wouldn't reliably wait through — see `eun-time-picker`'s identical
|
|
@@ -495,9 +496,7 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
495
496
|
*/
|
|
496
497
|
protected willUpdate(changed: PropertyValues): void;
|
|
497
498
|
/**
|
|
498
|
-
* Lifecycle hook called whenever reactive properties change.
|
|
499
|
-
* typed segments in sync whenever the committed value/range changes from
|
|
500
|
-
* outside (a direct property assignment, form reset, ...), and mirrors
|
|
499
|
+
* Lifecycle hook called whenever reactive properties change. Mirrors
|
|
501
500
|
* `valid`/`hideError`/`disabled` onto the host's `aria-invalid` — the
|
|
502
501
|
* `#field-wrapper`/`:host([aria-invalid="true"])` error styling in
|
|
503
502
|
* `date-picker.styles.ts` depends on it, matching the same host-attribute
|
|
@@ -511,7 +510,10 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
511
510
|
/**
|
|
512
511
|
* Reads local validation state : a partially/invalidly typed segment
|
|
513
512
|
* group reports as invalid, matching native constraint validation's
|
|
514
|
-
* `badInput`.
|
|
513
|
+
* `badInput`. A committed date before {@link minDate} or after
|
|
514
|
+
* {@link maxDate} reports `rangeUnderflow`/`rangeOverflow`, and one
|
|
515
|
+
* rejected by {@link isDateDisabled} reports `badInput`, whether it was
|
|
516
|
+
* typed, picked or assigned. While {@link withTime} is active, also checks the typed
|
|
515
517
|
* time segments the same way, and the committed value's time of day
|
|
516
518
|
* against {@link minTime}/{@link maxTime}, reporting
|
|
517
519
|
* `rangeUnderflow`/`rangeOverflow` exactly like a native
|
|
@@ -557,6 +559,20 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
557
559
|
* @private
|
|
558
560
|
*/
|
|
559
561
|
private isMobileViewport;
|
|
562
|
+
/**
|
|
563
|
+
* Which constraint a committed date breaks at the current
|
|
564
|
+
* `granularity`, read on its calendar day in {@link timezone} while
|
|
565
|
+
* {@link withTime} is active : the same checks that grey out the
|
|
566
|
+
* calendar's cells.
|
|
567
|
+
* @private
|
|
568
|
+
*/
|
|
569
|
+
private dateConstraintViolation;
|
|
570
|
+
/**
|
|
571
|
+
* Formats a `minDate`/`maxDate` bound for a validation message, at the
|
|
572
|
+
* current `granularity`.
|
|
573
|
+
* @private
|
|
574
|
+
*/
|
|
575
|
+
private formatConstraintDate;
|
|
560
576
|
/**
|
|
561
577
|
* @private
|
|
562
578
|
*/
|
|
@@ -571,7 +587,8 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
571
587
|
private isYearDisabled;
|
|
572
588
|
/**
|
|
573
589
|
* Seeds the in-progress staging state from the last committed
|
|
574
|
-
* value/range,
|
|
590
|
+
* value/range (or, in single mode, a fully typed date still waiting for
|
|
591
|
+
* its time), and centers the calendar on it (or today, if unset).
|
|
575
592
|
* Also seeds {@link stagingTime} from that same value's current
|
|
576
593
|
* hour/minute (in {@link timezone}) when {@link withTime} is set —
|
|
577
594
|
* midnight, absent a value yet.
|
|
@@ -1013,6 +1030,12 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
1013
1030
|
* @private
|
|
1014
1031
|
*/
|
|
1015
1032
|
private playSwipeAnimation;
|
|
1033
|
+
/**
|
|
1034
|
+
* Selects a segment's whole content when it gets focus or a click, so
|
|
1035
|
+
* typing replaces it instead of being blocked by its `maxlength`.
|
|
1036
|
+
* @private
|
|
1037
|
+
*/
|
|
1038
|
+
private readonly selectSegmentText;
|
|
1016
1039
|
/**
|
|
1017
1040
|
* Updates a single segment's typed value, auto-advancing to the next
|
|
1018
1041
|
* segment (in locale order) once it's fully typed, and committing the
|
|
@@ -1020,7 +1043,7 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
1020
1043
|
* (`isSegmentGroupComplete` — not just "parses so far", which a 1-3 digit
|
|
1021
1044
|
* year like `"202"` already does as year 202 AD ; gating on length too
|
|
1022
1045
|
* avoids committing mid-keystroke and stomping the segment the user is
|
|
1023
|
-
* still typing when `
|
|
1046
|
+
* still typing when `willUpdate()` reformats it from the committed value)
|
|
1024
1047
|
* and composes a real calendar date.
|
|
1025
1048
|
*
|
|
1026
1049
|
* @param event the native input event.
|
|
@@ -1040,6 +1063,17 @@ export declare class EunomiaDatePicker extends EunomiaDatePickerMixinBase {
|
|
|
1040
1063
|
* @private
|
|
1041
1064
|
*/
|
|
1042
1065
|
private commitSegmentGroupIfComplete;
|
|
1066
|
+
/**
|
|
1067
|
+
* The typed single-mode {@link segments}, once fully typed into a real
|
|
1068
|
+
* date.
|
|
1069
|
+
* @private
|
|
1070
|
+
*/
|
|
1071
|
+
private typedDate;
|
|
1072
|
+
/**
|
|
1073
|
+
* The typed {@link timeSegments}, once fully typed into a real time.
|
|
1074
|
+
* @private
|
|
1075
|
+
*/
|
|
1076
|
+
private typedTime;
|
|
1043
1077
|
/**
|
|
1044
1078
|
* Moves focus to the previous segment (in locale order) when Backspace
|
|
1045
1079
|
* is pressed on an already-empty segment, and to the previous/next
|
|
@@ -1319,5 +1353,8 @@ declare global {
|
|
|
1319
1353
|
interface HTMLElementTagNameMap {
|
|
1320
1354
|
[EunomiaDatePickerTagName]: EunomiaDatePicker;
|
|
1321
1355
|
}
|
|
1356
|
+
interface EunomiaStringAttributeMap {
|
|
1357
|
+
[EunomiaDatePickerTagName]: "default-value" | "default-range-value";
|
|
1358
|
+
}
|
|
1322
1359
|
}
|
|
1323
1360
|
export {};
|
|
@@ -93,7 +93,7 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedM
|
|
|
93
93
|
* @prop {EunomiaDateRange} defaultRangeValue - The default range applied when the field connects, and restored on form reset, in range mode
|
|
94
94
|
* @prop {0 | 1} [weekStartsOn=1] - Which weekday a week starts on, Sunday or Monday. Only relevant with day granularity
|
|
95
95
|
* @prop {boolean} [workWeek=false] - Whether to drop Saturdays and Sundays entirely from the day grid, as a five-column grid instead of seven. Only relevant with day granularity
|
|
96
|
-
* @prop {string} [locale] - The locale used for month and weekday labels and the segments' field order. Defaults to the
|
|
96
|
+
* @prop {string} [locale] - The locale used for month and weekday labels and the segments' field order. Defaults to the one set with setDefaultLocale, English otherwise
|
|
97
97
|
* @prop {Date} minDate - The earliest selectable value
|
|
98
98
|
* @prop {Date} maxDate - The latest selectable value
|
|
99
99
|
* @prop {(date: Date) => boolean} isDateDisabled - An optional predicate disabling specific days, months, or years on top of minDate and maxDate
|
|
@@ -122,7 +122,7 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedM
|
|
|
122
122
|
* @attr {12 | 24} [hour-format] - Overrides the time picker panel's hour format
|
|
123
123
|
* @prop {number} [stepMinute=1] - The time picker panel's minute column increment step. Only relevant when withTime is set
|
|
124
124
|
* @attr {number} [step-minute=1] - The time picker panel's minute column increment step
|
|
125
|
-
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string, when withTime is set.
|
|
125
|
+
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string, when withTime is set. The panel greys out the times outside minTime and maxTime, and a typed value outside them reports as invalid
|
|
126
126
|
* @attr {string} [min-time] - The earliest selectable time of day, as an HH:mm string
|
|
127
127
|
* @prop {string} [maxTime] - The latest selectable time of day, as an HH:mm string. When earlier than minTime, the valid range wraps past midnight instead of being empty
|
|
128
128
|
* @attr {string} [max-time] - The latest selectable time of day, as an HH:mm string
|
|
@@ -369,7 +369,10 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
369
369
|
/**
|
|
370
370
|
* Reads local validation state : a partially/invalidly typed segment
|
|
371
371
|
* group reports as invalid, matching native constraint validation's
|
|
372
|
-
* `badInput`.
|
|
372
|
+
* `badInput`. A committed date before {@link minDate} or after
|
|
373
|
+
* {@link maxDate} reports `rangeUnderflow`/`rangeOverflow`, and one
|
|
374
|
+
* rejected by {@link isDateDisabled} reports `badInput`, whether it was
|
|
375
|
+
* typed, picked or assigned. While {@link withTime} is active, also checks the typed
|
|
373
376
|
* time segments the same way, and the committed value's time of day
|
|
374
377
|
* against {@link minTime}/{@link maxTime}, reporting
|
|
375
378
|
* `rangeUnderflow`/`rangeOverflow` exactly like a native
|
|
@@ -389,9 +392,34 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
389
392
|
message: this.dictionary.validation.invalidDate,
|
|
390
393
|
};
|
|
391
394
|
}
|
|
395
|
+
const committed = this.mode === "single"
|
|
396
|
+
? [this.value]
|
|
397
|
+
: [this.rangeValue.start, this.rangeValue.end];
|
|
398
|
+
for (const date of committed) {
|
|
399
|
+
const violation = date ? this.dateConstraintViolation(date) : null;
|
|
400
|
+
if (violation === "min") {
|
|
401
|
+
return {
|
|
402
|
+
validity: { rangeUnderflow: true },
|
|
403
|
+
message: this.dictionary.validation.rangeUnderflow(this.formatConstraintDate(this.minDate)),
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
if (violation === "max") {
|
|
407
|
+
return {
|
|
408
|
+
validity: { rangeOverflow: true },
|
|
409
|
+
message: this.dictionary.validation.rangeOverflow(this.formatConstraintDate(this.maxDate)),
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
if (violation === "disabled") {
|
|
413
|
+
return {
|
|
414
|
+
validity: { badInput: true },
|
|
415
|
+
message: this.dictionary.validation.unavailableDate,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}
|
|
392
419
|
if (this.isWithTimeActive()) {
|
|
393
420
|
const format = this.resolvedHourFormat();
|
|
394
|
-
|
|
421
|
+
const isTimeMissing = !this.value && isPartiallyFilled(this.segments);
|
|
422
|
+
if ((isTimeMissing || isTimeSegmentsPartiallyFilled(this.timeSegments)) &&
|
|
395
423
|
!clockSegmentsToTime(this.timeSegments, format)) {
|
|
396
424
|
return {
|
|
397
425
|
validity: { badInput: true },
|
|
@@ -405,11 +433,11 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
405
433
|
return bounds.violation === "min"
|
|
406
434
|
? {
|
|
407
435
|
validity: { rangeUnderflow: true },
|
|
408
|
-
message:
|
|
436
|
+
message: this.dictionary.timePicker.mustBeAtOrAfter(this.minTime ?? ""),
|
|
409
437
|
}
|
|
410
438
|
: {
|
|
411
439
|
validity: { rangeOverflow: true },
|
|
412
|
-
message:
|
|
440
|
+
message: this.dictionary.timePicker.mustBeAtOrBefore(this.maxTime ?? ""),
|
|
413
441
|
};
|
|
414
442
|
}
|
|
415
443
|
}
|
|
@@ -942,6 +970,14 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
942
970
|
this.handleSwipeCancel = () => {
|
|
943
971
|
this.swipeStart = null;
|
|
944
972
|
};
|
|
973
|
+
/**
|
|
974
|
+
* Selects a segment's whole content when it gets focus or a click, so
|
|
975
|
+
* typing replaces it instead of being blocked by its `maxlength`.
|
|
976
|
+
* @private
|
|
977
|
+
*/
|
|
978
|
+
this.selectSegmentText = (event) => {
|
|
979
|
+
event.currentTarget.select();
|
|
980
|
+
};
|
|
945
981
|
/**
|
|
946
982
|
* @private
|
|
947
983
|
*/
|
|
@@ -1016,11 +1052,12 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1016
1052
|
* without this a partially/invalidly typed date (e.g. "31/02/2026", or a
|
|
1017
1053
|
* segment left empty) never surfaced as `badInput` until the group
|
|
1018
1054
|
* happened to also complete into a real, committable date. Also keeps
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
* {@link
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1055
|
+
* the typed segments in sync whenever the committed value/range changes
|
|
1056
|
+
* from outside (a direct property assignment, form reset, ...), and
|
|
1057
|
+
* {@link timeSegments} whenever the value (or the time zone/format it's
|
|
1058
|
+
* read through) changes while {@link withTime} is active — deliberately
|
|
1059
|
+
* here rather than in `updated()` : setting a reactive property from
|
|
1060
|
+
* `updated()` schedules a *second*,
|
|
1024
1061
|
* separate update pass (Lit warns about exactly this), which a single
|
|
1025
1062
|
* `await el.updateComplete` after an external `value`/`timezone` change
|
|
1026
1063
|
* wouldn't reliably wait through — see `eun-time-picker`'s identical
|
|
@@ -1029,9 +1066,23 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1029
1066
|
* @param changed the changed properties.
|
|
1030
1067
|
*/
|
|
1031
1068
|
willUpdate(changed) {
|
|
1069
|
+
if (changed.has("value") && this.mode === "single") {
|
|
1070
|
+
this.segments = dateToSegments(this.value ?? null);
|
|
1071
|
+
}
|
|
1072
|
+
if (changed.has("rangeValue") && this.mode === "range") {
|
|
1073
|
+
this.rangeSegments = {
|
|
1074
|
+
start: dateToSegments(this.rangeValue.start),
|
|
1075
|
+
end: dateToSegments(this.rangeValue.end),
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1032
1078
|
let revalidate = changed.has("segments") ||
|
|
1033
1079
|
changed.has("rangeSegments") ||
|
|
1034
1080
|
changed.has("timeSegments") ||
|
|
1081
|
+
changed.has("rangeValue") ||
|
|
1082
|
+
changed.has("minDate") ||
|
|
1083
|
+
changed.has("maxDate") ||
|
|
1084
|
+
changed.has("isDateDisabled") ||
|
|
1085
|
+
changed.has("granularity") ||
|
|
1035
1086
|
changed.has("minTime") ||
|
|
1036
1087
|
changed.has("maxTime");
|
|
1037
1088
|
if (this.isWithTimeActive() &&
|
|
@@ -1055,9 +1106,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1055
1106
|
super.willUpdate(changed);
|
|
1056
1107
|
}
|
|
1057
1108
|
/**
|
|
1058
|
-
* Lifecycle hook called whenever reactive properties change.
|
|
1059
|
-
* typed segments in sync whenever the committed value/range changes from
|
|
1060
|
-
* outside (a direct property assignment, form reset, ...), and mirrors
|
|
1109
|
+
* Lifecycle hook called whenever reactive properties change. Mirrors
|
|
1061
1110
|
* `valid`/`hideError`/`disabled` onto the host's `aria-invalid` — the
|
|
1062
1111
|
* `#field-wrapper`/`:host([aria-invalid="true"])` error styling in
|
|
1063
1112
|
* `date-picker.styles.ts` depends on it, matching the same host-attribute
|
|
@@ -1069,15 +1118,6 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1069
1118
|
*/
|
|
1070
1119
|
updated(changed) {
|
|
1071
1120
|
super.updated(changed);
|
|
1072
|
-
if (changed.has("value") && this.mode === "single") {
|
|
1073
|
-
this.segments = dateToSegments(this.value ?? null);
|
|
1074
|
-
}
|
|
1075
|
-
if (changed.has("rangeValue") && this.mode === "range") {
|
|
1076
|
-
this.rangeSegments = {
|
|
1077
|
-
start: dateToSegments(this.rangeValue.start),
|
|
1078
|
-
end: dateToSegments(this.rangeValue.end),
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
1121
|
if (hasErrorDisplayChange(changed)) {
|
|
1082
1122
|
this.setAttribute("aria-invalid", String(this.showError));
|
|
1083
1123
|
}
|
|
@@ -1114,6 +1154,48 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1114
1154
|
isMobileViewport() {
|
|
1115
1155
|
return window.matchMedia(mediaBelow("tablet")).matches;
|
|
1116
1156
|
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Which constraint a committed date breaks at the current
|
|
1159
|
+
* `granularity`, read on its calendar day in {@link timezone} while
|
|
1160
|
+
* {@link withTime} is active : the same checks that grey out the
|
|
1161
|
+
* calendar's cells.
|
|
1162
|
+
* @private
|
|
1163
|
+
*/
|
|
1164
|
+
dateConstraintViolation(date) {
|
|
1165
|
+
let day = date;
|
|
1166
|
+
if (this.isWithTimeActive()) {
|
|
1167
|
+
const parts = getZonedParts(date, this.timezone);
|
|
1168
|
+
day = new Date(parts.year, parts.month - 1, parts.day);
|
|
1169
|
+
}
|
|
1170
|
+
const isDisabled = this.granularity === "year"
|
|
1171
|
+
? isDisabledYear
|
|
1172
|
+
: this.granularity === "month"
|
|
1173
|
+
? isDisabledMonth
|
|
1174
|
+
: isDisabledDay;
|
|
1175
|
+
if (isDisabled(day, this.minDate, undefined, undefined)) {
|
|
1176
|
+
return "min";
|
|
1177
|
+
}
|
|
1178
|
+
if (isDisabled(day, undefined, this.maxDate, undefined)) {
|
|
1179
|
+
return "max";
|
|
1180
|
+
}
|
|
1181
|
+
if (isDisabled(day, undefined, undefined, this.isDateDisabled)) {
|
|
1182
|
+
return "disabled";
|
|
1183
|
+
}
|
|
1184
|
+
return null;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Formats a `minDate`/`maxDate` bound for a validation message, at the
|
|
1188
|
+
* current `granularity`.
|
|
1189
|
+
* @private
|
|
1190
|
+
*/
|
|
1191
|
+
formatConstraintDate(date) {
|
|
1192
|
+
const options = this.granularity === "year"
|
|
1193
|
+
? { year: "numeric" }
|
|
1194
|
+
: this.granularity === "month"
|
|
1195
|
+
? { month: "2-digit", year: "numeric" }
|
|
1196
|
+
: { day: "2-digit", month: "2-digit", year: "numeric" };
|
|
1197
|
+
return new Intl.DateTimeFormat(this.resolvedLocale, options).format(date);
|
|
1198
|
+
}
|
|
1117
1199
|
/**
|
|
1118
1200
|
* @private
|
|
1119
1201
|
*/
|
|
@@ -1134,14 +1216,15 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1134
1216
|
}
|
|
1135
1217
|
/**
|
|
1136
1218
|
* Seeds the in-progress staging state from the last committed
|
|
1137
|
-
* value/range,
|
|
1219
|
+
* value/range (or, in single mode, a fully typed date still waiting for
|
|
1220
|
+
* its time), and centers the calendar on it (or today, if unset).
|
|
1138
1221
|
* Also seeds {@link stagingTime} from that same value's current
|
|
1139
1222
|
* hour/minute (in {@link timezone}) when {@link withTime} is set —
|
|
1140
1223
|
* midnight, absent a value yet.
|
|
1141
1224
|
* @private
|
|
1142
1225
|
*/
|
|
1143
1226
|
resetStaging() {
|
|
1144
|
-
this.stagingValue = this.value ??
|
|
1227
|
+
this.stagingValue = this.value ?? this.typedDate();
|
|
1145
1228
|
this.stagingRange = {
|
|
1146
1229
|
start: this.rangeValue.start,
|
|
1147
1230
|
end: this.rangeValue.end,
|
|
@@ -1149,7 +1232,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1149
1232
|
this.hoverDate = null;
|
|
1150
1233
|
this.navLevel = this.granularity;
|
|
1151
1234
|
const anchor = this.mode === "single"
|
|
1152
|
-
? (this.
|
|
1235
|
+
? (this.stagingValue ?? new Date())
|
|
1153
1236
|
: (this.rangeValue.start ?? new Date());
|
|
1154
1237
|
this.displayedAnchor = anchor;
|
|
1155
1238
|
this.focusedDate = startOfDay(anchor);
|
|
@@ -1182,7 +1265,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1182
1265
|
* @private
|
|
1183
1266
|
*/
|
|
1184
1267
|
resolvedHourFormat() {
|
|
1185
|
-
return resolveHourFormat(this.
|
|
1268
|
+
return resolveHourFormat(this.resolvedLocale, this.hourFormat);
|
|
1186
1269
|
}
|
|
1187
1270
|
/**
|
|
1188
1271
|
* Folds {@link stagingTime}'s hour/minute into `date`'s calendar day (in
|
|
@@ -1321,7 +1404,16 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1321
1404
|
return;
|
|
1322
1405
|
}
|
|
1323
1406
|
const time = clockSegmentsToTime(group, format);
|
|
1324
|
-
if (time) {
|
|
1407
|
+
if (!time) {
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
// A date already typed in full takes the time with it, rather than
|
|
1411
|
+
// the committed value's day (or today's).
|
|
1412
|
+
const date = this.typedDate();
|
|
1413
|
+
if (date) {
|
|
1414
|
+
this.commitTypedDate("value", date);
|
|
1415
|
+
}
|
|
1416
|
+
else {
|
|
1325
1417
|
this.commitTypedTime(time.hour, time.minute);
|
|
1326
1418
|
}
|
|
1327
1419
|
}
|
|
@@ -1614,7 +1706,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1614
1706
|
* (`isSegmentGroupComplete` — not just "parses so far", which a 1-3 digit
|
|
1615
1707
|
* year like `"202"` already does as year 202 AD ; gating on length too
|
|
1616
1708
|
* avoids committing mid-keystroke and stomping the segment the user is
|
|
1617
|
-
* still typing when `
|
|
1709
|
+
* still typing when `willUpdate()` reformats it from the committed value)
|
|
1618
1710
|
* and composes a real calendar date.
|
|
1619
1711
|
*
|
|
1620
1712
|
* @param event the native input event.
|
|
@@ -1650,11 +1742,40 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1650
1742
|
if (!isSegmentGroupComplete(group, kinds)) {
|
|
1651
1743
|
return;
|
|
1652
1744
|
}
|
|
1745
|
+
// A first date typed with `withTime` waits for its time instead of
|
|
1746
|
+
// committing at midnight.
|
|
1747
|
+
if (target === "value" &&
|
|
1748
|
+
this.isWithTimeActive() &&
|
|
1749
|
+
!this.value &&
|
|
1750
|
+
!this.typedTime()) {
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1653
1753
|
const date = segmentsToDate(group, kinds);
|
|
1654
1754
|
if (date) {
|
|
1655
1755
|
this.commitTypedDate(target, date);
|
|
1656
1756
|
}
|
|
1657
1757
|
}
|
|
1758
|
+
/**
|
|
1759
|
+
* The typed single-mode {@link segments}, once fully typed into a real
|
|
1760
|
+
* date.
|
|
1761
|
+
* @private
|
|
1762
|
+
*/
|
|
1763
|
+
typedDate() {
|
|
1764
|
+
const kinds = segmentKindsForGranularity(this.granularity);
|
|
1765
|
+
return isSegmentGroupComplete(this.segments, kinds)
|
|
1766
|
+
? segmentsToDate(this.segments, kinds)
|
|
1767
|
+
: null;
|
|
1768
|
+
}
|
|
1769
|
+
/**
|
|
1770
|
+
* The typed {@link timeSegments}, once fully typed into a real time.
|
|
1771
|
+
* @private
|
|
1772
|
+
*/
|
|
1773
|
+
typedTime() {
|
|
1774
|
+
const format = this.resolvedHourFormat();
|
|
1775
|
+
return isClockSegmentGroupComplete(this.timeSegments, format)
|
|
1776
|
+
? clockSegmentsToTime(this.timeSegments, format)
|
|
1777
|
+
: null;
|
|
1778
|
+
}
|
|
1658
1779
|
/**
|
|
1659
1780
|
* Moves focus to the previous segment (in locale order) when Backspace
|
|
1660
1781
|
* is pressed on an already-empty segment, and to the previous/next
|
|
@@ -1756,7 +1877,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1756
1877
|
*/
|
|
1757
1878
|
visibleSegmentOrder() {
|
|
1758
1879
|
const kinds = segmentKindsForGranularity(this.granularity);
|
|
1759
|
-
return getSegmentOrder(this.
|
|
1880
|
+
return getSegmentOrder(this.resolvedLocale).filter((kind) => kinds.includes(kind));
|
|
1760
1881
|
}
|
|
1761
1882
|
/**
|
|
1762
1883
|
* Focuses the segment before `kind` (in locale order) within the same
|
|
@@ -1779,10 +1900,15 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1779
1900
|
focusNextSegment(target, kind) {
|
|
1780
1901
|
const order = this.visibleSegmentOrder();
|
|
1781
1902
|
const index = order.indexOf(kind);
|
|
1782
|
-
if (index === -1
|
|
1903
|
+
if (index === -1) {
|
|
1783
1904
|
return;
|
|
1784
1905
|
}
|
|
1785
|
-
|
|
1906
|
+
if (index < order.length - 1) {
|
|
1907
|
+
this.focusSegment(target, order[index + 1]);
|
|
1908
|
+
}
|
|
1909
|
+
else if (target === "value" && this.isWithTimeActive()) {
|
|
1910
|
+
this.focusTimeSegment(this.visibleTimeSegmentOrder()[0]);
|
|
1911
|
+
}
|
|
1786
1912
|
}
|
|
1787
1913
|
/**
|
|
1788
1914
|
* @private
|
|
@@ -1905,7 +2031,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1905
2031
|
*/
|
|
1906
2032
|
visibleTimeSegmentOrder() {
|
|
1907
2033
|
const kinds = clockSegmentKinds(this.resolvedHourFormat());
|
|
1908
|
-
return getClockSegmentOrder(this.
|
|
2034
|
+
return getClockSegmentOrder(this.resolvedLocale).filter((kind) => kinds.includes(kind));
|
|
1909
2035
|
}
|
|
1910
2036
|
/**
|
|
1911
2037
|
* @private
|
|
@@ -1913,10 +2039,13 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
1913
2039
|
focusPreviousTimeSegment(kind) {
|
|
1914
2040
|
const order = this.visibleTimeSegmentOrder();
|
|
1915
2041
|
const index = order.indexOf(kind);
|
|
1916
|
-
if (index
|
|
1917
|
-
|
|
2042
|
+
if (index === 0) {
|
|
2043
|
+
const dateOrder = this.visibleSegmentOrder();
|
|
2044
|
+
this.focusSegment("value", dateOrder[dateOrder.length - 1]);
|
|
2045
|
+
}
|
|
2046
|
+
else if (index > 0) {
|
|
2047
|
+
this.focusTimeSegment(order[index - 1]);
|
|
1918
2048
|
}
|
|
1919
|
-
this.focusTimeSegment(order[index - 1]);
|
|
1920
2049
|
}
|
|
1921
2050
|
/**
|
|
1922
2051
|
* @private
|
|
@@ -2005,6 +2134,8 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2005
2134
|
.value=${this.timeSegments[kind]}
|
|
2006
2135
|
?disabled=${this.disabled}
|
|
2007
2136
|
?readonly=${this.readonly}
|
|
2137
|
+
@focus=${this.selectSegmentText}
|
|
2138
|
+
@click=${this.selectSegmentText}
|
|
2008
2139
|
@input=${(event) => this.handleTimeSegmentInput(event, kind)}
|
|
2009
2140
|
@keydown=${(event) => this.handleTimeSegmentKeydown(event, kind)}
|
|
2010
2141
|
/>
|
|
@@ -2073,6 +2204,8 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2073
2204
|
.value=${values[kind]}
|
|
2074
2205
|
?disabled=${this.disabled}
|
|
2075
2206
|
?readonly=${this.readonly}
|
|
2207
|
+
@focus=${this.selectSegmentText}
|
|
2208
|
+
@click=${this.selectSegmentText}
|
|
2076
2209
|
@input=${(event) => this.handleSegmentInput(event, target, kind)}
|
|
2077
2210
|
@keydown=${(event) => this.handleSegmentKeydown(event, target, kind)}
|
|
2078
2211
|
/>
|
|
@@ -2094,7 +2227,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2094
2227
|
focusedDate: this.focusedDate,
|
|
2095
2228
|
weekStartsOn: this.weekStartsOn,
|
|
2096
2229
|
hideWeekends: this.workWeek,
|
|
2097
|
-
locale: this.
|
|
2230
|
+
locale: this.resolvedLocale,
|
|
2098
2231
|
minDate: this.minDate,
|
|
2099
2232
|
maxDate: this.maxDate,
|
|
2100
2233
|
isDateDisabled: this.isDateDisabled,
|
|
@@ -2130,7 +2263,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2130
2263
|
rangeValue: isPrimary ? this.stagingRange : { start: null, end: null },
|
|
2131
2264
|
hoverDate: isPrimary ? this.hoverDate : null,
|
|
2132
2265
|
focusedDate: this.focusedDate,
|
|
2133
|
-
locale: this.
|
|
2266
|
+
locale: this.resolvedLocale,
|
|
2134
2267
|
minDate: this.minDate,
|
|
2135
2268
|
maxDate: this.maxDate,
|
|
2136
2269
|
isDateDisabled: this.isDateDisabled,
|
|
@@ -2282,7 +2415,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2282
2415
|
}
|
|
2283
2416
|
const options = this.previewFormatOptions();
|
|
2284
2417
|
const effectiveEnd = end ?? start;
|
|
2285
|
-
return `${start.toLocaleDateString(this.
|
|
2418
|
+
return `${start.toLocaleDateString(this.resolvedLocale, options)} – ${effectiveEnd.toLocaleDateString(this.resolvedLocale, options)}`;
|
|
2286
2419
|
}
|
|
2287
2420
|
/**
|
|
2288
2421
|
* Renders the mobile modal's prominent date preview — a large, live
|
|
@@ -2300,14 +2433,14 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2300
2433
|
let text;
|
|
2301
2434
|
if (this.mode === "single") {
|
|
2302
2435
|
text = this.stagingValue
|
|
2303
|
-
? this.stagingValue.toLocaleDateString(this.
|
|
2436
|
+
? this.stagingValue.toLocaleDateString(this.resolvedLocale, this.previewFormatOptions())
|
|
2304
2437
|
: phrase.single;
|
|
2305
2438
|
}
|
|
2306
2439
|
else if (!this.stagingRange.start) {
|
|
2307
2440
|
text = phrase.range;
|
|
2308
2441
|
}
|
|
2309
2442
|
else if (this.granularity === "day") {
|
|
2310
|
-
text = formatDateRange(this.stagingRange.start, this.stagingRange.end ?? this.stagingRange.start, this.
|
|
2443
|
+
text = formatDateRange(this.stagingRange.start, this.stagingRange.end ?? this.stagingRange.start, this.resolvedLocale);
|
|
2311
2444
|
}
|
|
2312
2445
|
else {
|
|
2313
2446
|
text = this.formatCoarseRangePreview();
|
|
@@ -2340,6 +2473,8 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2340
2473
|
minute: time.minute,
|
|
2341
2474
|
period,
|
|
2342
2475
|
stepMinute: this.stepMinute,
|
|
2476
|
+
minTime: parseTimeOfDay(this.minTime),
|
|
2477
|
+
maxTime: parseTimeOfDay(this.maxTime),
|
|
2343
2478
|
disabled: this.disabled,
|
|
2344
2479
|
noAnimation: this.noAnimation,
|
|
2345
2480
|
labels: this.dictionary.timePicker,
|
|
@@ -2364,7 +2499,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2364
2499
|
}
|
|
2365
2500
|
const reference = this.stagingValue ?? new Date();
|
|
2366
2501
|
const label = getTimeZoneOffsetLabel(reference, this.timezone, {
|
|
2367
|
-
locale: this.
|
|
2502
|
+
locale: this.resolvedLocale,
|
|
2368
2503
|
});
|
|
2369
2504
|
return html `<p id="timezone-label">${label}</p>`;
|
|
2370
2505
|
}
|
|
@@ -2411,7 +2546,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2411
2546
|
</div>
|
|
2412
2547
|
<eun-modal
|
|
2413
2548
|
?open=${this.isModalOpen}
|
|
2414
|
-
|
|
2549
|
+
close-on-backdrop
|
|
2415
2550
|
confirm-label=${this.applyLabel ?? this.dictionary.common.apply}
|
|
2416
2551
|
cancel-label=${this.cancelLabel ?? this.dictionary.common.cancel}
|
|
2417
2552
|
aria-label=${this.label ?? this.headingFor()}
|
|
@@ -205,7 +205,7 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
205
205
|
"rangeOverflow",
|
|
206
206
|
"stepMismatch",
|
|
207
207
|
"badInput",
|
|
208
|
-
]);
|
|
208
|
+
], this.validationDictionary.validation);
|
|
209
209
|
};
|
|
210
210
|
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
211
211
|
}
|
|
@@ -235,9 +235,6 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
235
235
|
* @returns the native field element, if rendered.
|
|
236
236
|
*/
|
|
237
237
|
getFocusAnchor() {
|
|
238
|
-
// `@query` resolves to `null` (not `undefined`) when `#field` isn't rendered
|
|
239
|
-
// (e.g. in the readonly display). `ElementInternals.setValidity` rejects a
|
|
240
|
-
// `null` anchor, so it must be normalized to `undefined` (treated as omitted).
|
|
241
238
|
return this.fieldEl ?? undefined;
|
|
242
239
|
}
|
|
243
240
|
/**
|
|
@@ -33,7 +33,7 @@ const base = css `
|
|
|
33
33
|
--_textColor: var(--input-file-text-color, var(--eun-text-color, #071621));
|
|
34
34
|
--_iconColor: var(
|
|
35
35
|
--input-file-icon-color,
|
|
36
|
-
var(--eun-text-secondary, #
|
|
36
|
+
var(--eun-text-secondary, #666e8a)
|
|
37
37
|
);
|
|
38
38
|
--_errorColor: var(
|
|
39
39
|
--input-file-error-color,
|
|
@@ -41,7 +41,7 @@ const base = css `
|
|
|
41
41
|
);
|
|
42
42
|
--_hintColor: var(
|
|
43
43
|
--input-file-hint-color,
|
|
44
|
-
var(--eun-text-secondary, #
|
|
44
|
+
var(--eun-text-secondary, #666e8a)
|
|
45
45
|
);
|
|
46
46
|
--_focusIndicator: var(
|
|
47
47
|
--input-file-focus-outline-color,
|
|
@@ -329,8 +329,9 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
329
329
|
if (!query) {
|
|
330
330
|
return available;
|
|
331
331
|
}
|
|
332
|
-
return available.filter(({ iso, dialCode }) => getCountryName(iso, this.
|
|
333
|
-
|
|
332
|
+
return available.filter(({ iso, dialCode }) => getCountryName(iso, this.resolvedLocale)
|
|
333
|
+
.toLowerCase()
|
|
334
|
+
.includes(query) || dialCode.includes(query));
|
|
334
335
|
}
|
|
335
336
|
/**
|
|
336
337
|
* Lifecycle hook called whenever reactive properties change. Keeps
|
|
@@ -726,7 +727,7 @@ let EunomiaInputPhone = EunomiaInputPhone_1 = class EunomiaInputPhone extends Eu
|
|
|
726
727
|
>${getFlagEmoji(iso)}</span
|
|
727
728
|
>
|
|
728
729
|
<span class="country-name"
|
|
729
|
-
>${getCountryName(iso, this.
|
|
730
|
+
>${getCountryName(iso, this.resolvedLocale)}</span
|
|
730
731
|
>
|
|
731
732
|
<span class="country-dial-code">+${countryDialCode}</span>
|
|
732
733
|
</li>
|
|
@@ -19,7 +19,7 @@ const base = css `
|
|
|
19
19
|
slot[name="instructions"] {
|
|
20
20
|
display: block;
|
|
21
21
|
font-size: var(--field-message-font-size, var(--eun-font-size-xs, 12px));
|
|
22
|
-
color: var(--eun-text-secondary, #
|
|
22
|
+
color: var(--eun-text-secondary, #666e8a);
|
|
23
23
|
}
|
|
24
24
|
.required {
|
|
25
25
|
color: var(--eun-color-critical-100, #aa0014);
|