@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
|
@@ -40,12 +40,12 @@ const base = css `
|
|
|
40
40
|
);
|
|
41
41
|
--_hintColor: var(
|
|
42
42
|
--radio-card-hint-color,
|
|
43
|
-
var(--eun-text-secondary, #
|
|
43
|
+
var(--eun-text-secondary, #666e8a)
|
|
44
44
|
);
|
|
45
45
|
--_color: var(--eun-text-color, #071621);
|
|
46
46
|
--_iconColor: var(
|
|
47
47
|
--radio-card-icon-color,
|
|
48
|
-
var(--eun-text-secondary, #
|
|
48
|
+
var(--eun-text-secondary, #666e8a)
|
|
49
49
|
);
|
|
50
50
|
--_focusIndicator: var(
|
|
51
51
|
--radio-card-focus-outline-color,
|
|
@@ -30,7 +30,7 @@ const base = css `
|
|
|
30
30
|
--radio-error-color,
|
|
31
31
|
var(--eun-color-critical-100, #aa0014)
|
|
32
32
|
);
|
|
33
|
-
--_hintColor: var(--radio-hint-color, var(--eun-text-secondary, #
|
|
33
|
+
--_hintColor: var(--radio-hint-color, var(--eun-text-secondary, #666e8a));
|
|
34
34
|
--_borderSize: 1px;
|
|
35
35
|
--_roundGap: 2px;
|
|
36
36
|
--_cursor: pointer;
|
|
@@ -16,7 +16,6 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
16
16
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
17
17
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
18
18
|
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
19
|
-
import { getDefaultLocale } from "../../../i18n/index.js";
|
|
20
19
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
21
20
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
22
21
|
import { ratingStyles } from "./rating.styles.js";
|
|
@@ -328,9 +327,8 @@ let EunomiaRating = class EunomiaRating extends EunomiaRatingMixinBase {
|
|
|
328
327
|
* @private
|
|
329
328
|
*/
|
|
330
329
|
format(value) {
|
|
331
|
-
const locale = this.locale ?? getDefaultLocale();
|
|
332
330
|
try {
|
|
333
|
-
return new Intl.NumberFormat(
|
|
331
|
+
return new Intl.NumberFormat(this.resolvedLocale, {
|
|
334
332
|
maximumFractionDigits: 2,
|
|
335
333
|
}).format(value);
|
|
336
334
|
}
|
|
@@ -575,8 +573,8 @@ let EunomiaRating = class EunomiaRating extends EunomiaRatingMixinBase {
|
|
|
575
573
|
${this.renderFormLabels()}
|
|
576
574
|
${this.instructions
|
|
577
575
|
? html `<span id="group-instructions" hidden
|
|
578
|
-
|
|
579
|
-
|
|
576
|
+
>${this.instructions}</span
|
|
577
|
+
>`
|
|
580
578
|
: nothing}
|
|
581
579
|
<div id="control">
|
|
582
580
|
<div
|
|
@@ -28,7 +28,7 @@ const base = css `
|
|
|
28
28
|
--rating-error-color,
|
|
29
29
|
var(--eun-color-critical-100, #aa0014)
|
|
30
30
|
);
|
|
31
|
-
--_hintColor: var(--rating-hint-color, var(--eun-text-secondary, #
|
|
31
|
+
--_hintColor: var(--rating-hint-color, var(--eun-text-secondary, #666e8a));
|
|
32
32
|
--_focusIndicator: var(
|
|
33
33
|
--rating-focus-outline-color,
|
|
34
34
|
var(--eun-color-primary-500, #3d6fff)
|
|
@@ -147,7 +147,7 @@ const base = css `
|
|
|
147
147
|
border: none;
|
|
148
148
|
border-radius: 50%;
|
|
149
149
|
background: transparent;
|
|
150
|
-
color: var(--eun-text-secondary, #
|
|
150
|
+
color: var(--eun-text-secondary, #666e8a);
|
|
151
151
|
cursor: pointer;
|
|
152
152
|
outline: 2px solid transparent;
|
|
153
153
|
outline-offset: 2px;
|
|
@@ -14,7 +14,7 @@ export type EunomiaSearchFilter = "contains" | "none";
|
|
|
14
14
|
declare const EunomiaSearch_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/anchor-position.mixin.js").AnchorPositionMixinInterface> & typeof EunomiaInput;
|
|
15
15
|
/**
|
|
16
16
|
* An input field specialized for search: the native type is locked to
|
|
17
|
-
* search, icon
|
|
17
|
+
* search, icon defaults to a search glyph, and two
|
|
18
18
|
* opt-in behaviors modeled on documentation-site search bars are layered
|
|
19
19
|
* on top.
|
|
20
20
|
*
|
|
@@ -76,12 +76,6 @@ export declare class EunomiaSearch extends EunomiaSearch_base {
|
|
|
76
76
|
* @default search
|
|
77
77
|
*/
|
|
78
78
|
icon: EunomiaIconName;
|
|
79
|
-
/**
|
|
80
|
-
* Whether a clear button is displayed when the field has a value.
|
|
81
|
-
* Defaults to `true` instead of `EunomiaInput`'s `false`.
|
|
82
|
-
* @default true
|
|
83
|
-
*/
|
|
84
|
-
clearable: boolean;
|
|
85
79
|
/**
|
|
86
80
|
* Enables the Ctrl+K / Cmd+K global shortcut (focuses the field inline, or
|
|
87
81
|
* opens the panel when `panel` is set), along with a visual key-hint badge
|
|
@@ -18,14 +18,13 @@ import { listboxStyles, listboxAnchorPositioningStyles, } from "../shared-styles
|
|
|
18
18
|
import { parseListboxOptions, renderHighlightedLabel, renderListboxRows, } from "../../../utils/listbox-options.utils.js";
|
|
19
19
|
import { isWebKit } from "../../../utils/browser.utils.js";
|
|
20
20
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
21
|
-
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
22
21
|
/**
|
|
23
22
|
* Tag name of the search component.
|
|
24
23
|
*/
|
|
25
24
|
export const EunomiaSearchTagName = "eun-search";
|
|
26
25
|
/**
|
|
27
26
|
* An input field specialized for search: the native type is locked to
|
|
28
|
-
* search, icon
|
|
27
|
+
* search, icon defaults to a search glyph, and two
|
|
29
28
|
* opt-in behaviors modeled on documentation-site search bars are layered
|
|
30
29
|
* on top.
|
|
31
30
|
*
|
|
@@ -82,12 +81,6 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
82
81
|
* @default search
|
|
83
82
|
*/
|
|
84
83
|
this.icon = "search";
|
|
85
|
-
/**
|
|
86
|
-
* Whether a clear button is displayed when the field has a value.
|
|
87
|
-
* Defaults to `true` instead of `EunomiaInput`'s `false`.
|
|
88
|
-
* @default true
|
|
89
|
-
*/
|
|
90
|
-
this.clearable = true;
|
|
91
84
|
/**
|
|
92
85
|
* Enables the Ctrl+K / Cmd+K global shortcut (focuses the field inline, or
|
|
93
86
|
* opens the panel when `panel` is set), along with a visual key-hint badge
|
|
@@ -883,7 +876,7 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
883
876
|
id="panel"
|
|
884
877
|
kind="search"
|
|
885
878
|
hide-actions
|
|
886
|
-
|
|
879
|
+
close-on-backdrop
|
|
887
880
|
aria-label=${this.label ||
|
|
888
881
|
(this.panelLabel ?? this.dictionary.search.panel)}
|
|
889
882
|
>
|
|
@@ -923,9 +916,6 @@ __decorate([
|
|
|
923
916
|
__decorate([
|
|
924
917
|
property()
|
|
925
918
|
], EunomiaSearch.prototype, "icon", void 0);
|
|
926
|
-
__decorate([
|
|
927
|
-
property({ converter: defaultTrueConverter })
|
|
928
|
-
], EunomiaSearch.prototype, "clearable", void 0);
|
|
929
919
|
__decorate([
|
|
930
920
|
property({ type: Boolean })
|
|
931
921
|
], EunomiaSearch.prototype, "shortcut", void 0);
|
|
@@ -34,12 +34,12 @@ const base = css `
|
|
|
34
34
|
--field-placeholder-color,
|
|
35
35
|
var(--eun-placeholder-color, var(--eun-color-grey-400, #c1c9d6))
|
|
36
36
|
);
|
|
37
|
-
--_iconColor: var(--field-icon-color, var(--eun-text-secondary, #
|
|
37
|
+
--_iconColor: var(--field-icon-color, var(--eun-text-secondary, #666e8a));
|
|
38
38
|
--_errorColor: var(
|
|
39
39
|
--field-error-color,
|
|
40
40
|
var(--eun-color-critical-100, #aa0014)
|
|
41
41
|
);
|
|
42
|
-
--_hintColor: var(--field-hint-color, var(--eun-text-secondary, #
|
|
42
|
+
--_hintColor: var(--field-hint-color, var(--eun-text-secondary, #666e8a));
|
|
43
43
|
--_focusIndicator: var(
|
|
44
44
|
--field-focus-outline-color,
|
|
45
45
|
var(--eun-color-primary-500, #3d6fff)
|
|
@@ -56,7 +56,7 @@ const base = css `
|
|
|
56
56
|
--slider-error-color,
|
|
57
57
|
var(--eun-color-critical-100, #aa0014)
|
|
58
58
|
);
|
|
59
|
-
--_hintColor: var(--slider-hint-color, var(--eun-text-secondary, #
|
|
59
|
+
--_hintColor: var(--slider-hint-color, var(--eun-text-secondary, #666e8a));
|
|
60
60
|
--_focusIndicator: var(
|
|
61
61
|
--slider-focus-outline-color,
|
|
62
62
|
var(--eun-color-primary-500, #3d6fff)
|
|
@@ -31,7 +31,7 @@ const base = css `
|
|
|
31
31
|
--switch-error-color,
|
|
32
32
|
var(--eun-color-critical-100, #aa0014)
|
|
33
33
|
);
|
|
34
|
-
--_hintColor: var(--switch-hint-color, var(--eun-text-secondary, #
|
|
34
|
+
--_hintColor: var(--switch-hint-color, var(--eun-text-secondary, #666e8a));
|
|
35
35
|
--_color: var(--eun-text-color, #071621);
|
|
36
36
|
--_focusIndicator: var(
|
|
37
37
|
--switch-focus-outline-color,
|
|
@@ -641,11 +641,7 @@ let EunomiaTextarea = class EunomiaTextarea extends EunomiaTextareaMixinBase {
|
|
|
641
641
|
if (this.formatting) {
|
|
642
642
|
return this.checkEditableValidators();
|
|
643
643
|
}
|
|
644
|
-
return pickValidity(this.fieldEl, [
|
|
645
|
-
"valueMissing",
|
|
646
|
-
"tooShort",
|
|
647
|
-
"tooLong",
|
|
648
|
-
]);
|
|
644
|
+
return pickValidity(this.fieldEl, ["valueMissing", "tooShort", "tooLong"], this.validationDictionary.validation);
|
|
649
645
|
};
|
|
650
646
|
/**
|
|
651
647
|
* @see handleInput ; reads the contenteditable surface's live content back
|
|
@@ -92,7 +92,7 @@ const textarea = css `
|
|
|
92
92
|
);
|
|
93
93
|
border-radius: var(--eun-border-radius-m, 8px);
|
|
94
94
|
background: none;
|
|
95
|
-
color: var(--_iconColor, var(--eun-text-secondary, #
|
|
95
|
+
color: var(--_iconColor, var(--eun-text-secondary, #666e8a));
|
|
96
96
|
cursor: pointer;
|
|
97
97
|
}
|
|
98
98
|
.color-picker-trigger:hover:not(:disabled) {
|
|
@@ -163,7 +163,7 @@ const textarea = css `
|
|
|
163
163
|
margin-inline-start: auto;
|
|
164
164
|
white-space: nowrap;
|
|
165
165
|
font-size: var(--eun-font-size-xs, 12px);
|
|
166
|
-
color: var(--_hintColor, var(--eun-text-secondary, #
|
|
166
|
+
color: var(--_hintColor, var(--eun-text-secondary, #666e8a));
|
|
167
167
|
}
|
|
168
168
|
#char-count[data-exceeded] {
|
|
169
169
|
color: var(--_errorColor);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateResult } from "lit";
|
|
2
|
-
import { HourFormat, Period } from "../../../utils/clock.utils.js";
|
|
2
|
+
import { HourFormat, Period, TimeOfDay } from "../../../utils/clock.utils.js";
|
|
3
3
|
import { Dictionary } from "../../../i18n/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* The pixel height every `.tp-wheel-item` renders at (see
|
|
@@ -30,6 +30,9 @@ export interface TimePickerColumnsProps {
|
|
|
30
30
|
period: Period;
|
|
31
31
|
/** The minute column's increment step, and which minute values the wheel enumerates (e.g. `15` renders only `:00`/`:15`/`:30`/`:45`). */
|
|
32
32
|
stepMinute: number;
|
|
33
|
+
/** The `min-time`/`max-time` bounds : values outside them are greyed out in the wheel, and skipped by the arrows and keyboard steps. */
|
|
34
|
+
minTime?: TimeOfDay | null;
|
|
35
|
+
maxTime?: TimeOfDay | null;
|
|
33
36
|
disabled?: boolean;
|
|
34
37
|
noAnimation?: boolean;
|
|
35
38
|
/** The host's locale-resolved `timePicker` strings, naming the group, each column and its step buttons. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { classMap } from "lit/directives/class-map.js";
|
|
3
3
|
import { ref } from "lit/directives/ref.js";
|
|
4
|
-
import { formatHourLabel, formatMinuteLabel, incrementHour, incrementMinute, to12Hour, to24Hour, togglePeriod, } from "../../../utils/clock.utils.js";
|
|
4
|
+
import { checkTimeOfDayBounds, formatHourLabel, formatMinuteLabel, incrementHour, incrementMinute, to12Hour, to24Hour, togglePeriod, } from "../../../utils/clock.utils.js";
|
|
5
5
|
import { debounce } from "../../../utils/time.utils.js";
|
|
6
6
|
/**
|
|
7
7
|
* The pixel height every `.tp-wheel-item` renders at (see
|
|
@@ -29,37 +29,65 @@ export const WHEEL_ITEM_HEIGHT_PX = 40;
|
|
|
29
29
|
* @returns the rendered column trio.
|
|
30
30
|
*/
|
|
31
31
|
export function renderTimePickerColumns(props) {
|
|
32
|
-
const { visual, format, hour, minute, period, stepMinute, disabled = false, noAnimation = false, } = props;
|
|
32
|
+
const { visual, format, hour, minute, period, stepMinute, minTime, maxTime, disabled = false, noAnimation = false, } = props;
|
|
33
33
|
const display = format === 12 ? to12Hour(hour) : { hour, period };
|
|
34
34
|
const hourMin = format === 12 ? 1 : 0;
|
|
35
35
|
const hourMax = format === 12 ? 12 : 23;
|
|
36
|
+
const step = Math.max(1, stepMinute);
|
|
37
|
+
const minuteValues = [];
|
|
38
|
+
for (let value = 0; value < 60; value += step) {
|
|
39
|
+
minuteValues.push(value);
|
|
40
|
+
}
|
|
41
|
+
const isMinuteOutOfRange = (hour24, value) => !checkTimeOfDayBounds({ hour: hour24, minute: value }, minTime, maxTime)
|
|
42
|
+
.valid;
|
|
43
|
+
const isHourOutOfRange = (hour24) => minuteValues.every((value) => isMinuteOutOfRange(hour24, value));
|
|
36
44
|
const hourItems = [];
|
|
37
45
|
for (let value = hourMin; value <= hourMax; value += 1) {
|
|
38
46
|
hourItems.push({
|
|
39
47
|
value,
|
|
40
48
|
text: formatHourLabel(value),
|
|
41
49
|
selected: value === display.hour,
|
|
50
|
+
outOfRange: isHourOutOfRange(format === 12 ? to24Hour(value, display.period) : value),
|
|
42
51
|
});
|
|
43
52
|
}
|
|
44
|
-
const minuteItems =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
const minuteItems = minuteValues.map((value) => ({
|
|
54
|
+
value,
|
|
55
|
+
text: formatMinuteLabel(value),
|
|
56
|
+
selected: value === minute,
|
|
57
|
+
outOfRange: isMinuteOutOfRange(hour, value),
|
|
58
|
+
}));
|
|
59
|
+
const isPeriodOutOfRange = (value) => {
|
|
60
|
+
const offset = value === "AM" ? 0 : 12;
|
|
61
|
+
for (let h = 0; h < 12; h += 1) {
|
|
62
|
+
if (!isHourOutOfRange(h + offset)) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
};
|
|
52
68
|
// Always steps the 24-hour internal value, regardless of display format —
|
|
53
69
|
// `incrementHour` already wraps correctly there (see its own doc comment)
|
|
54
70
|
// ; stepping the *displayed* 12-hour digit directly instead would need to
|
|
55
71
|
// separately decide when a step also flips the period (crossing 11 <-> 12
|
|
56
72
|
// crosses noon/midnight), which `incrementHour` + `to12Hour` already give
|
|
57
73
|
// for free by construction.
|
|
74
|
+
// Out-of-range values are skipped, unless every value is out of range
|
|
75
|
+
// (contradictory bounds), where the plain step still applies.
|
|
58
76
|
const handleHourStep = (delta) => {
|
|
59
|
-
|
|
77
|
+
let next = incrementHour(hour, delta);
|
|
78
|
+
for (let i = 0; i < 24 && isHourOutOfRange(next); i += 1) {
|
|
79
|
+
next = incrementHour(next, delta);
|
|
80
|
+
}
|
|
81
|
+
props.onHourChange(isHourOutOfRange(next) ? incrementHour(hour, delta) : next);
|
|
60
82
|
};
|
|
61
83
|
const handleMinuteStep = (delta) => {
|
|
62
|
-
|
|
84
|
+
let next = incrementMinute(minute, delta * step);
|
|
85
|
+
for (let i = 0; i < 60 && isMinuteOutOfRange(hour, next); i += 1) {
|
|
86
|
+
next = incrementMinute(next, delta * step);
|
|
87
|
+
}
|
|
88
|
+
props.onMinuteChange(isMinuteOutOfRange(hour, next)
|
|
89
|
+
? incrementMinute(minute, delta * step)
|
|
90
|
+
: next);
|
|
63
91
|
};
|
|
64
92
|
return html `
|
|
65
93
|
<div class="tp-columns" role="group" aria-label=${props.labels.time}>
|
|
@@ -109,10 +137,24 @@ export function renderTimePickerColumns(props) {
|
|
|
109
137
|
current: period === "AM" ? 0 : 1,
|
|
110
138
|
valueText: period,
|
|
111
139
|
items: [
|
|
112
|
-
{
|
|
113
|
-
|
|
140
|
+
{
|
|
141
|
+
value: 0,
|
|
142
|
+
text: "AM",
|
|
143
|
+
selected: period === "AM",
|
|
144
|
+
outOfRange: isPeriodOutOfRange("AM"),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
value: 1,
|
|
148
|
+
text: "PM",
|
|
149
|
+
selected: period === "PM",
|
|
150
|
+
outOfRange: isPeriodOutOfRange("PM"),
|
|
151
|
+
},
|
|
114
152
|
],
|
|
115
|
-
onStep: () =>
|
|
153
|
+
onStep: () => {
|
|
154
|
+
if (!isPeriodOutOfRange(togglePeriod(period))) {
|
|
155
|
+
props.onPeriodChange(togglePeriod(period));
|
|
156
|
+
}
|
|
157
|
+
},
|
|
116
158
|
onPick: (value) => props.onPeriodChange(value === 0 ? "AM" : "PM"),
|
|
117
159
|
})
|
|
118
160
|
: null}
|
|
@@ -259,6 +301,12 @@ function renderWheel(config) {
|
|
|
259
301
|
return;
|
|
260
302
|
}
|
|
261
303
|
const item = config.items[Math.min(Math.max(index, 0), config.items.length - 1)];
|
|
304
|
+
if (item?.outOfRange) {
|
|
305
|
+
// Settled on a greyed-out value : scroll back to the current one.
|
|
306
|
+
const selectedIndex = config.items.findIndex((entry) => entry.selected);
|
|
307
|
+
syncWheelScrollPosition(container, selectedIndex, noAnimation);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
262
310
|
if (item && item.value !== current) {
|
|
263
311
|
config.onPick(item.value);
|
|
264
312
|
}
|
|
@@ -292,6 +340,7 @@ function renderWheel(config) {
|
|
|
292
340
|
})}
|
|
293
341
|
tabindex="-1"
|
|
294
342
|
aria-hidden="true"
|
|
343
|
+
?disabled=${item.outOfRange}
|
|
295
344
|
@click=${() => config.onPick(item.value)}
|
|
296
345
|
>
|
|
297
346
|
${item.text}
|
|
@@ -34,7 +34,7 @@ const timePickerColumns = css `
|
|
|
34
34
|
border-radius: var(--eun-border-radius-s, 5px);
|
|
35
35
|
background: none;
|
|
36
36
|
padding: var(--eun-space-xxs, 1.6px);
|
|
37
|
-
color: var(--_iconColor, var(--eun-text-secondary, #
|
|
37
|
+
color: var(--_iconColor, var(--eun-text-secondary, #666e8a));
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
transition: background-color var(--eun-duration-s, 150ms)
|
|
40
40
|
var(--eun-easing-default, ease);
|
|
@@ -117,6 +117,10 @@ const timePickerColumns = css `
|
|
|
117
117
|
color: var(--_textColor, var(--eun-text-color, #071621));
|
|
118
118
|
font-weight: var(--eun-font-weight-l, 700);
|
|
119
119
|
}
|
|
120
|
+
.tp-wheel-item:disabled {
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
opacity: 0.4;
|
|
123
|
+
}
|
|
120
124
|
@media (prefers-reduced-motion: reduce) {
|
|
121
125
|
.tp-wheel {
|
|
122
126
|
scroll-behavior: auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateResult } from "lit";
|
|
2
|
-
import { HourFormat } from "../../../utils/clock.utils.js";
|
|
2
|
+
import { HourFormat, TimeOfDay } from "../../../utils/clock.utils.js";
|
|
3
3
|
/**
|
|
4
4
|
* Props consumed by {@link renderTimePickerList} — a single flat listbox of
|
|
5
5
|
* every time of day at a `stepMinutes` gap, `panel-mode="list"`'s
|
|
@@ -15,6 +15,9 @@ export interface TimePickerListProps {
|
|
|
15
15
|
minute: number;
|
|
16
16
|
locale?: string;
|
|
17
17
|
stepMinutes: number;
|
|
18
|
+
/** The `min-time`/`max-time` bounds : entries outside them are disabled. */
|
|
19
|
+
minTime?: TimeOfDay | null;
|
|
20
|
+
maxTime?: TimeOfDay | null;
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
ariaLabel: string;
|
|
20
23
|
onPick: (hour24: number, minute: number) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { classMap } from "lit/directives/class-map.js";
|
|
3
|
+
import { checkTimeOfDayBounds, } from "../../../utils/clock.utils.js";
|
|
3
4
|
/**
|
|
4
5
|
* Minutes in a full day — the range {@link renderTimePickerList} enumerates
|
|
5
6
|
* its entries over.
|
|
@@ -24,7 +25,7 @@ const MINUTES_PER_DAY = 24 * 60;
|
|
|
24
25
|
* @returns the rendered listbox.
|
|
25
26
|
*/
|
|
26
27
|
export function renderTimePickerList(props) {
|
|
27
|
-
const { format, hour, minute, locale, disabled = false, onPick } = props;
|
|
28
|
+
const { format, hour, minute, locale, minTime, maxTime, disabled = false, onPick, } = props;
|
|
28
29
|
const stepMinutes = Math.max(1, Math.round(props.stepMinutes));
|
|
29
30
|
const formatter = new Intl.DateTimeFormat(locale, {
|
|
30
31
|
hour: "numeric",
|
|
@@ -40,20 +41,25 @@ export function renderTimePickerList(props) {
|
|
|
40
41
|
minute: itemMinute,
|
|
41
42
|
text: formatter.format(new Date(2000, 0, 1, hour24, itemMinute)),
|
|
42
43
|
selected: hour24 === hour && itemMinute === minute,
|
|
44
|
+
outOfRange: !checkTimeOfDayBounds({ hour: hour24, minute: itemMinute }, minTime, maxTime).valid,
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
|
-
const selectedIndex = items.findIndex((item) => item.selected);
|
|
46
|
-
const
|
|
47
|
+
const selectedIndex = items.findIndex((item) => item.selected && !item.outOfRange);
|
|
48
|
+
const firstInRangeIndex = items.findIndex((item) => !item.outOfRange);
|
|
49
|
+
const focusableIndex = selectedIndex === -1 ? Math.max(firstInRangeIndex, 0) : selectedIndex;
|
|
50
|
+
const enabledOptions = (container) => Array.from(container.querySelectorAll('[role="option"]:not(:disabled)'));
|
|
47
51
|
const focusOptionAt = (container, index) => {
|
|
48
|
-
const options = container
|
|
52
|
+
const options = enabledOptions(container);
|
|
49
53
|
const clamped = Math.min(Math.max(index, 0), options.length - 1);
|
|
50
54
|
options[clamped]?.focus();
|
|
51
55
|
};
|
|
52
56
|
const handleKeydown = (event) => {
|
|
53
57
|
const container = event.currentTarget;
|
|
54
|
-
const options =
|
|
58
|
+
const options = enabledOptions(container);
|
|
55
59
|
const activeIndex = options.indexOf(document.activeElement);
|
|
56
|
-
const current = activeIndex === -1
|
|
60
|
+
const current = activeIndex === -1
|
|
61
|
+
? Math.max(options.findIndex((option) => option.tabIndex === 0), 0)
|
|
62
|
+
: activeIndex;
|
|
57
63
|
switch (event.key) {
|
|
58
64
|
case "ArrowDown":
|
|
59
65
|
event.preventDefault();
|
|
@@ -82,7 +88,7 @@ export function renderTimePickerList(props) {
|
|
|
82
88
|
case "Enter":
|
|
83
89
|
case " ": {
|
|
84
90
|
event.preventDefault();
|
|
85
|
-
const item = items[current];
|
|
91
|
+
const item = items[Number(options[current]?.dataset.index)];
|
|
86
92
|
if (item) {
|
|
87
93
|
onPick(item.hour24, item.minute);
|
|
88
94
|
}
|
|
@@ -108,9 +114,10 @@ export function renderTimePickerList(props) {
|
|
|
108
114
|
"tp-list-item": true,
|
|
109
115
|
selected: item.selected,
|
|
110
116
|
})}
|
|
117
|
+
data-index=${index}
|
|
111
118
|
tabindex=${disabled ? "-1" : index === focusableIndex ? "0" : "-1"}
|
|
112
119
|
aria-selected=${item.selected ? "true" : "false"}
|
|
113
|
-
?disabled=${disabled}
|
|
120
|
+
?disabled=${disabled || item.outOfRange}
|
|
114
121
|
@click=${() => onPick(item.hour24, item.minute)}
|
|
115
122
|
>
|
|
116
123
|
${item.text}
|
|
@@ -51,11 +51,11 @@ declare const EunomiaTimePickerMixinBase: Constructor<EunomiaTimePickerBase>;
|
|
|
51
51
|
* @attr {12 | 24} [hour-format] - Overrides the hour format. Auto-detected from locale when unset
|
|
52
52
|
* @prop {number} [stepMinute=1] - The minute column's increment step, and which minute values the mobile wheel enumerates
|
|
53
53
|
* @attr {number} [step-minute=1] - The minute column's increment step, and which minute values the mobile wheel enumerates
|
|
54
|
-
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string.
|
|
54
|
+
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string. The panel greys out the times outside minTime and maxTime, and a typed value outside them reports as invalid
|
|
55
55
|
* @attr {string} [min-time] - The earliest selectable time of day, as an HH:mm string
|
|
56
56
|
* @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
|
|
57
57
|
* @attr {string} [max-time] - The latest selectable time of day, as an HH:mm string
|
|
58
|
-
* @prop {string} [locale] - The locale used for the hour format auto-detection, segment order, and the modal's time preview. Defaults to the
|
|
58
|
+
* @prop {string} [locale] - The locale used for the hour format auto-detection, segment order, and the modal's time preview. Defaults to the one set with setDefaultLocale, English otherwise
|
|
59
59
|
* @prop {'wheel' | 'modal'} [mobileMode='wheel'] - Which content the mobile modal fallback shows: the same arrow-button columns as desktop, or a scroll-snap wheel per column. Only relevant when panelMode is columns
|
|
60
60
|
* @attr {'wheel' | 'modal'} [mobile-mode='wheel'] - Which content the mobile modal fallback shows
|
|
61
61
|
* @prop {'columns' | 'list'} [panelMode='columns'] - Which panel the trailing clock trigger opens: the hour, minute, and period spin button columns, or a single scrollable listbox of every time of day at a listStepMinutes gap. Picking an entry from the list both commits it and closes the panel immediately. The list renders identically on every viewport, and never switches to the mobile modal fallback that columns uses on a small viewport
|
|
@@ -547,6 +547,12 @@ export declare class EunomiaTimePicker extends EunomiaTimePickerMixinBase {
|
|
|
547
547
|
* @private
|
|
548
548
|
*/
|
|
549
549
|
private focusSegment;
|
|
550
|
+
/**
|
|
551
|
+
* Selects a segment's whole content when it gets focus or a click, so
|
|
552
|
+
* typing replaces it instead of being blocked by its `maxlength`.
|
|
553
|
+
* @private
|
|
554
|
+
*/
|
|
555
|
+
private readonly selectSegmentText;
|
|
550
556
|
/**
|
|
551
557
|
* Updates a single hour/minute segment's typed value, auto-advancing to
|
|
552
558
|
* the next segment once it's fully typed, and committing the group once
|
|
@@ -642,5 +648,8 @@ declare global {
|
|
|
642
648
|
interface HTMLElementTagNameMap {
|
|
643
649
|
[EunomiaTimePickerTagName]: EunomiaTimePicker;
|
|
644
650
|
}
|
|
651
|
+
interface EunomiaStringAttributeMap {
|
|
652
|
+
[EunomiaTimePickerTagName]: "default-value";
|
|
653
|
+
}
|
|
645
654
|
}
|
|
646
655
|
export {};
|
|
@@ -68,11 +68,11 @@ const EunomiaTimePickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedM
|
|
|
68
68
|
* @attr {12 | 24} [hour-format] - Overrides the hour format. Auto-detected from locale when unset
|
|
69
69
|
* @prop {number} [stepMinute=1] - The minute column's increment step, and which minute values the mobile wheel enumerates
|
|
70
70
|
* @attr {number} [step-minute=1] - The minute column's increment step, and which minute values the mobile wheel enumerates
|
|
71
|
-
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string.
|
|
71
|
+
* @prop {string} [minTime] - The earliest selectable time of day, as an HH:mm string. The panel greys out the times outside minTime and maxTime, and a typed value outside them reports as invalid
|
|
72
72
|
* @attr {string} [min-time] - The earliest selectable time of day, as an HH:mm string
|
|
73
73
|
* @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
|
|
74
74
|
* @attr {string} [max-time] - The latest selectable time of day, as an HH:mm string
|
|
75
|
-
* @prop {string} [locale] - The locale used for the hour format auto-detection, segment order, and the modal's time preview. Defaults to the
|
|
75
|
+
* @prop {string} [locale] - The locale used for the hour format auto-detection, segment order, and the modal's time preview. Defaults to the one set with setDefaultLocale, English otherwise
|
|
76
76
|
* @prop {'wheel' | 'modal'} [mobileMode='wheel'] - Which content the mobile modal fallback shows: the same arrow-button columns as desktop, or a scroll-snap wheel per column. Only relevant when panelMode is columns
|
|
77
77
|
* @attr {'wheel' | 'modal'} [mobile-mode='wheel'] - Which content the mobile modal fallback shows
|
|
78
78
|
* @prop {'columns' | 'list'} [panelMode='columns'] - Which panel the trailing clock trigger opens: the hour, minute, and period spin button columns, or a single scrollable listbox of every time of day at a listStepMinutes gap. Picking an entry from the list both commits it and closes the panel immediately. The list renders identically on every viewport, and never switches to the mobile modal fallback that columns uses on a small viewport
|
|
@@ -383,6 +383,14 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
383
383
|
this.commitAdjustment(hour24, minute);
|
|
384
384
|
this.closePopover();
|
|
385
385
|
};
|
|
386
|
+
/**
|
|
387
|
+
* Selects a segment's whole content when it gets focus or a click, so
|
|
388
|
+
* typing replaces it instead of being blocked by its `maxlength`.
|
|
389
|
+
* @private
|
|
390
|
+
*/
|
|
391
|
+
this.selectSegmentText = (event) => {
|
|
392
|
+
event.currentTarget.select();
|
|
393
|
+
};
|
|
386
394
|
/**
|
|
387
395
|
* @private
|
|
388
396
|
*/
|
|
@@ -524,7 +532,7 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
524
532
|
* @private
|
|
525
533
|
*/
|
|
526
534
|
resolvedHourFormat() {
|
|
527
|
-
return resolveHourFormat(this.
|
|
535
|
+
return resolveHourFormat(this.resolvedLocale, this.hourFormat);
|
|
528
536
|
}
|
|
529
537
|
/**
|
|
530
538
|
* The instant the popover/modal panel's columns, and any segment
|
|
@@ -729,7 +737,7 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
729
737
|
*/
|
|
730
738
|
visibleSegmentOrder() {
|
|
731
739
|
const kinds = clockSegmentKinds(this.resolvedHourFormat());
|
|
732
|
-
return getClockSegmentOrder(this.
|
|
740
|
+
return getClockSegmentOrder(this.resolvedLocale).filter((kind) => kinds.includes(kind));
|
|
733
741
|
}
|
|
734
742
|
/**
|
|
735
743
|
* @private
|
|
@@ -901,6 +909,8 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
901
909
|
.value=${this.segments[kind]}
|
|
902
910
|
?disabled=${this.disabled}
|
|
903
911
|
?readonly=${this.readonly}
|
|
912
|
+
@focus=${this.selectSegmentText}
|
|
913
|
+
@click=${this.selectSegmentText}
|
|
904
914
|
@input=${(event) => this.handleSegmentInput(event, kind)}
|
|
905
915
|
@keydown=${(event) => this.handleSegmentKeydown(event, kind)}
|
|
906
916
|
/>
|
|
@@ -962,7 +972,7 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
962
972
|
return nothing;
|
|
963
973
|
}
|
|
964
974
|
const label = getTimeZoneOffsetLabel(this.value ?? new Date(), this.timezone, {
|
|
965
|
-
locale: this.
|
|
975
|
+
locale: this.resolvedLocale,
|
|
966
976
|
});
|
|
967
977
|
return html `<p id="timezone-label">${label}</p>`;
|
|
968
978
|
}
|
|
@@ -984,6 +994,8 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
984
994
|
minute: parts.minute,
|
|
985
995
|
period,
|
|
986
996
|
stepMinute: this.stepMinute,
|
|
997
|
+
minTime: parseTimeOfDay(this.minTime),
|
|
998
|
+
maxTime: parseTimeOfDay(this.maxTime),
|
|
987
999
|
disabled: this.disabled,
|
|
988
1000
|
noAnimation: this.noAnimation,
|
|
989
1001
|
labels: this.dictionary.timePicker,
|
|
@@ -1003,8 +1015,10 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
1003
1015
|
format,
|
|
1004
1016
|
hour: parts.hour,
|
|
1005
1017
|
minute: parts.minute,
|
|
1006
|
-
locale: this.
|
|
1018
|
+
locale: this.resolvedLocale,
|
|
1007
1019
|
stepMinutes: this.listStepMinutes,
|
|
1020
|
+
minTime: parseTimeOfDay(this.minTime),
|
|
1021
|
+
maxTime: parseTimeOfDay(this.maxTime),
|
|
1008
1022
|
disabled: this.disabled,
|
|
1009
1023
|
ariaLabel: this.label ?? this.dictionary.timePicker.time,
|
|
1010
1024
|
onPick: this.handleListPick,
|
|
@@ -1019,7 +1033,7 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
1019
1033
|
return this.dictionary.timePicker.selectATime;
|
|
1020
1034
|
}
|
|
1021
1035
|
const format = this.resolvedHourFormat();
|
|
1022
|
-
return new Intl.DateTimeFormat(this.
|
|
1036
|
+
return new Intl.DateTimeFormat(this.resolvedLocale, {
|
|
1023
1037
|
hour: "numeric",
|
|
1024
1038
|
minute: "2-digit",
|
|
1025
1039
|
hourCycle: format === 12 ? "h12" : "h23",
|
|
@@ -1043,7 +1057,7 @@ let EunomiaTimePicker = class EunomiaTimePicker extends EunomiaTimePickerMixinBa
|
|
|
1043
1057
|
</div>
|
|
1044
1058
|
<eun-modal
|
|
1045
1059
|
?open=${this.isModalOpen}
|
|
1046
|
-
|
|
1060
|
+
close-on-backdrop
|
|
1047
1061
|
confirm-label=${this.applyLabel ?? this.dictionary.common.apply}
|
|
1048
1062
|
cancel-label=${this.cancelLabel ?? this.dictionary.common.cancel}
|
|
1049
1063
|
aria-label=${this.label ?? this.dictionary.timePicker.selectATime}
|