@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
|
@@ -7,13 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
8
8
|
import { html, LitElement, nothing } from "lit";
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
-
import { addHours } from "../../../utils/date.utils.js";
|
|
11
10
|
import { AnchorPositionMixin } from "../../../mixins/anchor-position.mixin.js";
|
|
12
11
|
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
13
12
|
import { schedulerStyles } from "./scheduler.styles.js";
|
|
14
13
|
import { schedulerEventPopoverStyles } from "../shared/scheduler-event-popover.styles.js";
|
|
15
14
|
import { renderEventPopover } from "../shared/scheduler-event-popover.js";
|
|
16
|
-
import { addPeriod, getVisibleRange } from "../shared/scheduler.utils.js";
|
|
15
|
+
import { addPeriod, getVisibleRange, } from "../shared/scheduler.utils.js";
|
|
17
16
|
import { EventCreateEvent } from "../../../events/event-create.event.js";
|
|
18
17
|
import { EventUpdateEvent } from "../../../events/event-update.event.js";
|
|
19
18
|
import { EventDeleteEvent } from "../../../events/event-delete.event.js";
|
|
@@ -62,7 +61,7 @@ const VIEWS = [
|
|
|
62
61
|
* @prop {number} [dayStartHour=0] - The first visible hour row in day, week, and work week
|
|
63
62
|
* @prop {number} [dayEndHour=24] - The last visible hour row, exclusive, in day, week, and work week
|
|
64
63
|
* @prop {number} [slotDuration=30] - The grid's row granularity, in minutes, also the default duration for a newly created event
|
|
65
|
-
* @prop {string} [locale] - The locale used throughout. Defaults to the
|
|
64
|
+
* @prop {string} [locale] - The locale used throughout. Defaults to the one set with setDefaultLocale, English otherwise
|
|
66
65
|
* @prop {boolean} [readonly=false] - Disables creating, editing, and deleting. View only
|
|
67
66
|
* @prop {boolean} [noAnimation=false] - Disables the mobile swipe slide animation and the drawer or modal's own transitions
|
|
68
67
|
* @prop {boolean} [hideNowLine=false] - Hides the line marking the current time in day, week and work week views
|
|
@@ -78,21 +77,23 @@ const VIEWS = [
|
|
|
78
77
|
* @prop {string} [viewYearLabel] - The label of the year view switcher option. Defaults to the localized string for the current locale (English: "Year")
|
|
79
78
|
* @prop {string} [applyLabel] - The label of the event editor's save button. Defaults to the localized string for the current locale (English: "Apply")
|
|
80
79
|
* @prop {string} [deleteLabel] - The label of the delete button, in the event editor and the read-only event popover. Defaults to the localized string for the current locale (English: "Delete")
|
|
80
|
+
* @prop {string} [deleteConfirmLabel] - The question the read-only event popover asks before deleting. Defaults to the localized string for the current locale (English: "Delete this event?")
|
|
81
81
|
* @prop {string} [moreEventsLabel] - The template for the month view's overflow affordance, with the placeholder replaced by the hidden event count. Defaults to the localized string for the current locale (English: "+{count} more")
|
|
82
82
|
* @prop {'default' | 'transparent' | 'ghost'} [eventAppearance='default'] - The appearance applied to day, week, and work week event chips. Month view is unaffected, always picking ghost, or default for multi-day bars, itself
|
|
83
83
|
* @attr {'default' | 'transparent' | 'ghost'} [event-appearance='default'] - The visual variant applied to day, week, and work week event chips
|
|
84
84
|
* @fires {EventCreateEvent} euneventcreate - Fired when a new event is saved
|
|
85
85
|
* @fires {EventUpdateEvent} euneventupdate - Fired when an existing event is saved, or a day, week, or work week chip is dragged to a new time or day
|
|
86
86
|
* @fires {EventDeleteEvent} euneventdelete - Fired when an event is deleted
|
|
87
|
-
* @fires {PeriodChangeEvent} eunperiodchange - Fired whenever the visible period changes, from navigation, a swipe, a view switch, or an external view or displayedDate assignment
|
|
87
|
+
* @fires {PeriodChangeEvent} eunperiodchange - Fired whenever the visible period changes, from navigation, a swipe, a view switch, or an external view or displayedDate assignment. Not fired for the initial render, read visibleRange instead
|
|
88
88
|
* @cssprop [--scheduler-border-color] - Sets the border color throughout the shell and grids
|
|
89
89
|
* @cssprop [--scheduler-background] - Sets the background color
|
|
90
90
|
* @cssprop [--scheduler-slot-height] - Sets the pixel height per slotDuration row in day, week, and work week
|
|
91
91
|
* @cssprop [--scheduler-gutter-width] - Sets the width of the hour-label gutter
|
|
92
|
-
* @cssprop [--scheduler-body-max-height] - Sets the maximum height, with scroll, of the day, week, and work week grid body
|
|
92
|
+
* @cssprop [--scheduler-body-max-height] - Sets the maximum height, with scroll, of the day, week, and work week grid body and the year view, and of the month view when set (uncapped by default)
|
|
93
93
|
* @cssprop [--scheduler-month-cell-min-height] - Sets the minimum height of month view cells
|
|
94
94
|
* @cssprop [--scheduler-swipe-duration=200ms] - Sets the duration of the mobile swipe slide animation
|
|
95
95
|
* @cssprop [--scheduler-accent-color] - Sets the color marking today, the selected day and the focus ring. Defaults to the theme's primary color
|
|
96
|
+
* @cssprop [--scheduler-focus-outline-color] - Sets the keyboard focus outline color, falling back to --scheduler-accent-color, or to each event's own color on an event
|
|
96
97
|
* @cssprop [--scheduler-accent-text-color] - Sets the text color shown on the accent color, such as today's number in month view
|
|
97
98
|
* @cssprop [--scheduler-now-line-color] - Sets the color of the line marking the current time. Defaults to the critical color
|
|
98
99
|
* @element eun-scheduler
|
|
@@ -189,7 +190,7 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
189
190
|
*/
|
|
190
191
|
this.createStart = nextHour(new Date());
|
|
191
192
|
/** @internal */
|
|
192
|
-
this.createEnd =
|
|
193
|
+
this.createEnd = this.defaultCreateEnd(this.createStart);
|
|
193
194
|
/**
|
|
194
195
|
* Whether `eun-drawer`'s `dirty` unsaved-changes guard should be active
|
|
195
196
|
* — kept in sync with the embedded editor's own `dirty` getter via its
|
|
@@ -217,6 +218,18 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
217
218
|
* @internal
|
|
218
219
|
*/
|
|
219
220
|
this.selectedEvent = null;
|
|
221
|
+
/**
|
|
222
|
+
* Whether the popover's Delete was pressed once and now waits for its
|
|
223
|
+
* confirmation. Reset on every {@link openEventPopover}.
|
|
224
|
+
* @internal
|
|
225
|
+
*/
|
|
226
|
+
this.confirmingDelete = false;
|
|
227
|
+
/**
|
|
228
|
+
* Whether the drawer or modal footer's Delete was pressed once and now
|
|
229
|
+
* waits for its confirmation. Reset whenever the editor opens.
|
|
230
|
+
* @internal
|
|
231
|
+
*/
|
|
232
|
+
this.confirmingEditorDelete = false;
|
|
220
233
|
/** @private */
|
|
221
234
|
this.handleMobileMediaChange = (event) => {
|
|
222
235
|
this.isMobile = event.matches;
|
|
@@ -345,8 +358,17 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
345
358
|
this.openEditEditor(event);
|
|
346
359
|
}
|
|
347
360
|
};
|
|
348
|
-
/**
|
|
361
|
+
/**
|
|
362
|
+
* Swaps the popover's actions for the delete confirmation, moving focus
|
|
363
|
+
* onto its Cancel button since the pressed Delete button goes away.
|
|
364
|
+
* @private
|
|
365
|
+
*/
|
|
349
366
|
this.handlePopoverDelete = () => {
|
|
367
|
+
this.confirmingDelete = true;
|
|
368
|
+
void this.updateComplete.then(() => this.focusPopoverButton("#event-popover-confirm-cancel"));
|
|
369
|
+
};
|
|
370
|
+
/** @private */
|
|
371
|
+
this.handlePopoverConfirmDelete = () => {
|
|
350
372
|
const event = this.selectedEvent;
|
|
351
373
|
this.closeEventPopover();
|
|
352
374
|
if (event) {
|
|
@@ -354,6 +376,11 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
354
376
|
}
|
|
355
377
|
};
|
|
356
378
|
/** @private */
|
|
379
|
+
this.handlePopoverCancelDelete = () => {
|
|
380
|
+
this.confirmingDelete = false;
|
|
381
|
+
void this.updateComplete.then(() => this.focusPopoverButton("#event-popover-delete"));
|
|
382
|
+
};
|
|
383
|
+
/** @private */
|
|
357
384
|
this.handlePopoverClose = () => {
|
|
358
385
|
this.closeEventPopover();
|
|
359
386
|
};
|
|
@@ -393,8 +420,8 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
393
420
|
this.closeEditor();
|
|
394
421
|
};
|
|
395
422
|
/** @private */
|
|
396
|
-
this.handleEditorInput = () => {
|
|
397
|
-
this.editorDirty =
|
|
423
|
+
this.handleEditorInput = (event) => {
|
|
424
|
+
this.editorDirty = event.currentTarget.dirty;
|
|
398
425
|
};
|
|
399
426
|
/**
|
|
400
427
|
* Drives the drawer's Save button — the drawer's own footer holds the
|
|
@@ -434,21 +461,44 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
434
461
|
this.handleModalCancel = () => {
|
|
435
462
|
this.closeEditor();
|
|
436
463
|
};
|
|
464
|
+
/**
|
|
465
|
+
* Swaps the open footer for the delete confirmation, moving focus onto
|
|
466
|
+
* its Cancel button since the pressed Delete button goes away.
|
|
467
|
+
* @private
|
|
468
|
+
*/
|
|
469
|
+
this.handleEditorDeleteClick = () => {
|
|
470
|
+
this.confirmingEditorDelete = true;
|
|
471
|
+
void this.updateComplete.then(() => this.focusOpenFooterButton(".editor-confirm-cancel"));
|
|
472
|
+
};
|
|
473
|
+
/** @private */
|
|
474
|
+
this.handleEditorCancelDelete = () => {
|
|
475
|
+
this.confirmingEditorDelete = false;
|
|
476
|
+
void this.updateComplete.then(() => this.focusOpenFooterButton(".editor-delete"));
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* The range currently visible for {@link view} and {@link displayedDate},
|
|
481
|
+
* the same one `eunperiodchange` reports. In `month` view, it covers the
|
|
482
|
+
* whole 6-week grid, leading and trailing days included.
|
|
483
|
+
*/
|
|
484
|
+
get visibleRange() {
|
|
485
|
+
return getVisibleRange(this.view, this.displayedDate, this.weekStartsOn);
|
|
437
486
|
}
|
|
438
487
|
/**
|
|
439
488
|
* Re-dispatches `eunperiodchange` whenever the visible period changes —
|
|
440
489
|
* `view`/`displayedDate` are otherwise entirely self-managed (nav
|
|
441
490
|
* buttons, swipe, view switch) but always overridable from outside.
|
|
491
|
+
* Skipped on the first update, same as `eun-calendar` : {@link
|
|
492
|
+
* visibleRange} gives the initial range instead.
|
|
442
493
|
*
|
|
443
494
|
* @param changed the changed properties.
|
|
444
495
|
*/
|
|
445
496
|
updated(changed) {
|
|
446
497
|
super.updated(changed);
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
this.dispatchEvent(new PeriodChangeEvent(this.view, range.start, range.end));
|
|
498
|
+
const periodChanged = ["view", "displayedDate", "weekStartsOn"].some((key) => changed.has(key) && changed.get(key) !== undefined);
|
|
499
|
+
if (periodChanged) {
|
|
500
|
+
const range = this.visibleRange;
|
|
501
|
+
this.dispatchEvent(new PeriodChangeEvent(this.view, range.start, range.end, this.displayedDate));
|
|
452
502
|
}
|
|
453
503
|
}
|
|
454
504
|
/**
|
|
@@ -484,6 +534,14 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
484
534
|
navigate(direction) {
|
|
485
535
|
this.displayedDate = addPeriod(this.view, this.displayedDate, direction);
|
|
486
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* The end a new event starting at `start` is seeded with, one
|
|
539
|
+
* {@link slotDuration} later.
|
|
540
|
+
* @private
|
|
541
|
+
*/
|
|
542
|
+
defaultCreateEnd(start) {
|
|
543
|
+
return new Date(start.getTime() + this.slotDuration * 60_000);
|
|
544
|
+
}
|
|
487
545
|
/**
|
|
488
546
|
* Opens the editor in "create" mode, seeded at `start`.
|
|
489
547
|
* @private
|
|
@@ -494,7 +552,7 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
494
552
|
}
|
|
495
553
|
this.editingEvent = null;
|
|
496
554
|
this.createStart = start;
|
|
497
|
-
this.createEnd =
|
|
555
|
+
this.createEnd = this.defaultCreateEnd(start);
|
|
498
556
|
this.openEditorSurface();
|
|
499
557
|
}
|
|
500
558
|
/**
|
|
@@ -519,6 +577,7 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
519
577
|
*/
|
|
520
578
|
openEventPopover(event, anchor) {
|
|
521
579
|
this.selectedEvent = event;
|
|
580
|
+
this.confirmingDelete = false;
|
|
522
581
|
this.popoverTriggerEl = anchor;
|
|
523
582
|
void this.updateComplete.then(() => {
|
|
524
583
|
const popover = this.eventPopoverEl;
|
|
@@ -626,8 +685,13 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
626
685
|
});
|
|
627
686
|
}
|
|
628
687
|
/** @private */
|
|
688
|
+
focusPopoverButton(selector) {
|
|
689
|
+
this.eventPopoverEl?.querySelector(selector)?.focus();
|
|
690
|
+
}
|
|
691
|
+
/** @private */
|
|
629
692
|
openEditorSurface() {
|
|
630
693
|
this.editorDirty = false;
|
|
694
|
+
this.confirmingEditorDelete = false;
|
|
631
695
|
if (this.isMobile) {
|
|
632
696
|
this.isModalOpen = true;
|
|
633
697
|
}
|
|
@@ -642,6 +706,73 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
642
706
|
this.editingEvent = null;
|
|
643
707
|
this.editorDirty = false;
|
|
644
708
|
}
|
|
709
|
+
/**
|
|
710
|
+
* Renders the drawer or modal footer : Delete/Cancel/Apply, or the delete
|
|
711
|
+
* confirmation that replaces them once Delete was pressed, same as the
|
|
712
|
+
* event popover. Apply stays disabled while an edited event has no
|
|
713
|
+
* changes.
|
|
714
|
+
* @private
|
|
715
|
+
*/
|
|
716
|
+
renderEditorFooter(onSave, onCancel, onDelete) {
|
|
717
|
+
const deleteLabel = this.deleteLabel ?? this.dictionary.common.delete;
|
|
718
|
+
const cancelLabel = this.cancelLabel ?? this.dictionary.common.cancel;
|
|
719
|
+
if (this.confirmingEditorDelete) {
|
|
720
|
+
return html `
|
|
721
|
+
<span class="editor-confirm-text"
|
|
722
|
+
>${this.deleteConfirmLabel ??
|
|
723
|
+
this.dictionary.scheduler.deleteConfirm}</span
|
|
724
|
+
>
|
|
725
|
+
<eun-button
|
|
726
|
+
class="editor-confirm-cancel"
|
|
727
|
+
appearance="ghost"
|
|
728
|
+
@click=${this.handleEditorCancelDelete}
|
|
729
|
+
>${cancelLabel}</eun-button
|
|
730
|
+
>
|
|
731
|
+
<eun-button
|
|
732
|
+
class="editor-confirm-delete"
|
|
733
|
+
color="critical"
|
|
734
|
+
@click=${() => {
|
|
735
|
+
this.confirmingEditorDelete = false;
|
|
736
|
+
onDelete();
|
|
737
|
+
}}
|
|
738
|
+
>${deleteLabel}</eun-button
|
|
739
|
+
>
|
|
740
|
+
`;
|
|
741
|
+
}
|
|
742
|
+
return html `
|
|
743
|
+
${this.editingEvent
|
|
744
|
+
? html `<eun-button
|
|
745
|
+
class="editor-delete"
|
|
746
|
+
color="critical"
|
|
747
|
+
appearance="outline"
|
|
748
|
+
@click=${this.handleEditorDeleteClick}
|
|
749
|
+
>${deleteLabel}</eun-button
|
|
750
|
+
>`
|
|
751
|
+
: nothing}
|
|
752
|
+
<span style="flex: 1 1 auto;"></span>
|
|
753
|
+
<eun-button appearance="ghost" @click=${onCancel}
|
|
754
|
+
>${cancelLabel}</eun-button
|
|
755
|
+
>
|
|
756
|
+
<eun-button
|
|
757
|
+
class="editor-apply"
|
|
758
|
+
color="primary"
|
|
759
|
+
?disabled=${!!this.editingEvent && !this.editorDirty}
|
|
760
|
+
@click=${onSave}
|
|
761
|
+
>${this.applyLabel ?? this.dictionary.common.apply}</eun-button
|
|
762
|
+
>
|
|
763
|
+
`;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Focuses `selector` inside whichever editor surface is open, the drawer
|
|
767
|
+
* and the modal rendering the same footer.
|
|
768
|
+
* @private
|
|
769
|
+
*/
|
|
770
|
+
focusOpenFooterButton(selector) {
|
|
771
|
+
const surface = this.isModalOpen ? "#modal" : "#drawer";
|
|
772
|
+
this.shadowRoot
|
|
773
|
+
?.querySelector(`${surface} ${selector}`)
|
|
774
|
+
?.focus();
|
|
775
|
+
}
|
|
645
776
|
/**
|
|
646
777
|
* The prev/today/next navigation cluster, shared verbatim between the
|
|
647
778
|
* desktop header (inside `#header-nav`) and the mobile one (inside
|
|
@@ -697,12 +828,12 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
697
828
|
`;
|
|
698
829
|
}
|
|
699
830
|
render() {
|
|
700
|
-
const range =
|
|
831
|
+
const range = this.visibleRange;
|
|
701
832
|
return html `
|
|
702
833
|
<div id="header">
|
|
703
834
|
<div id="header-nav">
|
|
704
835
|
<span id="period-label" role="status" aria-live="polite">
|
|
705
|
-
${formatPeriodLabel(this.view, this.displayedDate, range.start, range.end, this.
|
|
836
|
+
${formatPeriodLabel(this.view, this.displayedDate, range.start, range.end, this.resolvedLocale)}
|
|
706
837
|
</span>
|
|
707
838
|
${!this.isMobile ? this.renderNavArrows() : nothing}
|
|
708
839
|
</div>
|
|
@@ -770,6 +901,8 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
770
901
|
<eun-drawer
|
|
771
902
|
id="drawer"
|
|
772
903
|
position="end"
|
|
904
|
+
closeable
|
|
905
|
+
close-on-backdrop
|
|
773
906
|
heading=${this.editingEvent
|
|
774
907
|
? this.editingEvent.title
|
|
775
908
|
: (this.newEventLabel ?? this.dictionary.scheduler.newEvent)}
|
|
@@ -791,27 +924,14 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
791
924
|
@input=${this.handleEditorInput}
|
|
792
925
|
></eun-scheduler-event-editor>
|
|
793
926
|
<div slot="footer" style="display: contents">
|
|
794
|
-
${this.
|
|
795
|
-
? html `<eun-button
|
|
796
|
-
color="critical"
|
|
797
|
-
appearance="outline"
|
|
798
|
-
@click=${this.handleDrawerDelete}
|
|
799
|
-
>${this.deleteLabel ??
|
|
800
|
-
this.dictionary.common.delete}</eun-button
|
|
801
|
-
>`
|
|
802
|
-
: nothing}
|
|
803
|
-
<span style="flex: 1 1 auto;"></span>
|
|
804
|
-
<eun-button appearance="ghost" @click=${this.handleDrawerCancel}
|
|
805
|
-
>${this.cancelLabel ?? this.dictionary.common.cancel}</eun-button
|
|
806
|
-
>
|
|
807
|
-
<eun-button color="primary" @click=${this.handleDrawerSave}
|
|
808
|
-
>${this.applyLabel ?? this.dictionary.common.apply}</eun-button
|
|
809
|
-
>
|
|
927
|
+
${this.renderEditorFooter(this.handleDrawerSave, this.handleDrawerCancel, this.handleDrawerDelete)}
|
|
810
928
|
</div>
|
|
811
929
|
</eun-drawer>
|
|
812
930
|
|
|
813
931
|
<eun-modal
|
|
814
932
|
id="modal"
|
|
933
|
+
closeable
|
|
934
|
+
close-on-backdrop
|
|
815
935
|
heading=${this.editingEvent
|
|
816
936
|
? this.editingEvent.title
|
|
817
937
|
: (this.newEventLabel ?? this.dictionary.scheduler.newEvent)}
|
|
@@ -829,21 +949,10 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
829
949
|
@euneventcreate=${this.handleEditorCreate}
|
|
830
950
|
@euneventupdate=${this.handleEditorUpdate}
|
|
831
951
|
@euneventdelete=${this.handleEditorDelete}
|
|
952
|
+
@input=${this.handleEditorInput}
|
|
832
953
|
></eun-scheduler-event-editor>
|
|
833
954
|
<div slot="footer">
|
|
834
|
-
${this.
|
|
835
|
-
? html `<eun-button color="critical" @click=${this.handleModalDelete}
|
|
836
|
-
>${this.deleteLabel ??
|
|
837
|
-
this.dictionary.common.delete}</eun-button
|
|
838
|
-
>`
|
|
839
|
-
: nothing}
|
|
840
|
-
<span style="flex: 1 1 auto;"></span>
|
|
841
|
-
<eun-button color="secondary" @click=${this.handleModalCancel}
|
|
842
|
-
>${this.cancelLabel ?? this.dictionary.common.cancel}</eun-button
|
|
843
|
-
>
|
|
844
|
-
<eun-button color="primary" @click=${this.handleModalSave}
|
|
845
|
-
>${this.applyLabel ?? this.dictionary.common.apply}</eun-button
|
|
846
|
-
>
|
|
955
|
+
${this.renderEditorFooter(this.handleModalSave, this.handleModalCancel, this.handleModalDelete)}
|
|
847
956
|
</div>
|
|
848
957
|
</eun-modal>
|
|
849
958
|
|
|
@@ -851,14 +960,21 @@ let EunomiaScheduler = class EunomiaScheduler extends LocalizableMixin(AnchorPos
|
|
|
851
960
|
${this.selectedEvent
|
|
852
961
|
? renderEventPopover({
|
|
853
962
|
event: this.selectedEvent,
|
|
854
|
-
locale: this.
|
|
963
|
+
locale: this.resolvedLocale,
|
|
855
964
|
editLabel: this.editLabel ?? this.dictionary.common.edit,
|
|
856
965
|
deleteLabel: this.deleteLabel ?? this.dictionary.common.delete,
|
|
966
|
+
deleteConfirmLabel: this.deleteConfirmLabel ??
|
|
967
|
+
this.dictionary.scheduler.deleteConfirm,
|
|
968
|
+
cancelLabel: this.cancelLabel ?? this.dictionary.common.cancel,
|
|
857
969
|
closeLabel: this.closeLabel ?? this.dictionary.common.close,
|
|
970
|
+
allDayLabel: this.dictionary.schedulerEventEditor.allDay,
|
|
858
971
|
priorityLabels: this.dictionary.scheduler.priorities,
|
|
859
972
|
readonly: this.readonly,
|
|
973
|
+
confirmingDelete: this.confirmingDelete,
|
|
860
974
|
onEdit: this.handlePopoverEdit,
|
|
861
975
|
onDelete: this.handlePopoverDelete,
|
|
976
|
+
onConfirmDelete: this.handlePopoverConfirmDelete,
|
|
977
|
+
onCancelDelete: this.handlePopoverCancelDelete,
|
|
862
978
|
onClose: this.handlePopoverClose,
|
|
863
979
|
})
|
|
864
980
|
: nothing}
|
|
@@ -957,6 +1073,9 @@ __decorate([
|
|
|
957
1073
|
__decorate([
|
|
958
1074
|
property({ attribute: "delete-label" })
|
|
959
1075
|
], EunomiaScheduler.prototype, "deleteLabel", void 0);
|
|
1076
|
+
__decorate([
|
|
1077
|
+
property({ attribute: "delete-confirm-label" })
|
|
1078
|
+
], EunomiaScheduler.prototype, "deleteConfirmLabel", void 0);
|
|
960
1079
|
__decorate([
|
|
961
1080
|
property({ attribute: "edit-label" })
|
|
962
1081
|
], EunomiaScheduler.prototype, "editLabel", void 0);
|
|
@@ -999,6 +1118,12 @@ __decorate([
|
|
|
999
1118
|
__decorate([
|
|
1000
1119
|
state()
|
|
1001
1120
|
], EunomiaScheduler.prototype, "selectedEvent", void 0);
|
|
1121
|
+
__decorate([
|
|
1122
|
+
state()
|
|
1123
|
+
], EunomiaScheduler.prototype, "confirmingDelete", void 0);
|
|
1124
|
+
__decorate([
|
|
1125
|
+
state()
|
|
1126
|
+
], EunomiaScheduler.prototype, "confirmingEditorDelete", void 0);
|
|
1002
1127
|
__decorate([
|
|
1003
1128
|
query("#event-popover")
|
|
1004
1129
|
], EunomiaScheduler.prototype, "eventPopoverEl", void 0);
|
|
@@ -10,6 +10,12 @@ import { css } from "lit";
|
|
|
10
10
|
* [--scheduler-background] - Set a custom background color
|
|
11
11
|
*/
|
|
12
12
|
const base = css `
|
|
13
|
+
.editor-confirm-text {
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
align-self: center;
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
:host {
|
|
14
20
|
display: block;
|
|
15
21
|
box-sizing: border-box;
|
|
@@ -41,11 +41,11 @@ export type EunomiaSchedulerEventCardDirection = "row" | "column";
|
|
|
41
41
|
* @prop {string} label - The event's title
|
|
42
42
|
* @prop {Date} start - The event's start time, shown as the chip's compact time label
|
|
43
43
|
* @prop {Date} [end] - The event's end time. Used only to build a fuller accessible name, such as "Team sync, 9:00 AM to 10:00 AM", never shown visually on the chip
|
|
44
|
-
* @prop {string} [color='blue'] - The event's accent color :
|
|
44
|
+
* @prop {string} [color='blue'] - The event's accent color : a hex string, where each of the six preset hex values (red #f14959, purple #9562e3, yellow #f0f050, blue #3bb3b9, green #49f15f, pink #d05df3) keeps its own tuned two-tone CSS, or a preset name as an alias of its hex. A #rgb or rgb() color is accepted too. Any other value falls back to blue with a console warning
|
|
45
45
|
* @prop {'default' | 'transparent' | 'ghost'} [appearance='default'] - How the chip's surface is drawn
|
|
46
46
|
* @prop {'row' | 'column'} [direction='column'] - Column stacks the title above the time as two lines. Row lays them out side by side on one line instead, the title truncating with an ellipsis while the time never does, for the month view's single-day chips on desktop, where a cell is wide but not tall
|
|
47
47
|
* @attr {'row' | 'column'} [direction='column'] - Column stacks the title above the time as two lines. Row lays them out side by side on one line instead
|
|
48
|
-
* @prop {string} [locale] - The locale used to format the time label. Defaults to the
|
|
48
|
+
* @prop {string} [locale] - The locale used to format the time label. Defaults to the one set with setDefaultLocale, English otherwise
|
|
49
49
|
* @prop {boolean} [hideTime=false] - Hides the visual time line, showing only the title. The accessible name still includes the time
|
|
50
50
|
* @attr {boolean} [hide-time=false] - Hides the visual time line, showing only the title
|
|
51
51
|
* @fires click - The native click event, fired on mouse or touch activation, or Enter or Space
|
|
@@ -89,13 +89,15 @@ export declare class EunomiaSchedulerEventCard extends LitElement {
|
|
|
89
89
|
*/
|
|
90
90
|
color: EunomiaSchedulerEventColor;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* pair per name, not derivable from one hex value alone) — see
|
|
95
|
-
* {@link updated} below.
|
|
92
|
+
* Configuration options for the component Shadow DOM : delegates focus,
|
|
93
|
+
* so `focus()` on the host lands on the inner button.
|
|
96
94
|
* @internal
|
|
97
95
|
*/
|
|
98
|
-
|
|
96
|
+
static readonly shadowRootOptions: {
|
|
97
|
+
delegatesFocus: boolean;
|
|
98
|
+
mode: ShadowRootMode;
|
|
99
|
+
slotAssignment?: SlotAssignmentMode | undefined;
|
|
100
|
+
};
|
|
99
101
|
/**
|
|
100
102
|
* How the chip's surface is drawn.
|
|
101
103
|
* @default default
|
|
@@ -111,8 +113,8 @@ export declare class EunomiaSchedulerEventCard extends LitElement {
|
|
|
111
113
|
*/
|
|
112
114
|
direction: EunomiaSchedulerEventCardDirection;
|
|
113
115
|
/**
|
|
114
|
-
* The locale used to format the time label ; defaults to the
|
|
115
|
-
*
|
|
116
|
+
* The locale used to format the time label ; defaults to the one set
|
|
117
|
+
* with `setDefaultLocale()`, English otherwise.
|
|
116
118
|
*/
|
|
117
119
|
locale?: string;
|
|
118
120
|
/**
|
|
@@ -123,17 +125,13 @@ export declare class EunomiaSchedulerEventCard extends LitElement {
|
|
|
123
125
|
hideTime: boolean;
|
|
124
126
|
/**
|
|
125
127
|
* Lifecycle hook called whenever reactive properties change.
|
|
126
|
-
* Drives `--_accent`/`--_tintBase` inline
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* flattens what the six presets each render as two distinct tuned
|
|
134
|
-
* shades (a lighter tint base, a darker accent) down to one, since
|
|
135
|
-
* there's no single "correct" way to derive a second shade from an
|
|
136
|
-
* arbitrary color the way the presets were hand-picked to.
|
|
128
|
+
* Drives `--_accent`/`--_tintBase` inline from {@link resolveEventColor} :
|
|
129
|
+
* a preset name or its hex gets the preset's two tuned token shades,
|
|
130
|
+
* which is what the attribute selectors in `scheduler-event.styles.ts`
|
|
131
|
+
* also give a preset name before the upgrade. Any other hex drives both
|
|
132
|
+
* from that one value, a deliberate simplification since there's no
|
|
133
|
+
* single "correct" way to derive a second shade from an arbitrary
|
|
134
|
+
* color. An invalid value warns and falls back to blue.
|
|
137
135
|
*
|
|
138
136
|
* @param changedProperties - Map of changed properties
|
|
139
137
|
*/
|
|
@@ -4,11 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var EunomiaSchedulerEventCard_1;
|
|
8
7
|
import { customElement, property } from "lit/decorators.js";
|
|
9
8
|
import { html, LitElement } from "lit";
|
|
10
9
|
import { schedulerEventStyles } from "./scheduler-event.styles.js";
|
|
11
|
-
import { formatEventChipTime } from "../shared/scheduler.utils.js";
|
|
10
|
+
import { formatEventChipTime, resolveEventColor, } from "../shared/scheduler.utils.js";
|
|
11
|
+
import { getDefaultLocale } from "../../../i18n/index.js";
|
|
12
12
|
/**
|
|
13
13
|
* Tag name of the scheduler event chip component.
|
|
14
14
|
*/
|
|
@@ -40,11 +40,11 @@ export const EunomiaSchedulerEventCardTagName = "eun-scheduler-event";
|
|
|
40
40
|
* @prop {string} label - The event's title
|
|
41
41
|
* @prop {Date} start - The event's start time, shown as the chip's compact time label
|
|
42
42
|
* @prop {Date} [end] - The event's end time. Used only to build a fuller accessible name, such as "Team sync, 9:00 AM to 10:00 AM", never shown visually on the chip
|
|
43
|
-
* @prop {string} [color='blue'] - The event's accent color :
|
|
43
|
+
* @prop {string} [color='blue'] - The event's accent color : a hex string, where each of the six preset hex values (red #f14959, purple #9562e3, yellow #f0f050, blue #3bb3b9, green #49f15f, pink #d05df3) keeps its own tuned two-tone CSS, or a preset name as an alias of its hex. A #rgb or rgb() color is accepted too. Any other value falls back to blue with a console warning
|
|
44
44
|
* @prop {'default' | 'transparent' | 'ghost'} [appearance='default'] - How the chip's surface is drawn
|
|
45
45
|
* @prop {'row' | 'column'} [direction='column'] - Column stacks the title above the time as two lines. Row lays them out side by side on one line instead, the title truncating with an ellipsis while the time never does, for the month view's single-day chips on desktop, where a cell is wide but not tall
|
|
46
46
|
* @attr {'row' | 'column'} [direction='column'] - Column stacks the title above the time as two lines. Row lays them out side by side on one line instead
|
|
47
|
-
* @prop {string} [locale] - The locale used to format the time label. Defaults to the
|
|
47
|
+
* @prop {string} [locale] - The locale used to format the time label. Defaults to the one set with setDefaultLocale, English otherwise
|
|
48
48
|
* @prop {boolean} [hideTime=false] - Hides the visual time line, showing only the title. The accessible name still includes the time
|
|
49
49
|
* @attr {boolean} [hide-time=false] - Hides the visual time line, showing only the title
|
|
50
50
|
* @fires click - The native click event, fired on mouse or touch activation, or Enter or Space
|
|
@@ -60,7 +60,7 @@ export const EunomiaSchedulerEventCardTagName = "eun-scheduler-event";
|
|
|
60
60
|
* @cssprop [--scheduler-event-time-color] - Sets the time text color
|
|
61
61
|
* @element eun-scheduler-event
|
|
62
62
|
*/
|
|
63
|
-
let EunomiaSchedulerEventCard =
|
|
63
|
+
let EunomiaSchedulerEventCard = class EunomiaSchedulerEventCard extends LitElement {
|
|
64
64
|
constructor() {
|
|
65
65
|
super(...arguments);
|
|
66
66
|
/**
|
|
@@ -99,17 +99,13 @@ let EunomiaSchedulerEventCard = EunomiaSchedulerEventCard_1 = class EunomiaSched
|
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Lifecycle hook called whenever reactive properties change.
|
|
102
|
-
* Drives `--_accent`/`--_tintBase` inline
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* flattens what the six presets each render as two distinct tuned
|
|
110
|
-
* shades (a lighter tint base, a darker accent) down to one, since
|
|
111
|
-
* there's no single "correct" way to derive a second shade from an
|
|
112
|
-
* arbitrary color the way the presets were hand-picked to.
|
|
102
|
+
* Drives `--_accent`/`--_tintBase` inline from {@link resolveEventColor} :
|
|
103
|
+
* a preset name or its hex gets the preset's two tuned token shades,
|
|
104
|
+
* which is what the attribute selectors in `scheduler-event.styles.ts`
|
|
105
|
+
* also give a preset name before the upgrade. Any other hex drives both
|
|
106
|
+
* from that one value, a deliberate simplification since there's no
|
|
107
|
+
* single "correct" way to derive a second shade from an arbitrary
|
|
108
|
+
* color. An invalid value warns and falls back to blue.
|
|
113
109
|
*
|
|
114
110
|
* @param changedProperties - Map of changed properties
|
|
115
111
|
*/
|
|
@@ -118,23 +114,24 @@ let EunomiaSchedulerEventCard = EunomiaSchedulerEventCard_1 = class EunomiaSched
|
|
|
118
114
|
if (!changedProperties.has("color")) {
|
|
119
115
|
return;
|
|
120
116
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.style.setProperty("--_accent", this.color);
|
|
127
|
-
this.style.setProperty("--_tintBase", this.color);
|
|
117
|
+
let resolved = resolveEventColor(this.color);
|
|
118
|
+
if (!resolved) {
|
|
119
|
+
console.warn(`<${this.localName}>: color "${this.color}" is neither a preset ` +
|
|
120
|
+
"name nor a color, falling back to blue.", this);
|
|
121
|
+
resolved = resolveEventColor("blue");
|
|
128
122
|
}
|
|
123
|
+
this.style.setProperty("--_accent", resolved.accent);
|
|
124
|
+
this.style.setProperty("--_tintBase", resolved.tint);
|
|
129
125
|
}
|
|
130
126
|
/**
|
|
131
127
|
* Renders the chip template.
|
|
132
128
|
* @returns The rendered HTML template
|
|
133
129
|
*/
|
|
134
130
|
render() {
|
|
135
|
-
const
|
|
131
|
+
const locale = this.locale ?? getDefaultLocale();
|
|
132
|
+
const time = formatEventChipTime(this.start, locale);
|
|
136
133
|
const accessibleName = this.end
|
|
137
|
-
? `${this.label}, ${time} – ${this.end.toLocaleTimeString(
|
|
134
|
+
? `${this.label}, ${time} – ${this.end.toLocaleTimeString(locale, { hour: "numeric", minute: "2-digit" })}`
|
|
138
135
|
: `${this.label}, ${time}`;
|
|
139
136
|
return html `
|
|
140
137
|
<button type="button" id="chip" aria-label=${accessibleName}>
|
|
@@ -158,20 +155,14 @@ let EunomiaSchedulerEventCard = EunomiaSchedulerEventCard_1 = class EunomiaSched
|
|
|
158
155
|
*/
|
|
159
156
|
EunomiaSchedulerEventCard.styles = schedulerEventStyles;
|
|
160
157
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* pair per name, not derivable from one hex value alone) — see
|
|
164
|
-
* {@link updated} below.
|
|
158
|
+
* Configuration options for the component Shadow DOM : delegates focus,
|
|
159
|
+
* so `focus()` on the host lands on the inner button.
|
|
165
160
|
* @internal
|
|
166
161
|
*/
|
|
167
|
-
EunomiaSchedulerEventCard.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"blue",
|
|
172
|
-
"green",
|
|
173
|
-
"pink",
|
|
174
|
-
]);
|
|
162
|
+
EunomiaSchedulerEventCard.shadowRootOptions = {
|
|
163
|
+
...LitElement.shadowRootOptions,
|
|
164
|
+
delegatesFocus: true,
|
|
165
|
+
};
|
|
175
166
|
__decorate([
|
|
176
167
|
property()
|
|
177
168
|
], EunomiaSchedulerEventCard.prototype, "label", void 0);
|
|
@@ -196,7 +187,7 @@ __decorate([
|
|
|
196
187
|
__decorate([
|
|
197
188
|
property({ type: Boolean, reflect: true, attribute: "hide-time" })
|
|
198
189
|
], EunomiaSchedulerEventCard.prototype, "hideTime", void 0);
|
|
199
|
-
EunomiaSchedulerEventCard =
|
|
190
|
+
EunomiaSchedulerEventCard = __decorate([
|
|
200
191
|
customElement(EunomiaSchedulerEventCardTagName)
|
|
201
192
|
], EunomiaSchedulerEventCard);
|
|
202
193
|
export { EunomiaSchedulerEventCard };
|
|
@@ -102,7 +102,7 @@ const base = css `
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
#chip:focus-visible {
|
|
105
|
-
outline-color: var(--_accent);
|
|
105
|
+
outline-color: var(--scheduler-focus-outline-color, var(--_accent));
|
|
106
106
|
outline-offset: 1px;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -160,7 +160,7 @@ const base = css `
|
|
|
160
160
|
white-space: nowrap;
|
|
161
161
|
color: var(
|
|
162
162
|
--scheduler-event-time-color,
|
|
163
|
-
var(--eun-text-secondary, #
|
|
163
|
+
var(--eun-text-secondary, #666e8a)
|
|
164
164
|
);
|
|
165
165
|
font-size: 11px;
|
|
166
166
|
line-height: 1.3;
|