@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
|
@@ -11,29 +11,16 @@ import { schedulerEventEditorStyles } from "./scheduler-event-editor.styles.js";
|
|
|
11
11
|
import { EventCreateEvent } from "../../../events/event-create.event.js";
|
|
12
12
|
import { EventUpdateEvent } from "../../../events/event-update.event.js";
|
|
13
13
|
import { EventDeleteEvent } from "../../../events/event-delete.event.js";
|
|
14
|
+
import { EventCancelEvent } from "../../../events/event-cancel.event.js";
|
|
15
|
+
import { EditorStateChangeEvent } from "../../../events/editor-state-change.event.js";
|
|
14
16
|
import { GuestInviteEvent } from "../../../events/event-guest-invite.event.js";
|
|
15
|
-
import { addHours, endOfDay, startOfDay } from "../../../utils/date.utils.js";
|
|
16
|
-
import { GUEST_STATUS_ICON, GUEST_STATUS_SEMANTIC_STATE, } from "../shared/scheduler.utils.js";
|
|
17
|
+
import { addDays, addHours, endOfDay, startOfDay, } from "../../../utils/date.utils.js";
|
|
18
|
+
import { EVENT_COLOR_PRESETS, GUEST_STATUS_ICON, GUEST_STATUS_SEMANTIC_STATE, toEventColorHex, } from "../shared/scheduler.utils.js";
|
|
17
19
|
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
18
20
|
/**
|
|
19
21
|
* Tag name of the scheduler event editor component.
|
|
20
22
|
*/
|
|
21
23
|
export const EunomiaSchedulerEventEditorTagName = "eun-scheduler-event-editor";
|
|
22
|
-
/**
|
|
23
|
-
* The six preset colors offered by the color picker's `option` swatches,
|
|
24
|
-
* keyed by the same names {@link colorLabels} uses for their accessible
|
|
25
|
-
* labels. Hex values match `scheduler-event.styles.ts`'s own tuned `500`
|
|
26
|
-
* shade for each preset name, so picking one here renders identically to
|
|
27
|
-
* setting `color` to the bare preset name directly (e.g. `"blue"`).
|
|
28
|
-
*/
|
|
29
|
-
const COLOR_PRESETS = [
|
|
30
|
-
{ name: "red", value: "#f14959" },
|
|
31
|
-
{ name: "purple", value: "#9562e3" },
|
|
32
|
-
{ name: "yellow", value: "#f0f050" },
|
|
33
|
-
{ name: "blue", value: "#3bb3b9" },
|
|
34
|
-
{ name: "green", value: "#49f15f" },
|
|
35
|
-
{ name: "pink", value: "#d05df3" },
|
|
36
|
-
];
|
|
37
24
|
const PRIORITIES = [
|
|
38
25
|
"low",
|
|
39
26
|
"medium",
|
|
@@ -80,13 +67,13 @@ const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
|
80
67
|
* @prop {EunomiaSchedulerEvent | null} [event] - The event being edited. Unset, or null, puts the form in create mode instead, seeded from initialStart and initialEnd
|
|
81
68
|
* @prop {Date} [initialStart] - The start time to seed a new event with, in create mode. Defaults to the next hour
|
|
82
69
|
* @prop {Date} [initialEnd] - The end time to seed a new event with, in create mode. Defaults to one hour after initialStart
|
|
83
|
-
* @prop {string} [locale] - The locale used by the nested date and time fields. Defaults to the
|
|
70
|
+
* @prop {string} [locale] - The locale used by the nested date and time fields. Defaults to the one set with setDefaultLocale, English otherwise
|
|
84
71
|
* @prop {boolean} [hideActions=false] - Hides the built-in save, cancel, and delete footer, for a host that drives the form itself
|
|
85
72
|
* @prop {string} [titleLabel] - The label of the title field. Defaults to the localized string for the current locale (English: "Title")
|
|
86
73
|
* @prop {string} [descriptionLabel] - The label of the description field. Defaults to the localized string for the current locale (English: "Description")
|
|
87
74
|
* @prop {string} [allDayLabel] - The label of the all day checkbox. Defaults to the localized string for the current locale (English: "All day")
|
|
88
75
|
* @prop {string} [dateLabel] - The label of the date field. Defaults to the localized string for the current locale (English: "Date")
|
|
89
|
-
* @prop {string} [endDateLabel] - The label of the end date field
|
|
76
|
+
* @prop {string} [endDateLabel] - The label of the end date field. Defaults to the localized string for the current locale (English: "End date")
|
|
90
77
|
* @prop {string} [startTimeLabel] - The label of the start time field. Defaults to the localized string for the current locale (English: "Start time")
|
|
91
78
|
* @prop {string} [endTimeLabel] - The label of the end time field. Defaults to the localized string for the current locale (English: "End time")
|
|
92
79
|
* @prop {string} [locationLabel] - The label of the location field. Defaults to the localized string for the current locale (English: "Location")
|
|
@@ -95,13 +82,18 @@ const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
|
95
82
|
* @prop {string} [colorLabel] - The label of the color swatch picker. Defaults to the localized string for the current locale (English: "Color")
|
|
96
83
|
* @prop {string} [guestsLabel] - The label of the guest-sharing field. Defaults to the localized string for the current locale (English: "Guests")
|
|
97
84
|
* @prop {string} [addGuestLabel] - The accessible label of the guest email input's add button. Defaults to the localized string for the current locale (English: "Add guest")
|
|
85
|
+
* @prop {string} [rangeErrorLabel] - The error shown under the time fields when the end isn't after the start. Defaults to the localized string for the current locale (English: "The end must be after the start")
|
|
86
|
+
* @prop {string} [guestErrorLabel] - The error shown under the guest email field when the entered address is malformed. Defaults to the localized string for the current locale (English: "Enter a valid email address")
|
|
98
87
|
* @prop {string} [removeGuestLabel] - A prefix combined with the guest's email to build each guest chip's delete button accessible name, such as "Remove alice@example.com". Defaults to the localized string for the current locale (English: "Remove")
|
|
99
88
|
* @prop {string} [saveLabel] - The label of the built-in save button. Defaults to the localized string for the current locale (English: "Save")
|
|
100
|
-
* @prop {string} [cancelLabel] - The label of the built-in cancel button. Resets the form to its last-seeded values. Defaults to the localized string for the current locale (English: "Cancel")
|
|
89
|
+
* @prop {string} [cancelLabel] - The label of the built-in cancel button. Resets the form to its last-seeded values and fires the cancel event. Defaults to the localized string for the current locale (English: "Cancel")
|
|
101
90
|
* @prop {string} [deleteLabel] - The label of the built-in delete button. Only shown while editing an existing event. Defaults to the localized string for the current locale (English: "Delete")
|
|
91
|
+
* @prop {string} [deleteConfirmLabel] - The question the built-in footer asks before deleting. Defaults to the localized string for the current locale (English: "Delete this event?")
|
|
102
92
|
* @fires {EventCreateEvent} euneventcreate - Fired on a valid save, in create mode
|
|
103
|
-
* @fires {EventUpdateEvent} euneventupdate - Fired on a valid save, in edit mode
|
|
93
|
+
* @fires {EventUpdateEvent} euneventupdate - Fired on a valid save, in edit mode, unless nothing changed
|
|
104
94
|
* @fires {EventDeleteEvent} euneventdelete - Fired when the built-in delete button is activated
|
|
95
|
+
* @fires {EventCancelEvent} euneventcancel - Fired when the built-in cancel button, or requestCancel, resets the form
|
|
96
|
+
* @fires {EditorStateChangeEvent} euneditorstatechange - Fired whenever dirty or valid changes value. Not fired for the initial render
|
|
105
97
|
* @fires {GuestInviteEvent} eunguestinvite - Fired whenever a guest email is added, so a consumer can actually send the share invite
|
|
106
98
|
* @cssprop [--scheduler-event-editor-gap] - Sets the gap between fields
|
|
107
99
|
* @element eun-scheduler-event-editor
|
|
@@ -114,6 +106,12 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
114
106
|
* @default false
|
|
115
107
|
*/
|
|
116
108
|
this.hideActions = false;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the built-in Delete was pressed once and now waits for its
|
|
111
|
+
* confirmation. Reset whenever the form is seeded.
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
this.confirmingDelete = false;
|
|
117
115
|
/** @internal */
|
|
118
116
|
this.formTitle = "";
|
|
119
117
|
/** @internal */
|
|
@@ -127,9 +125,9 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
127
125
|
/** @internal */
|
|
128
126
|
this.formDate = startOfDay(new Date());
|
|
129
127
|
/**
|
|
130
|
-
* The end date of
|
|
131
|
-
* {@link
|
|
132
|
-
*
|
|
128
|
+
* The end date of the event — a single-day event has this equal to
|
|
129
|
+
* {@link formDate}. Combined with {@link formEnd}'s time outside
|
|
130
|
+
* all-day mode.
|
|
133
131
|
* @internal
|
|
134
132
|
*/
|
|
135
133
|
this.formEndDate = startOfDay(new Date());
|
|
@@ -148,11 +146,10 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
148
146
|
*/
|
|
149
147
|
this.formPriority = "medium";
|
|
150
148
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* show the matching preset swatch as picked in its own radiogroup.
|
|
149
|
+
* Always held as hex (see `toEventColorHex`), seeded from a preset name
|
|
150
|
+
* or hex alike, so the `eun-color-picker` rendered in {@link render}
|
|
151
|
+
* below shows the matching preset swatch as picked, and saved events
|
|
152
|
+
* always carry hex. Defaults to the `blue` preset's hex.
|
|
156
153
|
* @internal
|
|
157
154
|
*/
|
|
158
155
|
this.formColor = "#3bb3b9";
|
|
@@ -181,13 +178,38 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
181
178
|
* @internal
|
|
182
179
|
*/
|
|
183
180
|
this.seedSnapshot = "";
|
|
181
|
+
/**
|
|
182
|
+
* The `dirty`/`valid` pair last reported by `EditorStateChangeEvent`,
|
|
183
|
+
* `null` until the first update records it without dispatching.
|
|
184
|
+
* @internal
|
|
185
|
+
*/
|
|
186
|
+
this.reportedState = null;
|
|
184
187
|
/** @private */
|
|
185
188
|
this.handleSaveClick = () => {
|
|
186
189
|
this.requestSave();
|
|
187
190
|
};
|
|
188
191
|
/** @private */
|
|
189
192
|
this.handleCancelClick = () => {
|
|
190
|
-
this.
|
|
193
|
+
this.requestCancel();
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Swaps the built-in footer for the delete confirmation, moving focus
|
|
197
|
+
* onto its Cancel button since the pressed Delete button goes away.
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
this.handleDeleteClick = () => {
|
|
201
|
+
this.confirmingDelete = true;
|
|
202
|
+
void this.updateComplete.then(() => this.focusAction("#confirm-cancel"));
|
|
203
|
+
};
|
|
204
|
+
/** @private */
|
|
205
|
+
this.handleConfirmDeleteClick = () => {
|
|
206
|
+
this.confirmingDelete = false;
|
|
207
|
+
this.requestDelete();
|
|
208
|
+
};
|
|
209
|
+
/** @private */
|
|
210
|
+
this.handleCancelDeleteClick = () => {
|
|
211
|
+
this.confirmingDelete = false;
|
|
212
|
+
void this.updateComplete.then(() => this.focusAction("#delete"));
|
|
191
213
|
};
|
|
192
214
|
/**
|
|
193
215
|
* Reads the priority picker's new selection back into {@link formPriority}
|
|
@@ -272,6 +294,22 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
272
294
|
if (formFields.some((field) => changed.has(field))) {
|
|
273
295
|
this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
|
|
274
296
|
}
|
|
297
|
+
this.reportStateChange();
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Dispatches `EditorStateChangeEvent` when {@link dirty} or
|
|
301
|
+
* {@link valid} differs from what was last reported. The first call only
|
|
302
|
+
* records the initial pair.
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
reportStateChange() {
|
|
306
|
+
const state = { dirty: this.dirty, valid: this.valid };
|
|
307
|
+
const previous = this.reportedState;
|
|
308
|
+
this.reportedState = state;
|
|
309
|
+
if (previous &&
|
|
310
|
+
(previous.dirty !== state.dirty || previous.valid !== state.valid)) {
|
|
311
|
+
this.dispatchEvent(new EditorStateChangeEvent(state.dirty, state.valid));
|
|
312
|
+
}
|
|
275
313
|
}
|
|
276
314
|
/**
|
|
277
315
|
* Seeds every form field from {@link event} (edit mode) or
|
|
@@ -292,7 +330,7 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
292
330
|
this.formLocation = source.location ?? "";
|
|
293
331
|
this.formNotes = source.notes ?? "";
|
|
294
332
|
this.formPriority = source.priority ?? "medium";
|
|
295
|
-
this.formColor = source.color;
|
|
333
|
+
this.formColor = toEventColorHex(source.color);
|
|
296
334
|
this.formGuests = source.guests
|
|
297
335
|
? source.guests.map((g) => ({ ...g }))
|
|
298
336
|
: [];
|
|
@@ -310,12 +348,13 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
310
348
|
this.formLocation = "";
|
|
311
349
|
this.formNotes = "";
|
|
312
350
|
this.formPriority = "medium";
|
|
313
|
-
this.formColor = "blue";
|
|
351
|
+
this.formColor = toEventColorHex("blue");
|
|
314
352
|
this.formGuests = [];
|
|
315
353
|
}
|
|
316
354
|
this.guestInputValue = "";
|
|
317
355
|
this.guestInputError = false;
|
|
318
356
|
this.showErrors = false;
|
|
357
|
+
this.confirmingDelete = false;
|
|
319
358
|
this.seedSnapshot = this.snapshot();
|
|
320
359
|
}
|
|
321
360
|
/** @private */
|
|
@@ -354,8 +393,9 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
354
393
|
* Composes the current form fields into the final `start`/`end` instants
|
|
355
394
|
* — in all-day mode, {@link formDate}/{@link formEndDate} at their own
|
|
356
395
|
* day boundaries (no time-of-day involved) ; otherwise
|
|
357
|
-
* {@link formDate}
|
|
358
|
-
* hour/minute
|
|
396
|
+
* {@link formDate}/{@link formEndDate}'s calendar days with
|
|
397
|
+
* {@link formStart}/{@link formEnd}'s hour/minute. Never rolls the end
|
|
398
|
+
* over to the next day : an end before the start stays invalid.
|
|
359
399
|
* @private
|
|
360
400
|
*/
|
|
361
401
|
composeStartEnd() {
|
|
@@ -370,11 +410,8 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
370
410
|
}
|
|
371
411
|
const start = new Date(this.formDate);
|
|
372
412
|
start.setHours(this.formStart.getHours(), this.formStart.getMinutes(), 0, 0);
|
|
373
|
-
const end = new Date(this.
|
|
413
|
+
const end = new Date(this.formEndDate);
|
|
374
414
|
end.setHours(this.formEnd.getHours(), this.formEnd.getMinutes(), 0, 0);
|
|
375
|
-
if (end.getTime() <= start.getTime()) {
|
|
376
|
-
end.setDate(end.getDate() + 1);
|
|
377
|
-
}
|
|
378
415
|
return { start, end };
|
|
379
416
|
}
|
|
380
417
|
/**
|
|
@@ -392,7 +429,8 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
392
429
|
* Validates the form and, if valid, dispatches
|
|
393
430
|
* `EventCreateEvent`/`EventUpdateEvent` as appropriate. Otherwise turns
|
|
394
431
|
* on inline error messages and returns `false` without dispatching
|
|
395
|
-
* anything.
|
|
432
|
+
* anything. Editing an event without changing anything succeeds without
|
|
433
|
+
* dispatching either, so the consumer's data is left untouched.
|
|
396
434
|
*
|
|
397
435
|
* @returns whether the save succeeded.
|
|
398
436
|
*/
|
|
@@ -401,6 +439,9 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
401
439
|
this.showErrors = true;
|
|
402
440
|
return false;
|
|
403
441
|
}
|
|
442
|
+
if (this.event && !this.dirty) {
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
404
445
|
const range = this.composeStartEnd();
|
|
405
446
|
const event = {
|
|
406
447
|
id: this.event?.id ?? crypto.randomUUID(),
|
|
@@ -411,7 +452,7 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
411
452
|
end: range.end,
|
|
412
453
|
location: this.formLocation || undefined,
|
|
413
454
|
notes: this.formNotes || undefined,
|
|
414
|
-
color: this.
|
|
455
|
+
color: this.savedColor(),
|
|
415
456
|
priority: this.formPriority,
|
|
416
457
|
guests: this.formGuests.length ? this.formGuests : undefined,
|
|
417
458
|
};
|
|
@@ -420,6 +461,34 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
420
461
|
this.seedSnapshot = this.snapshot();
|
|
421
462
|
return true;
|
|
422
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* The color to save : the edited event's own value, in whatever form it
|
|
466
|
+
* was given (a preset name, say), while the picked swatch still matches
|
|
467
|
+
* it, {@link formColor}'s hex otherwise.
|
|
468
|
+
* @private
|
|
469
|
+
*/
|
|
470
|
+
savedColor() {
|
|
471
|
+
const original = this.event?.color;
|
|
472
|
+
return original && toEventColorHex(original) === this.formColor
|
|
473
|
+
? original
|
|
474
|
+
: this.formColor;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Whether the composed end falls at or before the start.
|
|
478
|
+
* @private
|
|
479
|
+
*/
|
|
480
|
+
get rangeInvalid() {
|
|
481
|
+
const range = this.composeStartEnd();
|
|
482
|
+
return !!range && range.end.getTime() <= range.start.getTime();
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Resets the form to its last-seeded values and dispatches
|
|
486
|
+
* `EventCancelEvent`, for a host modal or drawer to close itself.
|
|
487
|
+
*/
|
|
488
|
+
requestCancel() {
|
|
489
|
+
this.seedForm();
|
|
490
|
+
this.dispatchEvent(new EventCancelEvent());
|
|
491
|
+
}
|
|
423
492
|
/**
|
|
424
493
|
* Dispatches `EventDeleteEvent` for the event currently being edited. A
|
|
425
494
|
* no-op in "create" mode (there's nothing to delete yet).
|
|
@@ -429,6 +498,20 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
429
498
|
this.dispatchEvent(new EventDeleteEvent(this.event.id));
|
|
430
499
|
}
|
|
431
500
|
}
|
|
501
|
+
/** @private */
|
|
502
|
+
focusAction(selector) {
|
|
503
|
+
this.shadowRoot?.querySelector(selector)?.focus();
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Moves {@link formDate} to `date`, shifting {@link formEndDate} by the
|
|
507
|
+
* same number of days so the event keeps its length.
|
|
508
|
+
* @private
|
|
509
|
+
*/
|
|
510
|
+
moveStartDate(date) {
|
|
511
|
+
const delta = Math.round((startOfDay(date).getTime() - this.formDate.getTime()) / 86_400_000);
|
|
512
|
+
this.formDate = startOfDay(date);
|
|
513
|
+
this.formEndDate = addDays(this.formEndDate, delta);
|
|
514
|
+
}
|
|
432
515
|
/**
|
|
433
516
|
* Validates {@link guestInputValue} and, if it's a well-formed email not
|
|
434
517
|
* already in {@link formGuests}, adds it as a new `pending` guest and
|
|
@@ -477,9 +560,11 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
477
560
|
? html `<span
|
|
478
561
|
role="alert"
|
|
479
562
|
style="color: var(--eun-color-critical-100, #aa0014); font-size: 12px;"
|
|
480
|
-
>${this.titleLabel
|
|
481
|
-
|
|
482
|
-
this.dictionary.schedulerEventEditor.
|
|
563
|
+
>${this.titleLabel === undefined &&
|
|
564
|
+
this.requiredLabel === undefined
|
|
565
|
+
? this.dictionary.schedulerEventEditor.titleRequired
|
|
566
|
+
: `${this.titleLabel ?? this.dictionary.schedulerEventEditor.title} ${this.requiredLabel ??
|
|
567
|
+
this.dictionary.schedulerEventEditor.required}`}</span
|
|
483
568
|
>`
|
|
484
569
|
: nothing}
|
|
485
570
|
|
|
@@ -501,52 +586,37 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
501
586
|
}}
|
|
502
587
|
></eun-checkbox>
|
|
503
588
|
|
|
589
|
+
<div class="row">
|
|
590
|
+
<eun-date-picker
|
|
591
|
+
?required=${true}
|
|
592
|
+
label=${this.dateLabel ?? this.dictionary.schedulerEventEditor.date}
|
|
593
|
+
.value=${this.formDate}
|
|
594
|
+
locale=${ifDefined(this.locale)}
|
|
595
|
+
@eunchange=${(e) => {
|
|
596
|
+
const value = e.target.value;
|
|
597
|
+
if (value) {
|
|
598
|
+
this.moveStartDate(value);
|
|
599
|
+
}
|
|
600
|
+
}}
|
|
601
|
+
></eun-date-picker>
|
|
602
|
+
<eun-date-picker
|
|
603
|
+
?required=${true}
|
|
604
|
+
label=${this.endDateLabel ??
|
|
605
|
+
this.dictionary.schedulerEventEditor.endDate}
|
|
606
|
+
.value=${this.formEndDate}
|
|
607
|
+
locale=${ifDefined(this.locale)}
|
|
608
|
+
@eunchange=${(e) => {
|
|
609
|
+
const value = e.target.value;
|
|
610
|
+
if (value) {
|
|
611
|
+
this.formEndDate = startOfDay(value);
|
|
612
|
+
}
|
|
613
|
+
}}
|
|
614
|
+
></eun-date-picker>
|
|
615
|
+
</div>
|
|
616
|
+
|
|
504
617
|
${this.formAllDay
|
|
505
|
-
?
|
|
506
|
-
<div class="row">
|
|
507
|
-
<eun-date-picker
|
|
508
|
-
?required=${true}
|
|
509
|
-
label=${this.dateLabel ??
|
|
510
|
-
this.dictionary.schedulerEventEditor.date}
|
|
511
|
-
.value=${this.formDate}
|
|
512
|
-
locale=${ifDefined(this.locale)}
|
|
513
|
-
@eunchange=${(e) => {
|
|
514
|
-
const value = e.target.value;
|
|
515
|
-
if (value) {
|
|
516
|
-
this.formDate = startOfDay(value);
|
|
517
|
-
}
|
|
518
|
-
}}
|
|
519
|
-
></eun-date-picker>
|
|
520
|
-
<eun-date-picker
|
|
521
|
-
?required=${true}
|
|
522
|
-
label=${this.endDateLabel ??
|
|
523
|
-
this.dictionary.schedulerEventEditor.endDate}
|
|
524
|
-
.value=${this.formEndDate}
|
|
525
|
-
locale=${ifDefined(this.locale)}
|
|
526
|
-
@eunchange=${(e) => {
|
|
527
|
-
const value = e.target.value;
|
|
528
|
-
if (value) {
|
|
529
|
-
this.formEndDate = startOfDay(value);
|
|
530
|
-
}
|
|
531
|
-
}}
|
|
532
|
-
></eun-date-picker>
|
|
533
|
-
</div>
|
|
534
|
-
`
|
|
618
|
+
? nothing
|
|
535
619
|
: html `
|
|
536
|
-
<eun-date-picker
|
|
537
|
-
?required=${true}
|
|
538
|
-
label=${this.dateLabel ??
|
|
539
|
-
this.dictionary.schedulerEventEditor.date}
|
|
540
|
-
.value=${this.formDate}
|
|
541
|
-
locale=${ifDefined(this.locale)}
|
|
542
|
-
@eunchange=${(e) => {
|
|
543
|
-
const value = e.target.value;
|
|
544
|
-
if (value) {
|
|
545
|
-
this.formDate = startOfDay(value);
|
|
546
|
-
}
|
|
547
|
-
}}
|
|
548
|
-
></eun-date-picker>
|
|
549
|
-
|
|
550
620
|
<div class="row">
|
|
551
621
|
<eun-time-picker
|
|
552
622
|
?required=${true}
|
|
@@ -572,6 +642,12 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
572
642
|
></eun-time-picker>
|
|
573
643
|
</div>
|
|
574
644
|
`}
|
|
645
|
+
${this.rangeInvalid
|
|
646
|
+
? html `<span role="alert" id="range-error" class="field-error"
|
|
647
|
+
>${this.rangeErrorLabel ??
|
|
648
|
+
this.dictionary.schedulerEventEditor.endBeforeStart}</span
|
|
649
|
+
>`
|
|
650
|
+
: nothing}
|
|
575
651
|
|
|
576
652
|
<eun-input
|
|
577
653
|
label=${this.locationLabel ??
|
|
@@ -612,9 +688,9 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
612
688
|
</eun-button>
|
|
613
689
|
</div>
|
|
614
690
|
${this.guestInputError
|
|
615
|
-
? html `<span role="alert" class="
|
|
616
|
-
>${this.
|
|
617
|
-
this.dictionary.
|
|
691
|
+
? html `<span role="alert" class="field-error"
|
|
692
|
+
>${this.guestErrorLabel ??
|
|
693
|
+
this.dictionary.validation.typeMismatch.email}</span
|
|
618
694
|
>`
|
|
619
695
|
: nothing}
|
|
620
696
|
${this.formGuests.length
|
|
@@ -628,6 +704,8 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
628
704
|
>
|
|
629
705
|
<eun-chip
|
|
630
706
|
appearance="outline"
|
|
707
|
+
rounded
|
|
708
|
+
removable
|
|
631
709
|
icon=${GUEST_STATUS_ICON[guest.status]}
|
|
632
710
|
.severity=${GUEST_STATUS_SEMANTIC_STATE[guest.status]}
|
|
633
711
|
.removeLabel=${this.removeGuestLabel ??
|
|
@@ -684,32 +762,79 @@ let EunomiaSchedulerEventEditor = class EunomiaSchedulerEventEditor extends Loca
|
|
|
684
762
|
this.formColor = e.target.value;
|
|
685
763
|
}}
|
|
686
764
|
>
|
|
687
|
-
${
|
|
688
|
-
<option value=${preset.
|
|
765
|
+
${EVENT_COLOR_PRESETS.map((preset) => html `
|
|
766
|
+
<option value=${preset.hex}>${colorLabels[preset.name]}</option>
|
|
689
767
|
`)}
|
|
690
768
|
</eun-color-picker>
|
|
691
769
|
</div>
|
|
692
770
|
|
|
693
|
-
${this.
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
771
|
+
${this.renderActions()}
|
|
772
|
+
`;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Renders the built-in footer : Delete/Cancel/Save, or the delete
|
|
776
|
+
* confirmation that replaces them once Delete was pressed. Save stays
|
|
777
|
+
* disabled while an edited event has no changes. Nothing with
|
|
778
|
+
* {@link hideActions}.
|
|
779
|
+
* @private
|
|
780
|
+
*/
|
|
781
|
+
renderActions() {
|
|
782
|
+
if (this.hideActions) {
|
|
783
|
+
return nothing;
|
|
784
|
+
}
|
|
785
|
+
const deleteLabel = this.deleteLabel ?? this.dictionary.common.delete;
|
|
786
|
+
const cancelLabel = this.cancelLabel ?? this.dictionary.common.cancel;
|
|
787
|
+
if (this.confirmingDelete) {
|
|
788
|
+
return html `
|
|
789
|
+
<div
|
|
790
|
+
id="actions"
|
|
791
|
+
class="confirm"
|
|
792
|
+
role="group"
|
|
793
|
+
aria-labelledby="confirm-text"
|
|
794
|
+
>
|
|
795
|
+
<span id="confirm-text"
|
|
796
|
+
>${this.deleteConfirmLabel ??
|
|
797
|
+
this.dictionary.scheduler.deleteConfirm}</span
|
|
798
|
+
>
|
|
799
|
+
<eun-button
|
|
800
|
+
id="confirm-cancel"
|
|
801
|
+
appearance="ghost"
|
|
802
|
+
@click=${this.handleCancelDeleteClick}
|
|
803
|
+
>${cancelLabel}</eun-button
|
|
804
|
+
>
|
|
805
|
+
<eun-button
|
|
806
|
+
id="confirm-delete"
|
|
807
|
+
color="critical"
|
|
808
|
+
@click=${this.handleConfirmDeleteClick}
|
|
809
|
+
>${deleteLabel}</eun-button
|
|
810
|
+
>
|
|
811
|
+
</div>
|
|
812
|
+
`;
|
|
813
|
+
}
|
|
814
|
+
return html `
|
|
815
|
+
<div id="actions">
|
|
816
|
+
${this.event
|
|
817
|
+
? html `
|
|
818
|
+
<eun-button
|
|
819
|
+
id="delete"
|
|
820
|
+
color="critical"
|
|
821
|
+
@click=${this.handleDeleteClick}
|
|
822
|
+
>${deleteLabel}</eun-button
|
|
823
|
+
>
|
|
824
|
+
`
|
|
825
|
+
: nothing}
|
|
826
|
+
<span class="spacer"></span>
|
|
827
|
+
<eun-button appearance="ghost" @click=${this.handleCancelClick}
|
|
828
|
+
>${cancelLabel}</eun-button
|
|
829
|
+
>
|
|
830
|
+
<eun-button
|
|
831
|
+
id="save"
|
|
832
|
+
color="primary"
|
|
833
|
+
?disabled=${!!this.event && !this.dirty}
|
|
834
|
+
@click=${this.handleSaveClick}
|
|
835
|
+
>${this.saveLabel ?? this.dictionary.common.save}</eun-button
|
|
836
|
+
>
|
|
837
|
+
</div>
|
|
713
838
|
`;
|
|
714
839
|
}
|
|
715
840
|
};
|
|
@@ -781,6 +906,12 @@ __decorate([
|
|
|
781
906
|
__decorate([
|
|
782
907
|
property({ attribute: "add-guest-label" })
|
|
783
908
|
], EunomiaSchedulerEventEditor.prototype, "addGuestLabel", void 0);
|
|
909
|
+
__decorate([
|
|
910
|
+
property({ attribute: "guest-error-label" })
|
|
911
|
+
], EunomiaSchedulerEventEditor.prototype, "guestErrorLabel", void 0);
|
|
912
|
+
__decorate([
|
|
913
|
+
property({ attribute: "range-error-label" })
|
|
914
|
+
], EunomiaSchedulerEventEditor.prototype, "rangeErrorLabel", void 0);
|
|
784
915
|
__decorate([
|
|
785
916
|
property({ attribute: "remove-guest-label" })
|
|
786
917
|
], EunomiaSchedulerEventEditor.prototype, "removeGuestLabel", void 0);
|
|
@@ -793,6 +924,12 @@ __decorate([
|
|
|
793
924
|
__decorate([
|
|
794
925
|
property({ attribute: "delete-label" })
|
|
795
926
|
], EunomiaSchedulerEventEditor.prototype, "deleteLabel", void 0);
|
|
927
|
+
__decorate([
|
|
928
|
+
property({ attribute: "delete-confirm-label" })
|
|
929
|
+
], EunomiaSchedulerEventEditor.prototype, "deleteConfirmLabel", void 0);
|
|
930
|
+
__decorate([
|
|
931
|
+
state()
|
|
932
|
+
], EunomiaSchedulerEventEditor.prototype, "confirmingDelete", void 0);
|
|
796
933
|
__decorate([
|
|
797
934
|
state()
|
|
798
935
|
], EunomiaSchedulerEventEditor.prototype, "formTitle", void 0);
|
|
@@ -43,7 +43,7 @@ const base = css `
|
|
|
43
43
|
flex: 0 0 auto;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
.field-error {
|
|
47
47
|
display: block;
|
|
48
48
|
margin-top: var(--eun-space-xs, 4px);
|
|
49
49
|
color: var(--eun-color-critical-100, #aa0014);
|
|
@@ -73,5 +73,15 @@ const base = css `
|
|
|
73
73
|
#actions .spacer {
|
|
74
74
|
flex: 1 1 auto;
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
#actions.confirm {
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
align-items: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
#confirm-text {
|
|
83
|
+
flex: 1 1 auto;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
}
|
|
76
86
|
`;
|
|
77
87
|
export const schedulerEventEditorStyles = base;
|
|
@@ -8,11 +8,17 @@ export interface EventPopoverProps {
|
|
|
8
8
|
locale?: string;
|
|
9
9
|
editLabel: string;
|
|
10
10
|
deleteLabel: string;
|
|
11
|
+
deleteConfirmLabel: string;
|
|
12
|
+
cancelLabel: string;
|
|
11
13
|
closeLabel: string;
|
|
14
|
+
allDayLabel: string;
|
|
12
15
|
priorityLabels: Record<string, string>;
|
|
13
16
|
readonly: boolean;
|
|
17
|
+
confirmingDelete: boolean;
|
|
14
18
|
onEdit: () => void;
|
|
15
19
|
onDelete: () => void;
|
|
20
|
+
onConfirmDelete: () => void;
|
|
21
|
+
onCancelDelete: () => void;
|
|
16
22
|
onClose: () => void;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
@@ -22,7 +28,9 @@ export interface EventPopoverProps {
|
|
|
22
28
|
* shared guests, each with a status icon — check/hourglass/cross for
|
|
23
29
|
* confirmed/pending/declined), plus
|
|
24
30
|
* Edit/Delete actions to actually enter the editor and a close (✕) button
|
|
25
|
-
* to dismiss it without acting on the event at all.
|
|
31
|
+
* to dismiss it without acting on the event at all. Delete asks for a
|
|
32
|
+
* confirmation in place first, swapping the actions for a question and a
|
|
33
|
+
* Cancel/Delete pair. Deliberately not
|
|
26
34
|
* `eun-tooltip` : that component is non-interactive (`role="tooltip"`,
|
|
27
35
|
* closes on blur) by ARIA convention, the wrong fit for a panel that needs
|
|
28
36
|
* to hold focusable buttons — this is a small popover instead, positioned
|