@globalpayments/vega 2.16.0 → 2.17.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/dist/cjs/{app-globals-5e074c5e.js → app-globals-4e0416c1.js} +2 -2
- package/dist/cjs/{childNodesEventPreventSlimmer-7e1895d7.js → childNodesEventPreventSlimmer-6848c3cf.js} +1 -1
- package/dist/cjs/{eventEmitSlimmer-ea57144a.js → eventEmitSlimmer-1d70a720.js} +1 -1
- package/dist/cjs/{formFieldControllerSlimmer-9271a8b8.js → formFieldControllerSlimmer-8b54f14d.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{internalVegaEventManager-543c20cb.js → internalVegaEventManager-743a124d.js} +2 -2
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{subStateObserverSlimmer-48ad20a1.js → subStateObserverSlimmer-60e4d6da.js} +28 -14
- package/dist/cjs/vega-accordion.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-group_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +57 -12
- package/dist/cjs/vega-calendar_2.cjs.entry.js +830 -90
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +308 -183
- package/dist/cjs/vega-field-label.cjs.entry.js +4 -4
- package/dist/cjs/vega-form.cjs.entry.js +6 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-select.cjs.entry.js +168 -58
- package/dist/cjs/vega-input.cjs.entry.js +5 -5
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +4 -4
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +7 -7
- package/dist/cjs/{vega-skeleton-loader-controller-bac82c82.js → vega-skeleton-loader-controller-8932c0ed.js} +3 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_8.cjs.entry.js +6 -6
- package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega.cjs.js +5 -5
- package/dist/cjs/{vegaEventId-d7774262.js → vegaEventId-f375a6a3.js} +2 -0
- package/dist/cjs/{vegaInternalEventId-173c4941.js → vegaInternalEventId-ac38dd4b.js} +2 -0
- package/dist/collection/components/vega-button/slimmers/renderers/vega-button-loading-renderer.js +24 -0
- package/dist/collection/components/vega-button/vega-button.css +9 -1
- package/dist/collection/components/vega-button/vega-button.js +49 -7
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-current-period-controller.js +38 -24
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-controller.js +54 -1
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-view-controller.js +13 -21
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/baseRepeatPattern.js +61 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventDailyRepeatPattern.js +70 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventMonthlyRepeatPattern.js +90 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventRepeatPatternFactory.js +60 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventWeeklyRepeatPattern.js +163 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventYearlyRepeatPattern.js +92 -0
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/test/calendarEventRepeatPatternFactory.test.js +105 -0
- package/dist/collection/components/vega-calendar/slimmers/common/layout/test/longEventLayoutGenerator.test.js +0 -5
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/layout/test/dayViewEventLayoutGenerator.test.js +0 -5
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +21 -4
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +45 -2
- package/dist/collection/components/vega-calendar/vega-calendar.css +0 -1
- package/dist/collection/components/vega-calendar/vega-calendar.js +51 -4
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +0 -4
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-children-controller.js +14 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.js +142 -0
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +16 -50
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.js +6 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/controllers/vega-dropdown-item-state-controller.js +1 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +7 -5
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +5 -2
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.js +23 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.js +62 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +11 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +7 -10
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +18 -2
- package/dist/collection/components/vega-input-select/vega-input-select.js +5 -0
- package/dist/collection/components/vega-loading-indicator/vega-loading-indicator.js +2 -2
- package/dist/collection/constants/ui.js +1 -1
- package/dist/collection/helpers/calendar/calendar-date.js +11 -0
- package/dist/collection/helpers/calendar/calendar-event.js +73 -24
- package/dist/collection/helpers/calendar/calendar-period/calendar-period.abstract.js +8 -0
- package/dist/collection/helpers/calendar/calendar-period/day-period.js +1 -0
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +16 -3
- package/dist/collection/helpers/calendar/calendar-period/week-period.js +1 -0
- package/dist/collection/helpers/calendar/test/calendar-event.test.js +23 -20
- package/dist/collection/helpers/event-manager/eventID/componentEventIdMap.js +2 -2
- package/dist/collection/helpers/event-manager/eventID/vegaEventId.js +1 -1
- package/dist/collection/helpers/event-manager/eventID/vegaInternalEventId.js +1 -0
- package/dist/collection/helpers/slimmers/sub-state/subStateObserverSlimmer.js +27 -13
- package/dist/collection/helpers/slimmers/sub-state/test/sub-state-observer-slimmer.test.js +15 -3
- package/dist/collection/helpers/vega-telemetry-helper/test/vegaEnvManager.test.js +1 -1
- package/dist/collection/helpers/vega-telemetry-helper/vegaEnvManager.js +2 -2
- package/dist/esm/{app-globals-032d6105.js → app-globals-ba85a900.js} +2 -2
- package/dist/esm/{childNodesEventPreventSlimmer-b9c50cc4.js → childNodesEventPreventSlimmer-d0da4527.js} +1 -1
- package/dist/esm/{eventEmitSlimmer-9c33f04e.js → eventEmitSlimmer-7b16eef9.js} +1 -1
- package/dist/esm/{formFieldControllerSlimmer-85ff874e.js → formFieldControllerSlimmer-ea050a17.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{internalVegaEventManager-e1501923.js → internalVegaEventManager-71d00966.js} +2 -2
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{subStateObserverSlimmer-354b33f6.js → subStateObserverSlimmer-2a8a615e.js} +28 -14
- package/dist/esm/vega-accordion.entry.js +4 -4
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +4 -4
- package/dist/esm/vega-button-group_2.entry.js +6 -6
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +59 -14
- package/dist/esm/vega-calendar_2.entry.js +830 -90
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-color-picker.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +6 -6
- package/dist/esm/vega-date-picker_2.entry.js +6 -6
- package/dist/esm/vega-dialog_2.entry.js +4 -4
- package/dist/esm/vega-dropdown_5.entry.js +308 -183
- package/dist/esm/vega-field-label.entry.js +4 -4
- package/dist/esm/vega-form.entry.js +6 -6
- package/dist/esm/vega-image-uploader.entry.js +6 -6
- package/dist/esm/vega-input-credit-card.entry.js +6 -6
- package/dist/esm/vega-input-range.entry.js +6 -6
- package/dist/esm/vega-input-select.entry.js +168 -58
- package/dist/esm/vega-input.entry.js +5 -5
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +4 -4
- package/dist/esm/vega-loader-wrapper_2.entry.js +1 -1
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +3 -3
- package/dist/esm/vega-progress-tracker.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +6 -6
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-tile_2.entry.js +7 -7
- package/dist/esm/{vega-skeleton-loader-controller-3f5500e5.js → vega-skeleton-loader-controller-778b12be.js} +3 -3
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_8.entry.js +6 -6
- package/dist/esm/vega-textarea.entry.js +6 -6
- package/dist/esm/vega-time-picker_2.entry.js +6 -6
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega.js +5 -5
- package/dist/esm/{vegaEventId-680887e1.js → vegaEventId-f279bb62.js} +2 -1
- package/dist/esm/{vegaInternalEventId-600b3751.js → vegaInternalEventId-bde5d617.js} +2 -1
- package/dist/types/components/vega-button/slimmers/renderers/vega-button-loading-renderer.d.ts +13 -0
- package/dist/types/components/vega-button/vega-button.d.ts +16 -0
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-current-period-controller.d.ts +12 -9
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-controller.d.ts +20 -0
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-view-controller.d.ts +8 -12
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/baseRepeatPattern.d.ts +50 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventDailyRepeatPattern.d.ts +43 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventMonthlyRepeatPattern.d.ts +55 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventRepeatPatternFactory.d.ts +34 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventWeeklyRepeatPattern.d.ts +99 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/repeatPattern/calendarEventYearlyRepeatPattern.d.ts +57 -0
- package/dist/types/components/vega-calendar/slimmers/common/helpers/test/calendarEventRepeatPatternFactory.test.d.ts +1 -0
- package/dist/types/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.d.ts +8 -0
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +23 -0
- package/dist/types/components/vega-calendar/types.d.ts +14 -2
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +15 -3
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +0 -1
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-children-controller.d.ts +4 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.d.ts +57 -0
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +7 -17
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.d.ts +3 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +2 -1
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.d.ts +2 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.d.ts +19 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +11 -1
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -1
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +6 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +2 -0
- package/dist/types/components.d.ts +17 -1
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/calendar/calendar-date.d.ts +8 -0
- package/dist/types/helpers/calendar/calendar-event.d.ts +44 -2
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +10 -2
- package/dist/types/helpers/calendar/calendar-period/day-period.d.ts +1 -0
- package/dist/types/helpers/calendar/calendar-period/month-period.d.ts +12 -0
- package/dist/types/helpers/calendar/calendar-period/week-period.d.ts +1 -0
- package/dist/types/helpers/event-manager/eventID/vegaEventId.d.ts +1 -1
- package/dist/types/helpers/event-manager/eventID/vegaInternalEventId.d.ts +1 -0
- package/dist/types/helpers/slimmers/sub-state/subStateObserverSlimmer.d.ts +9 -0
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-0f88130f.entry.js → p-0ef3d3fd.entry.js} +1 -1
- package/dist/vega/p-1080d80a.js +1 -0
- package/dist/vega/{p-9d9f7c25.entry.js → p-154a3145.entry.js} +1 -1
- package/dist/vega/{p-cbb90cf6.entry.js → p-1bc3348e.entry.js} +1 -1
- package/dist/vega/{p-86d3e5eb.entry.js → p-255aa39b.entry.js} +1 -1
- package/dist/vega/p-29654e12.entry.js +1 -0
- package/dist/vega/{p-77b39fe7.entry.js → p-2f905e6f.entry.js} +1 -1
- package/dist/vega/p-3490dd8a.entry.js +1 -0
- package/dist/vega/p-3fee5d7e.entry.js +1 -0
- package/dist/vega/p-44f4924b.js +1 -0
- package/dist/vega/p-4546cd3d.entry.js +1 -0
- package/dist/vega/{p-77ff7c72.js → p-5141bcac.js} +1 -1
- package/dist/vega/{p-16608c5a.js → p-51e2c836.js} +1 -1
- package/dist/vega/{p-d7cb0227.entry.js → p-52bf3ce1.entry.js} +1 -1
- package/dist/vega/{p-cd05ab96.entry.js → p-5611cf4c.entry.js} +1 -1
- package/dist/vega/{p-40db8b33.entry.js → p-5e3f5e8e.entry.js} +1 -1
- package/dist/vega/p-642d58ff.js +1 -0
- package/dist/vega/{p-9b5e858e.entry.js → p-6470d034.entry.js} +1 -1
- package/dist/vega/{p-8e63fc54.entry.js → p-6877dc17.entry.js} +1 -1
- package/dist/vega/{p-1dfddf03.entry.js → p-69cf5269.entry.js} +1 -1
- package/dist/vega/{p-21675b8e.entry.js → p-70af1334.entry.js} +1 -1
- package/dist/vega/{p-bd1bc019.entry.js → p-7115c145.entry.js} +1 -1
- package/dist/vega/{p-7d22c459.entry.js → p-795927c4.entry.js} +1 -1
- package/dist/vega/{p-6ad96891.entry.js → p-7c1d2dcf.entry.js} +1 -1
- package/dist/vega/p-7f9cb4c0.entry.js +1 -0
- package/dist/vega/p-82fd348b.entry.js +1 -0
- package/dist/vega/p-8543f9c3.entry.js +1 -0
- package/dist/vega/{p-12e93c00.entry.js → p-8771bf66.entry.js} +1 -1
- package/dist/vega/{p-84787f59.entry.js → p-88cf7e56.entry.js} +1 -1
- package/dist/vega/{p-d7f7e2df.entry.js → p-8e7d6700.entry.js} +1 -1
- package/dist/vega/p-9119ad95.entry.js +1 -0
- package/dist/vega/p-9799f3d8.entry.js +1 -0
- package/dist/vega/{p-61c96c79.entry.js → p-a6c43909.entry.js} +1 -1
- package/dist/vega/{p-ceb5067a.entry.js → p-b23ad436.entry.js} +1 -1
- package/dist/vega/{p-c8e1b56d.entry.js → p-b570e6c7.entry.js} +1 -1
- package/dist/vega/{p-ba37eaad.entry.js → p-b6f68efd.entry.js} +1 -1
- package/dist/vega/{p-25f60a0b.entry.js → p-b8a47375.entry.js} +1 -1
- package/dist/vega/{p-7fd253e0.entry.js → p-b8d45e28.entry.js} +1 -1
- package/dist/vega/{p-9e5f7b82.js → p-bba06111.js} +1 -1
- package/dist/vega/{p-2066e3eb.entry.js → p-c1401fab.entry.js} +1 -1
- package/dist/vega/{p-a9f61d9e.entry.js → p-cafe75e8.entry.js} +1 -1
- package/dist/vega/{p-7d9934ee.entry.js → p-cf40587e.entry.js} +1 -1
- package/dist/vega/{p-7706a169.js → p-d126407a.js} +1 -1
- package/dist/vega/{p-fb34de30.entry.js → p-e373bc4d.entry.js} +1 -1
- package/dist/vega/p-eacf64be.js +1 -0
- package/dist/vega/{p-1d628d23.entry.js → p-ec4afdaa.entry.js} +1 -1
- package/dist/vega/{p-a9d3ea86.js → p-f0330fcc.js} +1 -1
- package/dist/vega/{p-c0ca1a1c.entry.js → p-f8a97354.entry.js} +1 -1
- package/dist/vega/{p-f5d3d49f.entry.js → p-f96ee751.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-1092a8ce.entry.js +0 -1
- package/dist/vega/p-43515fe4.entry.js +0 -1
- package/dist/vega/p-592e755b.entry.js +0 -1
- package/dist/vega/p-76265c0e.entry.js +0 -1
- package/dist/vega/p-9316cd6d.entry.js +0 -1
- package/dist/vega/p-a9c3e9fd.js +0 -1
- package/dist/vega/p-aae8855d.js +0 -1
- package/dist/vega/p-bb845e70.entry.js +0 -1
- package/dist/vega/p-c47d4933.js +0 -1
- package/dist/vega/p-c9f922bf.entry.js +0 -1
- package/dist/vega/p-ca1fae74.entry.js +0 -1
- package/dist/vega/p-eb461dad.entry.js +0 -1
- package/dist/vega/p-f1d8fd1c.js +0 -1
|
@@ -3,24 +3,26 @@ import { s as sanitizeVegaComponent } from './component-40be4402.js';
|
|
|
3
3
|
import { a as MapToComponentField, V as VegaSlimmer, M as MapToComponentMethod, L as LogUtility, I as InjectVegaSlimmer } from './global-slimmer-registry-16fd7452.js';
|
|
4
4
|
import { V as VegaComponentUsageRuntimeMetricsSlimmer, I as InjectVegaGlobalSlimmer } from './componentUsageRuntimeMetrics-4f08dec8.js';
|
|
5
5
|
import { D as DomNodeSubjectObserverFactory, d as domNodeSubjectFactory } from './domNodeSubjectObserverFactory-a764a6df.js';
|
|
6
|
-
import { a as VegaClick, d as VegaChange, e as VegaEventClick } from './vegaEventId-
|
|
6
|
+
import { a as VegaClick, d as VegaChange, e as VegaEventClick, f as VegaDateDblClick } from './vegaEventId-f279bb62.js';
|
|
7
7
|
import { V as VegaInternalIconManager } from './internal-icon-manager-a52b1c10.js';
|
|
8
8
|
import { p as pad } from './date-97fc22a5.js';
|
|
9
|
-
import { c as createEventEmitSlimmer } from './eventEmitSlimmer-
|
|
10
|
-
import { C as ChildNodesEventPreventSlimmer } from './childNodesEventPreventSlimmer-
|
|
11
|
-
import {
|
|
9
|
+
import { c as createEventEmitSlimmer } from './eventEmitSlimmer-7b16eef9.js';
|
|
10
|
+
import { C as ChildNodesEventPreventSlimmer } from './childNodesEventPreventSlimmer-d0da4527.js';
|
|
11
|
+
import { g as VegaInternalCalendarMonthEventsChange } from './vegaInternalEventId-bde5d617.js';
|
|
12
12
|
import { c as createEnterKeyHandlerToTriggerClick } from './accessibility-e5fd0fab.js';
|
|
13
|
+
import { f as flatNestedArray } from './array-8c82516c.js';
|
|
13
14
|
import { g as generateUUID } from './misc-c21a85c9.js';
|
|
14
15
|
import { P as PageResizeObserverSlimmer } from './pageResizeObserverSlimmer-d36f30e8.js';
|
|
15
16
|
import { d as debounce } from './timer-9321173b.js';
|
|
16
17
|
import { C as ChangeManager } from './changeManager-d60d98c8.js';
|
|
17
|
-
import { c as createSubStateNotifySlimmer, S as SubStateObserverSlimmer } from './subStateObserverSlimmer-
|
|
18
|
+
import { c as createSubStateNotifySlimmer, S as SubStateObserverSlimmer } from './subStateObserverSlimmer-2a8a615e.js';
|
|
18
19
|
import { p as isBackgroundColorTokenType } from './typeGuard-f33ed2eb.js';
|
|
19
20
|
import { s as stateBackgroundColorFormatter } from './stateBackgroundColorFormatter-e705312f.js';
|
|
20
21
|
import { b as parsePixelStringToNumber } from './pixel-f32c07ce.js';
|
|
21
22
|
import './iconManager-48bebc43.js';
|
|
22
23
|
import './dynamic-slimmer-ef83e258.js';
|
|
23
|
-
import './internalVegaEventManager-
|
|
24
|
+
import './internalVegaEventManager-71d00966.js';
|
|
25
|
+
import './number-e2519d1c.js';
|
|
24
26
|
import './breakpoints-e59edf8d.js';
|
|
25
27
|
import './ui-df46cc20.js';
|
|
26
28
|
import './ui-28499aab.js';
|
|
@@ -101,7 +103,7 @@ class VegaCalendarSwitchPanelRenderer extends VegaSlimmer {
|
|
|
101
103
|
* @param {NotifyObserverPayload<VegaCalendarViewModeType>} input mark which view should be selected
|
|
102
104
|
*/
|
|
103
105
|
this.handleViewChange = (input) => {
|
|
104
|
-
this.
|
|
106
|
+
this.currentPeriodController.updateCalendarPeriod(input.detail, this.currentPeriod.current);
|
|
105
107
|
};
|
|
106
108
|
/**
|
|
107
109
|
* reset view content to today
|
|
@@ -293,7 +295,9 @@ class VegaCalendarMonthViewRenderer extends VegaSlimmer {
|
|
|
293
295
|
'current-month-day': item.compare(currentDate).inMonth,
|
|
294
296
|
'active': item.isToday(),
|
|
295
297
|
'disabled': false,
|
|
296
|
-
}, key: `${item.month}-${item.date}
|
|
298
|
+
}, key: `${item.month}-${item.date}`,
|
|
299
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
300
|
+
onDblClick: (e) => this.handleDateBlockClick(e, item) },
|
|
297
301
|
this.renderDateBlock(item),
|
|
298
302
|
this.monthEventRenderer.render(item, eventsArray[itemIndex], displayEventsArray[itemIndex], itemIndex)));
|
|
299
303
|
})));
|
|
@@ -309,7 +313,42 @@ class VegaCalendarMonthViewRenderer extends VegaSlimmer {
|
|
|
309
313
|
const isMonthFirstDay = item.date === 1;
|
|
310
314
|
return (h("div", { class: "date" },
|
|
311
315
|
isMonthFirstDay && h("div", { class: "month-block" }, getMonthName(item.toDate(), true)),
|
|
312
|
-
h("div", { role: "button", tabIndex: 0, class: "grid-col"
|
|
316
|
+
h("div", { role: "button", tabIndex: 0, class: "grid-col",
|
|
317
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
318
|
+
onDblClick: (e) => this.goToCurrentDayView(e, item) }, item.date)));
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* switch to current date day view
|
|
322
|
+
*
|
|
323
|
+
* @param {MouseEvent} e the double click event object
|
|
324
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
325
|
+
*/
|
|
326
|
+
goToCurrentDayView(e, calendarDate) {
|
|
327
|
+
e.stopPropagation();
|
|
328
|
+
this.currentPeriodController.updateCalendarPeriod('day', calendarDate);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* emit vega click event when click the date block
|
|
332
|
+
*
|
|
333
|
+
* @param {MouseEvent} e the mouse event object
|
|
334
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
335
|
+
*/
|
|
336
|
+
handleDateBlockClick(e, calendarDate) {
|
|
337
|
+
const target = e.target;
|
|
338
|
+
if (this.isMonthBlockBlankArea(target)) {
|
|
339
|
+
const { year, month, date } = calendarDate;
|
|
340
|
+
this.dateDblClickEmitter.emit({ year, month, date, hour: 0 });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* determine if the clicked element is blank area
|
|
345
|
+
*
|
|
346
|
+
* @param {HTMLElement} element the target element
|
|
347
|
+
* @returns {boolean} true or false
|
|
348
|
+
*/
|
|
349
|
+
isMonthBlockBlankArea(element) {
|
|
350
|
+
// the more button and the calendar event component should not trigger dateDblClick event
|
|
351
|
+
return !element.classList.contains('more-button') && element.tagName !== 'VEGA-CALENDAR-EVENT';
|
|
313
352
|
}
|
|
314
353
|
}
|
|
315
354
|
__decorate$i([
|
|
@@ -324,9 +363,15 @@ __decorate$i([
|
|
|
324
363
|
__decorate$i([
|
|
325
364
|
MapToComponentField()
|
|
326
365
|
], VegaCalendarMonthViewRenderer.prototype, "calendarViewController", void 0);
|
|
366
|
+
__decorate$i([
|
|
367
|
+
MapToComponentField()
|
|
368
|
+
], VegaCalendarMonthViewRenderer.prototype, "currentPeriodController", void 0);
|
|
327
369
|
__decorate$i([
|
|
328
370
|
MapToComponentField()
|
|
329
371
|
], VegaCalendarMonthViewRenderer.prototype, "monthEventRenderer", void 0);
|
|
372
|
+
__decorate$i([
|
|
373
|
+
MapToComponentField()
|
|
374
|
+
], VegaCalendarMonthViewRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
330
375
|
|
|
331
376
|
var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
332
377
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -379,7 +424,7 @@ class VegaCalendarViewWithTimeRenderer extends VegaSlimmer {
|
|
|
379
424
|
h("div", { class: "calendar-view-content" }, source.map((item) => {
|
|
380
425
|
return (h("div", { class: "grid-col border-divider-left", key: item.date },
|
|
381
426
|
h("div", { class: "hour-empty border-divider-top" }),
|
|
382
|
-
this.renderHourBlock()));
|
|
427
|
+
this.renderHourBlock(item)));
|
|
383
428
|
})),
|
|
384
429
|
this.dayViewTimedEventRenderer.render(),
|
|
385
430
|
this.timeLineRenderer.renderTimeMarker(source))));
|
|
@@ -387,14 +432,28 @@ class VegaCalendarViewWithTimeRenderer extends VegaSlimmer {
|
|
|
387
432
|
/**
|
|
388
433
|
* The function `renderHourBlock` returns an array of HTML elements representing hour blocks with time information.
|
|
389
434
|
*
|
|
435
|
+
* @param {CalendarDate} calendarDate then current calendar date object
|
|
390
436
|
* @returns {HTMLElement[]} An array of HTMLElements is being returned. Each HTMLElement represents an hour block with a time value inside a div element.
|
|
391
437
|
*/
|
|
392
|
-
renderHourBlock() {
|
|
438
|
+
renderHourBlock(calendarDate) {
|
|
393
439
|
const timeLineSource = Array(24).fill('');
|
|
394
|
-
return timeLineSource.map(() => {
|
|
395
|
-
return h("div", { class: "grid-cell border-divider-top"
|
|
440
|
+
return timeLineSource.map((_item, index) => {
|
|
441
|
+
return (h("div", { class: "grid-cell border-divider-top",
|
|
442
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
443
|
+
onDblClick: () => {
|
|
444
|
+
this.handleDateBlockClick(calendarDate, index);
|
|
445
|
+
} }));
|
|
396
446
|
});
|
|
397
447
|
}
|
|
448
|
+
/**
|
|
449
|
+
* emit vega click event when click the date block
|
|
450
|
+
*
|
|
451
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
452
|
+
*/
|
|
453
|
+
handleDateBlockClick(calendarDate, hour) {
|
|
454
|
+
const { year, month, date } = calendarDate;
|
|
455
|
+
this.dateDblClickEmitter.emit({ year, month, date, hour });
|
|
456
|
+
}
|
|
398
457
|
}
|
|
399
458
|
__decorate$h([
|
|
400
459
|
MapToComponentField()
|
|
@@ -414,6 +473,9 @@ __decorate$h([
|
|
|
414
473
|
__decorate$h([
|
|
415
474
|
MapToComponentField()
|
|
416
475
|
], VegaCalendarViewWithTimeRenderer.prototype, "calendarViewController", void 0);
|
|
476
|
+
__decorate$h([
|
|
477
|
+
MapToComponentField()
|
|
478
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
417
479
|
|
|
418
480
|
var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
419
481
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -757,6 +819,17 @@ class CalendarDate {
|
|
|
757
819
|
}
|
|
758
820
|
return result;
|
|
759
821
|
}
|
|
822
|
+
/**
|
|
823
|
+
* The function "equal" compares the year, month, and date of two CalendarDate objects and returns true if they are equal.
|
|
824
|
+
*
|
|
825
|
+
* @param {CalendarDate} calendarDate - The `equal` method in the code snippet is a function that compares the year, month, and date of the current `CalendarDate` object with another
|
|
826
|
+
* `CalendarDate` object passed as a parameter. The method returns `true` if all three values (year, month, date) are equal
|
|
827
|
+
* @returns {boolean} The date is same day with current
|
|
828
|
+
*/
|
|
829
|
+
equal(calendarDate) {
|
|
830
|
+
const { year, month, date } = calendarDate;
|
|
831
|
+
return this._year === year && this._month === month && this._date === date;
|
|
832
|
+
}
|
|
760
833
|
}
|
|
761
834
|
|
|
762
835
|
/**
|
|
@@ -835,6 +908,14 @@ class CalendarPeriod {
|
|
|
835
908
|
get count() {
|
|
836
909
|
return this._count;
|
|
837
910
|
}
|
|
911
|
+
/**
|
|
912
|
+
* This function returns the type of the object.
|
|
913
|
+
*
|
|
914
|
+
* @type {string}
|
|
915
|
+
*/
|
|
916
|
+
get type() {
|
|
917
|
+
return this._type;
|
|
918
|
+
}
|
|
838
919
|
/**
|
|
839
920
|
* Go to a specific date.
|
|
840
921
|
*
|
|
@@ -874,6 +955,7 @@ class CalendarPeriod {
|
|
|
874
955
|
class DayPeriod extends CalendarPeriod {
|
|
875
956
|
constructor(current) {
|
|
876
957
|
super(DayPeriod.DISPLAY_DATE_COUNT, current);
|
|
958
|
+
this._type = 'day';
|
|
877
959
|
}
|
|
878
960
|
/**
|
|
879
961
|
* @inheritDoc
|
|
@@ -906,6 +988,7 @@ DayPeriod.DISPLAY_DATE_COUNT = 1;
|
|
|
906
988
|
class WeekPeriod extends CalendarPeriod {
|
|
907
989
|
constructor(current) {
|
|
908
990
|
super(WeekPeriod.DISPLAY_DATE_COUNT, current);
|
|
991
|
+
this._type = 'week';
|
|
909
992
|
}
|
|
910
993
|
/**
|
|
911
994
|
* @inheritDoc
|
|
@@ -937,9 +1020,22 @@ WeekPeriod.DISPLAY_DATE_COUNT = 7;
|
|
|
937
1020
|
*/
|
|
938
1021
|
class MonthPeriod extends CalendarPeriod {
|
|
939
1022
|
constructor(current) {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1023
|
+
super(MonthPeriod.DISPLAY_DATE_COUNT, MonthPeriod.getMonthFirstDay(current));
|
|
1024
|
+
this._type = 'month';
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* The function `getMonthFirstDay` returns the first day of a given month in a calendar.
|
|
1028
|
+
*
|
|
1029
|
+
* @param {CalendarDate} [calendarDate] - The `calendarDate` parameter is an optional parameter of
|
|
1030
|
+
* type `CalendarDate`. It represents a specific date in the calendar. If a `calendarDate` is
|
|
1031
|
+
* provided, the function will use that date to determine the first day of the month. If no
|
|
1032
|
+
* `calendarDate` is provided, the function
|
|
1033
|
+
* @returns {CalendarDate} A new `CalendarDate` object representing the first day of the month from the provided
|
|
1034
|
+
* `calendarDate` parameter or the current date if no parameter is provided.
|
|
1035
|
+
*/
|
|
1036
|
+
static getMonthFirstDay(calendarDate) {
|
|
1037
|
+
const date = calendarDate || CalendarDate.from(new Date());
|
|
1038
|
+
return new CalendarDate(date.year, date.month, 1);
|
|
943
1039
|
}
|
|
944
1040
|
/**
|
|
945
1041
|
* @inheritDoc
|
|
@@ -980,39 +1076,34 @@ class VegaCalendarViewController extends VegaSlimmer {
|
|
|
980
1076
|
this.weekViewGenerator = new WeekViewGenerator();
|
|
981
1077
|
this.dayViewGenerator = new DayViewGenerator();
|
|
982
1078
|
}
|
|
983
|
-
/**
|
|
984
|
-
* Update the view mode by param
|
|
985
|
-
*
|
|
986
|
-
* @param {VegaCalendarViewModeType} viewMode view mode string
|
|
987
|
-
*/
|
|
988
|
-
setViewMode(viewMode) {
|
|
989
|
-
this.viewMode = viewMode;
|
|
990
|
-
}
|
|
991
1079
|
/**
|
|
992
1080
|
* set default calendar view
|
|
993
1081
|
*/
|
|
994
1082
|
initialCalendarView() {
|
|
995
|
-
this.setCalendarView(this.
|
|
1083
|
+
this.setCalendarView(this.getCalendarViewByPeriod(this.currentPeriod));
|
|
996
1084
|
}
|
|
997
1085
|
/**
|
|
998
1086
|
* generator new calendar view if the calendar current period changes
|
|
1087
|
+
*
|
|
1088
|
+
* @param {CalendarPeriod} newValue the new calendar period
|
|
999
1089
|
*/
|
|
1000
|
-
generateCalendarView() {
|
|
1001
|
-
this.setCalendarView(this.
|
|
1090
|
+
generateCalendarView(newValue) {
|
|
1091
|
+
this.setCalendarView(this.getCalendarViewByPeriod(newValue));
|
|
1002
1092
|
}
|
|
1003
1093
|
/**
|
|
1004
|
-
* The function `
|
|
1094
|
+
* The function `getCalendarViewByPeriod` returns a specific calendar view based on the current period.
|
|
1005
1095
|
*
|
|
1006
|
-
* @
|
|
1096
|
+
* @param {CalendarPeriod} newPeriod the new period
|
|
1097
|
+
* @returns {CalendarView} get the match calendar view by the period
|
|
1007
1098
|
*/
|
|
1008
|
-
|
|
1009
|
-
switch (
|
|
1099
|
+
getCalendarViewByPeriod(newPeriod) {
|
|
1100
|
+
switch (newPeriod.type) {
|
|
1010
1101
|
case 'week':
|
|
1011
|
-
return this.weekViewGenerator.generate(
|
|
1102
|
+
return this.weekViewGenerator.generate(newPeriod);
|
|
1012
1103
|
case 'day':
|
|
1013
|
-
return this.dayViewGenerator.generate(
|
|
1104
|
+
return this.dayViewGenerator.generate(newPeriod);
|
|
1014
1105
|
default:
|
|
1015
|
-
return this.monthViewGenerator.generate(
|
|
1106
|
+
return this.monthViewGenerator.generate(newPeriod);
|
|
1016
1107
|
}
|
|
1017
1108
|
}
|
|
1018
1109
|
/**
|
|
@@ -1027,9 +1118,6 @@ class VegaCalendarViewController extends VegaSlimmer {
|
|
|
1027
1118
|
__decorate$f([
|
|
1028
1119
|
MapToComponentField({ writable: true })
|
|
1029
1120
|
], VegaCalendarViewController.prototype, "calendarView", void 0);
|
|
1030
|
-
__decorate$f([
|
|
1031
|
-
MapToComponentField({ writable: true })
|
|
1032
|
-
], VegaCalendarViewController.prototype, "viewMode", void 0);
|
|
1033
1121
|
__decorate$f([
|
|
1034
1122
|
MapToComponentField()
|
|
1035
1123
|
], VegaCalendarViewController.prototype, "currentPeriod", void 0);
|
|
@@ -1059,19 +1147,50 @@ class VegaCalendarCurrentPeriodController extends VegaSlimmer {
|
|
|
1059
1147
|
setCurrentPeriod(newPeriod) {
|
|
1060
1148
|
this.currentPeriod = newPeriod;
|
|
1061
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* set new current period by the view mode and the current date
|
|
1152
|
+
*
|
|
1153
|
+
* @param {VegaCalendarViewModeType} viewMode view mode value
|
|
1154
|
+
* @param {CalendarDate} date current date
|
|
1155
|
+
*/
|
|
1156
|
+
updateCalendarPeriod(viewMode, date) {
|
|
1157
|
+
switch (viewMode) {
|
|
1158
|
+
case 'month':
|
|
1159
|
+
this.setCurrentPeriod(new MonthPeriod(date));
|
|
1160
|
+
break;
|
|
1161
|
+
case 'week':
|
|
1162
|
+
this.setCurrentPeriod(new WeekPeriod(date));
|
|
1163
|
+
break;
|
|
1164
|
+
case 'day':
|
|
1165
|
+
this.setCurrentPeriod(new DayPeriod(date));
|
|
1166
|
+
break;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1062
1169
|
/**
|
|
1063
1170
|
* default current period is month period, re-create period if the default view mode is not month
|
|
1064
1171
|
* set default calendar view
|
|
1065
1172
|
*/
|
|
1066
1173
|
initialCurrentPeriod() {
|
|
1067
|
-
this.
|
|
1174
|
+
this.updateCalendarPeriod(this.viewMode, CalendarDate.from(new Date()));
|
|
1068
1175
|
}
|
|
1069
1176
|
/**
|
|
1070
1177
|
* emit period change event
|
|
1178
|
+
*
|
|
1179
|
+
* @param {CalendarPeriod} newValue the new calendar period
|
|
1180
|
+
* @param {CalendarPeriod} oldValue the prev calendar period
|
|
1071
1181
|
*/
|
|
1072
|
-
emitChangeEvent() {
|
|
1182
|
+
emitChangeEvent(newValue, oldValue) {
|
|
1183
|
+
if (newValue &&
|
|
1184
|
+
oldValue &&
|
|
1185
|
+
newValue.startDate.equal(oldValue.startDate) &&
|
|
1186
|
+
newValue.endDate.equal(oldValue.endDate)) {
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
if (newValue && newValue.type !== this.viewMode) {
|
|
1190
|
+
this.viewMode = newValue.type;
|
|
1191
|
+
}
|
|
1073
1192
|
this.changeEventEmitter.emit({
|
|
1074
|
-
viewMode:
|
|
1193
|
+
viewMode: newValue.type,
|
|
1075
1194
|
currentPeriod: this.getCurrentPeriodSummary(),
|
|
1076
1195
|
});
|
|
1077
1196
|
}
|
|
@@ -1081,7 +1200,9 @@ class VegaCalendarCurrentPeriodController extends VegaSlimmer {
|
|
|
1081
1200
|
* @param {VegaCalendarViewModeType} viewMode new view mode value
|
|
1082
1201
|
*/
|
|
1083
1202
|
updateCurrentPeriodByViewMode(viewMode) {
|
|
1084
|
-
this.
|
|
1203
|
+
if (this.currentPeriod && viewMode !== this.currentPeriod.type) {
|
|
1204
|
+
this.updateCalendarPeriod(viewMode, this.currentPeriod.current);
|
|
1205
|
+
}
|
|
1085
1206
|
}
|
|
1086
1207
|
/**
|
|
1087
1208
|
* The function `getStartDateAndEndDate` returns an array of `VegaCalendarDateType` objects based on the `startDate` and `endDate` properties of the `currentPeriod` object.
|
|
@@ -1106,25 +1227,6 @@ class VegaCalendarCurrentPeriodController extends VegaSlimmer {
|
|
|
1106
1227
|
},
|
|
1107
1228
|
};
|
|
1108
1229
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* set new current period by the view mode and the current date
|
|
1111
|
-
*
|
|
1112
|
-
* @param {VegaCalendarViewModeType} viewMode view mode value
|
|
1113
|
-
* @param {CalendarDate} date current date
|
|
1114
|
-
*/
|
|
1115
|
-
initCalendarPeriod(viewMode, date) {
|
|
1116
|
-
switch (viewMode) {
|
|
1117
|
-
case 'month':
|
|
1118
|
-
this.setCurrentPeriod(new MonthPeriod(date));
|
|
1119
|
-
break;
|
|
1120
|
-
case 'week':
|
|
1121
|
-
this.setCurrentPeriod(new WeekPeriod(date));
|
|
1122
|
-
break;
|
|
1123
|
-
case 'day':
|
|
1124
|
-
this.setCurrentPeriod(new DayPeriod(date));
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
1230
|
}
|
|
1129
1231
|
__decorate$e([
|
|
1130
1232
|
MapToComponentField({ writable: true })
|
|
@@ -1133,7 +1235,7 @@ __decorate$e([
|
|
|
1133
1235
|
MapToComponentField()
|
|
1134
1236
|
], VegaCalendarCurrentPeriodController.prototype, "changeEventEmitter", void 0);
|
|
1135
1237
|
__decorate$e([
|
|
1136
|
-
MapToComponentField()
|
|
1238
|
+
MapToComponentField({ writable: true })
|
|
1137
1239
|
], VegaCalendarCurrentPeriodController.prototype, "viewMode", void 0);
|
|
1138
1240
|
__decorate$e([
|
|
1139
1241
|
MapToComponentMethod('componentWillLoad')
|
|
@@ -1317,6 +1419,534 @@ __decorate$d([
|
|
|
1317
1419
|
MapToComponentMethod('componentWillLoad')
|
|
1318
1420
|
], VegaCalendarMonthEventRenderer.prototype, "addMaxDisplayCountChange", null);
|
|
1319
1421
|
|
|
1422
|
+
/** The above code defines an abstract class `CalendarEventBaseRepeatPattern` in TypeScript that represents a repeat pattern for calendar events. Here is a summary of what the code is doing: */
|
|
1423
|
+
class CalendarEventBaseRepeatPattern {
|
|
1424
|
+
/**
|
|
1425
|
+
* The constructor initializes the current date for a given date range and interval.
|
|
1426
|
+
*
|
|
1427
|
+
* @param {CalendarDate} repeatStartDate - The `repeatStartDate` parameter represents the starting date of a
|
|
1428
|
+
* calendar event or interval. It is of type `CalendarDate`, which likely contains information such as
|
|
1429
|
+
* the year, month, and day of the event.
|
|
1430
|
+
* @param {number} interval - The `interval` parameter represents the frequency at which the event
|
|
1431
|
+
* occurs. For example, if the interval is set to 2, it means the event occurs every 2 units of time
|
|
1432
|
+
* (e.g., every 2 days, weeks, months, etc.).
|
|
1433
|
+
* @param {Nullable<number>} count - The `count` parameter specifies the number of occurrences of the event. If `count`
|
|
1434
|
+
* is provided, the event will repeat `count` times within the specified interval. If `count` is
|
|
1435
|
+
* `null`, the event will repeat indefinitely until the `until` date is reached.
|
|
1436
|
+
* @param {Nullable<CalendarDate>} until - The `until` parameter in the constructor represents a date until which the recurring
|
|
1437
|
+
* event will occur. If this date is reached, the recurring event will stop.
|
|
1438
|
+
*/
|
|
1439
|
+
constructor(repeatStartDate, interval, count, until) {
|
|
1440
|
+
this.repeatStartDate = repeatStartDate;
|
|
1441
|
+
this.interval = interval;
|
|
1442
|
+
this.count = count;
|
|
1443
|
+
this.until = until;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* The function `getRepeatSeries` retrieves a series of repeated events within a specified calendar period.
|
|
1447
|
+
*
|
|
1448
|
+
* @param {CalendarPeriod} period - The `period` parameter in the `getRepeatSeries` method represents
|
|
1449
|
+
* a specific time period in the form of a `CalendarPeriod` object. This object typically contains a
|
|
1450
|
+
* `startDate` and an `endDate`, which define the range of dates for which you want to generate repeat series.
|
|
1451
|
+
* @param {number} eventSpansDays - the current repeat series cross days, default value is one
|
|
1452
|
+
* @returns {CalendarDate[]} repeat start date array
|
|
1453
|
+
*/
|
|
1454
|
+
getRepeatSeries(period, eventSpansDays = 1) {
|
|
1455
|
+
this.generateRepeatDateCacheUntilEndDate(period.endDate);
|
|
1456
|
+
return this.cache.filter((item) => {
|
|
1457
|
+
return this.isSeriesInPeriod(item, eventSpansDays, period);
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* The function `isSeriesInPeriod` checks if a series of dates falls within a specified date range.
|
|
1462
|
+
*
|
|
1463
|
+
* @param {CalendarDate} series - The `series` parameter represents a specific date in the form of a
|
|
1464
|
+
* `CalendarDate` object.
|
|
1465
|
+
* @param {number} seriesSpansDays - The `seriesSpansDays` parameter represents the number of days
|
|
1466
|
+
* that the series spans. It is used to calculate the end date of the series based on the start date.
|
|
1467
|
+
* @param {CalendarPeriod} period - Date period
|
|
1468
|
+
* @returns {boolean} a boolean value indicating whether the given series falls within the specified date
|
|
1469
|
+
* range.
|
|
1470
|
+
*/
|
|
1471
|
+
isSeriesInPeriod(series, seriesSpansDays, period) {
|
|
1472
|
+
const seriesStart = series.toDate();
|
|
1473
|
+
const seriesEnd = new Date(series.year, series.month - 1, series.date + seriesSpansDays - 1);
|
|
1474
|
+
const { startDate, endDate } = period;
|
|
1475
|
+
const rangeStart = startDate.toDate();
|
|
1476
|
+
const rangeEnd = endDate.toDate();
|
|
1477
|
+
return ((seriesStart >= rangeStart && seriesStart <= rangeEnd) ||
|
|
1478
|
+
(seriesEnd >= rangeStart && seriesEnd <= rangeEnd) ||
|
|
1479
|
+
(seriesStart <= rangeStart && seriesEnd >= rangeEnd));
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
CalendarEventBaseRepeatPattern.daySeconds = 24 * 60 * 60 * 1000;
|
|
1483
|
+
|
|
1484
|
+
/** The `CalendarEventDailyRepeatPattern` class in TypeScript represents a daily repeating pattern for calendar events. */
|
|
1485
|
+
class CalendarEventDailyRepeatPattern extends CalendarEventBaseRepeatPattern {
|
|
1486
|
+
/**
|
|
1487
|
+
* The constructor initializes the current date for a given date range and interval.
|
|
1488
|
+
*
|
|
1489
|
+
* @param {CalendarDate} startDate - The `startDate` parameter is of type `CalendarDate` and represents the starting date for a specific interval or range.
|
|
1490
|
+
* @param {number} interval - The `interval` parameter represents the frequency at which the event
|
|
1491
|
+
* occurs. For example, if the interval is set to 1, it means the event occurs every day. If the
|
|
1492
|
+
* interval is set to 2, it means the event occurs every other day.
|
|
1493
|
+
* @param {Nullable<number>} count - The `count` parameter specifies the number of occurrences of the event. If `count`
|
|
1494
|
+
* is provided, the event will repeat `count` times within the specified interval. If `count` is
|
|
1495
|
+
* `null`, the event will repeat indefinitely until the `until` date is reached.
|
|
1496
|
+
* @param {Nullable<CalendarDate>} until - The `until` parameter in the constructor is of type `Nullable<CalendarDate>`, which
|
|
1497
|
+
* means it can either accept a `CalendarDate` object or be `null`. This parameter is used to specify
|
|
1498
|
+
* a date until which the recurring event should repeat. If `until` is provided, the event
|
|
1499
|
+
*/
|
|
1500
|
+
constructor(startDate, interval, count, until) {
|
|
1501
|
+
super(startDate, interval, count, until);
|
|
1502
|
+
this.initCache();
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* The function generates and caches repeated dates before a specified end date.
|
|
1506
|
+
*
|
|
1507
|
+
* @param {CalendarDate} endDate - The `endDate` parameter represents the date until which you want to
|
|
1508
|
+
* generate repeat dates in the cache. The function `generateRepeatDateCacheBeforeEndDate` is
|
|
1509
|
+
* responsible for populating the cache with repeat dates until the specified `endDate`. It checks the
|
|
1510
|
+
* last date in the cache and generates subsequent repeat dates until
|
|
1511
|
+
*/
|
|
1512
|
+
generateRepeatDateCacheUntilEndDate(endDate) {
|
|
1513
|
+
const lastMatchDate = this.cache[this.cache.length - 1];
|
|
1514
|
+
if (lastMatchDate.toDate() < endDate.toDate() &&
|
|
1515
|
+
(!this.count || (typeof this.count === 'number' && this.cache.length < this.count))) {
|
|
1516
|
+
let nextMatchDate = this.getNextRepeatStartDate(lastMatchDate);
|
|
1517
|
+
while (nextMatchDate && nextMatchDate.toDate() < endDate.toDate()) {
|
|
1518
|
+
nextMatchDate = this.getNextRepeatStartDate(nextMatchDate);
|
|
1519
|
+
if (typeof this.count === 'number' && this.cache.length >= this.count) {
|
|
1520
|
+
break;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* The function `initCache` initializes a cache array with the `startDate` value.
|
|
1527
|
+
*/
|
|
1528
|
+
initCache() {
|
|
1529
|
+
this.cache = [this.repeatStartDate];
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* The function getNextRepeatStartDate calculates the next repeat start date based on a given date and certain conditions.
|
|
1533
|
+
*
|
|
1534
|
+
* @param {CalendarDate} date - The `date` parameter represents the current date for which you want to
|
|
1535
|
+
* calculate the next repeat start date. It is an instance of the `CalendarDate` class.
|
|
1536
|
+
* @returns {Nullable<CalendarDate>} The function `getNextRepeatStartDate` returns either a `CalendarDate` object if certain
|
|
1537
|
+
* conditions are met, or `null` if the conditions are not met.
|
|
1538
|
+
*/
|
|
1539
|
+
getNextRepeatStartDate(date) {
|
|
1540
|
+
const nextDate = new Date(date.year, date.month - 1, date.date + this.interval);
|
|
1541
|
+
const nextCalendarDate = CalendarDate.from(nextDate);
|
|
1542
|
+
if ((this.until && nextDate > this.until.toDate()) ||
|
|
1543
|
+
(typeof this.count === 'number' && this.cache.length >= this.count)) {
|
|
1544
|
+
return null;
|
|
1545
|
+
}
|
|
1546
|
+
else {
|
|
1547
|
+
this.cache.push(nextCalendarDate);
|
|
1548
|
+
return nextCalendarDate;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/** The `CalendarEventMonthlyRepeatPattern` class in TypeScript represents a monthly repeat pattern for calendar events. */
|
|
1554
|
+
class CalendarEventMonthlyRepeatPattern extends CalendarEventBaseRepeatPattern {
|
|
1555
|
+
/**
|
|
1556
|
+
* The constructor initializes the event with specified start and end dates, interval, count, and until date, and sets the byMonthDay property to the start date's day.
|
|
1557
|
+
*
|
|
1558
|
+
* @param {CalendarDate} startDate - The `startDate` parameter represents the starting date of the
|
|
1559
|
+
* event or interval. It is of type `CalendarDate`, which likely includes the year, month, and day
|
|
1560
|
+
* components of the date.
|
|
1561
|
+
* @param {number} interval - The `interval` parameter specifies the frequency of the recurring
|
|
1562
|
+
* events. For example, if the interval is set to 2, the event will occur every 2 units of time (days,
|
|
1563
|
+
* weeks, months, etc.).
|
|
1564
|
+
* @param {Nullable<number>} count - The `count` parameter specifies the number of occurrences of the event. If `count`
|
|
1565
|
+
* is provided, the event will repeat `count` times within the specified interval. If `count` is not
|
|
1566
|
+
* provided (or is `null`), the event will repeat indefinitely based on the other parameters like `
|
|
1567
|
+
* @param {Nullable<CalendarDate>} until - The `until` parameter is a nullable `CalendarDate` that specifies the end date for
|
|
1568
|
+
* the recurring event. If provided, the event will repeat until this date. If not provided, the event
|
|
1569
|
+
* will repeat indefinitely based on the other parameters like `count` or `endDate`.
|
|
1570
|
+
*/
|
|
1571
|
+
constructor(startDate, interval, count, until) {
|
|
1572
|
+
super(startDate, interval, count, until);
|
|
1573
|
+
this.byMonthDay = this.repeatStartDate.date;
|
|
1574
|
+
this.initCache();
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* This function generates and caches repeated dates before a specified end date.
|
|
1578
|
+
*
|
|
1579
|
+
* @param {CalendarDate} endDate - The `endDate` parameter in the
|
|
1580
|
+
* `generateRepeatDateCacheUntilEndDate` function is a CalendarDate object that represents the end
|
|
1581
|
+
* date until which the repeat dates need to be generated and cached. The function checks if the last
|
|
1582
|
+
* cached date is before the `endDate` and generates additional repeat dates until it reaches
|
|
1583
|
+
*/
|
|
1584
|
+
generateRepeatDateCacheUntilEndDate(endDate) {
|
|
1585
|
+
const lastMatchDate = this.cache[this.cache.length - 1];
|
|
1586
|
+
if (lastMatchDate.toDate() < endDate.toDate() &&
|
|
1587
|
+
(!this.count || (typeof this.count === 'number' && this.cache.length < this.count))) {
|
|
1588
|
+
let nextMatchDate = this.getNextRepeatStartDate(lastMatchDate);
|
|
1589
|
+
while (nextMatchDate && nextMatchDate.toDate() < endDate.toDate()) {
|
|
1590
|
+
nextMatchDate = this.getNextRepeatStartDate(nextMatchDate);
|
|
1591
|
+
if (typeof this.count === 'number' && this.cache.length >= this.count) {
|
|
1592
|
+
break;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* The function `initCache` initializes a cache array with the startDate value.
|
|
1599
|
+
*/
|
|
1600
|
+
initCache() {
|
|
1601
|
+
this.cache = [this.repeatStartDate];
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* The getNextRepeatStartDate function calculates the next start date based on a given date and interval, considering constraints such as end date and count limit.
|
|
1605
|
+
*
|
|
1606
|
+
* @param {CalendarDate} date - The `date` parameter represents the current date for which you want to
|
|
1607
|
+
* calculate the next repeat start date. It is of type `CalendarDate`.
|
|
1608
|
+
* @returns {Nullable<CalendarDate>} The function `getNextRepeatStartDate` returns a nullable `CalendarDate`. It either returns
|
|
1609
|
+
* the next calculated `CalendarDate` based on the input date and interval, or it returns `null` if
|
|
1610
|
+
* certain conditions are met (such as reaching the specified end date or count limit).
|
|
1611
|
+
*/
|
|
1612
|
+
getNextRepeatStartDate(date) {
|
|
1613
|
+
const nextDate = this.getNextStartDate(date.year, date.month - 1 + this.interval);
|
|
1614
|
+
const nextCalendarDate = CalendarDate.from(nextDate);
|
|
1615
|
+
if ((this.until && nextDate > this.until.toDate()) ||
|
|
1616
|
+
(typeof this.count === 'number' && this.cache.length >= this.count)) {
|
|
1617
|
+
return null;
|
|
1618
|
+
}
|
|
1619
|
+
else {
|
|
1620
|
+
this.cache.push(nextCalendarDate);
|
|
1621
|
+
return nextCalendarDate;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* get the new date with fixed date, if the date.getDate() not equal the fixed date, find the next month
|
|
1626
|
+
*
|
|
1627
|
+
* @param {number} year year
|
|
1628
|
+
* @param {number} month month
|
|
1629
|
+
* @returns {Date} the new date
|
|
1630
|
+
*/
|
|
1631
|
+
getNextStartDate(year, month) {
|
|
1632
|
+
const nextDate = new Date(year, month, this.byMonthDay);
|
|
1633
|
+
if (nextDate.getDate() === this.byMonthDay) {
|
|
1634
|
+
return nextDate;
|
|
1635
|
+
}
|
|
1636
|
+
else {
|
|
1637
|
+
return this.getNextStartDate(year, month + 1);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/** The `CalendarEventWeeklyRepeatPattern` class in TypeScript represents a weekly repeat pattern for calendar events, allowing for matching dates based on specific weekdays and generating future dates with optional constraints. */
|
|
1643
|
+
class CalendarEventWeeklyRepeatPattern extends CalendarEventBaseRepeatPattern {
|
|
1644
|
+
/**
|
|
1645
|
+
* This TypeScript constructor initializes a calendar date range with specified parameters including start date, end date, interval, count, until date, and an array of week days.
|
|
1646
|
+
*
|
|
1647
|
+
* @param {CalendarDate} startDate - The `startDate` parameter represents the starting date of the
|
|
1648
|
+
* calendar event or schedule. It is of type `CalendarDate`, which likely includes the year, month, and day components of a date.
|
|
1649
|
+
* @param {number} interval - The `interval` parameter represents the frequency of the recurrence. For
|
|
1650
|
+
* example, if `interval` is set to 1, the event will occur every week. If it's set to 2, the event
|
|
1651
|
+
* will occur every two weeks.
|
|
1652
|
+
* @param {Nullable<number>} count - The `count` parameter specifies the number of occurrences of the rule. If `count` is
|
|
1653
|
+
* provided, the recurrence will generate at most that many occurrences. If `count` is not provided,
|
|
1654
|
+
* the recurrence will continue indefinitely based on other parameters like `endDate` or `until`.
|
|
1655
|
+
* @param {Nullable<CalendarDate>} until - The `until` parameter specifies the end date for the recurrence rule. If provided,
|
|
1656
|
+
* the recurrence will continue until this date. If not provided, the recurrence will continue
|
|
1657
|
+
* indefinitely based on other parameters like `count` or `interval`.
|
|
1658
|
+
* @param {Nullable<VegaCalendarWeekDayType[]>} byWeekDay - The `byWeekDay` parameter is an array of
|
|
1659
|
+
* `VegaCalendarWeekDayType` values, which represent the days of the week for which the event should occur.
|
|
1660
|
+
*/
|
|
1661
|
+
constructor(startDate, interval, count, until, byWeekDay) {
|
|
1662
|
+
super(startDate, interval, count, until);
|
|
1663
|
+
this.byWeekDay = this.sortWeekDay(byWeekDay);
|
|
1664
|
+
this.initCache();
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* The function `getRepeatSeries` retrieves a series of repeated events within a specified calendar period.
|
|
1668
|
+
*
|
|
1669
|
+
* @param {CalendarPeriod} period - The `period` parameter in the `getRepeatSeries` method represents
|
|
1670
|
+
* a specific time period in the form of a `CalendarPeriod` object. This object typically contains a
|
|
1671
|
+
* `startDate` and an `endDate`, which define the range of dates for which you want to generate repeat series.
|
|
1672
|
+
* @param {number} eventSpansDays - the current repeat series cross days, default value is one
|
|
1673
|
+
* @returns {CalendarDate[]} repeat start date array
|
|
1674
|
+
*/
|
|
1675
|
+
getRepeatSeries(period, eventSpansDays = 1) {
|
|
1676
|
+
this.generateRepeatDateCacheUntilEndDate(period.endDate);
|
|
1677
|
+
return this.getValidCache().filter((item) => {
|
|
1678
|
+
return this.isSeriesInPeriod(item, eventSpansDays, period);
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* This function generates repeated dates and caches them until a specified end date.
|
|
1683
|
+
*
|
|
1684
|
+
* @param {CalendarDate} endDate - The `endDate` parameter is a `CalendarDate` object that represents
|
|
1685
|
+
* the date until which the repeat date cache needs to be generated. The function
|
|
1686
|
+
* `generateRepeatDateCacheUntilEndDate` generates repeat dates until this specified end date.
|
|
1687
|
+
*/
|
|
1688
|
+
generateRepeatDateCacheUntilEndDate(endDate) {
|
|
1689
|
+
const lastMatchDate = this.cache[this.cache.length - 1];
|
|
1690
|
+
if (lastMatchDate[0].toDate() < endDate.toDate() &&
|
|
1691
|
+
(!this.count || (typeof this.count === 'number' && this.cache.length < this.count))) {
|
|
1692
|
+
let nextMatchDate = this.getNextRepeatStartDate(lastMatchDate);
|
|
1693
|
+
while (nextMatchDate && nextMatchDate[0].toDate() < endDate.toDate()) {
|
|
1694
|
+
nextMatchDate = this.getNextRepeatStartDate(nextMatchDate);
|
|
1695
|
+
if (typeof this.count === 'number' && this.getValidCache().length >= this.count) {
|
|
1696
|
+
break;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
/**
|
|
1702
|
+
* The function getNextRepeatStartDate calculates the next start dates based on a given array of CalendarDate objects and returns them if certain conditions are met.
|
|
1703
|
+
*
|
|
1704
|
+
* @param {CalendarDate[]} dates - The `dates` parameter is an array of `CalendarDate` objects.
|
|
1705
|
+
* @returns {Nullable<CalendarDate[]>} The `getNextRepeatStartDate` function returns a nullable array of `CalendarDate` objects.
|
|
1706
|
+
* If there are no next dates available or if the cache count exceeds a specified limit, it returns
|
|
1707
|
+
* `null`. Otherwise, it returns an array of `CalendarDate` objects representing the next start dates.
|
|
1708
|
+
*/
|
|
1709
|
+
getNextRepeatStartDate(dates) {
|
|
1710
|
+
const nextDate = this.getNextStartDates(dates);
|
|
1711
|
+
if (nextDate.length === 0 ||
|
|
1712
|
+
(typeof this.count === 'number' && this.getValidCache().length >= this.count)) {
|
|
1713
|
+
return null;
|
|
1714
|
+
}
|
|
1715
|
+
else {
|
|
1716
|
+
const nextCalendarDates = nextDate.map((item) => CalendarDate.from(item));
|
|
1717
|
+
this.cache.push(nextCalendarDates);
|
|
1718
|
+
return nextCalendarDates;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* The function `getNextStartDates` takes an array of `CalendarDate` objects, calculates the next dates based on a specified interval, and filters out dates that are after a specified end date.
|
|
1723
|
+
*
|
|
1724
|
+
* @param {CalendarDate[]} dates - The `dates` parameter is an array of `CalendarDate` objects
|
|
1725
|
+
* representing specific dates in a calendar. Each `CalendarDate` object has properties for the year,
|
|
1726
|
+
* month, and date.
|
|
1727
|
+
* @returns {Date[]} The `getNextStartDates` function returns an array of `Date` objects representing the next
|
|
1728
|
+
* start dates based on the input `CalendarDate` array. The function calculates the next start dates
|
|
1729
|
+
* by adding a specific interval (multiplied by 7 to represent weeks) to each date in the input array.
|
|
1730
|
+
* Finally, it filters out any dates that are after a specified `until` date, if provided.
|
|
1731
|
+
*/
|
|
1732
|
+
getNextStartDates(dates) {
|
|
1733
|
+
const nextDates = dates.map((dateItem) => new Date(dateItem.year, dateItem.month - 1, dateItem.date + this.interval * 7));
|
|
1734
|
+
return nextDates.filter((item) => !this.until || item <= this.until.toDate());
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* The `initCache` function initializes a cache of calendar dates based on the start date and weekly repeat pattern.
|
|
1738
|
+
*/
|
|
1739
|
+
initCache() {
|
|
1740
|
+
const result = [];
|
|
1741
|
+
const currentWeekDayIndex = this.getCurrentDayIndex(this.repeatStartDate);
|
|
1742
|
+
this.byWeekDay.forEach((day) => {
|
|
1743
|
+
const index = CalendarEventWeeklyRepeatPattern.weekDay.indexOf(day);
|
|
1744
|
+
const days = index - currentWeekDayIndex;
|
|
1745
|
+
const { year, month, date } = this.repeatStartDate;
|
|
1746
|
+
const dateItem = CalendarDate.from(new Date(year, month - 1, date + days));
|
|
1747
|
+
result.push(dateItem);
|
|
1748
|
+
});
|
|
1749
|
+
this.cache = [result];
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* The function `sortWeekDay` sorts an array of week days based on their position in a predefined list.
|
|
1753
|
+
*
|
|
1754
|
+
* @param {boolean} weekDay - The `weekDay` parameter is an array of week day values that need to be sorted in a
|
|
1755
|
+
* specific order. The function `sortWeekDay` takes this array and sorts it based on a predefined
|
|
1756
|
+
* order specified in `CalendarEventWeeklyRepeatPattern.weekDay`.
|
|
1757
|
+
* @returns {VegaCalendarWeekDayType[]} The `sortWeekDay` function is returning the `weekDay` array sorted based on the index of
|
|
1758
|
+
* each `VegaCalendarWeekDayType` item in the `CalendarEventWeeklyRepeatPattern.weekDay` array.
|
|
1759
|
+
*/
|
|
1760
|
+
sortWeekDay(weekDay) {
|
|
1761
|
+
if (weekDay && weekDay.length) {
|
|
1762
|
+
return weekDay
|
|
1763
|
+
.map((item) => item.toLocaleLowerCase())
|
|
1764
|
+
.sort((itemA, itemB) => {
|
|
1765
|
+
return (CalendarEventWeeklyRepeatPattern.weekDay.indexOf(itemA) -
|
|
1766
|
+
CalendarEventWeeklyRepeatPattern.weekDay.indexOf(itemB));
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
else {
|
|
1770
|
+
return [CalendarEventWeeklyRepeatPattern.weekDay[this.getCurrentDayIndex(this.repeatStartDate)]];
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* This function returns the index of the current day in a week, with Sunday represented as 0.
|
|
1775
|
+
*
|
|
1776
|
+
* @param {CalendarDate} date - The `date` parameter in the `getCurrentDayIndex` function is of type
|
|
1777
|
+
* `CalendarDate`, which is a custom data type representing a date in a calendar.
|
|
1778
|
+
* @returns {number} The function `getCurrentDayIndex` returns the index of the current day in the week, with
|
|
1779
|
+
* Sunday being represented as 0 and Saturday being represented as 6.
|
|
1780
|
+
*/
|
|
1781
|
+
getCurrentDayIndex(date) {
|
|
1782
|
+
return date.toDate().getDay();
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* The function `getValidCache` returns a filtered and concatenated array of CalendarDate objects from the cache based on a start date.
|
|
1786
|
+
*
|
|
1787
|
+
* @returns {CalendarDate[]} The `getValidCache` method returns an array of `CalendarDate` objects that meet the
|
|
1788
|
+
* condition of having a date greater than or equal to the `startDate` property. The method first
|
|
1789
|
+
* flattens a nested array of `CalendarDate` objects stored in the `cache` property, then filters out
|
|
1790
|
+
* the `CalendarDate` objects that do not meet the condition, and finally concatenates the filtered
|
|
1791
|
+
* array
|
|
1792
|
+
*/
|
|
1793
|
+
getValidCache() {
|
|
1794
|
+
const flatArr = flatNestedArray(this.cache.slice(1));
|
|
1795
|
+
return this.cache[0]
|
|
1796
|
+
.filter((item) => item.toDate() >= this.repeatStartDate.toDate())
|
|
1797
|
+
.concat(flatArr)
|
|
1798
|
+
.slice(0, typeof this.count === 'number' ? this.count : undefined);
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
CalendarEventWeeklyRepeatPattern.weekDay = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map((item) => item.toLowerCase());
|
|
1802
|
+
|
|
1803
|
+
/** The `CalendarEventYearlyRepeatPattern` class defines a yearly repeat pattern for calendar events, checking for matches and generating future dates based on specified criteria. */
|
|
1804
|
+
class CalendarEventYearlyRepeatPattern extends CalendarEventBaseRepeatPattern {
|
|
1805
|
+
/**
|
|
1806
|
+
* The constructor initializes a new instance with specified start and end dates, interval, count, and until date.
|
|
1807
|
+
*
|
|
1808
|
+
* @param {CalendarDate} startDate - The `startDate` parameter is of type `CalendarDate` and
|
|
1809
|
+
* represents the starting date of a calendar event or interval.
|
|
1810
|
+
* @param {number} interval - The `interval` parameter represents the frequency at which the event
|
|
1811
|
+
* occurs. For example, if the interval is set to 2, the event will occur every 2 units of time (days,
|
|
1812
|
+
* weeks, months, etc.).
|
|
1813
|
+
* @param {Nullable<number>} count - The `count` parameter specifies the number of occurrences of the event. If `count`
|
|
1814
|
+
* is provided, the event will repeat `count` times within the specified interval. If `count` is not
|
|
1815
|
+
* provided, the event will repeat indefinitely based on the other parameters like `endDate` or
|
|
1816
|
+
* `until`.
|
|
1817
|
+
* @param {Nullable<CalendarDate>} until - The `until` parameter in the constructor is of type `Nullable<CalendarDate>`. This
|
|
1818
|
+
* means that it can either accept a `CalendarDate` object or be `null`. It is used to specify a date
|
|
1819
|
+
* until which the recurring event should repeat. If `until` is provided, the event
|
|
1820
|
+
*/
|
|
1821
|
+
constructor(startDate, interval, count, until) {
|
|
1822
|
+
super(startDate, interval, count, until);
|
|
1823
|
+
this.matchDay = this.repeatStartDate.date;
|
|
1824
|
+
this.matchMonth = this.repeatStartDate.month;
|
|
1825
|
+
this.initCache();
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* The function generates repeat dates and caches them until reaching the specified end date.
|
|
1829
|
+
*
|
|
1830
|
+
* @param {CalendarDate} endDate - The `endDate` parameter in the
|
|
1831
|
+
* `generateRepeatDateCacheUntilEndDate` function is a CalendarDate object that represents the date
|
|
1832
|
+
* until which the repeat date cache should be generated. The function checks if the last date in the
|
|
1833
|
+
* cache is before the `endDate`, and if so, it generates additional repeat dates
|
|
1834
|
+
*/
|
|
1835
|
+
generateRepeatDateCacheUntilEndDate(endDate) {
|
|
1836
|
+
const lastMatchDate = this.cache[this.cache.length - 1];
|
|
1837
|
+
if (lastMatchDate.toDate() < endDate.toDate() &&
|
|
1838
|
+
(!this.count || (typeof this.count === 'number' && this.cache.length < this.count))) {
|
|
1839
|
+
let nextMatchDate = this.getNextRepeatStartDate(lastMatchDate);
|
|
1840
|
+
while (nextMatchDate && nextMatchDate.toDate() < endDate.toDate()) {
|
|
1841
|
+
nextMatchDate = this.getNextRepeatStartDate(nextMatchDate);
|
|
1842
|
+
if (typeof this.count === 'number' && this.cache.length >= this.count) {
|
|
1843
|
+
break;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* The function getNextRepeatStartDate calculates the next repeat start date based on a given date and certain conditions.
|
|
1850
|
+
*
|
|
1851
|
+
* @param {CalendarDate} date - The `date` parameter represents the current date for which you want to
|
|
1852
|
+
* calculate the next repeat start date. It is of type `CalendarDate`, which seems to be a custom
|
|
1853
|
+
* class or structure that holds year, month, and day information.
|
|
1854
|
+
* @returns {Nullable<CalendarDate>} The function `getNextRepeatStartDate` returns either a `CalendarDate` object or `null`
|
|
1855
|
+
* based on certain conditions. If the next date exceeds the `until` date or the count limit has been
|
|
1856
|
+
* reached, it returns `null`. Otherwise, it adds the next date to the cache and returns it as a
|
|
1857
|
+
* `CalendarDate`.
|
|
1858
|
+
*/
|
|
1859
|
+
getNextRepeatStartDate(date) {
|
|
1860
|
+
const nextDate = this.getNextStartDate(date.year + this.interval);
|
|
1861
|
+
const nextCalendarDate = CalendarDate.from(nextDate);
|
|
1862
|
+
if ((this.until && nextDate > this.until.toDate()) ||
|
|
1863
|
+
(typeof this.count === 'number' && this.cache.length >= this.count)) {
|
|
1864
|
+
return null;
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
this.cache.push(nextCalendarDate);
|
|
1868
|
+
return nextCalendarDate;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* get the new date with fixed month and fixed date, if the date.getDate() not equal the fixed date or fixed month, find the next year
|
|
1873
|
+
*
|
|
1874
|
+
* @param {number} year year
|
|
1875
|
+
* @returns {Date} the new date
|
|
1876
|
+
*/
|
|
1877
|
+
getNextStartDate(year) {
|
|
1878
|
+
const nextDate = new Date(year, this.matchMonth - 1, this.matchDay);
|
|
1879
|
+
if (nextDate.getDate() === this.matchDay && nextDate.getMonth() + 1 === this.matchMonth) {
|
|
1880
|
+
return nextDate;
|
|
1881
|
+
}
|
|
1882
|
+
else {
|
|
1883
|
+
return this.getNextStartDate(year + 1);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* The function `initCache` initializes a cache array with the `startDate` value.
|
|
1888
|
+
*/
|
|
1889
|
+
initCache() {
|
|
1890
|
+
this.cache = [this.repeatStartDate];
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
/** This code snippet defines a TypeScript class `CalendarEventRepeatPatternFactory` that serves as a factory for creating different types of repeat patterns for calendar events. Here's a breakdown of what the class and its methods are doing: */
|
|
1895
|
+
class CalendarEventRepeatPatternFactory {
|
|
1896
|
+
/**
|
|
1897
|
+
* This `getPattern` method within the `CalendarEventRepeatPatternFactory` class is a public method that is responsible for creating and returning a specific type of repeat pattern for a calendar event based on the input parameters provided. Here's a breakdown of what this method is doing:
|
|
1898
|
+
*
|
|
1899
|
+
* @param {Date} startDate repeat start date
|
|
1900
|
+
* @param {VegaCalendarEventRepeatOptions|undefined} repeatOptions repeat options
|
|
1901
|
+
* @returns {CalendarEventBaseRepeatPattern} the match repeat pattern
|
|
1902
|
+
*/
|
|
1903
|
+
getPattern(startDate, repeatOptions) {
|
|
1904
|
+
const repeatStartDate = CalendarDate.from(startDate);
|
|
1905
|
+
const { frequency, interval = 1, byWeekDay, until, count, } = repeatOptions;
|
|
1906
|
+
const repeatEndDate = this.initDate(until);
|
|
1907
|
+
return this.initRepeatPattern(frequency, repeatStartDate, interval < 1 ? 1 : interval, count, repeatEndDate, byWeekDay);
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* The `initDate` function initializes a `CalendarDate` object based on the input date string or Date object provided.
|
|
1911
|
+
*
|
|
1912
|
+
* @param {Nullable<string | Date>} date - The `date` parameter can be either a string or a Date object.
|
|
1913
|
+
* @returns {Nullable<CalendarDate>} The function `initDate` returns a `Nullable<CalendarDate>`, which means it can return either a `CalendarDate` object or `null`.
|
|
1914
|
+
*/
|
|
1915
|
+
initDate(date) {
|
|
1916
|
+
if (date && typeof date === 'object') {
|
|
1917
|
+
return CalendarDate.from(date);
|
|
1918
|
+
}
|
|
1919
|
+
else if (date && typeof date === 'string') {
|
|
1920
|
+
const [month, day, year] = date.split('/');
|
|
1921
|
+
return new CalendarDate(Number(year), Number(month), Number(day));
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* The function `initRepeatPattern` initializes a repeat pattern based on the frequency specified for a calendar event.
|
|
1926
|
+
*
|
|
1927
|
+
* @param {VegaCalendarEventRepeatType} frequency event frequency
|
|
1928
|
+
* @param {CalendarDate} repeatStartDate event start date
|
|
1929
|
+
* @param {number} interval event repeat interval
|
|
1930
|
+
* @param {Nullable<number>} count the event repeat count
|
|
1931
|
+
* @param {Nullable<CalendarDate>} repeatEndDate repeat end date
|
|
1932
|
+
* @param {Nullable<VegaCalendarWeekDayType[]>} byWeekDay weekly week days
|
|
1933
|
+
* @returns {CalendarEventBaseRepeatPattern} calendar event repeat pattern instance
|
|
1934
|
+
*/
|
|
1935
|
+
initRepeatPattern(frequency, repeatStartDate, interval, count, repeatEndDate, byWeekDay) {
|
|
1936
|
+
switch (frequency) {
|
|
1937
|
+
case 'daily':
|
|
1938
|
+
return new CalendarEventDailyRepeatPattern(repeatStartDate, interval, count, repeatEndDate);
|
|
1939
|
+
case 'weekly':
|
|
1940
|
+
return new CalendarEventWeeklyRepeatPattern(repeatStartDate, interval, count, repeatEndDate, byWeekDay);
|
|
1941
|
+
case 'monthly':
|
|
1942
|
+
return new CalendarEventMonthlyRepeatPattern(repeatStartDate, interval, count, repeatEndDate);
|
|
1943
|
+
default:
|
|
1944
|
+
return new CalendarEventYearlyRepeatPattern(repeatStartDate, interval, count, repeatEndDate);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
const calendarEventRepeatPatternFactory = new CalendarEventRepeatPatternFactory();
|
|
1949
|
+
|
|
1320
1950
|
const CalendarDateFormatReg = /^\d{1,2}\/\d{1,2}\/\d{4}/;
|
|
1321
1951
|
const CalendarTimeFormatReg = /^\d{1,2}:\d{1,2}/;
|
|
1322
1952
|
/** The `CalendarEvent` class in TypeScript represents a calendar event with methods to validate required fields, initialize dates and times, and determine if it is a group event. */
|
|
@@ -1327,12 +1957,20 @@ class CalendarEvent {
|
|
|
1327
1957
|
* @param {VegaCalendarRawEvent} eventOptions - The `eventOptions` parameter in the constructor
|
|
1328
1958
|
* represents the raw event data for a Vega calendar event. It contains information such as the event
|
|
1329
1959
|
* title, start and end dates, location, description, and any other relevant details about the event.
|
|
1330
|
-
|
|
1331
|
-
|
|
1960
|
+
* @param {string} eventKey If a value is not provided for `eventKey`, a UUID (Universally
|
|
1961
|
+
* Unique Identifier) will be generated as a default value. This identifier is used to distinguish
|
|
1962
|
+
* different events and can be helpful for tracking
|
|
1963
|
+
*/
|
|
1964
|
+
constructor(eventOptions, eventKey) {
|
|
1965
|
+
// the default value is 1 when the event end date is same as start date
|
|
1966
|
+
this._eventSpansDays = 1;
|
|
1967
|
+
this.repeatPattern = null;
|
|
1332
1968
|
this._event = eventOptions;
|
|
1333
|
-
this._eventKey = generateUUID();
|
|
1969
|
+
this._eventKey = eventKey || generateUUID();
|
|
1334
1970
|
this.checkEventRequireField(eventOptions);
|
|
1335
1971
|
this.initDate(eventOptions);
|
|
1972
|
+
this.initEventSpansDays();
|
|
1973
|
+
this.initRepeatPattern();
|
|
1336
1974
|
}
|
|
1337
1975
|
/**
|
|
1338
1976
|
* The function returns the raw event data for a VegaCalendar event.
|
|
@@ -1391,12 +2029,12 @@ class CalendarEvent {
|
|
|
1391
2029
|
return !!this._event.isAllDay;
|
|
1392
2030
|
}
|
|
1393
2031
|
/**
|
|
1394
|
-
* The function isRepeatEvent returns a boolean value based on whether the event's
|
|
2032
|
+
* The function isRepeatEvent returns a boolean value based on whether the event's repeatOptions property is not equal to 'none'.
|
|
1395
2033
|
*
|
|
1396
2034
|
* @returns {boolean} The method `isRepeatEvent` returns a boolean value indicating whether the `_event` has a repeat value other than 'none'.
|
|
1397
2035
|
*/
|
|
1398
2036
|
get isRepeatEvent() {
|
|
1399
|
-
return this.
|
|
2037
|
+
return this.repeatPattern !== null;
|
|
1400
2038
|
}
|
|
1401
2039
|
/**
|
|
1402
2040
|
* The function returns the start date property of an object.
|
|
@@ -1430,16 +2068,39 @@ class CalendarEvent {
|
|
|
1430
2068
|
get endTime() {
|
|
1431
2069
|
return this._endTime;
|
|
1432
2070
|
}
|
|
2071
|
+
/**
|
|
2072
|
+
* This function returns the number of days that an event spans.
|
|
2073
|
+
*
|
|
2074
|
+
* @returns {number} The method `get eventSpansDays()` is returning the value of the property
|
|
2075
|
+
* `_eventSpansDays`, which is of type `number`.
|
|
2076
|
+
*/
|
|
2077
|
+
get eventSpansDays() {
|
|
2078
|
+
return this._eventSpansDays;
|
|
2079
|
+
}
|
|
2080
|
+
/**
|
|
2081
|
+
* The function `copyTo` copies a calendar event with updated start and end dates.
|
|
2082
|
+
*
|
|
2083
|
+
* @param {string} eventKey - The `eventKey` parameter in the `copyTo` function is a string that represents the key or identifier of the new calendar event that will be created.
|
|
2084
|
+
* @param {CalendarDate} startDate - The `startDate` parameter in the `copyTo` function represents
|
|
2085
|
+
* the starting date of a calendar event. It is of type `CalendarDate`, which may contain information such as the day, month, and year of the event.
|
|
2086
|
+
* @returns {CalendarEvent} A new `CalendarEvent` object is being returned with the properties from the original
|
|
2087
|
+
* `_event` object (excluding `repeatOptions`) and the `startDate` and `endDate` properties set to
|
|
2088
|
+
* the `toDate()` values of the `startDate` and `endDate` parameters.
|
|
2089
|
+
*/
|
|
2090
|
+
copyTo(eventKey, startDate) {
|
|
2091
|
+
const endDate = this._eventSpansDays > 1
|
|
2092
|
+
? new Date(startDate.year, startDate.month - 1, startDate.date + (this._eventSpansDays - 1))
|
|
2093
|
+
: startDate.toDate();
|
|
2094
|
+
const result = new CalendarEvent(Object.assign(Object.assign({}, this._event), { startDate: startDate.toDate(), endDate: endDate, startTime: this.startTime, endTime: this.endTime }), eventKey);
|
|
2095
|
+
return result;
|
|
2096
|
+
}
|
|
1433
2097
|
/**
|
|
1434
2098
|
* Check the event is a group event or not
|
|
1435
2099
|
*
|
|
1436
2100
|
* @returns {boolean} true or false
|
|
1437
2101
|
*/
|
|
1438
2102
|
isGroupEvent() {
|
|
1439
|
-
|
|
1440
|
-
const { year: endYear, month: endMonth, date: endDay, } = CalendarDate.from(this.endDate);
|
|
1441
|
-
return (!(startYear === endYear && startMonth === endMonth && startDay === endDay) &&
|
|
1442
|
-
this._event.repeat !== 'daily');
|
|
2103
|
+
return this._eventSpansDays > 1;
|
|
1443
2104
|
}
|
|
1444
2105
|
/**
|
|
1445
2106
|
* This TypeScript function checks if a given date falls within the range of a calendar event based on its start and end dates, considering different repeat types like daily, weekly, monthly, and yearly.
|
|
@@ -1452,23 +2113,8 @@ class CalendarEvent {
|
|
|
1452
2113
|
const { startDate, endDate } = this;
|
|
1453
2114
|
const startCalendarDate = CalendarDate.from(startDate);
|
|
1454
2115
|
const endCalendarDate = CalendarDate.from(new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate() + 1));
|
|
1455
|
-
const repeat = this._event.repeat;
|
|
1456
2116
|
const currentDate = date.toDate();
|
|
1457
|
-
|
|
1458
|
-
switch (repeat) {
|
|
1459
|
-
case 'daily':
|
|
1460
|
-
return true;
|
|
1461
|
-
case 'weekly':
|
|
1462
|
-
return currentDate.getDay() === startDate.getDay();
|
|
1463
|
-
case 'monthly':
|
|
1464
|
-
return date.date === startCalendarDate.date;
|
|
1465
|
-
case 'yearly':
|
|
1466
|
-
return date.month === startCalendarDate.month && date.date === startCalendarDate.date;
|
|
1467
|
-
default:
|
|
1468
|
-
return endCalendarDate.toDate() > currentDate;
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
return false;
|
|
2117
|
+
return startCalendarDate.toDate() <= currentDate && endCalendarDate.toDate() > currentDate;
|
|
1472
2118
|
}
|
|
1473
2119
|
/**
|
|
1474
2120
|
* Get the number of minutes the event lasted
|
|
@@ -1483,6 +2129,21 @@ class CalendarEvent {
|
|
|
1483
2129
|
const endDate = new Date(now.year, now.month, now.date, Number(endHour) === 0 && Number(startHour) !== 0 ? 24 : Number(endHour), Number(endMinutes));
|
|
1484
2130
|
return (endDate.valueOf() - startDate.valueOf()) / (60 * 1000);
|
|
1485
2131
|
}
|
|
2132
|
+
/**
|
|
2133
|
+
* This function returns an array of repeat series based on a given calendar period.
|
|
2134
|
+
*
|
|
2135
|
+
* @param {CalendarPeriod} period - The `period` parameter in the `getRepeatSeries` method is of type
|
|
2136
|
+
* `CalendarPeriod`. It represents a specific time period within a calendar, typically defined by a
|
|
2137
|
+
* start date and an end date. The method uses this period to generate a series of repeated events
|
|
2138
|
+
* based on a daily repeat pattern specified
|
|
2139
|
+
* @returns {CalendarDate[]} repeat start date array
|
|
2140
|
+
*/
|
|
2141
|
+
getRepeatSeries(period) {
|
|
2142
|
+
if (this.repeatPattern) {
|
|
2143
|
+
return this.repeatPattern.getRepeatSeries(period, this._eventSpansDays);
|
|
2144
|
+
}
|
|
2145
|
+
return [];
|
|
2146
|
+
}
|
|
1486
2147
|
/**
|
|
1487
2148
|
* The function `convertTimeTo24Hour` converts a time string from 12-hour format to 24-hour format in TypeScript.
|
|
1488
2149
|
*
|
|
@@ -1570,6 +2231,23 @@ class CalendarEvent {
|
|
|
1570
2231
|
this._endTime = this.convertTimeTo24Hour(endTime);
|
|
1571
2232
|
}
|
|
1572
2233
|
}
|
|
2234
|
+
/**
|
|
2235
|
+
* The function initializes a repeat pattern controller for a calendar event with specified start and end dates and repeat options.
|
|
2236
|
+
*/
|
|
2237
|
+
initRepeatPattern() {
|
|
2238
|
+
if (this._event.repeatOptions && this._event.repeatOptions.frequency) {
|
|
2239
|
+
this.repeatPattern = calendarEventRepeatPatternFactory.getPattern(this._startDate, this._event.repeatOptions);
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* Initializes the event cross days by the event start date and end date.
|
|
2244
|
+
*/
|
|
2245
|
+
initEventSpansDays() {
|
|
2246
|
+
const start = CalendarDate.from(this.startDate);
|
|
2247
|
+
const end = CalendarDate.from(this.endDate);
|
|
2248
|
+
this._eventSpansDays =
|
|
2249
|
+
(end.toDate().valueOf() - start.toDate().valueOf()) / (24 * 60 * 60 * 1000) + 1;
|
|
2250
|
+
}
|
|
1573
2251
|
}
|
|
1574
2252
|
|
|
1575
2253
|
var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -1580,6 +2258,11 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1580
2258
|
};
|
|
1581
2259
|
/** The `VegaCalendarEventController` class in TypeScript manages calendar events, initializes event layouts, retrieves events for the current date, and checks if a date falls within the range of a calendar event. */
|
|
1582
2260
|
class VegaCalendarEventController extends VegaSlimmer {
|
|
2261
|
+
constructor() {
|
|
2262
|
+
super(...arguments);
|
|
2263
|
+
// This map is cache for newly generated calendar events
|
|
2264
|
+
this.repeatEventMap = new Map();
|
|
2265
|
+
}
|
|
1583
2266
|
/**
|
|
1584
2267
|
* The function `getCurrentDateEvent` returns an array of calendar events for the current date, including both normal events and group events.
|
|
1585
2268
|
*
|
|
@@ -1590,7 +2273,7 @@ class VegaCalendarEventController extends VegaSlimmer {
|
|
|
1590
2273
|
* the group events and returns the combined array.
|
|
1591
2274
|
*/
|
|
1592
2275
|
getCurrentDateEvents(date) {
|
|
1593
|
-
const allEvents = this.
|
|
2276
|
+
const allEvents = this.createRepeatEvents();
|
|
1594
2277
|
return allEvents.filter((item) => item.isCurrentDayEvent(date));
|
|
1595
2278
|
}
|
|
1596
2279
|
/**
|
|
@@ -1600,6 +2283,7 @@ class VegaCalendarEventController extends VegaSlimmer {
|
|
|
1600
2283
|
*/
|
|
1601
2284
|
updateAfterEventChange(newEvents) {
|
|
1602
2285
|
this.initCalendarEvents(newEvents);
|
|
2286
|
+
this.repeatEventMap.clear();
|
|
1603
2287
|
}
|
|
1604
2288
|
/**
|
|
1605
2289
|
* initial calendar events in first time
|
|
@@ -1627,10 +2311,57 @@ class VegaCalendarEventController extends VegaSlimmer {
|
|
|
1627
2311
|
}
|
|
1628
2312
|
this.calendarEvents = result;
|
|
1629
2313
|
}
|
|
2314
|
+
/**
|
|
2315
|
+
* We need generate new calendar event from the full-day repeat calendar event, so we can render those event as normal full-day event
|
|
2316
|
+
*
|
|
2317
|
+
* @returns {CalendarEvent[]} The `handleRepeatEvents` method returns an array of `CalendarEvent` objects.
|
|
2318
|
+
*/
|
|
2319
|
+
createRepeatEvents() {
|
|
2320
|
+
const allEvents = this.calendarEvents;
|
|
2321
|
+
const otherEvents = [];
|
|
2322
|
+
const newRepeatEvents = [];
|
|
2323
|
+
allEvents.forEach((item) => {
|
|
2324
|
+
if (item.isRepeatEvent) {
|
|
2325
|
+
const repeatSeries = item.getRepeatSeries(this.currentPeriod);
|
|
2326
|
+
repeatSeries.forEach((series) => {
|
|
2327
|
+
newRepeatEvents.push(this.generateCalendarEventByRepeatSeries(item, series));
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
else {
|
|
2331
|
+
otherEvents.push(item);
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
return newRepeatEvents.concat(otherEvents);
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* This function generates a calendar event based on a repeat series and stores it in a map to avoid duplicate creation.
|
|
2338
|
+
*
|
|
2339
|
+
* @param {CalendarEvent} calendarEvent - The `calendarEvent` parameter represents a single event on
|
|
2340
|
+
* a calendar. It contains information such as the event's start date, end date, and other details.
|
|
2341
|
+
* @param {CalendarDate} series - The repeat start date
|
|
2342
|
+
* @returns {CalendarEvent} The function `generateCalendarEventByRepeatSeries` returns a `CalendarEvent` object. If
|
|
2343
|
+
* the event key already exists in the `repeatEventMap`, it returns the corresponding `CalendarEvent`
|
|
2344
|
+
* object from the map. Otherwise, it creates a new `CalendarEvent` object based on the input
|
|
2345
|
+
* `calendarEvent` and `series` parameters, adds it to the `repeatEventMap`, and then
|
|
2346
|
+
*/
|
|
2347
|
+
generateCalendarEventByRepeatSeries(calendarEvent, series) {
|
|
2348
|
+
const eventKey = `${calendarEvent.eventKey}-${series.year}${series.month}${series.date}`;
|
|
2349
|
+
if (this.repeatEventMap.has(eventKey)) {
|
|
2350
|
+
return this.repeatEventMap.get(eventKey);
|
|
2351
|
+
}
|
|
2352
|
+
else {
|
|
2353
|
+
const result = calendarEvent.copyTo(eventKey, series);
|
|
2354
|
+
this.repeatEventMap.set(eventKey, result);
|
|
2355
|
+
return result;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
1630
2358
|
}
|
|
1631
2359
|
__decorate$c([
|
|
1632
2360
|
MapToComponentField({ writable: true })
|
|
1633
2361
|
], VegaCalendarEventController.prototype, "calendarEvents", void 0);
|
|
2362
|
+
__decorate$c([
|
|
2363
|
+
MapToComponentField()
|
|
2364
|
+
], VegaCalendarEventController.prototype, "currentPeriod", void 0);
|
|
1634
2365
|
__decorate$c([
|
|
1635
2366
|
MapToComponentField()
|
|
1636
2367
|
], VegaCalendarEventController.prototype, "events", void 0);
|
|
@@ -2458,7 +3189,7 @@ __decorate$6([
|
|
|
2458
3189
|
MapToComponentField()
|
|
2459
3190
|
], VegaCalendarFullDayEventLayoutRenderer.prototype, "calendarView", void 0);
|
|
2460
3191
|
|
|
2461
|
-
const vegaCalendarCss = ".border-divider-top{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-left-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-left{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-right{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-bottom-width:0px}.border-divider-bottom{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px}:host{display:flex;flex-direction:column;border-radius:12px;border:1px solid rgba(var(--v-border-divider, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));overflow:hidden;width:100%;height:100%;box-sizing:border-box;max-height:1966px}.calendar-switch-panel{padding:24px;border-bottom-width:1px;border-top-width:0px;border-left-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));flex-shrink:0;width:100%;box-sizing:border-box}.calendar-switch-panel .calendar-date-switch-container{display:flex;gap:8px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-view-switch-container{display:flex;gap:16px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-current-date{padding-left:8px}.calendar-view{width:100%;position:relative;flex-grow:1;overflow-y:auto;overflow-x:hidden}.calendar-view-month .calendar-view-month-container{width:100%;display:grid;min-height:100%;grid-template-rows:43px repeat(6, minmax(64px, 1fr))}.calendar-view-month .calendar-view-title{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));top:0;left:0;z-index:62}.calendar-view-month .calendar-view-title div{padding-top:12px;padding-bottom:12px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-month .calendar-view-row{position:relative;display:grid;grid-template-rows:1fr;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-month .calendar-view-row.calendar-view-title{position:sticky}.calendar-view-month .calendar-view-row:last-child{border-bottom-width:0px}.calendar-view-month .calendar-view-row .row-cell{overflow:hidden;display:flex;flex-direction:column;justify-content:space-between}.calendar-view-month .calendar-view-row .row-cell:last-child{border-right-width:0px}.calendar-view-month .calendar-view-row .row-cell .date{padding-top:4px;padding-bottom:4px;padding-right:12px;padding-left:8px}.calendar-view-month .calendar-view-row .row-cell .date>div{display:inline-block;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-month .calendar-view-row .row-cell .date .month-block{margin-right:2px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col{text-align:center;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;cursor:pointer;width:18px;height:18px;line-height:18px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:hover{background-color:rgba(var(--v-bg-action-secondary-hover, 4, 112, 236, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:active{background-color:rgba(var(--v-bg-action-secondary-active, 29, 65, 195, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-month .calendar-view-row .row-cell.current-month-day .date>div{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled .date>div{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-top-left-radius:9999px;border-bottom-left-radius:9999px;color:rgba(var(--v-text-on-action, 252, 252, 252, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-container{width:100%}.calendar-view-container .calendar-view-title-container{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:sticky;top:0;left:0;z-index:62}.calendar-view-container .calendar-view-row{box-sizing:border-box;width:100%;display:flex;flex-direction:row}.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{width:72px;text-align:right;padding-right:8px;box-sizing:border-box;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-shrink:0}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-container .calendar-view-title{width:100%}.calendar-view-container .calendar-view-title>div{padding:12px;padding-bottom:8px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center;display:flex;flex-direction:column;gap:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-container .calendar-view-title .week-day{cursor:pointer;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}.calendar-view-container .calendar-view-title .active div{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.calendar-view-container .calendar-view-event-all-container{align-items:center}.calendar-view-container .calendar-view-event-all{display:grid;grid-template-rows:1fr;flex-grow:1;min-height:18px}.calendar-view-container .calendar-view-day-container .time-line{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr))}.calendar-view-container .calendar-view-day-container .time-line .time-text{margin-top:-9px}.calendar-view-container .calendar-view-day-container .calendar-view-content{width:100%}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr));grid-template-columns:minmax(64px, 1fr)}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col>.border-divider-top:first-child{border-top-width:0px}.calendar-view-container .calendar-view-content-container{width:100%;position:relative}.calendar-view-week .calendar-view-container{min-height:100%}.calendar-view-week .calendar-view-container .calendar-view-title{display:grid;grid-template-rows:1fr;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-event-all{grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-day-container .calendar-view-content{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .time-marker-container .time-marker{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .day-event-container{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-day .calendar-view-container{min-height:100%}.time-marker-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.time-marker-container.hidden{display:none}.time-marker-container .time-marker{position:absolute;height:2px;display:grid;min-width:100%;left:0;top:0;z-index:61}.time-marker-container .time-marker div{width:100%;height:2px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));opacity:0.3}.time-marker-container .time-marker div.active{opacity:1;position:relative}.time-marker-container .time-marker div.active::before{content:\"\";display:block;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;position:absolute;width:8px;height:8px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));top:-3px;left:-4px}.day-event-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.day-event-container .day-event-col{height:100%;overflow:hidden}.day-event-container vega-calendar-event{pointer-events:auto;height:100%}.calendar-view-month .month-event-row{position:absolute;width:100%;overflow:hidden;height:calc(100% - 26px);left:0;bottom:0}.calendar-view-month .events-container{width:100%;box-sizing:border-box;overflow:hidden;padding:2px;display:flex;flex-direction:column;gap:2px;justify-content:space-between;flex-grow:1}.calendar-view-month .events-container .event-list{display:flex;flex-direction:column;gap:2px;flex-grow:1}.calendar-view-month .events-container .event-list .month-event-block{box-sizing:border-box;padding-left:2px;padding-right:3px}.calendar-view-month .events-container .month-event-more .more-button{display:inline-block;height:16px;font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;border-radius:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-month .events-container .month-event-more .more-button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}.calendar-view-container .calendar-view-event-all{position:relative}.calendar-view-container .calendar-view-event-all .placeholder-block{padding-top:2px;padding-bottom:2px;box-sizing:content-box}.calendar-view-container .calendar-view-event-all .placeholder-block span{display:none}.calendar-view-container .calendar-view-event-all .day-event-block{padding-top:2px;padding-right:2px;box-sizing:border-box;padding-left:3px}.calendar-view-container .day-event-col{position:relative}.calendar-view-container .day-event-col .time-event-block{box-sizing:border-box;padding-right:8px;padding-bottom:2px;padding-top:3px}.calendar-view-container .day-event-col .time-event-block vega-calendar-event.bg-shadow::part(event-container):not(:focus){outline:2px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}.calendar-view-container .day-event-col .time-event-block:focus-within{z-index:60 !important}";
|
|
3192
|
+
const vegaCalendarCss = ".border-divider-top{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-left-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-left{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-right{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-bottom-width:0px}.border-divider-bottom{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px}:host{display:flex;flex-direction:column;border-radius:12px;border:1px solid rgba(var(--v-border-divider, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));overflow:hidden;width:100%;height:100%;box-sizing:border-box;max-height:1966px}.calendar-switch-panel{padding:24px;border-bottom-width:1px;border-top-width:0px;border-left-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));flex-shrink:0;width:100%;box-sizing:border-box}.calendar-switch-panel .calendar-date-switch-container{display:flex;gap:8px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-view-switch-container{display:flex;gap:16px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-current-date{padding-left:8px}.calendar-view{width:100%;position:relative;flex-grow:1;overflow-y:auto;overflow-x:hidden}.calendar-view-month .calendar-view-month-container{width:100%;display:grid;min-height:100%;grid-template-rows:43px repeat(6, minmax(64px, 1fr))}.calendar-view-month .calendar-view-title{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));top:0;left:0;z-index:62}.calendar-view-month .calendar-view-title div{padding-top:12px;padding-bottom:12px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-title div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-month .calendar-view-row{position:relative;display:grid;grid-template-rows:1fr;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-month .calendar-view-row.calendar-view-title{position:sticky}.calendar-view-month .calendar-view-row:last-child{border-bottom-width:0px}.calendar-view-month .calendar-view-row .row-cell{overflow:hidden;display:flex;flex-direction:column;justify-content:space-between}.calendar-view-month .calendar-view-row .row-cell:last-child{border-right-width:0px}.calendar-view-month .calendar-view-row .row-cell .date{padding-top:4px;padding-bottom:4px;padding-right:12px;padding-left:8px}.calendar-view-month .calendar-view-row .row-cell .date>div{display:inline-block;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-month .calendar-view-row .row-cell .date .month-block{margin-right:2px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col{text-align:center;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;cursor:pointer;width:18px;height:18px;line-height:18px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:hover{background-color:rgba(var(--v-bg-action-secondary-hover, 4, 112, 236, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:active{background-color:rgba(var(--v-bg-action-secondary-active, 29, 65, 195, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-month .calendar-view-row .row-cell.current-month-day .date>div{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled .date>div{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-top-left-radius:9999px;border-bottom-left-radius:9999px;color:rgba(var(--v-text-on-action, 252, 252, 252, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-container{width:100%}.calendar-view-container .calendar-view-title-container{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:sticky;top:0;left:0;z-index:62}.calendar-view-container .calendar-view-row{box-sizing:border-box;width:100%;display:flex;flex-direction:row}.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{width:72px;text-align:right;padding-right:8px;box-sizing:border-box;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-shrink:0}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-container .calendar-view-title{width:100%}.calendar-view-container .calendar-view-title>div{padding:12px;padding-bottom:8px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center;display:flex;flex-direction:column;gap:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-container .calendar-view-title .week-day{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title .week-day{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}.calendar-view-container .calendar-view-title .active div{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.calendar-view-container .calendar-view-event-all-container{align-items:center}.calendar-view-container .calendar-view-event-all{display:grid;grid-template-rows:1fr;flex-grow:1;min-height:18px}.calendar-view-container .calendar-view-day-container .time-line{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr))}.calendar-view-container .calendar-view-day-container .time-line .time-text{margin-top:-9px}.calendar-view-container .calendar-view-day-container .calendar-view-content{width:100%}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr));grid-template-columns:minmax(64px, 1fr)}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col>.border-divider-top:first-child{border-top-width:0px}.calendar-view-container .calendar-view-content-container{width:100%;position:relative}.calendar-view-week .calendar-view-container{min-height:100%}.calendar-view-week .calendar-view-container .calendar-view-title{display:grid;grid-template-rows:1fr;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-event-all{grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-day-container .calendar-view-content{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .time-marker-container .time-marker{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-week .day-event-container{display:grid;grid-template-columns:repeat(7, minmax(64px, 1fr))}.calendar-view-day .calendar-view-container{min-height:100%}.time-marker-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.time-marker-container.hidden{display:none}.time-marker-container .time-marker{position:absolute;height:2px;display:grid;min-width:100%;left:0;top:0;z-index:61}.time-marker-container .time-marker div{width:100%;height:2px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));opacity:0.3}.time-marker-container .time-marker div.active{opacity:1;position:relative}.time-marker-container .time-marker div.active::before{content:\"\";display:block;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;position:absolute;width:8px;height:8px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));top:-3px;left:-4px}.day-event-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.day-event-container .day-event-col{height:100%;overflow:hidden}.day-event-container vega-calendar-event{pointer-events:auto;height:100%}.calendar-view-month .month-event-row{position:absolute;width:100%;overflow:hidden;height:calc(100% - 26px);left:0;bottom:0}.calendar-view-month .events-container{width:100%;box-sizing:border-box;overflow:hidden;padding:2px;display:flex;flex-direction:column;gap:2px;justify-content:space-between;flex-grow:1}.calendar-view-month .events-container .event-list{display:flex;flex-direction:column;gap:2px;flex-grow:1}.calendar-view-month .events-container .event-list .month-event-block{box-sizing:border-box;padding-left:2px;padding-right:3px}.calendar-view-month .events-container .month-event-more .more-button{display:inline-block;height:16px;font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;border-radius:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .events-container .month-event-more .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-month .events-container .month-event-more .more-button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}.calendar-view-container .calendar-view-event-all{position:relative}.calendar-view-container .calendar-view-event-all .placeholder-block{padding-top:2px;padding-bottom:2px;box-sizing:content-box}.calendar-view-container .calendar-view-event-all .placeholder-block span{display:none}.calendar-view-container .calendar-view-event-all .day-event-block{padding-top:2px;padding-right:2px;box-sizing:border-box;padding-left:3px}.calendar-view-container .day-event-col{position:relative}.calendar-view-container .day-event-col .time-event-block{box-sizing:border-box;padding-right:8px;padding-bottom:2px;padding-top:3px}.calendar-view-container .day-event-col .time-event-block vega-calendar-event.bg-shadow::part(event-container):not(:focus){outline:2px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}.calendar-view-container .day-event-col .time-event-block:focus-within{z-index:60 !important}";
|
|
2462
3193
|
|
|
2463
3194
|
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2464
3195
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2477,6 +3208,8 @@ const VegaCalendar = class {
|
|
|
2477
3208
|
this.change = createEvent(this, "change", 7);
|
|
2478
3209
|
this.vegaEventClick = createEvent(this, "vegaEventClick", 7);
|
|
2479
3210
|
this.eventClick = createEvent(this, "eventClick", 7);
|
|
3211
|
+
this.vegaDateDblClick = createEvent(this, "vegaDateDblClick", 7);
|
|
3212
|
+
this.dateDblClick = createEvent(this, "dateDblClick", 7);
|
|
2480
3213
|
this.globalSlimmer = {};
|
|
2481
3214
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
2482
3215
|
this.renderer = new VegaCalendarRenderer();
|
|
@@ -2498,6 +3231,7 @@ const VegaCalendar = class {
|
|
|
2498
3231
|
this.eventResponsiveController = new VegaCalendarEventResponsiveController();
|
|
2499
3232
|
this.changeEventEmitter = createEventEmitSlimmer(VegaCalendar, VegaChange);
|
|
2500
3233
|
this.eventClickEmitter = createEventEmitSlimmer(VegaCalendar, VegaEventClick);
|
|
3234
|
+
this.dateDblClickEmitter = createEventEmitSlimmer(VegaCalendar, VegaDateDblClick);
|
|
2501
3235
|
this.changeEventPrevent = new ChildNodesEventPreventSlimmer([VegaChange], () => this.switchPanelRenderer.getSwitchPanelRef());
|
|
2502
3236
|
this.timeFormatNotifySlimmer = createSubStateNotifySlimmer(VegaCalendar, 'timeFormat', 'watchTimeFormat');
|
|
2503
3237
|
this.calendarEvents = [];
|
|
@@ -2512,9 +3246,12 @@ const VegaCalendar = class {
|
|
|
2512
3246
|
this.timeFormat = '24-hour';
|
|
2513
3247
|
}
|
|
2514
3248
|
/**
|
|
2515
|
-
*
|
|
3249
|
+
* Tracks changes to the current period state.
|
|
3250
|
+
*
|
|
3251
|
+
* @param {CalendarPeriod} newValue Specifies the new calendar period.
|
|
3252
|
+
* @param {CalendarPeriod} oldValue Specifies the old calendar period.
|
|
2516
3253
|
*/
|
|
2517
|
-
watchCurrentPeriodChange() {
|
|
3254
|
+
watchCurrentPeriodChange(newValue, oldValue) {
|
|
2518
3255
|
}
|
|
2519
3256
|
/**
|
|
2520
3257
|
* Watch the view mode change
|
|
@@ -2608,6 +3345,9 @@ __decorate$5([
|
|
|
2608
3345
|
__decorate$5([
|
|
2609
3346
|
InjectVegaSlimmer()
|
|
2610
3347
|
], VegaCalendar.prototype, "eventClickEmitter", void 0);
|
|
3348
|
+
__decorate$5([
|
|
3349
|
+
InjectVegaSlimmer()
|
|
3350
|
+
], VegaCalendar.prototype, "dateDblClickEmitter", void 0);
|
|
2611
3351
|
__decorate$5([
|
|
2612
3352
|
InjectVegaSlimmer()
|
|
2613
3353
|
], VegaCalendar.prototype, "changeEventPrevent", void 0);
|