@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as Re,b as re,c as Fe,d as Oe,e as Ke,f as Ge,g as ne,h as z,i as oe,j as E,k as Ie,l as se,m as Y,n as le,o as Ne,p as Ve,q as He,r as ze,s as Ee}from"./chunks/chunk-W4VCWRY7.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as $e}from"./chunks/chunk-7HXPLZ7C.js";import{a as Ce}from"./chunks/chunk-WIUERJII.js";import{a as Pe}from"./chunks/chunk-AW7PU43S.js";import{b as Le,c as ie}from"./chunks/chunk-624VJYNA.js";import{a as ae}from"./chunks/chunk-LYYQAALT.js";import{a as Ae,b as Ye}from"./chunks/chunk-MSQWOKBB.js";import{a as ke}from"./chunks/chunk-GVS6IUKC.js";import{a as Me}from"./chunks/chunk-P6LGU3FT.js";import{a as Te}from"./chunks/chunk-7PEODUNH.js";import{b as De,c as xe,d as Se,e as we,f as _}from"./chunks/chunk-JDUWKPHW.js";import{a as j}from"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-QNWKRPOW.js";import{a as ve}from"./chunks/chunk-3BMACIDO.js";import{a as D,c as J,d as x,e as ee,f as O,g as te,h as $,k as T,l as v,m as H,n as k,o as A,p as fe,q as G,r as I,s as be,t as ye}from"./chunks/chunk-MJ4RDZLL.js";import{b as ge}from"./chunks/chunk-OTX6FWAF.js";import"./chunks/chunk-PPCHQG7P.js";import"./chunks/chunk-SD2H5UDZ.js";import{a as L}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as me}from"./chunks/chunk-WP6ZYBAC.js";import"./chunks/chunk-2XPIGFBD.js";import{a as l,f as he,h as w,j as h,k as b,l as F,p as u,r as C,u as pe}from"./chunks/chunk-YITWLCD3.js";var at=["day","month","year"];function We(i){let e=new Intl.DateTimeFormat(i,{day:"numeric",month:"numeric",year:"numeric"}).formatToParts(new Date(2e3,0,2)).map(t=>t.type).filter(t=>t==="day"||t==="month"||t==="year");return e.length===3?e:at}function W(i){switch(i){case"year":return["year"];case"month":return["month","year"];default:return["day","month","year"]}}function B(i,n=["day","month","year"]){let e=Number(i.year);if(!Number.isInteger(e)||e<1)return null;let t=n.includes("month"),a=t?Number(i.month):1;if(t&&(!Number.isInteger(a)||a<1||a>12))return null;let r=n.includes("day"),o=r?Number(i.day):1;if(r&&(!Number.isInteger(o)||o<1||o>31))return null;let d=new Date(e,a-1,o);return d.getFullYear()!==e||d.getMonth()!==a-1||r&&d.getDate()!==o?null:d}function de(i,n=["day","month","year"]){return n.every(e=>i[e].length===(e==="year"?4:2))}function K(i){return i?{day:String(i.getDate()).padStart(2,"0"),month:String(i.getMonth()+1).padStart(2,"0"),year:String(i.getFullYear()).padStart(4,"0")}:{day:"",month:"",year:""}}var je=w`
|
|
2
2
|
#calendar {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -195,7 +195,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
195
195
|
display: grid;
|
|
196
196
|
}
|
|
197
197
|
#calendar-weekdays span {
|
|
198
|
-
color: var(--date-picker-weekday-color, var(--eun-text-secondary, #
|
|
198
|
+
color: var(--date-picker-weekday-color, var(--eun-text-secondary, #666e8a));
|
|
199
199
|
font-size: var(--eun-font-size-xxs, 10px);
|
|
200
200
|
text-align: center;
|
|
201
201
|
text-transform: uppercase;
|
|
@@ -240,7 +240,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
240
240
|
padding: var(--eun-space-xs, 4px);
|
|
241
241
|
border-radius: var(--_cellRadius);
|
|
242
242
|
}
|
|
243
|
-
`;var
|
|
243
|
+
`;var it=w`
|
|
244
244
|
:host {
|
|
245
245
|
display: block;
|
|
246
246
|
width: 100%;
|
|
@@ -509,7 +509,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
509
509
|
var(--_borderColor, var(--eun-color-grey-300, #dee0e7));
|
|
510
510
|
padding: var(--eun-space-m);
|
|
511
511
|
}
|
|
512
|
-
`,Xe=[
|
|
512
|
+
`,Xe=[Pe,it],rt=w`
|
|
513
513
|
@supports (anchor-name: --a) {
|
|
514
514
|
#calendar-popover:popover-open {
|
|
515
515
|
position-try-fallbacks: --eun-date-picker-above;
|
|
@@ -521,24 +521,24 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
521
521
|
bottom: calc(anchor(top) + 4px);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
`,Qe=rt;function qe(
|
|
524
|
+
`,Qe=rt;function qe(i){let{displayedMonth:n,weekStartsOn:e,hideWeekends:t,locale:a,todayLabel:r,previousMonthLabel:o,chooseMonthYearLabel:d,nextMonthLabel:c}=i,p=be(n,e),g=st(e,t,a),f=t?"row-5":"row-7";return u`
|
|
525
525
|
<div id="calendar">
|
|
526
526
|
<div id="calendar-header">
|
|
527
527
|
<button
|
|
528
528
|
type="button"
|
|
529
529
|
id="grid-previous"
|
|
530
|
-
aria-label=${
|
|
531
|
-
@click=${
|
|
530
|
+
aria-label=${o}
|
|
531
|
+
@click=${i.onPreviousMonth}
|
|
532
532
|
>
|
|
533
533
|
<eun-icon name="chevron_left" size="16"></eun-icon>
|
|
534
534
|
</button>
|
|
535
|
-
${
|
|
535
|
+
${i.onLabelClick?u`
|
|
536
536
|
<button
|
|
537
537
|
type="button"
|
|
538
538
|
id="grid-label"
|
|
539
539
|
class="grid-label-button"
|
|
540
540
|
aria-label=${d}
|
|
541
|
-
@click=${
|
|
541
|
+
@click=${i.onLabelClick}
|
|
542
542
|
>
|
|
543
543
|
${n.toLocaleDateString(a,{month:"long",year:"numeric"})}
|
|
544
544
|
</button>
|
|
@@ -551,61 +551,61 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
551
551
|
type="button"
|
|
552
552
|
id="grid-next"
|
|
553
553
|
aria-label=${c}
|
|
554
|
-
@click=${
|
|
554
|
+
@click=${i.onNextMonth}
|
|
555
555
|
>
|
|
556
556
|
<eun-icon name="chevron_right" size="16"></eun-icon>
|
|
557
557
|
</button>
|
|
558
558
|
</div>
|
|
559
559
|
<div id="calendar-weekdays" class=${f} role="row">
|
|
560
|
-
${
|
|
560
|
+
${g.map(m=>u`<span role="columnheader">${m}</span>`)}
|
|
561
561
|
</div>
|
|
562
562
|
<div id="calendar-grid" role="grid">
|
|
563
|
-
${
|
|
563
|
+
${p.map(m=>u`
|
|
564
564
|
<div class="calendar-row ${f}" role="row">
|
|
565
|
-
${
|
|
565
|
+
${m.filter(y=>!t||!G(y)).map(y=>ot(y,i))}
|
|
566
566
|
</div>
|
|
567
567
|
`)}
|
|
568
568
|
</div>
|
|
569
569
|
<div id="calendar-footer">
|
|
570
|
-
<button type="button" id="today-button" @click=${
|
|
571
|
-
${
|
|
570
|
+
<button type="button" id="today-button" @click=${i.onToday}>
|
|
571
|
+
${r}
|
|
572
572
|
</button>
|
|
573
573
|
</div>
|
|
574
574
|
</div>
|
|
575
|
-
`}function
|
|
575
|
+
`}function U(i,n,e,t){return n&&D(i).getTime()<D(n).getTime()||e&&D(i).getTime()>D(e).getTime()?!0:!!t?.(i)}function nt(i,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,r=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":H(i,a),"range-end":H(i,r),"in-range":I(D(i),D(a),D(r))}}function ot(i,n){let{mode:e,displayedMonth:t,value:a,rangeValue:r,hoverDate:o,focusedDate:d,locale:c,minDate:p,maxDate:g,isDateDisabled:f,onDayClick:m,onDayHover:y,onDayKeydown:M}=n,S=U(i,p,g,f),P=e==="single"&&!!a&&H(i,a),R=e==="range"?nt(i,r,o):{"range-start":!1,"range-end":!1,"in-range":!1},V=()=>{S||m(i)},Z=()=>{S||y(i)};return u`
|
|
576
576
|
<button
|
|
577
577
|
type="button"
|
|
578
|
-
class=${
|
|
578
|
+
class=${L({"grid-cell":!0,"cell-day":!0,outside:!k(i,t),today:fe(i),selected:P,...R})}
|
|
579
579
|
role="gridcell"
|
|
580
|
-
tabindex=${
|
|
580
|
+
tabindex=${H(i,d)?"0":"-1"}
|
|
581
581
|
?disabled=${S}
|
|
582
582
|
aria-disabled=${S?"true":"false"}
|
|
583
|
-
aria-selected=${P||
|
|
584
|
-
aria-label=${
|
|
585
|
-
@click=${
|
|
586
|
-
@mouseenter=${
|
|
587
|
-
@keydown=${
|
|
583
|
+
aria-selected=${P||R["range-start"]||R["range-end"]?"true":"false"}
|
|
584
|
+
aria-label=${i.toLocaleDateString(c,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}
|
|
585
|
+
@click=${V}
|
|
586
|
+
@mouseenter=${Z}
|
|
587
|
+
@keydown=${tt=>M(tt,i)}
|
|
588
588
|
>
|
|
589
|
-
<span class="cell-label">${
|
|
589
|
+
<span class="cell-label">${i.getDate()}</span>
|
|
590
590
|
</button>
|
|
591
|
-
`}function
|
|
591
|
+
`}function st(i,n,e){let t=new Date(1970,0,4);return Array.from({length:7},(a,r)=>$(t,i+r)).filter(a=>!n||!G(a)).map(a=>a.toLocaleDateString(e,{weekday:"short"}))}function Ze(i){let{displayedYear:n,locale:e,previousYearLabel:t,chooseYearLabel:a,nextYearLabel:r}=i,o=Array.from({length:12},(d,c)=>new Date(n,c,1));return u`
|
|
592
592
|
<div id="calendar">
|
|
593
593
|
<div id="calendar-header">
|
|
594
594
|
<button
|
|
595
595
|
type="button"
|
|
596
596
|
id="grid-previous"
|
|
597
597
|
aria-label=${t}
|
|
598
|
-
@click=${
|
|
598
|
+
@click=${i.onPreviousYear}
|
|
599
599
|
>
|
|
600
600
|
<eun-icon name="chevron_left" size="16"></eun-icon>
|
|
601
601
|
</button>
|
|
602
|
-
${
|
|
602
|
+
${i.onLabelClick?u`
|
|
603
603
|
<button
|
|
604
604
|
type="button"
|
|
605
605
|
id="grid-label"
|
|
606
606
|
class="grid-label-button"
|
|
607
607
|
aria-label=${a}
|
|
608
|
-
@click=${
|
|
608
|
+
@click=${i.onLabelClick}
|
|
609
609
|
>
|
|
610
610
|
${n}
|
|
611
611
|
</button>
|
|
@@ -613,94 +613,94 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
613
613
|
<button
|
|
614
614
|
type="button"
|
|
615
615
|
id="grid-next"
|
|
616
|
-
aria-label=${
|
|
617
|
-
@click=${
|
|
616
|
+
aria-label=${r}
|
|
617
|
+
@click=${i.onNextYear}
|
|
618
618
|
>
|
|
619
619
|
<eun-icon name="chevron_right" size="16"></eun-icon>
|
|
620
620
|
</button>
|
|
621
621
|
</div>
|
|
622
622
|
<div id="calendar-grid" role="grid">
|
|
623
|
-
${
|
|
623
|
+
${ut(o,3).map(d=>u`
|
|
624
624
|
<div class="calendar-row row-3" role="row">
|
|
625
|
-
${d.map(c=>
|
|
625
|
+
${d.map(c=>dt(c,i,e))}
|
|
626
626
|
</div>
|
|
627
627
|
`)}
|
|
628
628
|
</div>
|
|
629
629
|
</div>
|
|
630
|
-
`}function
|
|
630
|
+
`}function X(i,n,e,t){return n&&ee(i).getTime()<x(n).getTime()||e&&x(i).getTime()>ee(e).getTime()?!0:!!t?.(x(i))}function lt(i,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,r=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":k(i,a),"range-end":k(i,r),"in-range":I(x(i),x(a),x(r))}}function dt(i,n,e){let{mode:t,value:a,rangeValue:r,hoverDate:o,focusedDate:d,minDate:c,maxDate:p,isDateDisabled:g,onMonthClick:f,onMonthHover:m,onMonthKeydown:y}=n,M=X(i,c,p,g),S=t==="single"&&!!a&&k(i,a),P=t==="range"?lt(i,r,o):{"range-start":!1,"range-end":!1,"in-range":!1},R=()=>{M||f(i)},V=()=>{M||m(i)};return u`
|
|
631
631
|
<button
|
|
632
632
|
type="button"
|
|
633
|
-
class=${
|
|
633
|
+
class=${L({"grid-cell":!0,"cell-month":!0,today:k(i,new Date),selected:S,...P})}
|
|
634
634
|
role="gridcell"
|
|
635
|
-
tabindex=${k(
|
|
635
|
+
tabindex=${k(i,d)?"0":"-1"}
|
|
636
636
|
?disabled=${M}
|
|
637
637
|
aria-disabled=${M?"true":"false"}
|
|
638
638
|
aria-selected=${S||P["range-start"]||P["range-end"]?"true":"false"}
|
|
639
|
-
aria-label=${
|
|
640
|
-
@click=${
|
|
641
|
-
@mouseenter=${
|
|
642
|
-
@keydown=${
|
|
639
|
+
aria-label=${i.toLocaleDateString(e,{month:"long",year:"numeric"})}
|
|
640
|
+
@click=${R}
|
|
641
|
+
@mouseenter=${V}
|
|
642
|
+
@keydown=${Z=>y(Z,i)}
|
|
643
643
|
>
|
|
644
644
|
<span class="cell-label"
|
|
645
|
-
>${
|
|
645
|
+
>${i.toLocaleDateString(e,{month:"short"})}</span
|
|
646
646
|
>
|
|
647
647
|
</button>
|
|
648
|
-
`}function
|
|
648
|
+
`}function ut(i,n){let e=[];for(let t=0;t<i.length;t+=n)e.push(i.slice(t,t+n));return e}var Q=12;function N(i){return Math.floor(i/Q)*Q}function Je(i){let n=N(i.displayedYear),e=Array.from({length:Q},(t,a)=>new Date(n+a,0,1));return u`
|
|
649
649
|
<div id="calendar">
|
|
650
650
|
<div id="calendar-header">
|
|
651
651
|
<button
|
|
652
652
|
type="button"
|
|
653
653
|
id="grid-previous"
|
|
654
|
-
aria-label=${
|
|
655
|
-
@click=${
|
|
654
|
+
aria-label=${i.previousYearsLabel}
|
|
655
|
+
@click=${i.onPreviousPage}
|
|
656
656
|
>
|
|
657
657
|
<eun-icon name="chevron_left" size="16"></eun-icon>
|
|
658
658
|
</button>
|
|
659
659
|
<span id="grid-label"
|
|
660
|
-
>${n}–${n+
|
|
660
|
+
>${n}–${n+Q-1}</span
|
|
661
661
|
>
|
|
662
662
|
<button
|
|
663
663
|
type="button"
|
|
664
664
|
id="grid-next"
|
|
665
|
-
aria-label=${
|
|
666
|
-
@click=${
|
|
665
|
+
aria-label=${i.nextYearsLabel}
|
|
666
|
+
@click=${i.onNextPage}
|
|
667
667
|
>
|
|
668
668
|
<eun-icon name="chevron_right" size="16"></eun-icon>
|
|
669
669
|
</button>
|
|
670
670
|
</div>
|
|
671
671
|
<div id="calendar-grid" role="grid">
|
|
672
|
-
${
|
|
672
|
+
${pt(e,3).map(t=>u`
|
|
673
673
|
<div class="calendar-row row-3" role="row">
|
|
674
|
-
${t.map(a=>
|
|
674
|
+
${t.map(a=>ht(a,i))}
|
|
675
675
|
</div>
|
|
676
676
|
`)}
|
|
677
677
|
</div>
|
|
678
678
|
</div>
|
|
679
|
-
`}function
|
|
679
|
+
`}function q(i,n,e,t){return n&&te(i).getTime()<O(n).getTime()||e&&O(i).getTime()>te(e).getTime()?!0:!!t?.(O(i))}function ct(i,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,r=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":A(i,a),"range-end":A(i,r),"in-range":I(O(i),O(a),O(r))}}function ht(i,n){let{mode:e,value:t,rangeValue:a,hoverDate:r,focusedDate:o,minDate:d,maxDate:c,isDateDisabled:p,onYearClick:g,onYearHover:f,onYearKeydown:m}=n,y=q(i,d,c,p),M=e==="single"&&!!t&&A(i,t),S=e==="range"?ct(i,a,r):{"range-start":!1,"range-end":!1,"in-range":!1},P=()=>{y||g(i)},R=()=>{y||f(i)};return u`
|
|
680
680
|
<button
|
|
681
681
|
type="button"
|
|
682
|
-
class=${
|
|
682
|
+
class=${L({"grid-cell":!0,"cell-year":!0,today:A(i,new Date),selected:M,...S})}
|
|
683
683
|
role="gridcell"
|
|
684
|
-
tabindex=${A(
|
|
684
|
+
tabindex=${A(i,o)?"0":"-1"}
|
|
685
685
|
?disabled=${y}
|
|
686
686
|
aria-disabled=${y?"true":"false"}
|
|
687
687
|
aria-selected=${M||S["range-start"]||S["range-end"]?"true":"false"}
|
|
688
|
-
aria-label=${String(
|
|
688
|
+
aria-label=${String(i.getFullYear())}
|
|
689
689
|
@click=${P}
|
|
690
|
-
@mouseenter=${
|
|
691
|
-
@keydown=${
|
|
690
|
+
@mouseenter=${R}
|
|
691
|
+
@keydown=${V=>m(V,i)}
|
|
692
692
|
>
|
|
693
|
-
<span class="cell-label">${
|
|
693
|
+
<span class="cell-label">${i.getFullYear()}</span>
|
|
694
694
|
</button>
|
|
695
|
-
`}function ht(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var pt="eun-date-picker",mt={day:{min:1,max:31},month:{min:1,max:12}},gt=me(xe(ce)),vt=he(Me(Te(ke(we(Se(De(ye(gt)))))))),o=class extends vt{constructor(){super();this.errorOnChange=!0;this.mode="single";this.granularity="day";this.rangeValue={start:null,end:null};this.weekStartsOn=1;this.workWeek=!1;this.noAnimation=!1;this.withTime=!1;this.stepMinute=1;this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=x(new Date);this.focusedDate=D(new Date);this.navLevel=this.granularity;this.hoverDate=null;this.stagingValue=null;this.stagingRange={start:null,end:null};this.stagingTime=null;this.segments={day:"",month:"",year:""};this.rangeSegments={start:{day:"",month:"",year:""},end:{day:"",month:"",year:""}};this.timeSegments={hour:"",minute:"",period:""};this.handleImplicitSubmission=e=>{let t=this.internals.form,a=e.composedPath()[0];!t||this.isOpen||!(a instanceof Element&&a.matches(".segment"))||!Pe(e)||(e.preventDefault(),Ye(t))};this.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>ft(i)&&!ie(i,e)))return{validity:{badInput:!0},message:this.dictionary.validation.invalidDate};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(bt(this.timeSegments)&&!W(this.timeSegments,i))return{validity:{badInput:!0},message:this.dictionary.validation.invalidTime};if(this.value){let{hour:s,minute:d}=K(this.value,this.timezone),c=Oe({hour:s,minute:d},te(this.minTime),te(this.maxTime));if(!c.valid)return c.violation==="min"?{validity:{rangeUnderflow:!0},message:`Time must be at or after ${this.minTime}`}:{validity:{rangeOverflow:!0},message:`Time must be at or before ${this.maxTime}`}}}return{validity:{}}};this.buildCommonValidators=()=>{let e=this.mode==="range"?!this.rangeValue.start||!this.rangeValue.end:this.value===void 0||this.value===null,t={},a;return this.required&&e&&(t.valueMissing=!0,a=this.dictionary.validation.valueMissing),{validity:t,message:a}};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let a=!e.matches(":popover-open");a&&e.showPopover(),(a||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:q}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.focusCalendarCell());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handlePopoverApply=()=>{this.commitStaged(),this.closePopover()};this.handlePopoverCancel=()=>{this.closePopover()};this.handleTimeHourChange=e=>{this.stagingTime={hour:e,minute:this.stagingTime?.minute??0}};this.handleTimeMinuteChange=e=>{this.stagingTime={hour:this.stagingTime?.hour??0,minute:e}};this.handleTimePeriodChange=e=>{let t=this.stagingTime??{hour:0,minute:0},{hour:a}=J(t.hour);this.stagingTime={hour:Le(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,C,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,C,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(U(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(C(U(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?12:1),1));break;case"Enter":case" ":e.preventDefault(),this.handleDayClick(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleMonthKeydown=(e,t,a=i=>this.handleMonthClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,T,i=>this.isMonthDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,T,i=>this.isMonthDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,T,i=>this.isMonthDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,T,i=>this.isMonthDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),11,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?-10:-1));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?10:1));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleYearKeydown=(e,t,a=i=>this.handleYearClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,g,i=>this.isYearDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,g,i=>this.isYearDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,g,i=>this.isYearDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,g,i=>this.isYearDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(N(this.focusedDate.getFullYear()),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(N(this.focusedDate.getFullYear())+11,0,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,-12));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,12));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.enterMonthNav=()=>{this.navLevel="month"};this.enterYearNav=()=>{this.navLevel="year"};this.handleQuickNavMonthClick=e=>{if(this.isMonthDisabled(e))return;let t=(e.getFullYear()-this.focusedDate.getFullYear())*12+(e.getMonth()-this.focusedDate.getMonth());this.jumpFocused(T(this.focusedDate,t)),this.navLevel="day"};this.handleQuickNavYearClick=e=>{if(this.isYearDisabled(e))return;let t=e.getFullYear()-this.focusedDate.getFullYear();this.jumpFocused(g(this.focusedDate,t)),this.navLevel="month"};this.handleHover=e=>{this.hoverDate=e};this.handlePreviousMonth=()=>{this.displayedAnchor=T(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=T(this.displayedAnchor,1)};this.handlePreviousYear=()=>{this.displayedAnchor=g(this.displayedAnchor,-1)};this.handleNextYear=()=>{this.displayedAnchor=g(this.displayedAnchor,1)};this.handlePreviousYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,-12)};this.handleNextYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,12)};this.handleToday=()=>{let e=new Date;this.displayedAnchor=x(e),this.jumpFocused(this.nearestWorkweekDay(D(e),1))};this.navigateGridPrevious=()=>{switch(this.navLevel){case"month":this.handlePreviousYear();break;case"year":this.handlePreviousYearsPage();break;default:this.handlePreviousMonth();break}};this.navigateGridNext=()=>{switch(this.navLevel){case"month":this.handleNextYear();break;case"year":this.handleNextYearsPage();break;default:this.handleNextMonth();break}};this.swipeStart=null;this.handleSwipeStart=e=>{e.pointerType==="touch"&&(this.swipeStart={x:e.clientX,y:e.clientY})};this.handleSwipeEnd=e=>{let t=this.swipeStart;if(this.swipeStart=null,e.pointerType!=="touch"||!t)return;let a=e.clientX-t.x,i=e.clientY-t.y;Math.abs(a)<o.SWIPE_THRESHOLD_PX||Math.abs(a)<Math.abs(i)||(a<0?(this.navigateGridNext(),this.playSwipeAnimation("next")):(this.navigateGridPrevious(),this.playSwipeAnimation("previous")))};this.handleSwipeCancel=()=>{this.swipeStart=null};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(Re(this.timeSegments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousTimeSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextTimeSegment("period");break;default:break}};this.addEventListener("keydown",this.handleImplicitSubmission)}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.mode==="range"&&this.defaultRangeValue&&(this.rangeValue=this.defaultRangeValue)}formResetCallback(){super.formResetCallback(),this.mode==="range"&&(this.rangeValue=this.defaultRangeValue??{start:null,end:null})}willUpdate(e){let t=e.has("segments")||e.has("rangeSegments")||e.has("timeSegments")||e.has("minTime")||e.has("maxTime");if(this.isWithTimeActive()&&(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale"))){let a=this.resolvedHourFormat();if(this.value){let i=K(this.value,this.timezone);this.timeSegments=ee(i.hour,i.minute,a)}else this.timeSegments=ee(null,null,a);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),e.has("value")&&this.mode==="single"&&(this.segments=G(this.value??null)),e.has("rangeValue")&&this.mode==="range"&&(this.rangeSegments={start:G(this.rangeValue.start),end:G(this.rangeValue.end)}),be(e)&&this.setAttribute("aria-invalid",String(this.showError))}get hostTabStop(){return!1}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(pe("tablet")).matches}isDayDisabled(e){return ne(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return oe(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return se(e,this.minDate,this.maxDate,this.isDateDisabled)}resetStaging(){this.stagingValue=this.value??null,this.stagingRange={start:this.rangeValue.start,end:this.rangeValue.end},this.hoverDate=null,this.navLevel=this.granularity;let e=this.mode==="single"?this.value??new Date:this.rangeValue.start??new Date;if(this.displayedAnchor=e,this.focusedDate=D(e),this.isWithTimeActive()){let t=this.mode==="single"?this.value:this.rangeValue.start;if(t){let{hour:a,minute:i}=K(t,this.timezone);this.stagingTime={hour:a,minute:i}}else this.stagingTime={hour:0,minute:0}}}isWithTimeActive(){return this.withTime&&this.granularity==="day"}resolvedHourFormat(){return Ae(this.locale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=K(e,this.timezone);return re({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??ae())}commitStaged(){this.mode==="single"?(this.value=this.isWithTimeActive()&&this.stagingValue?this.composeWithTime(this.stagingValue):this.stagingValue,this.segments=G(this.value)):(this.rangeValue=this.stagingRange,this.rangeSegments={start:G(this.stagingRange.start),end:G(this.stagingRange.end)}),this.dispatchEvent(new z(this.mode==="single"?this.value:this.rangeValue))}commitTypedDate(e,t){e==="value"?this.value=this.isWithTimeActive()?this.composeTypedDateTime(t):t:this.rangeValue={...this.rangeValue,[e]:t},this.dispatchEvent(new z(e==="value"?this.value:this.rangeValue)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}composeTypedDateTime(e){let t=this.resolvedHourFormat(),i=W(this.timeSegments,t);if(!i)if(this.value){let{hour:s,minute:d}=K(this.value,this.timezone);i={hour:s,minute:d}}else i={hour:0,minute:0};return re({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:i.hour,minute:i.minute},this.timezone??ae())}commitTypedTime(e,t){this.value=Ie(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new z(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitTimeSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!Ge(e,t))return;let a=W(e,t);a&&this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Ce(e,"--date-picker-panel-transition-duration","m",200)}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:Z(e),fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let a=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:Z(e),fill:"forwards"});this.popoverAnimation=a,a.finished.then(()=>{this.popoverAnimation===a&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusCalendarCell(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('.grid-cell[tabindex="0"]')?.focus({preventScroll:!0})}syncDisplayedAnchor(){switch(this.granularity){case"month":A(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=this.focusedDate);break;case"year":N(this.focusedDate.getFullYear())!==N(this.displayedAnchor.getFullYear())&&(this.displayedAnchor=this.focusedDate);break;default:k(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=x(this.focusedDate));break}}moveFocused(e,t,a){let i=e>0?1:-1,s=t(this.focusedDate,e);for(let d=0;a(s)&&d<1e3;d+=1)s=t(s,i);this.focusedDate=s,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}jumpFocused(e){this.focusedDate=e,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}isDayFocusSkippable(e){return this.isDayDisabled(e)||this.workWeek&&O(e)}nearestWorkweekDay(e,t){if(!this.workWeek)return e;let a=e;for(let i=0;O(a)&&i<2;i+=1)a=C(a,t);return a}commitCell(e){this.focusedDate=e;let t;if(this.mode==="single")this.stagingValue=e,t=!0;else{let{start:a,end:i}=this.stagingRange;if(!a||i)this.stagingRange={start:e,end:null},this.hoverDate=null,t=!1;else{let[s,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:s,end:d},t=!0}}this.isModalOpen||this.isWithTimeActive()&&this.isOpen||t&&(this.commitStaged(),this.closePopover())}handleDayClick(e){this.isDayDisabled(e)||this.commitCell(e)}handleMonthClick(e){this.isMonthDisabled(e)||this.commitCell(e)}handleYearClick(e){this.isYearDisabled(e)||this.commitCell(e)}playSwipeAnimation(e){this.updateComplete.then(()=>{let t=this.swipeAreaEl;t&&(t.classList.remove("slide-in-next","slide-in-previous"),t.getBoundingClientRect(),t.classList.add(e==="next"?"slide-in-next":"slide-in-previous"))})}handleSegmentInput(e,t,a){let i=e.target,s=a==="year"?4:2,d=i.value.replace(/\D/g,"").slice(0,s);i.value=d;let m={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,m),d.length===s&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,m)}commitSegmentGroupIfComplete(e,t){let a=j(this.granularity);if(!We(t,a))return;let i=ie(t,a);i&&this.commitTypedDate(e,i)}handleSegmentKeydown(e,t,a){let i=e.target;e.key==="Backspace"&&i.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t,a)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t,a)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,a,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,a,-1))}adjustSegment(e,t,a){let i=this.readSegmentGroup(e),s=Number(i[t]),d=yt(t),c;if(i[t]===""||Number.isNaN(s))c=d;else{let p=mt[t];c=s+a,p&&c>p.max?c=p.min:p&&c<p.min?c=p.max:p||(c=Math.max(0,c))}let m=t==="year"?4:2,v=String(c).padStart(m,"0").slice(-m),f={...i,[t]:v};this.writeSegmentGroup(e,f),this.commitSegmentGroupIfComplete(e,f)}readSegmentGroup(e){return e==="value"?this.segments:this.rangeSegments[e]}writeSegmentGroup(e,t){e==="value"?this.segments=t:this.rangeSegments={...this.rangeSegments,[e]:t}}visibleSegmentOrder(){let e=j(this.granularity);return Ee(this.locale).filter(t=>e.includes(t))}focusPreviousSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i<=0||this.focusSegment(e,a[i-1])}focusNextSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i===-1||i>=a.length-1||this.focusSegment(e,a[i+1])}focusSegment(e,t){this.shadowRoot?.querySelector(`.segment-group[data-target="${e}"] .segment-${t}`)?.focus()}handleTimeSegmentInput(e,t){let a=e.target,i=a.value.replace(/\D/g,"").slice(0,2);a.value=i;let s={...this.timeSegments,[t]:i};this.timeSegments=s,i.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(s)}handleTimeSegmentKeydown(e,t){let a=e.target;e.key==="Backspace"&&a.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousTimeSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextTimeSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustTimeSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustTimeSegment(t,-1))}adjustTimeSegment(e,t){let a=this.resolvedHourFormat(),s=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},d=Number(this.timeSegments[e]),c;if(this.timeSegments[e]===""||Number.isNaN(d)){let v=K(this.value??new Date,this.timezone),f=a===12?J(v.hour).hour:v.hour;c=e==="hour"?f:v.minute}else c=d+t,c>s.max?c=s.min:c<s.min&&(c=s.max);let m={...this.timeSegments,[e]:String(c).padStart(2,"0")};this.timeSegments=m,this.commitTimeSegmentGroupIfComplete(m)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Fe(this.resolvedHourFormat());return Ke(this.locale).filter(t=>e.includes(t))}focusPreviousTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a<=0||this.focusTimeSegment(t[a-1])}focusNextTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a===-1||a>=t.length-1||this.focusTimeSegment(t[a+1])}focusTimeSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}renderTimeSegmentGroup(){let e=this.visibleTimeSegmentOrder();return u`
|
|
695
|
+
`}function pt(i,n){let e=[];for(let t=0;t<i.length;t+=n)e.push(i.slice(t,t+n));return e}var mt="eun-date-picker",gt={day:{min:1,max:31},month:{min:1,max:12}},vt=ve(we(pe)),ft=me($e(Me(Ce(ke(Te(Se(xe(vt)))))))),s=class extends ft{constructor(){super();this.errorOnChange=!0;this.mode="single";this.granularity="day";this.rangeValue={start:null,end:null};this.weekStartsOn=1;this.workWeek=!1;this.noAnimation=!1;this.withTime=!1;this.stepMinute=1;this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=x(new Date);this.focusedDate=D(new Date);this.navLevel=this.granularity;this.hoverDate=null;this.stagingValue=null;this.stagingRange={start:null,end:null};this.stagingTime=null;this.segments={day:"",month:"",year:""};this.rangeSegments={start:{day:"",month:"",year:""},end:{day:"",month:"",year:""}};this.timeSegments={hour:"",minute:"",period:""};this.handleImplicitSubmission=e=>{let t=this.internals.form,a=e.composedPath()[0];!t||this.isOpen||!(a instanceof Element&&a.matches(".segment"))||!Ae(e)||(e.preventDefault(),Ye(t))};this.checkLocalValidators=()=>{let e=W(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(o=>et(o)&&!B(o,e)))return{validity:{badInput:!0},message:this.dictionary.validation.invalidDate};let r=this.mode==="single"?[this.value]:[this.rangeValue.start,this.rangeValue.end];for(let o of r){let d=o?this.dateConstraintViolation(o):null;if(d==="min")return{validity:{rangeUnderflow:!0},message:this.dictionary.validation.rangeUnderflow(this.formatConstraintDate(this.minDate))};if(d==="max")return{validity:{rangeOverflow:!0},message:this.dictionary.validation.rangeOverflow(this.formatConstraintDate(this.maxDate))};if(d==="disabled")return{validity:{badInput:!0},message:this.dictionary.validation.unavailableDate}}if(this.isWithTimeActive()){let o=this.resolvedHourFormat();if((!this.value&&et(this.segments)||bt(this.timeSegments))&&!z(this.timeSegments,o))return{validity:{badInput:!0},message:this.dictionary.validation.invalidTime};if(this.value){let{hour:c,minute:p}=Y(this.value,this.timezone),g=Ie({hour:c,minute:p},E(this.minTime),E(this.maxTime));if(!g.valid)return g.violation==="min"?{validity:{rangeUnderflow:!0},message:this.dictionary.timePicker.mustBeAtOrAfter(this.minTime??"")}:{validity:{rangeOverflow:!0},message:this.dictionary.timePicker.mustBeAtOrBefore(this.maxTime??"")}}}return{validity:{}}};this.buildCommonValidators=()=>{let e=this.mode==="range"?!this.rangeValue.start||!this.rangeValue.end:this.value===void 0||this.value===null,t={},a;return this.required&&e&&(t.valueMissing=!0,a=this.dictionary.validation.valueMissing),{validity:t,message:a}};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let a=!e.matches(":popover-open");a&&e.showPopover(),(a||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:ae}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.focusCalendarCell());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handlePopoverApply=()=>{this.commitStaged(),this.closePopover()};this.handlePopoverCancel=()=>{this.closePopover()};this.handleTimeHourChange=e=>{this.stagingTime={hour:e,minute:this.stagingTime?.minute??0}};this.handleTimeMinuteChange=e=>{this.stagingTime={hour:this.stagingTime?.hour??0,minute:e}};this.handleTimePeriodChange=e=>{let t=this.stagingTime??{hour:0,minute:0},{hour:a}=re(t.hour);this.stagingTime={hour:Fe(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,$,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,$,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(J(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay($(J(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?12:1),1));break;case"Enter":case" ":e.preventDefault(),this.handleDayClick(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleMonthKeydown=(e,t,a=r=>this.handleMonthClick(r))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,T,r=>this.isMonthDisabled(r));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,T,r=>this.isMonthDisabled(r));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,T,r=>this.isMonthDisabled(r));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,T,r=>this.isMonthDisabled(r));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),11,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(v(this.focusedDate,e.shiftKey?-10:-1));break;case"PageDown":e.preventDefault(),this.jumpFocused(v(this.focusedDate,e.shiftKey?10:1));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleYearKeydown=(e,t,a=r=>this.handleYearClick(r))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,v,r=>this.isYearDisabled(r));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,v,r=>this.isYearDisabled(r));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,v,r=>this.isYearDisabled(r));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,v,r=>this.isYearDisabled(r));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(N(this.focusedDate.getFullYear()),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(N(this.focusedDate.getFullYear())+11,0,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(v(this.focusedDate,-12));break;case"PageDown":e.preventDefault(),this.jumpFocused(v(this.focusedDate,12));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.enterMonthNav=()=>{this.navLevel="month"};this.enterYearNav=()=>{this.navLevel="year"};this.handleQuickNavMonthClick=e=>{if(this.isMonthDisabled(e))return;let t=(e.getFullYear()-this.focusedDate.getFullYear())*12+(e.getMonth()-this.focusedDate.getMonth());this.jumpFocused(T(this.focusedDate,t)),this.navLevel="day"};this.handleQuickNavYearClick=e=>{if(this.isYearDisabled(e))return;let t=e.getFullYear()-this.focusedDate.getFullYear();this.jumpFocused(v(this.focusedDate,t)),this.navLevel="month"};this.handleHover=e=>{this.hoverDate=e};this.handlePreviousMonth=()=>{this.displayedAnchor=T(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=T(this.displayedAnchor,1)};this.handlePreviousYear=()=>{this.displayedAnchor=v(this.displayedAnchor,-1)};this.handleNextYear=()=>{this.displayedAnchor=v(this.displayedAnchor,1)};this.handlePreviousYearsPage=()=>{this.displayedAnchor=v(this.displayedAnchor,-12)};this.handleNextYearsPage=()=>{this.displayedAnchor=v(this.displayedAnchor,12)};this.handleToday=()=>{let e=new Date;this.displayedAnchor=x(e),this.jumpFocused(this.nearestWorkweekDay(D(e),1))};this.navigateGridPrevious=()=>{switch(this.navLevel){case"month":this.handlePreviousYear();break;case"year":this.handlePreviousYearsPage();break;default:this.handlePreviousMonth();break}};this.navigateGridNext=()=>{switch(this.navLevel){case"month":this.handleNextYear();break;case"year":this.handleNextYearsPage();break;default:this.handleNextMonth();break}};this.swipeStart=null;this.handleSwipeStart=e=>{e.pointerType==="touch"&&(this.swipeStart={x:e.clientX,y:e.clientY})};this.handleSwipeEnd=e=>{let t=this.swipeStart;if(this.swipeStart=null,e.pointerType!=="touch"||!t)return;let a=e.clientX-t.x,r=e.clientY-t.y;Math.abs(a)<s.SWIPE_THRESHOLD_PX||Math.abs(a)<Math.abs(r)||(a<0?(this.navigateGridNext(),this.playSwipeAnimation("next")):(this.navigateGridPrevious(),this.playSwipeAnimation("previous")))};this.handleSwipeCancel=()=>{this.swipeStart=null};this.selectSegmentText=e=>{e.currentTarget.select()};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(Oe(this.timeSegments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousTimeSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextTimeSegment("period");break;default:break}};this.addEventListener("keydown",this.handleImplicitSubmission)}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.mode==="range"&&this.defaultRangeValue&&(this.rangeValue=this.defaultRangeValue)}formResetCallback(){super.formResetCallback(),this.mode==="range"&&(this.rangeValue=this.defaultRangeValue??{start:null,end:null})}willUpdate(e){e.has("value")&&this.mode==="single"&&(this.segments=K(this.value??null)),e.has("rangeValue")&&this.mode==="range"&&(this.rangeSegments={start:K(this.rangeValue.start),end:K(this.rangeValue.end)});let t=e.has("segments")||e.has("rangeSegments")||e.has("timeSegments")||e.has("rangeValue")||e.has("minDate")||e.has("maxDate")||e.has("isDateDisabled")||e.has("granularity")||e.has("minTime")||e.has("maxTime");if(this.isWithTimeActive()&&(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale"))){let a=this.resolvedHourFormat();if(this.value){let r=Y(this.value,this.timezone);this.timeSegments=ne(r.hour,r.minute,a)}else this.timeSegments=ne(null,null,a);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),De(e)&&this.setAttribute("aria-invalid",String(this.showError))}get hostTabStop(){return!1}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(ge("tablet")).matches}dateConstraintViolation(e){let t=e;if(this.isWithTimeActive()){let r=Y(e,this.timezone);t=new Date(r.year,r.month-1,r.day)}let a=this.granularity==="year"?q:this.granularity==="month"?X:U;return a(t,this.minDate,void 0,void 0)?"min":a(t,void 0,this.maxDate,void 0)?"max":a(t,void 0,void 0,this.isDateDisabled)?"disabled":null}formatConstraintDate(e){let t=this.granularity==="year"?{year:"numeric"}:this.granularity==="month"?{month:"2-digit",year:"numeric"}:{day:"2-digit",month:"2-digit",year:"numeric"};return new Intl.DateTimeFormat(this.resolvedLocale,t).format(e)}isDayDisabled(e){return U(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return X(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return q(e,this.minDate,this.maxDate,this.isDateDisabled)}resetStaging(){this.stagingValue=this.value??this.typedDate(),this.stagingRange={start:this.rangeValue.start,end:this.rangeValue.end},this.hoverDate=null,this.navLevel=this.granularity;let e=this.mode==="single"?this.stagingValue??new Date:this.rangeValue.start??new Date;if(this.displayedAnchor=e,this.focusedDate=D(e),this.isWithTimeActive()){let t=this.mode==="single"?this.value:this.rangeValue.start;if(t){let{hour:a,minute:r}=Y(t,this.timezone);this.stagingTime={hour:a,minute:r}}else this.stagingTime={hour:0,minute:0}}}isWithTimeActive(){return this.withTime&&this.granularity==="day"}resolvedHourFormat(){return Re(this.resolvedLocale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=Y(e,this.timezone);return le({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??se())}commitStaged(){this.mode==="single"?(this.value=this.isWithTimeActive()&&this.stagingValue?this.composeWithTime(this.stagingValue):this.stagingValue,this.segments=K(this.value)):(this.rangeValue=this.stagingRange,this.rangeSegments={start:K(this.stagingRange.start),end:K(this.stagingRange.end)}),this.dispatchEvent(new j(this.mode==="single"?this.value:this.rangeValue))}commitTypedDate(e,t){e==="value"?this.value=this.isWithTimeActive()?this.composeTypedDateTime(t):t:this.rangeValue={...this.rangeValue,[e]:t},this.dispatchEvent(new j(e==="value"?this.value:this.rangeValue)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}composeTypedDateTime(e){let t=this.resolvedHourFormat(),r=z(this.timeSegments,t);if(!r)if(this.value){let{hour:o,minute:d}=Y(this.value,this.timezone);r={hour:o,minute:d}}else r={hour:0,minute:0};return le({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:r.hour,minute:r.minute},this.timezone??se())}commitTypedTime(e,t){this.value=Ne(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new j(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitTimeSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!oe(e,t))return;let a=z(e,t);if(!a)return;let r=this.typedDate();r?this.commitTypedDate("value",r):this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Le(e,"--date-picker-panel-transition-duration","m",200)}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:ie(e),fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let a=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:ie(e),fill:"forwards"});this.popoverAnimation=a,a.finished.then(()=>{this.popoverAnimation===a&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusCalendarCell(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('.grid-cell[tabindex="0"]')?.focus({preventScroll:!0})}syncDisplayedAnchor(){switch(this.granularity){case"month":A(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=this.focusedDate);break;case"year":N(this.focusedDate.getFullYear())!==N(this.displayedAnchor.getFullYear())&&(this.displayedAnchor=this.focusedDate);break;default:k(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=x(this.focusedDate));break}}moveFocused(e,t,a){let r=e>0?1:-1,o=t(this.focusedDate,e);for(let d=0;a(o)&&d<1e3;d+=1)o=t(o,r);this.focusedDate=o,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}jumpFocused(e){this.focusedDate=e,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}isDayFocusSkippable(e){return this.isDayDisabled(e)||this.workWeek&&G(e)}nearestWorkweekDay(e,t){if(!this.workWeek)return e;let a=e;for(let r=0;G(a)&&r<2;r+=1)a=$(a,t);return a}commitCell(e){this.focusedDate=e;let t;if(this.mode==="single")this.stagingValue=e,t=!0;else{let{start:a,end:r}=this.stagingRange;if(!a||r)this.stagingRange={start:e,end:null},this.hoverDate=null,t=!1;else{let[o,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:o,end:d},t=!0}}this.isModalOpen||this.isWithTimeActive()&&this.isOpen||t&&(this.commitStaged(),this.closePopover())}handleDayClick(e){this.isDayDisabled(e)||this.commitCell(e)}handleMonthClick(e){this.isMonthDisabled(e)||this.commitCell(e)}handleYearClick(e){this.isYearDisabled(e)||this.commitCell(e)}playSwipeAnimation(e){this.updateComplete.then(()=>{let t=this.swipeAreaEl;t&&(t.classList.remove("slide-in-next","slide-in-previous"),t.getBoundingClientRect(),t.classList.add(e==="next"?"slide-in-next":"slide-in-previous"))})}handleSegmentInput(e,t,a){let r=e.target,o=a==="year"?4:2,d=r.value.replace(/\D/g,"").slice(0,o);r.value=d;let p={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,p),d.length===o&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,p)}commitSegmentGroupIfComplete(e,t){let a=W(this.granularity);if(!de(t,a)||e==="value"&&this.isWithTimeActive()&&!this.value&&!this.typedTime())return;let r=B(t,a);r&&this.commitTypedDate(e,r)}typedDate(){let e=W(this.granularity);return de(this.segments,e)?B(this.segments,e):null}typedTime(){let e=this.resolvedHourFormat();return oe(this.timeSegments,e)?z(this.timeSegments,e):null}handleSegmentKeydown(e,t,a){let r=e.target;e.key==="Backspace"&&r.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t,a)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t,a)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,a,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,a,-1))}adjustSegment(e,t,a){let r=this.readSegmentGroup(e),o=Number(r[t]),d=yt(t),c;if(r[t]===""||Number.isNaN(o))c=d;else{let m=gt[t];c=o+a,m&&c>m.max?c=m.min:m&&c<m.min?c=m.max:m||(c=Math.max(0,c))}let p=t==="year"?4:2,g=String(c).padStart(p,"0").slice(-p),f={...r,[t]:g};this.writeSegmentGroup(e,f),this.commitSegmentGroupIfComplete(e,f)}readSegmentGroup(e){return e==="value"?this.segments:this.rangeSegments[e]}writeSegmentGroup(e,t){e==="value"?this.segments=t:this.rangeSegments={...this.rangeSegments,[e]:t}}visibleSegmentOrder(){let e=W(this.granularity);return We(this.resolvedLocale).filter(t=>e.includes(t))}focusPreviousSegment(e,t){let a=this.visibleSegmentOrder(),r=a.indexOf(t);r<=0||this.focusSegment(e,a[r-1])}focusNextSegment(e,t){let a=this.visibleSegmentOrder(),r=a.indexOf(t);r!==-1&&(r<a.length-1?this.focusSegment(e,a[r+1]):e==="value"&&this.isWithTimeActive()&&this.focusTimeSegment(this.visibleTimeSegmentOrder()[0]))}focusSegment(e,t){this.shadowRoot?.querySelector(`.segment-group[data-target="${e}"] .segment-${t}`)?.focus()}handleTimeSegmentInput(e,t){let a=e.target,r=a.value.replace(/\D/g,"").slice(0,2);a.value=r;let o={...this.timeSegments,[t]:r};this.timeSegments=o,r.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(o)}handleTimeSegmentKeydown(e,t){let a=e.target;e.key==="Backspace"&&a.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousTimeSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextTimeSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustTimeSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustTimeSegment(t,-1))}adjustTimeSegment(e,t){let a=this.resolvedHourFormat(),o=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},d=Number(this.timeSegments[e]),c;if(this.timeSegments[e]===""||Number.isNaN(d)){let g=Y(this.value??new Date,this.timezone),f=a===12?re(g.hour).hour:g.hour;c=e==="hour"?f:g.minute}else c=d+t,c>o.max?c=o.min:c<o.min&&(c=o.max);let p={...this.timeSegments,[e]:String(c).padStart(2,"0")};this.timeSegments=p,this.commitTimeSegmentGroupIfComplete(p)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Ke(this.resolvedHourFormat());return Ge(this.resolvedLocale).filter(t=>e.includes(t))}focusPreviousTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);if(a===0){let r=this.visibleSegmentOrder();this.focusSegment("value",r[r.length-1])}else a>0&&this.focusTimeSegment(t[a-1])}focusNextTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a===-1||a>=t.length-1||this.focusTimeSegment(t[a+1])}focusTimeSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}renderTimeSegmentGroup(){let e=this.visibleTimeSegmentOrder();return u`
|
|
696
696
|
<div
|
|
697
697
|
class="segment-group time-segment-group"
|
|
698
698
|
role="group"
|
|
699
699
|
aria-label=${this.dictionary.datePicker.time}
|
|
700
700
|
>
|
|
701
|
-
${e.map((t,a)=>{let
|
|
702
|
-
${a===0
|
|
703
|
-
>${
|
|
701
|
+
${e.map((t,a)=>{let r=e[a-1];return u`
|
|
702
|
+
${a===0?C:u`<span class="segment-divider" aria-hidden="true"
|
|
703
|
+
>${r==="hour"&&t==="minute"||r==="minute"&&t==="hour"?":":" "}</span
|
|
704
704
|
>`}
|
|
705
705
|
${this.renderTimeSegment(t)}
|
|
706
706
|
`})}
|
|
@@ -730,49 +730,53 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
730
730
|
.value=${this.timeSegments[e]}
|
|
731
731
|
?disabled=${this.disabled}
|
|
732
732
|
?readonly=${this.readonly}
|
|
733
|
+
@focus=${this.selectSegmentText}
|
|
734
|
+
@click=${this.selectSegmentText}
|
|
733
735
|
@input=${t=>this.handleTimeSegmentInput(t,e)}
|
|
734
736
|
@keydown=${t=>this.handleTimeSegmentKeydown(t,e)}
|
|
735
737
|
/>
|
|
736
|
-
`}renderSegmentGroup(e,t){let a=this.visibleSegmentOrder(),
|
|
738
|
+
`}renderSegmentGroup(e,t){let a=this.visibleSegmentOrder(),r=this.readSegmentGroup(e);return u`
|
|
737
739
|
<div
|
|
738
740
|
class="segment-group"
|
|
739
741
|
data-target=${e}
|
|
740
742
|
role="group"
|
|
741
743
|
aria-label=${t}
|
|
742
|
-
aria-describedby=${this.description?.length?"description"
|
|
744
|
+
aria-describedby=${this.description?.length?"description":C}
|
|
743
745
|
>
|
|
744
|
-
${a.map((
|
|
745
|
-
${d>0?u`<span class="segment-divider" aria-hidden="true">/</span
|
|
746
|
-
${this.renderSegment(e,
|
|
746
|
+
${a.map((o,d)=>u`
|
|
747
|
+
${d>0?u`<span class="segment-divider" aria-hidden="true">/</span>`:C}
|
|
748
|
+
${this.renderSegment(e,o,r)}
|
|
747
749
|
`)}
|
|
748
750
|
</div>
|
|
749
|
-
`}placeholderFor(e){switch(e){case"day":return this.dayPlaceholder??this.dictionary.datePicker.dayPlaceholder;case"month":return this.monthPlaceholder??this.dictionary.datePicker.monthPlaceholder;default:return this.yearPlaceholder??this.dictionary.datePicker.yearPlaceholder}}renderSegment(e,t,a){let
|
|
751
|
+
`}placeholderFor(e){switch(e){case"day":return this.dayPlaceholder??this.dictionary.datePicker.dayPlaceholder;case"month":return this.monthPlaceholder??this.dictionary.datePicker.monthPlaceholder;default:return this.yearPlaceholder??this.dictionary.datePicker.yearPlaceholder}}renderSegment(e,t,a){let r=t==="year"?4:2;return u`
|
|
750
752
|
<input
|
|
751
753
|
class="segment segment-${t}"
|
|
752
754
|
type="text"
|
|
753
755
|
inputmode="numeric"
|
|
754
756
|
autocomplete="off"
|
|
755
|
-
maxlength=${
|
|
756
|
-
size=${
|
|
757
|
+
maxlength=${r}
|
|
758
|
+
size=${r}
|
|
757
759
|
placeholder=${this.placeholderFor(t)}
|
|
758
760
|
aria-label=${this.dictionary.datePicker[t]}
|
|
759
761
|
.value=${a[t]}
|
|
760
762
|
?disabled=${this.disabled}
|
|
761
763
|
?readonly=${this.readonly}
|
|
762
|
-
@
|
|
763
|
-
@
|
|
764
|
+
@focus=${this.selectSegmentText}
|
|
765
|
+
@click=${this.selectSegmentText}
|
|
766
|
+
@input=${o=>this.handleSegmentInput(o,e,t)}
|
|
767
|
+
@keydown=${o=>this.handleSegmentKeydown(o,e,t)}
|
|
764
768
|
/>
|
|
765
|
-
`}dayGridProps(){return{mode:this.mode,displayedMonth:this.displayedAnchor,value:this.stagingValue,rangeValue:this.stagingRange,hoverDate:this.hoverDate,focusedDate:this.focusedDate,weekStartsOn:this.weekStartsOn,hideWeekends:this.workWeek,locale:this.
|
|
769
|
+
`}dayGridProps(){return{mode:this.mode,displayedMonth:this.displayedAnchor,value:this.stagingValue,rangeValue:this.stagingRange,hoverDate:this.hoverDate,focusedDate:this.focusedDate,weekStartsOn:this.weekStartsOn,hideWeekends:this.workWeek,locale:this.resolvedLocale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,todayLabel:this.todayLabel??this.dictionary.common.today,previousMonthLabel:this.dictionary.datePicker.previousMonth,chooseMonthYearLabel:this.dictionary.datePicker.chooseMonthYear,nextMonthLabel:this.dictionary.datePicker.nextMonth,onDayClick:e=>this.handleDayClick(e),onDayHover:this.handleHover,onDayKeydown:this.handleDayKeydown,onPreviousMonth:this.handlePreviousMonth,onNextMonth:this.handleNextMonth,onToday:this.handleToday,onLabelClick:this.enterMonthNav}}monthGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:x(this.displayedAnchor),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,locale:this.resolvedLocale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearLabel:this.dictionary.datePicker.previousYear,chooseYearLabel:this.dictionary.datePicker.chooseYear,nextYearLabel:this.dictionary.datePicker.nextYear,onMonthClick:e?t=>this.handleMonthClick(t):this.handleQuickNavMonthClick,onMonthHover:this.handleHover,onMonthKeydown:e?this.handleMonthKeydown:(t,a)=>this.handleMonthKeydown(t,a,this.handleQuickNavMonthClick),onPreviousYear:this.handlePreviousYear,onNextYear:this.handleNextYear,onLabelClick:this.enterYearNav}}yearGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:new Date(this.displayedAnchor.getFullYear(),0,1),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearsLabel:this.dictionary.datePicker.previousYears,nextYearsLabel:this.dictionary.datePicker.nextYears,onYearClick:e?t=>this.handleYearClick(t):this.handleQuickNavYearClick,onYearHover:this.handleHover,onYearKeydown:e?this.handleYearKeydown:(t,a)=>this.handleYearKeydown(t,a,this.handleQuickNavYearClick),onPreviousPage:this.handlePreviousYearsPage,onNextPage:this.handleNextYearsPage}}renderGrid(){switch(this.navLevel){case"month":return Ze(this.monthGridProps());case"year":return Je(this.yearGridProps());default:return qe(this.dayGridProps())}}headingFor(){let e=this.dictionary.datePicker.heading[this.granularity];return this.mode==="single"?e.single:e.range}renderField(){return u`
|
|
766
770
|
<div
|
|
767
771
|
id="field-wrapper"
|
|
768
|
-
class=${
|
|
772
|
+
class=${L({"has-range":this.mode==="range"})}
|
|
769
773
|
>
|
|
770
774
|
${this.mode==="single"?this.renderSegmentGroup("value",this.label??this.headingFor()):u`
|
|
771
775
|
${this.renderSegmentGroup("start",this.dictionary.datePicker.startDate)}
|
|
772
776
|
<span class="range-separator" aria-hidden="true">–</span>
|
|
773
777
|
${this.renderSegmentGroup("end",this.dictionary.datePicker.endDate)}
|
|
774
778
|
`}
|
|
775
|
-
${this.isWithTimeActive()?this.renderTimeSegmentGroup()
|
|
779
|
+
${this.isWithTimeActive()?this.renderTimeSegmentGroup():C}
|
|
776
780
|
<button
|
|
777
781
|
type="button"
|
|
778
782
|
id="calendar-trigger"
|
|
@@ -785,12 +789,12 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
785
789
|
<eun-icon name="calendar_today"></eun-icon>
|
|
786
790
|
</button>
|
|
787
791
|
</div>
|
|
788
|
-
`}previewFormatOptions(){switch(this.granularity){case"year":return{year:"numeric"};case"month":return{month:"short",year:"numeric"};default:return{weekday:"short",month:"short",day:"numeric",year:"numeric"}}}formatCoarseRangePreview(){let{start:e,end:t}=this.stagingRange;if(!e)return"";let a=this.previewFormatOptions(),
|
|
792
|
+
`}previewFormatOptions(){switch(this.granularity){case"year":return{year:"numeric"};case"month":return{month:"short",year:"numeric"};default:return{weekday:"short",month:"short",day:"numeric",year:"numeric"}}}formatCoarseRangePreview(){let{start:e,end:t}=this.stagingRange;if(!e)return"";let a=this.previewFormatOptions(),r=t??e;return`${e.toLocaleDateString(this.resolvedLocale,a)} \u2013 ${r.toLocaleDateString(this.resolvedLocale,a)}`}renderModalDatePreview(){let e=this.dictionary.datePicker.modalPreview[this.granularity],t;return this.mode==="single"?t=this.stagingValue?this.stagingValue.toLocaleDateString(this.resolvedLocale,this.previewFormatOptions()):e.single:this.stagingRange.start?this.granularity==="day"?t=ye(this.stagingRange.start,this.stagingRange.end??this.stagingRange.start,this.resolvedLocale):t=this.formatCoarseRangePreview():t=e.range,u`<div id="modal-date-preview">${t}</div>`}renderTimeSection(){if(!this.isWithTimeActive())return C;let e=this.resolvedHourFormat(),t=this.stagingTime??{hour:0,minute:0},a=t.hour<12?"AM":"PM";return u`
|
|
789
793
|
<div id="time-section">
|
|
790
|
-
${
|
|
794
|
+
${ze({visual:"buttons",format:e,hour:t.hour,minute:t.minute,period:a,stepMinute:this.stepMinute,minTime:E(this.minTime),maxTime:E(this.maxTime),disabled:this.disabled,noAnimation:this.noAnimation,labels:this.dictionary.timePicker,onHourChange:this.handleTimeHourChange,onMinuteChange:this.handleTimeMinuteChange,onPeriodChange:this.handleTimePeriodChange})}
|
|
791
795
|
${this.renderTimezoneLabel()}
|
|
792
796
|
</div>
|
|
793
|
-
`}renderTimezoneLabel(){if(!this.timezone||
|
|
797
|
+
`}renderTimezoneLabel(){if(!this.timezone||Ve(this.timezone))return C;let e=this.stagingValue??new Date,t=He(e,this.timezone,{locale:this.resolvedLocale});return u`<p id="timezone-label">${t}</p>`}renderPopoverFooter(){return this.isWithTimeActive()?u`
|
|
794
798
|
<div id="popover-footer" class="modal-footer">
|
|
795
799
|
<eun-button
|
|
796
800
|
appearance="ghost"
|
|
@@ -803,7 +807,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
803
807
|
${this.applyLabel??this.dictionary.common.apply}
|
|
804
808
|
</eun-button>
|
|
805
809
|
</div>
|
|
806
|
-
|
|
810
|
+
`:C}render(){return u`
|
|
807
811
|
<div id="wrapper">
|
|
808
812
|
${this.renderFormLabels("calendar-trigger")} ${this.renderField()}
|
|
809
813
|
${this.renderDescription()}
|
|
@@ -818,7 +822,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
818
822
|
</div>
|
|
819
823
|
<eun-modal
|
|
820
824
|
?open=${this.isModalOpen}
|
|
821
|
-
|
|
825
|
+
close-on-backdrop
|
|
822
826
|
confirm-label=${this.applyLabel??this.dictionary.common.apply}
|
|
823
827
|
cancel-label=${this.cancelLabel??this.dictionary.common.cancel}
|
|
824
828
|
aria-label=${this.label??this.headingFor()}
|
|
@@ -837,7 +841,7 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
837
841
|
${this.renderGrid()}
|
|
838
842
|
</div>
|
|
839
843
|
${this.renderTimeSection()}
|
|
840
|
-
|
|
844
|
+
`:C}
|
|
841
845
|
<div slot="footer" class="modal-footer">
|
|
842
846
|
<eun-button
|
|
843
847
|
appearance="ghost"
|
|
@@ -851,4 +855,4 @@ import{a as Ae,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j a
|
|
|
851
855
|
</eun-button>
|
|
852
856
|
</div>
|
|
853
857
|
</eun-modal>
|
|
854
|
-
`}};
|
|
858
|
+
`}};s.styles=[Xe,...ae?[]:[Qe],je,_e,Be,Ue,Ee,_.base,_.errorMessages,_.hintMessages],s.SWIPE_THRESHOLD_PX=40,l([h({reflect:!0,useDefault:!0})],s.prototype,"mode",2),l([h({reflect:!0,useDefault:!0})],s.prototype,"granularity",2),l([h({attribute:"default-value",converter:{fromAttribute:e=>ue(e),toAttribute:e=>e?ce(e):null}})],s.prototype,"defaultValue",1),l([h({attribute:!1})],s.prototype,"rangeValue",2),l([h({type:Number,attribute:"week-starts-on"})],s.prototype,"weekStartsOn",2),l([h({type:Boolean,attribute:"work-week"})],s.prototype,"workWeek",2),l([h({type:Boolean,reflect:!0,attribute:"no-animation"})],s.prototype,"noAnimation",2),l([h({type:Boolean,reflect:!0,attribute:"with-time"})],s.prototype,"withTime",2),l([h()],s.prototype,"timezone",2),l([h({type:Number,attribute:"hour-format"})],s.prototype,"hourFormat",2),l([h({type:Number,attribute:"step-minute"})],s.prototype,"stepMinute",2),l([h({attribute:"min-time"})],s.prototype,"minTime",2),l([h({attribute:"max-time"})],s.prototype,"maxTime",2),l([h({attribute:!1})],s.prototype,"minDate",2),l([h({attribute:!1})],s.prototype,"maxDate",2),l([h({attribute:!1})],s.prototype,"isDateDisabled",2),l([h({attribute:"today-label"})],s.prototype,"todayLabel",2),l([h({attribute:"apply-label"})],s.prototype,"applyLabel",2),l([h({attribute:"cancel-label"})],s.prototype,"cancelLabel",2),l([h({attribute:"calendar-label"})],s.prototype,"calendarLabel",2),l([h({attribute:"day-placeholder"})],s.prototype,"dayPlaceholder",2),l([h({attribute:"month-placeholder"})],s.prototype,"monthPlaceholder",2),l([h({attribute:"year-placeholder"})],s.prototype,"yearPlaceholder",2),l([h({attribute:"hour-placeholder"})],s.prototype,"hourPlaceholder",2),l([h({attribute:"minute-placeholder"})],s.prototype,"minutePlaceholder",2),l([h({attribute:"default-range-value",converter:{fromAttribute:e=>{if(!e)return;let[t,a]=e.split(",").map(r=>r.trim());return{start:ue(t),end:ue(a)}},toAttribute:e=>e?`${ce(e.start)},${ce(e.end)}`:null}})],s.prototype,"defaultRangeValue",2),l([b()],s.prototype,"isOpen",2),l([b()],s.prototype,"isModalOpen",2),l([b()],s.prototype,"displayedAnchor",2),l([b()],s.prototype,"focusedDate",2),l([b()],s.prototype,"navLevel",2),l([b()],s.prototype,"hoverDate",2),l([b()],s.prototype,"stagingValue",2),l([b()],s.prototype,"stagingRange",2),l([b()],s.prototype,"stagingTime",2),l([b()],s.prototype,"segments",2),l([b()],s.prototype,"rangeSegments",2),l([b()],s.prototype,"timeSegments",2),l([F("#calendar-trigger")],s.prototype,"triggerEl",2),l([F("#calendar-popover")],s.prototype,"popoverEl",2),l([F("#field-wrapper")],s.prototype,"fieldWrapperEl",2),l([F("#modal-date")],s.prototype,"modalEl",2),l([F("#calendar-swipe-area")],s.prototype,"swipeAreaEl",2),l([F(".segment")],s.prototype,"firstSegmentEl",2),s=l([he(mt)],s);function et(i){return Object.values(i).some(n=>n.length>0)}function bt(i){return i.hour!==""||i.minute!==""||i.period!==""}function yt(i){let n=new Date;switch(i){case"year":return n.getFullYear();case"month":return n.getMonth()+1;default:return n.getDate()}}function ue(i){if(!i)return null;let n=new Date(i);return Number.isNaN(n.getTime())?null:n}function ce(i){return i?i.toISOString().slice(0,10):""}export{s as EunomiaDatePicker,mt as EunomiaDatePickerTagName};
|
|
@@ -40,7 +40,7 @@ import{a as r}from"./chunks/chunk-VG6NAAIV.js";import{b as d}from"./chunks/chunk
|
|
|
40
40
|
font-weight: var(--description-list-label-font-weight, inherit);
|
|
41
41
|
color: var(
|
|
42
42
|
--description-list-label-color,
|
|
43
|
-
var(--eun-text-secondary, #
|
|
43
|
+
var(--eun-text-secondary, #666e8a)
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as t,f as i,h as o,j as a,p as n,u as l}from"./chunks/chunk-YITWLCD3.js";var c=o`
|
|
2
2
|
:host {
|
|
3
3
|
--_color: var(--divider-color, var(--eun-border-color, #dee0e7));
|
|
4
4
|
--_spacing: var(--divider-spacing, var(--eun-space-m, 16px));
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
:host(
|
|
9
|
-
|
|
8
|
+
:host([orientation="vertical"]) {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-self: stretch;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host(:is([orientation="horizontal"], :not([orientation]))) #line {
|
|
10
14
|
height: 0;
|
|
11
15
|
margin-block: var(--_spacing);
|
|
12
16
|
border-block-start: 1px solid var(--_color);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
:host([orientation="vertical"]) {
|
|
16
|
-
display: inline-block;
|
|
17
|
-
align-self: stretch;
|
|
19
|
+
:host([orientation="vertical"]) #line {
|
|
18
20
|
width: 0;
|
|
19
|
-
height: auto;
|
|
20
21
|
margin-inline: var(--_spacing);
|
|
21
22
|
border-inline-start: 1px solid var(--_color);
|
|
22
23
|
}
|
|
23
|
-
`,s=c;var p="eun-divider",
|
|
24
|
+
`,s=c;var p="eun-divider",e=class extends l{constructor(){super(...arguments);this.orientation="horizontal"}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","separator"),super.connectedCallback?.()}updated(r){super.updated(r),r.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}render(){return n`<div id="line" part="line"></div>`}};e.styles=s,t([a({reflect:!0,useDefault:!0})],e.prototype,"orientation",2),e=t([i(p)],e);export{e as EunomiaDivider,p as EunomiaDividerTagName};
|