@globalpayments/vega 2.26.0 → 2.28.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-2bae50fb.js → app-globals-512d84f4.js} +61 -9
- package/dist/cjs/{breakpoints-cb3291ba.js → breakpoints-7e2dff90.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-cc557cb3.js → child-nodes-event-prevent-slimmer-e383a914.js} +1 -1
- package/dist/cjs/{child-nodes-notify-observer-slimmer-c144a963.js → child-nodes-notify-observer-slimmer-79f2f5a7.js} +2 -2
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-d2d49ff5.js → create-public-api-runtime-metrics-slimmer-7510221b.js} +39 -2
- package/dist/cjs/{design-token-2c2cdd7d.js → design-token-17b8e4d8.js} +5 -5
- package/dist/cjs/{dom-node-subject-observer-factory-d2698876.js → dom-node-subject-observer-factory-2e41340d.js} +2 -31
- package/dist/cjs/{element-appender-slimmer-5fa9ff52.js → element-appender-slimmer-bf5ecbd8.js} +4 -4
- package/dist/cjs/{event-emit-slimmer-54616105.js → event-emit-slimmer-8f51adaa.js} +1 -1
- package/dist/cjs/{feature-flag-controller-e031c341.js → feature-flag-controller-078da332.js} +3 -0
- package/dist/cjs/{form-field-controller-slimmer-8b314ba2.js → form-field-controller-slimmer-223f8ee3.js} +54 -12
- package/dist/cjs/{icon-manager-2c3cf5ba.js → icon-manager-5a2b67cf.js} +4 -1
- package/dist/cjs/index.cjs.js +18 -14
- package/dist/cjs/{internal-icon-manager-3dd4faeb.js → internal-icon-manager-858baff1.js} +1 -1
- package/dist/cjs/loader.cjs.js +15 -12
- package/dist/cjs/{min-number-rule-0ce5347c.js → min-number-rule-84f21ad9.js} +8 -4
- package/dist/cjs/{min-string-length-rule-d1a1ea94.js → min-string-length-rule-75f24a48.js} +11 -4
- package/dist/cjs/observer-f49483e8.js +32 -0
- package/dist/cjs/{page-resize-observer-slimmer-1e404fc7.js → page-resize-observer-slimmer-a8cf1874.js} +1 -1
- package/dist/cjs/{remote-invocation-registry-162044d5.js → remote-invocation-registry-32aaf6c2.js} +3 -3
- package/dist/cjs/{required-field-rule-8655758f.js → required-field-rule-9a57b1a0.js} +1 -1
- package/dist/cjs/{responsive-format-facade-aa849dc7.js → responsive-format-facade-7bc51a43.js} +3 -3
- package/dist/cjs/{state-background-color-formatter-33ae4282.js → state-background-color-formatter-418b84e6.js} +1 -1
- package/dist/cjs/{static-subject-title-35e2a92c.js → static-subject-title-3599787e.js} +2 -0
- package/dist/cjs/{string-input-formatter-slimmer-0ac6e18a.js → string-input-formatter-slimmer-fcfa5bb7.js} +1 -1
- package/dist/cjs/{style-formatter-dc0682a4.js → style-formatter-a0829641.js} +2 -2
- package/dist/cjs/{sub-state-observer-slimmer-58217668.js → sub-state-observer-slimmer-36660092.js} +6 -5
- package/dist/cjs/translation-0dd74433.js +276 -0
- package/dist/cjs/translation-slimmer-83577cfd.js +42 -0
- package/dist/cjs/{type-guard-4d05d4b2.js → type-guard-a07b353b.js} +2 -2
- package/dist/cjs/{ui-077fc009.js → ui-32e69595.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +20 -20
- package/dist/cjs/vega-app-footer.cjs.entry.js +11 -11
- package/dist/cjs/vega-app-header-button.cjs.entry.js +25 -25
- package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/vega-banner.cjs.entry.js +14 -14
- package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-box.cjs.entry.js +9 -9
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +7 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +20 -19
- package/dist/cjs/vega-button-group_2.cjs.entry.js +12 -11
- package/dist/cjs/vega-button-link.cjs.entry.js +13 -12
- package/dist/cjs/vega-button.cjs.entry.js +21 -20
- package/dist/cjs/vega-calendar_3.cjs.entry.js +963 -826
- package/dist/cjs/vega-card.cjs.entry.js +7 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +16 -15
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +34 -32
- package/dist/cjs/vega-chip.cjs.entry.js +23 -22
- package/dist/cjs/vega-color-picker.cjs.entry.js +20 -18
- package/dist/cjs/vega-combo-box.cjs.entry.js +29 -27
- package/dist/cjs/vega-counter-badge.cjs.entry.js +4 -4
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +86 -48
- package/dist/cjs/{vega-dialog-controller-cb07e697.js → vega-dialog-controller-6a8525b3.js} +3 -3
- package/dist/cjs/vega-dialog_2.cjs.entry.js +26 -25
- package/dist/cjs/vega-divider.cjs.entry.js +10 -10
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +63 -50
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +7 -6
- package/dist/cjs/vega-file-uploader.cjs.entry.js +33 -24
- package/dist/cjs/vega-flex.cjs.entry.js +12 -12
- package/dist/cjs/vega-font.cjs.entry.js +11 -11
- package/dist/cjs/vega-form.cjs.entry.js +23 -21
- package/dist/cjs/vega-grid.cjs.entry.js +8 -8
- package/dist/cjs/vega-icon.cjs.entry.js +9 -10
- package/dist/cjs/vega-image-uploader.cjs.entry.js +40 -31
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +26 -25
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +35 -31
- package/dist/cjs/vega-input-range.cjs.entry.js +41 -31
- package/dist/cjs/vega-input-select.cjs.entry.js +43 -34
- package/dist/cjs/vega-input.cjs.entry.js +83 -48
- package/dist/cjs/vega-item-toggle.cjs.entry.js +7 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +24 -24
- package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +9 -8
- package/dist/cjs/vega-pagination.cjs.entry.js +27 -18
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +16 -15
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +13 -12
- package/dist/cjs/vega-radio_2.cjs.entry.js +29 -27
- package/dist/cjs/vega-section-title.cjs.entry.js +2 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +10 -9
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +28 -26
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +25 -23
- package/dist/cjs/vega-signature-capture.cjs.entry.js +40 -31
- package/dist/cjs/{vega-skeleton-loader-controller-cb631f0e.js → vega-skeleton-loader-controller-e886dc58.js} +28 -6
- package/dist/cjs/vega-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +22 -20
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +43 -17
- package/dist/cjs/vega-table_8.cjs.entry.js +389 -333
- package/dist/cjs/vega-text.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +27 -25
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +46 -29
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +18 -16
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -10
- package/dist/cjs/vega.cjs.js +15 -12
- package/dist/collection/components/vega-accordion/vega-accordion.css +21 -0
- package/dist/collection/components/vega-accordion/vega-accordion.js +16 -16
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +23 -23
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.css +7 -1
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +23 -23
- package/dist/collection/components/vega-backdrop/vega-backdrop.js +7 -7
- package/dist/collection/components/vega-banner/vega-banner.js +19 -19
- package/dist/collection/components/vega-box/vega-box.css +21 -0
- package/dist/collection/components/vega-box/vega-box.js +27 -27
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.js +7 -7
- package/dist/collection/components/vega-button/vega-button.css +1 -0
- package/dist/collection/components/vega-button/vega-button.js +22 -22
- package/dist/collection/components/vega-button-circle/vega-button-circle.css +4 -0
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +20 -20
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.css +10 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +8 -8
- package/dist/collection/components/vega-button-group/vega-button-group.css +13 -0
- package/dist/collection/components/vega-button-group/vega-button-group.js +9 -9
- package/dist/collection/components/vega-button-link/vega-button-link.js +20 -20
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-current-period-controller.js +17 -3
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-responsive-controller.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-view-controller.js +3 -0
- package/dist/collection/components/vega-calendar/slimmers/common/layout/full-day-event-layout-generator.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +19 -10
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-view-renderer.js +4 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/vega-calendar-day-event-layout-renderer.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-time-line-renderer.js +12 -2
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +9 -8
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +3 -1
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +12 -6
- package/dist/collection/components/vega-calendar/utils/index.js +24 -0
- package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.js +3 -2
- package/dist/collection/components/vega-calendar/vega-calendar-event/vega-calendar-event.js +2 -2
- package/dist/collection/components/vega-calendar/vega-calendar-event-slot/vega-calendar-event-slot.js +2 -2
- package/dist/collection/components/vega-calendar/vega-calendar.css +10 -6
- package/dist/collection/components/vega-calendar/vega-calendar.js +60 -19
- package/dist/collection/components/vega-card/vega-card.js +6 -6
- package/dist/collection/components/vega-carousel/vega-carousel.js +19 -19
- package/dist/collection/components/vega-chart/vega-bar-chart/vega-bar-chart.js +3 -3
- package/dist/collection/components/vega-chart/vega-line-chart/vega-line-chart.js +4 -4
- package/dist/collection/components/vega-chart/vega-pie-chart/vega-pie-chart.js +4 -4
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +21 -21
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +19 -19
- package/dist/collection/components/vega-chip/vega-chip.css +4 -0
- package/dist/collection/components/vega-chip/vega-chip.js +26 -26
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +21 -21
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +37 -37
- package/dist/collection/components/vega-counter-badge/vega-counter-badge.js +9 -9
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +16 -2
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.js +5 -2
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +1 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +42 -37
- package/dist/collection/components/vega-dialog/vega-dialog.js +13 -13
- package/dist/collection/components/vega-divider/vega-divider.js +7 -7
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +6 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-content-box/vega-dropdown-content-box.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-group/vega-dropdown-group.js +4 -4
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.js +12 -12
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +70 -65
- package/dist/collection/components/vega-field-error/vega-field-error.js +3 -3
- package/dist/collection/components/vega-field-label/vega-field-label.js +12 -12
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-container-renderer.js +4 -1
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +35 -30
- package/dist/collection/components/vega-flex/vega-flex.js +16 -16
- package/dist/collection/components/vega-font/vega-font.js +10 -10
- package/dist/collection/components/vega-form/vega-form.js +19 -19
- package/dist/collection/components/vega-grid/vega-grid.js +8 -8
- package/dist/collection/components/vega-hint/vega-hint.js +1 -1
- package/dist/collection/components/vega-icon/vega-icon.js +5 -5
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-default-content-renderer.js +4 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +45 -40
- package/dist/collection/components/vega-input/vega-input.js +58 -58
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +29 -29
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +28 -28
- package/dist/collection/components/vega-input-range/slimmers/renderers/vega-input-range-input-renderer.js +4 -1
- package/dist/collection/components/vega-input-range/vega-input-range.js +37 -32
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -2
- package/dist/collection/components/vega-input-select/vega-input-select.js +45 -40
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +9 -9
- package/dist/collection/components/vega-loader-wrapper/vega-loader-wrapper.js +1 -1
- package/dist/collection/components/vega-loading-indicator/vega-loading-indicator.js +15 -15
- package/dist/collection/components/vega-modal/vega-modal.js +29 -29
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +16 -16
- package/dist/collection/components/vega-nav/vega-left-nav-group/vega-left-nav-group.js +6 -6
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +8 -8
- package/dist/collection/components/vega-nav/vega-left-nav-section/vega-left-nav-section.js +4 -4
- package/dist/collection/components/vega-nav/vega-nav-card/vega-nav-card.js +3 -3
- package/dist/collection/components/vega-page-notification/vega-page-notification-list/vega-page-notification-list.js +1 -1
- package/dist/collection/components/vega-page-notification/vega-page-notification.js +15 -15
- package/dist/collection/components/vega-pagination/internal/vega-pagination-current-page-label.js +2 -2
- package/dist/collection/components/vega-pagination/internal/vega-pagination-go-to.js +2 -2
- package/dist/collection/components/vega-pagination/internal/vega-pagination-page-size-selector.js +2 -2
- package/dist/collection/components/vega-pagination/vega-pagination.js +23 -18
- package/dist/collection/components/vega-popover/vega-popover-content-box/vega-popover-content-box.js +3 -3
- package/dist/collection/components/vega-popover/vega-popover.js +19 -19
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +23 -23
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +22 -22
- package/dist/collection/components/vega-radio/vega-radio.js +16 -16
- package/dist/collection/components/vega-section-title/vega-section-title.js +7 -7
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +12 -12
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +16 -16
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +18 -18
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +18 -18
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +13 -13
- package/dist/collection/components/vega-signature-capture/slimmers/written-mode/renderers/written-mode-renderer.js +5 -2
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +34 -29
- package/dist/collection/components/vega-skeleton/vega-skeleton.js +7 -7
- package/dist/collection/components/vega-slot-container/vega-slot-container.js +1 -1
- package/dist/collection/components/vega-stepper/vega-stepper.js +22 -22
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.js +26 -1
- package/dist/collection/components/vega-tab-group/vega-tab-group-panel/vega-tab-group-panel.js +3 -3
- package/dist/collection/components/vega-tab-group/vega-tab-group.css +29 -0
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +14 -14
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-renderer.js +4 -1
- package/dist/collection/components/vega-table/vega-table-body/vega-table-body.js +1 -1
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +5 -5
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +2 -2
- package/dist/collection/components/vega-table/vega-table-head/vega-table-head.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head-cell/slimmers/renderers/sort-icon-renderer.js +38 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +27 -31
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +25 -26
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +3 -3
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +6 -6
- package/dist/collection/components/vega-table/vega-table.js +87 -82
- package/dist/collection/components/vega-text/vega-text.js +4 -4
- package/dist/collection/components/vega-textarea/vega-textarea.js +31 -31
- package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-input-renderer.js +7 -2
- package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.js +6 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker-dropdown/vega-time-picker-dropdown.js +1 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +31 -26
- package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +20 -20
- package/dist/collection/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.js +2 -2
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +15 -15
- package/dist/collection/components/vega-virtual-scroll/vega-virtual-scroll.js +16 -16
- package/dist/collection/constants/runtime-metrics-payload-definition/public-api/VegaTranslation/runtime-metrics-payload-definition.js +42 -0
- package/dist/collection/constants/ui.js +1 -1
- package/dist/collection/global/icons/arrow-up-arrow-down.js +3 -0
- package/dist/collection/global/icons/circle-arrow-down.js +3 -0
- package/dist/collection/global/icons/circle-arrow-up.js +3 -0
- package/dist/collection/global/scripts/before-vega-load.js +12 -2
- package/dist/collection/helpers/calendar/calendar-period/calendar-period.abstract.js +8 -0
- package/dist/collection/helpers/calendar/calendar-period/day-period.js +27 -4
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +4 -2
- package/dist/collection/helpers/calendar/calendar-period/week-period.js +4 -2
- package/dist/collection/helpers/calendar/calendar-view-generator/month-view-generator.js +8 -2
- package/dist/collection/helpers/calendar/calendar-view-generator/week-view-generator.js +8 -1
- package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +16 -0
- package/dist/collection/helpers/calendar/test/calendar-view-generator/month-view-generator.test.js +50 -0
- package/dist/collection/helpers/calendar/test/calendar-view-generator/week-view-generator.test.js +15 -0
- package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +1 -0
- package/dist/collection/helpers/common/wait-for-vega-handler.js +2 -0
- package/dist/collection/helpers/dialog/vega-dialog-controller.js +1 -0
- package/dist/collection/helpers/event-manager/vega-event-manager.js +3 -0
- package/dist/collection/helpers/feature-control/feature-flag-controller.js +3 -0
- package/dist/collection/helpers/formatter/string-formatter/number-mask-strategy.js +36 -4
- package/dist/collection/helpers/formatter/string-formatter/number-thousand-comma-strategy.js +9 -7
- package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-box-display-formatter.test.js +15 -3
- package/dist/collection/helpers/formatter/test/string-formatter/number-mask-strategy.test.js +11 -2
- package/dist/collection/helpers/formatter/test/string-formatter/number-thousand-comma-mask-strategy.test.js +2 -0
- package/dist/collection/helpers/icon/icon-manager.js +3 -0
- package/dist/collection/helpers/loading-indicator/vega-loader-controller.js +2 -0
- package/dist/collection/helpers/notify/vega-notify-controller.js +6 -0
- package/dist/collection/helpers/public-api.js +1 -0
- package/dist/collection/helpers/skeleton-loader/vega-skeleton-loader-controller.js +4 -0
- package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +46 -3
- package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +44 -0
- package/dist/collection/helpers/slimmers/sub-state/sub-state-observer-slimmer.js +2 -2
- package/dist/collection/helpers/slimmers/test/string-input-formatter-slimmer.test.js +20 -0
- package/dist/collection/helpers/slimmers/test/translation-slimmer.test.js +89 -0
- package/dist/collection/helpers/slimmers/translation/index.js +1 -0
- package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +37 -0
- package/dist/collection/helpers/theme/theme-manager.js +5 -0
- package/dist/collection/helpers/translation/index.js +4 -0
- package/dist/collection/helpers/translation/internal-translation-controller.js +104 -0
- package/dist/collection/helpers/translation/locales/en.js +74 -0
- package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +182 -0
- package/dist/collection/helpers/translation/tests/translation.test.js +32 -0
- package/dist/collection/helpers/translation/translation.js +51 -0
- package/dist/collection/helpers/validator/rules/check-box-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/date-range-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/date-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/email-field-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/input-phone-number-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/input-range-min-and-max-rule.js +5 -5
- package/dist/collection/helpers/validator/rules/input-range-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/max-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/max-string-length-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-and-max-date-rule.js +25 -10
- package/dist/collection/helpers/validator/rules/min-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-string-length-rule.js +7 -2
- package/dist/collection/helpers/validator/rules/required-field-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/time-range-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/time-range-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/time-required-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +8 -5
- package/dist/collection/helpers/validator/test/rules/custom-validation-rule.test.js +56 -0
- package/dist/collection/helpers/validator/test/rules/input-range-min-and-max-rule.test.js +4 -4
- package/dist/collection/helpers/validator/test/rules/max-number-rule.test.js +3 -3
- package/dist/collection/helpers/validator/test/rules/max-string-length-rule.test.js +1 -1
- package/dist/collection/helpers/validator/test/rules/min-and-max-date-rule.test.js +10 -10
- package/dist/collection/helpers/validator/test/rules/min-number-rule.test.js +2 -2
- package/dist/collection/helpers/validator/test/rules/min-string-length-rule.test.js +1 -1
- package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +4 -1
- package/dist/collection/helpers/zindex/vega-z-index-manager.js +1 -0
- package/dist/esm/{app-globals-b5bc861f.js → app-globals-41797af8.js} +61 -9
- package/dist/esm/{breakpoints-e59edf8d.js → breakpoints-36a3ed69.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-d3883004.js → child-nodes-event-prevent-slimmer-345c46c5.js} +1 -1
- package/dist/esm/{child-nodes-notify-observer-slimmer-50cd94b9.js → child-nodes-notify-observer-slimmer-3d52b843.js} +1 -1
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-dc9af92b.js → create-public-api-runtime-metrics-slimmer-928ad7f0.js} +37 -2
- package/dist/esm/{design-token-44525832.js → design-token-3671ce60.js} +5 -5
- package/dist/esm/{dom-node-subject-observer-factory-0d4b85b8.js → dom-node-subject-observer-factory-9461cd67.js} +2 -30
- package/dist/esm/{element-appender-slimmer-1aa00c06.js → element-appender-slimmer-1172e2ea.js} +4 -4
- package/dist/esm/{event-emit-slimmer-0315fa00.js → event-emit-slimmer-eee9fd41.js} +1 -1
- package/dist/esm/{feature-flag-controller-a5fe5022.js → feature-flag-controller-10780eeb.js} +3 -0
- package/dist/esm/{form-field-controller-slimmer-bf7441bd.js → form-field-controller-slimmer-edbaaf7c.js} +49 -7
- package/dist/esm/{icon-manager-754cda3f.js → icon-manager-0f030f8a.js} +4 -1
- package/dist/esm/index.js +16 -14
- package/dist/esm/{internal-icon-manager-ebe6ecf4.js → internal-icon-manager-9671142a.js} +1 -1
- package/dist/esm/loader.js +15 -12
- package/dist/esm/{min-number-rule-88e546e5.js → min-number-rule-8f643dbd.js} +8 -4
- package/dist/esm/{min-string-length-rule-27a8ba07.js → min-string-length-rule-c6a69eeb.js} +11 -4
- package/dist/esm/observer-3959f9dd.js +30 -0
- package/dist/esm/{page-resize-observer-slimmer-8caeb03b.js → page-resize-observer-slimmer-994c1e1b.js} +1 -1
- package/dist/esm/{remote-invocation-registry-cf9c81bb.js → remote-invocation-registry-1682b34e.js} +1 -1
- package/dist/esm/{required-field-rule-f438a73f.js → required-field-rule-5da360cc.js} +1 -1
- package/dist/esm/{responsive-format-facade-4488d609.js → responsive-format-facade-5a1329a7.js} +3 -3
- package/dist/esm/{state-background-color-formatter-de7e6522.js → state-background-color-formatter-0540d006.js} +1 -1
- package/dist/esm/{static-subject-title-2a4d6602.js → static-subject-title-6987a80b.js} +2 -1
- package/dist/esm/{string-input-formatter-slimmer-633271ed.js → string-input-formatter-slimmer-bfe3f5e5.js} +1 -1
- package/dist/esm/{style-formatter-391b4f97.js → style-formatter-2fa5ce09.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-46abe492.js → sub-state-observer-slimmer-8eff5559.js} +4 -3
- package/dist/esm/translation-0fa7cf77.js +272 -0
- package/dist/esm/translation-slimmer-79f9a9c9.js +40 -0
- package/dist/esm/{type-guard-467c9e3e.js → type-guard-63caf78b.js} +2 -2
- package/dist/esm/{ui-df46cc20.js → ui-8424715a.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +19 -19
- package/dist/esm/vega-app-footer.entry.js +11 -11
- package/dist/esm/vega-app-header-button.entry.js +25 -25
- package/dist/esm/vega-backdrop.entry.js +2 -2
- package/dist/esm/vega-banner.entry.js +14 -14
- package/dist/esm/vega-bar-chart.entry.js +1 -1
- package/dist/esm/vega-box.entry.js +9 -9
- package/dist/esm/vega-breadcrumb.entry.js +7 -6
- package/dist/esm/vega-button-circle.entry.js +20 -19
- package/dist/esm/vega-button-group_2.entry.js +12 -11
- package/dist/esm/vega-button-link.entry.js +13 -12
- package/dist/esm/vega-button.entry.js +21 -20
- package/dist/esm/vega-calendar_3.entry.js +962 -825
- package/dist/esm/vega-card.entry.js +7 -7
- package/dist/esm/vega-carousel.entry.js +16 -15
- package/dist/esm/vega-checkbox_2.entry.js +32 -30
- package/dist/esm/vega-chip.entry.js +23 -22
- package/dist/esm/vega-color-picker.entry.js +20 -18
- package/dist/esm/vega-combo-box.entry.js +29 -27
- package/dist/esm/vega-counter-badge.entry.js +4 -4
- package/dist/esm/vega-date-picker_2.entry.js +86 -48
- package/dist/esm/{vega-dialog-controller-fb1a8e21.js → vega-dialog-controller-3b905672.js} +2 -2
- package/dist/esm/vega-dialog_2.entry.js +26 -25
- package/dist/esm/vega-divider.entry.js +10 -10
- package/dist/esm/vega-dropdown_5.entry.js +63 -50
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +2 -2
- package/dist/esm/vega-field-label.entry.js +7 -6
- package/dist/esm/vega-file-uploader.entry.js +32 -23
- package/dist/esm/vega-flex.entry.js +12 -12
- package/dist/esm/vega-font.entry.js +11 -11
- package/dist/esm/vega-form.entry.js +19 -17
- package/dist/esm/vega-grid.entry.js +8 -8
- package/dist/esm/vega-icon.entry.js +9 -10
- package/dist/esm/vega-image-uploader.entry.js +40 -31
- package/dist/esm/vega-input-credit-card.entry.js +26 -25
- package/dist/esm/vega-input-phone-number.entry.js +35 -31
- package/dist/esm/vega-input-range.entry.js +41 -31
- package/dist/esm/vega-input-select.entry.js +43 -34
- package/dist/esm/vega-input.entry.js +83 -48
- package/dist/esm/vega-item-toggle.entry.js +7 -6
- package/dist/esm/vega-left-nav_5.entry.js +23 -23
- package/dist/esm/vega-line-chart.entry.js +1 -1
- package/dist/esm/vega-loader-wrapper_2.entry.js +12 -12
- package/dist/esm/vega-page-notification_2.entry.js +9 -8
- package/dist/esm/vega-pagination.entry.js +27 -18
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +16 -15
- package/dist/esm/vega-progress-tracker.entry.js +13 -12
- package/dist/esm/vega-radio_2.entry.js +27 -25
- package/dist/esm/vega-section-title.entry.js +2 -2
- package/dist/esm/vega-segment-control.entry.js +10 -9
- package/dist/esm/vega-selection-chip_2.entry.js +27 -25
- package/dist/esm/vega-selection-tile_2.entry.js +24 -22
- package/dist/esm/vega-signature-capture.entry.js +40 -31
- package/dist/esm/{vega-skeleton-loader-controller-74e3d189.js → vega-skeleton-loader-controller-6fb25f3b.js} +25 -3
- package/dist/esm/vega-skeleton.entry.js +2 -2
- package/dist/esm/vega-stepper.entry.js +22 -20
- package/dist/esm/vega-tab-group_2.entry.js +42 -16
- package/dist/esm/vega-table_8.entry.js +377 -321
- package/dist/esm/vega-text.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +27 -25
- package/dist/esm/vega-time-picker_2.entry.js +46 -29
- package/dist/esm/vega-toggle-switch.entry.js +18 -16
- package/dist/esm/vega-tooltip_2.entry.js +10 -10
- package/dist/esm/vega.js +15 -12
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +11 -11
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +12 -12
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +14 -14
- package/dist/types/components/vega-backdrop/vega-backdrop.d.ts +5 -5
- package/dist/types/components/vega-banner/vega-banner.d.ts +12 -12
- package/dist/types/components/vega-box/vega-box.d.ts +26 -26
- package/dist/types/components/vega-breadcrumb/vega-breadcrumb.d.ts +5 -5
- package/dist/types/components/vega-button/vega-button.d.ts +13 -13
- package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +13 -13
- package/dist/types/components/vega-button-group/vega-button-group-item/vega-button-group-item.d.ts +7 -7
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +6 -6
- package/dist/types/components/vega-button-link/vega-button-link.d.ts +12 -12
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-current-period-controller.d.ts +5 -0
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-view-controller.d.ts +1 -0
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.d.ts +2 -1
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-view-renderer.d.ts +1 -0
- package/dist/types/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-time-line-renderer.d.ts +4 -0
- package/dist/types/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.d.ts +1 -1
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +1 -1
- package/dist/types/components/vega-calendar/types.d.ts +9 -1
- package/dist/types/components/vega-calendar/utils/index.d.ts +13 -0
- package/dist/types/components/vega-calendar/vega-calendar-event/vega-calendar-event.d.ts +2 -2
- package/dist/types/components/vega-calendar/vega-calendar-event-slot/vega-calendar-event-slot.d.ts +2 -2
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +26 -14
- package/dist/types/components/vega-card/vega-card.d.ts +5 -5
- package/dist/types/components/vega-carousel/vega-carousel.d.ts +11 -11
- package/dist/types/components/vega-chart/vega-bar-chart/vega-bar-chart.d.ts +2 -2
- package/dist/types/components/vega-chart/vega-line-chart/vega-line-chart.d.ts +3 -3
- package/dist/types/components/vega-chart/vega-pie-chart/vega-pie-chart.d.ts +3 -3
- package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +12 -12
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +11 -11
- package/dist/types/components/vega-chip/vega-chip.d.ts +16 -16
- package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +12 -12
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +22 -22
- package/dist/types/components/vega-counter-badge/vega-counter-badge.d.ts +5 -5
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +7 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +24 -22
- package/dist/types/components/vega-dialog/vega-dialog.d.ts +10 -10
- package/dist/types/components/vega-divider/vega-divider.d.ts +4 -4
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-content-box/vega-dropdown-content-box.d.ts +1 -1
- package/dist/types/components/vega-dropdown/vega-dropdown-group/vega-dropdown-group.d.ts +3 -3
- package/dist/types/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.d.ts +10 -10
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +42 -40
- package/dist/types/components/vega-field-error/vega-field-error.d.ts +2 -2
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +8 -8
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-container-renderer.d.ts +1 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +23 -21
- package/dist/types/components/vega-flex/vega-flex.d.ts +13 -13
- package/dist/types/components/vega-font/vega-font.d.ts +6 -6
- package/dist/types/components/vega-form/vega-form.d.ts +13 -13
- package/dist/types/components/vega-grid/vega-grid.d.ts +4 -4
- package/dist/types/components/vega-hint/vega-hint.d.ts +1 -1
- package/dist/types/components/vega-icon/vega-icon.d.ts +4 -4
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-default-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +27 -25
- package/dist/types/components/vega-input/vega-input.d.ts +35 -35
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +18 -18
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +17 -17
- package/dist/types/components/vega-input-range/slimmers/renderers/vega-input-range-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-range/vega-input-range.d.ts +20 -18
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +26 -24
- package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +6 -6
- package/dist/types/components/vega-loader-wrapper/vega-loader-wrapper.d.ts +1 -1
- package/dist/types/components/vega-loading-indicator/vega-loading-indicator.d.ts +8 -8
- package/dist/types/components/vega-modal/vega-modal.d.ts +18 -18
- package/dist/types/components/vega-nav/vega-left-nav/vega-left-nav.d.ts +10 -10
- package/dist/types/components/vega-nav/vega-left-nav-group/vega-left-nav-group.d.ts +5 -5
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +7 -7
- package/dist/types/components/vega-nav/vega-left-nav-section/vega-left-nav-section.d.ts +4 -4
- package/dist/types/components/vega-nav/vega-nav-card/vega-nav-card.d.ts +3 -3
- package/dist/types/components/vega-page-notification/vega-page-notification-list/vega-page-notification-list.d.ts +1 -1
- package/dist/types/components/vega-page-notification/vega-page-notification.d.ts +8 -8
- package/dist/types/components/vega-pagination/internal/vega-pagination-current-page-label.d.ts +2 -0
- package/dist/types/components/vega-pagination/internal/vega-pagination-go-to.d.ts +2 -0
- package/dist/types/components/vega-pagination/internal/vega-pagination-page-size-selector.d.ts +2 -0
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +12 -10
- package/dist/types/components/vega-popover/vega-popover-content-box/vega-popover-content-box.d.ts +2 -2
- package/dist/types/components/vega-popover/vega-popover.d.ts +13 -13
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +13 -13
- package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +13 -13
- package/dist/types/components/vega-radio/vega-radio.d.ts +12 -12
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +5 -5
- package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +8 -8
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +11 -11
- package/dist/types/components/vega-selection-chip/vega-selection-chip.d.ts +12 -12
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +12 -12
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +10 -10
- package/dist/types/components/vega-signature-capture/slimmers/written-mode/renderers/written-mode-renderer.d.ts +1 -0
- package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +18 -16
- package/dist/types/components/vega-skeleton/vega-skeleton.d.ts +5 -5
- package/dist/types/components/vega-slot-container/vega-slot-container.d.ts +1 -1
- package/dist/types/components/vega-stepper/vega-stepper.d.ts +13 -13
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.d.ts +2 -0
- package/dist/types/components/vega-tab-group/types.d.ts +7 -0
- package/dist/types/components/vega-tab-group/vega-tab-group-panel/vega-tab-group-panel.d.ts +2 -2
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +9 -9
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-body/vega-table-body.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table-cell/vega-table-cell.d.ts +5 -5
- package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +2 -2
- package/dist/types/components/vega-table/vega-table-head/vega-table-head.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table-head-cell/slimmers/renderers/sort-icon-renderer.d.ts +8 -0
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +10 -10
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +3 -3
- package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +6 -6
- package/dist/types/components/vega-table/vega-table.d.ts +51 -49
- package/dist/types/components/vega-text/vega-text.d.ts +3 -3
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +18 -18
- package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-time-picker/vega-time-picker-dropdown/vega-time-picker-dropdown.d.ts +1 -1
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +18 -16
- package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +12 -12
- package/dist/types/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.d.ts +2 -2
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +11 -11
- package/dist/types/components/vega-virtual-scroll/vega-virtual-scroll.d.ts +9 -9
- package/dist/types/components.d.ts +1462 -1452
- package/dist/types/constants/runtime-metrics-payload-definition/public-api/VegaTranslation/runtime-metrics-payload-definition.d.ts +2 -0
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/global/icons/arrow-up-arrow-down.d.ts +3 -0
- package/dist/types/global/icons/circle-arrow-down.d.ts +3 -0
- package/dist/types/global/icons/circle-arrow-up.d.ts +3 -0
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +7 -0
- package/dist/types/helpers/calendar/calendar-period/day-period.d.ts +8 -1
- package/dist/types/helpers/calendar/calendar-period/month-period.d.ts +2 -1
- package/dist/types/helpers/calendar/calendar-period/week-period.d.ts +2 -1
- package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +2 -1
- package/dist/types/helpers/common/wait-for-vega-handler.d.ts +2 -0
- package/dist/types/helpers/dialog/vega-dialog-controller.d.ts +1 -0
- package/dist/types/helpers/event-manager/vega-event-manager.d.ts +3 -0
- package/dist/types/helpers/feature-control/feature-flag-controller.d.ts +3 -0
- package/dist/types/helpers/formatter/string-formatter/number-mask-strategy.d.ts +20 -0
- package/dist/types/helpers/icon/icon-manager.d.ts +3 -0
- package/dist/types/helpers/loading-indicator/vega-loader-controller.d.ts +2 -0
- package/dist/types/helpers/notify/vega-notify-controller.d.ts +6 -0
- package/dist/types/helpers/public-api.d.ts +1 -0
- package/dist/types/helpers/skeleton-loader/vega-skeleton-loader-controller.d.ts +4 -0
- package/dist/types/helpers/slimmers/field-error-ui-controller-slimmer.d.ts +22 -2
- package/dist/types/helpers/slimmers/global/vega-translate-observer-slimmer.d.ts +19 -0
- package/dist/types/helpers/slimmers/sub-state/sub-state-observer-slimmer.d.ts +1 -1
- package/dist/types/helpers/slimmers/test/translation-slimmer.test.d.ts +1 -0
- package/dist/types/helpers/slimmers/translation/index.d.ts +1 -0
- package/dist/types/helpers/slimmers/translation/translation-slimmer.d.ts +22 -0
- package/dist/types/helpers/theme/theme-manager.d.ts +5 -0
- package/dist/types/helpers/translation/index.d.ts +4 -0
- package/dist/types/helpers/translation/interface.d.ts +90 -0
- package/dist/types/helpers/translation/internal-translation-controller.d.ts +58 -0
- package/dist/types/helpers/translation/locales/en.d.ts +5 -0
- package/dist/types/helpers/translation/tests/internal-translation-controller.test.d.ts +1 -0
- package/dist/types/helpers/translation/tests/translation.test.d.ts +1 -0
- package/dist/types/helpers/translation/translation.d.ts +33 -0
- package/dist/types/helpers/validator/rules/check-box-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/date-range-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/date-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/email-field-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/form-field-validation-rule.d.ts +2 -5
- package/dist/types/helpers/validator/rules/input-phone-number-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/input-range-min-and-max-rule.d.ts +6 -5
- package/dist/types/helpers/validator/rules/input-range-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/max-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/max-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-and-max-date-rule.d.ts +8 -7
- package/dist/types/helpers/validator/rules/min-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/required-field-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/time-range-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/time-range-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/time-required-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/valid-credit-card-number-rule.d.ts +2 -1
- package/dist/types/helpers/validator/rules/valid-phone-number-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/validation-rule.d.ts +15 -2
- package/dist/types/helpers/validator/test/rules/custom-validation-rule.test.d.ts +1 -0
- package/dist/types/helpers/zindex/vega-z-index-manager.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/types/types/type-guard.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0120ce7a.js +1 -0
- package/dist/vega/p-0395e791.entry.js +1 -0
- package/dist/vega/p-048a97d1.entry.js +1 -0
- package/dist/vega/p-056f448c.entry.js +1 -0
- package/dist/vega/{p-1cb8f21a.entry.js → p-063c3ba6.entry.js} +1 -1
- package/dist/vega/p-0dd750b0.entry.js +1 -0
- package/dist/vega/p-115e5967.js +1 -0
- package/dist/vega/p-1b901368.entry.js +13 -0
- package/dist/vega/p-1bbc62ef.entry.js +1 -0
- package/dist/vega/{p-66098cf8.js → p-1ea57951.js} +1 -1
- package/dist/vega/p-1f38eef6.entry.js +1 -0
- package/dist/vega/p-1fc5373a.entry.js +1 -0
- package/dist/vega/p-22a85055.entry.js +1 -0
- package/dist/vega/p-26d0d411.entry.js +1 -0
- package/dist/vega/p-331a62d5.js +1 -0
- package/dist/vega/p-33366630.entry.js +1 -0
- package/dist/vega/p-34545d2d.entry.js +1 -0
- package/dist/vega/p-365c340d.entry.js +1 -0
- package/dist/vega/{p-f71aa49e.entry.js → p-3fc59fd3.entry.js} +1 -1
- package/dist/vega/p-40f6add9.entry.js +1 -0
- package/dist/vega/p-41784db1.js +1 -0
- package/dist/vega/p-456416ea.js +1 -0
- package/dist/vega/{p-883a939b.js → p-47c87634.js} +1 -1
- package/dist/vega/{p-5f456ea0.entry.js → p-4bc042ec.entry.js} +1 -1
- package/dist/vega/p-51622ace.entry.js +1 -0
- package/dist/vega/p-51cd2a39.entry.js +1 -0
- package/dist/vega/{p-1c1805aa.js → p-573948c2.js} +1 -1
- package/dist/vega/p-5d231a82.entry.js +1 -0
- package/dist/vega/{p-191c5c26.js → p-5dc98104.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-64e8bb64.js +1 -0
- package/dist/vega/p-657df167.entry.js +1 -0
- package/dist/vega/p-68055c2d.entry.js +1 -0
- package/dist/vega/p-6874d6a1.entry.js +1 -0
- package/dist/vega/p-6c6d86da.js +1 -0
- package/dist/vega/p-6d015656.entry.js +1 -0
- package/dist/vega/p-6e3cc7f0.entry.js +1 -0
- package/dist/vega/p-74168615.js +1 -0
- package/dist/vega/{p-4b29a9c2.entry.js → p-7a1df282.entry.js} +1 -1
- package/dist/vega/p-80c0f98c.entry.js +1 -0
- package/dist/vega/{p-016045b0.js → p-83af8ed7.js} +1 -1
- package/dist/vega/{p-462a6417.entry.js → p-84118b6d.entry.js} +1 -1
- package/dist/vega/p-880f91fb.js +1 -0
- package/dist/vega/p-8b0533c4.entry.js +1 -0
- package/dist/vega/p-8c72aa56.entry.js +1 -0
- package/dist/vega/p-8f60c3ee.entry.js +1 -0
- package/dist/vega/p-8fd6775a.entry.js +1 -0
- package/dist/vega/p-9a4ffc2c.entry.js +1 -0
- package/dist/vega/p-9e6934fb.js +1 -0
- package/dist/vega/{p-2df25c7f.js → p-9fbdeada.js} +1 -1
- package/dist/vega/p-a190c86a.js +1 -0
- package/dist/vega/p-a19ae233.entry.js +1 -0
- package/dist/vega/p-a454acc4.entry.js +1 -0
- package/dist/vega/{p-f1a59ae3.entry.js → p-a57eed48.entry.js} +1 -1
- package/dist/vega/p-a59c221b.entry.js +1 -0
- package/dist/vega/{p-a73c06f0.js → p-a5f80d35.js} +1 -1
- package/dist/vega/p-a8b1f19c.entry.js +1 -0
- package/dist/vega/{p-764be3f6.entry.js → p-a901494d.entry.js} +1 -1
- package/dist/vega/{p-af26780d.js → p-ac0ab38b.js} +1 -1
- package/dist/vega/p-acc14aa2.js +1 -0
- package/dist/vega/{p-9909e768.js → p-acf8b473.js} +1 -1
- package/dist/vega/{p-2675fb06.entry.js → p-b2053fa8.entry.js} +1 -1
- package/dist/vega/p-bccacf42.js +1 -0
- package/dist/vega/p-be26b334.entry.js +1 -0
- package/dist/vega/p-be784f53.js +1 -0
- package/dist/vega/{p-f6fa60f9.entry.js → p-cbeda6ca.entry.js} +1 -1
- package/dist/vega/p-d0a83562.entry.js +1 -0
- package/dist/vega/{p-3e1b21ec.entry.js → p-d4c85e4e.entry.js} +1 -1
- package/dist/vega/p-d4fb2264.entry.js +1 -0
- package/dist/vega/p-d550fc66.entry.js +1 -0
- package/dist/vega/p-d686dd96.entry.js +1 -0
- package/dist/vega/{p-bb491bed.js → p-da86ba01.js} +1 -1
- package/dist/vega/{p-59a75a4e.js → p-db120a1e.js} +1 -1
- package/dist/vega/p-e0410974.entry.js +1 -0
- package/dist/vega/p-ead9a2b9.entry.js +1 -0
- package/dist/vega/p-ec157238.js +1 -0
- package/dist/vega/p-f0ad06bd.entry.js +1 -0
- package/dist/vega/p-f2019f70.entry.js +1 -0
- package/dist/vega/p-f41102cd.js +1 -0
- package/dist/vega/{p-3542f8fe.js → p-f46c930f.js} +1 -1
- package/dist/vega/p-f948debe.entry.js +1 -0
- package/dist/vega/p-fb6c90d6.js +1 -0
- package/dist/vega/p-fc746bae.entry.js +1 -0
- package/dist/vega/{p-b6ef48be.entry.js → p-fd929ab5.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/misc-3d30df91.js +0 -41
- package/dist/esm/misc-9fdbcfbb.js +0 -37
- package/dist/vega/p-0134e8c5.js +0 -1
- package/dist/vega/p-020baf8d.entry.js +0 -1
- package/dist/vega/p-0702921a.entry.js +0 -1
- package/dist/vega/p-0f71ffab.entry.js +0 -1
- package/dist/vega/p-13f2c41c.entry.js +0 -1
- package/dist/vega/p-16c85ca9.entry.js +0 -1
- package/dist/vega/p-1878a270.entry.js +0 -1
- package/dist/vega/p-1f712313.js +0 -1
- package/dist/vega/p-23ec14fe.js +0 -1
- package/dist/vega/p-241bd30d.entry.js +0 -1
- package/dist/vega/p-25310239.entry.js +0 -1
- package/dist/vega/p-28b1a294.entry.js +0 -1
- package/dist/vega/p-29ac203a.js +0 -1
- package/dist/vega/p-396c3e32.entry.js +0 -1
- package/dist/vega/p-3c8b2105.js +0 -1
- package/dist/vega/p-3e6e7fe0.entry.js +0 -1
- package/dist/vega/p-41f61205.entry.js +0 -1
- package/dist/vega/p-4302b57d.entry.js +0 -1
- package/dist/vega/p-47d106e7.js +0 -1
- package/dist/vega/p-47ee3c26.entry.js +0 -1
- package/dist/vega/p-4925ec08.entry.js +0 -1
- package/dist/vega/p-4f8ce53e.entry.js +0 -1
- package/dist/vega/p-5041624e.entry.js +0 -1
- package/dist/vega/p-527fec9b.entry.js +0 -1
- package/dist/vega/p-530f2b72.entry.js +0 -1
- package/dist/vega/p-54f87b68.entry.js +0 -1
- package/dist/vega/p-55ccc669.entry.js +0 -1
- package/dist/vega/p-68e87fb4.entry.js +0 -13
- package/dist/vega/p-75c401fe.entry.js +0 -1
- package/dist/vega/p-770c736e.js +0 -1
- package/dist/vega/p-7cbd8367.entry.js +0 -1
- package/dist/vega/p-7ff750c0.entry.js +0 -1
- package/dist/vega/p-8172bde8.entry.js +0 -1
- package/dist/vega/p-8b5d3a52.js +0 -1
- package/dist/vega/p-8ca2b2a6.js +0 -1
- package/dist/vega/p-9f9535d4.js +0 -1
- package/dist/vega/p-a1f7484f.js +0 -1
- package/dist/vega/p-a537eaa9.entry.js +0 -1
- package/dist/vega/p-b34a7f6c.entry.js +0 -1
- package/dist/vega/p-b441fd2d.entry.js +0 -1
- package/dist/vega/p-b9cb9098.entry.js +0 -1
- package/dist/vega/p-bb953c8e.js +0 -1
- package/dist/vega/p-bc5ce560.entry.js +0 -1
- package/dist/vega/p-be893ca7.entry.js +0 -1
- package/dist/vega/p-c093f5d2.js +0 -1
- package/dist/vega/p-c4ebfb95.entry.js +0 -1
- package/dist/vega/p-c6e0ca01.entry.js +0 -1
- package/dist/vega/p-c946ff64.entry.js +0 -1
- package/dist/vega/p-ca656348.entry.js +0 -1
- package/dist/vega/p-d26f7423.entry.js +0 -1
- package/dist/vega/p-d6893dba.entry.js +0 -1
- package/dist/vega/p-d9cd543f.entry.js +0 -1
- package/dist/vega/p-d9fc1fff.entry.js +0 -1
- package/dist/vega/p-e011e457.entry.js +0 -1
- package/dist/vega/p-e4085f89.entry.js +0 -1
- package/dist/vega/p-ea1f50c9.entry.js +0 -1
- package/dist/vega/p-eae4a1c1.js +0 -1
- package/dist/vega/p-f9e456a6.js +0 -1
- /package/dist/vega/{p-7c316199.js → p-319efe6c.js} +0 -0
- /package/dist/vega/{p-961e1ecd.js → p-e2acbc60.js} +0 -0
|
@@ -6,35 +6,38 @@ const index = require('./index-09acd3c9.js');
|
|
|
6
6
|
const component = require('./component-73a88c4e.js');
|
|
7
7
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
8
8
|
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-1ee24991.js');
|
|
9
|
-
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-
|
|
9
|
+
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-2e41340d.js');
|
|
10
10
|
const vegaEventId = require('./vega-event-id-e40ac8f0.js');
|
|
11
|
-
const internalIconManager = require('./internal-icon-manager-
|
|
11
|
+
const internalIconManager = require('./internal-icon-manager-858baff1.js');
|
|
12
12
|
const date = require('./date-0a6bb035.js');
|
|
13
|
-
const eventEmitSlimmer = require('./event-emit-slimmer-
|
|
14
|
-
const childNodesEventPreventSlimmer = require('./child-nodes-event-prevent-slimmer-
|
|
13
|
+
const eventEmitSlimmer = require('./event-emit-slimmer-8f51adaa.js');
|
|
14
|
+
const childNodesEventPreventSlimmer = require('./child-nodes-event-prevent-slimmer-e383a914.js');
|
|
15
15
|
const vegaInternalEventId = require('./vega-internal-event-id-c98e9a7d.js');
|
|
16
16
|
const accessibility = require('./accessibility-bfa227f6.js');
|
|
17
17
|
const array = require('./array-6e559cde.js');
|
|
18
|
-
const
|
|
19
|
-
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-
|
|
18
|
+
const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-7510221b.js');
|
|
19
|
+
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-a8cf1874.js');
|
|
20
20
|
const timer = require('./timer-5f33058b.js');
|
|
21
21
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
22
|
-
const subStateObserverSlimmer = require('./sub-state-observer-slimmer-
|
|
22
|
+
const subStateObserverSlimmer = require('./sub-state-observer-slimmer-36660092.js');
|
|
23
|
+
const translationSlimmer = require('./translation-slimmer-83577cfd.js');
|
|
23
24
|
const placeholder = require('./placeholder-cb6d37ad.js');
|
|
24
|
-
const typeGuard = require('./type-guard-
|
|
25
|
-
const stateBackgroundColorFormatter = require('./state-background-color-formatter-
|
|
25
|
+
const typeGuard = require('./type-guard-a07b353b.js');
|
|
26
|
+
const stateBackgroundColorFormatter = require('./state-background-color-formatter-418b84e6.js');
|
|
26
27
|
const pixel = require('./pixel-98f2a10c.js');
|
|
28
|
+
require('./observer-f49483e8.js');
|
|
27
29
|
require('./ui-08f33116.js');
|
|
28
|
-
require('./icon-manager-
|
|
29
|
-
require('./create-public-api-runtime-metrics-slimmer-d2d49ff5.js');
|
|
30
|
+
require('./icon-manager-5a2b67cf.js');
|
|
30
31
|
require('./dynamic-slimmer-f31fdfd7.js');
|
|
31
32
|
require('./internal-vega-event-manager-627b1328.js');
|
|
32
33
|
require('./vega-env-manager-23b8b23c.js');
|
|
33
|
-
require('./feature-flag-controller-
|
|
34
|
+
require('./feature-flag-controller-078da332.js');
|
|
34
35
|
require('./index-5792390b.js');
|
|
35
36
|
require('./number-459031f7.js');
|
|
36
|
-
require('./breakpoints-
|
|
37
|
-
require('./ui-
|
|
37
|
+
require('./breakpoints-7e2dff90.js');
|
|
38
|
+
require('./ui-32e69595.js');
|
|
39
|
+
require('./translation-0dd74433.js');
|
|
40
|
+
require('./static-subject-title-3599787e.js');
|
|
38
41
|
require('./regex-c1f70fd4.js');
|
|
39
42
|
require('./typography-4560e7f1.js');
|
|
40
43
|
|
|
@@ -73,1047 +76,1146 @@ const chevronLeft = {
|
|
|
73
76
|
};
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* @param {Date} date the date object
|
|
79
|
-
* @param {boolean} isShortName short or long name
|
|
80
|
-
* @returns {string} the month English name
|
|
81
|
-
*/
|
|
82
|
-
function getMonthName(date, isShortName = false) {
|
|
83
|
-
return date.toLocaleDateString('en-US', { month: isShortName ? 'short' : 'long' });
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* The function `getTimeIndex` calculates the index of a given time string based on a specified time unit.
|
|
87
|
-
*
|
|
88
|
-
* @param {string} timeString - A string representing a time in the format "HH:MM", where HH is the hour and MM is the minutes.
|
|
89
|
-
* @param {number} [unit=15] - The `unit` parameter in the `getTimeIndex` function is used to specify
|
|
90
|
-
* the interval in minutes for dividing the day. By default, it is set to 15 minutes, meaning that the
|
|
91
|
-
* day will be divided into 15-minute intervals.
|
|
92
|
-
* @returns {number} the index of the given time string based on the specified time unit.
|
|
93
|
-
*/
|
|
94
|
-
function getTimeIndex(timeString, unit = 15) {
|
|
95
|
-
const [hour, minutes] = timeString.split(':');
|
|
96
|
-
return Math.round((Number(hour) * 60 + Number(minutes)) / unit);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Returns a string that includes the event key for a calendar event slot.
|
|
79
|
+
* Get a week days array
|
|
100
80
|
*
|
|
101
|
-
* @param {
|
|
102
|
-
* @returns {
|
|
81
|
+
* @param {number} firstWeekDay - The first week day (0: Sunday, 1: Monday, ...)
|
|
82
|
+
* @returns {number[]} - The week days array
|
|
103
83
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const ellipsisVertical = {
|
|
109
|
-
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M48 464a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm0-160a48 48 0 1 1 0-96 48 48 0 1 1 0 96zM0 96a48 48 0 1 1 96 0A48 48 0 1 1 0 96z"/></svg>`,
|
|
84
|
+
const getWeekdays = (firstWeekDay = 0) => {
|
|
85
|
+
const weekdays = [0, 1, 2, 3, 4, 5, 6];
|
|
86
|
+
return weekdays.concat(weekdays).slice(firstWeekDay, firstWeekDay + 7);
|
|
110
87
|
};
|
|
111
88
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
117
|
-
};
|
|
118
|
-
/** The `VegaCalendarSwitchPanelRenderer` class in TypeScript React renders a calendar switch panel with date navigation, view selection, and action buttons. */
|
|
119
|
-
class VegaCalendarSwitchPanelRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
89
|
+
/**
|
|
90
|
+
* Calendar view generator abstract class.
|
|
91
|
+
*/
|
|
92
|
+
class CalendarViewGenerator {
|
|
120
93
|
constructor() {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
* This function is responsible for updating the `viewMode` property of the `VegaCalendarSwitchPanelRenderer` class with the value extracted from the `input` parameter.
|
|
124
|
-
*
|
|
125
|
-
* @param {NotifyObserverPayload<VegaCalendarViewModeType>} input mark which view should be selected
|
|
126
|
-
*/
|
|
127
|
-
this.handleViewChange = (input) => {
|
|
128
|
-
this.currentPeriodController.updateCalendarPeriod(input.detail, this.currentPeriod.current);
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* reset view content to today
|
|
132
|
-
*/
|
|
133
|
-
this.todayButtonClick = () => {
|
|
134
|
-
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.now());
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* update view content after click next button
|
|
138
|
-
*/
|
|
139
|
-
this.nextButtonClick = () => {
|
|
140
|
-
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.next());
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* update view content after click previous button
|
|
144
|
-
*/
|
|
145
|
-
this.prevButtonClick = () => {
|
|
146
|
-
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.previous());
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* The more action menu ite click
|
|
150
|
-
*
|
|
151
|
-
* @param {NotifyObserverPayload<string>} payload The object contains the menu item key
|
|
152
|
-
*/
|
|
153
|
-
this.moreActionMenuClick = (payload) => {
|
|
154
|
-
this.moreActionClickEmitter.emit(payload.detail);
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* get the switch panel container element
|
|
159
|
-
*
|
|
160
|
-
* @returns {HTMLElement} container element
|
|
161
|
-
*/
|
|
162
|
-
getSwitchPanelRef() {
|
|
163
|
-
return this.switchPanelRef;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* calendar switch panel with date switch, view switch, add new button, and more action components.
|
|
167
|
-
*
|
|
168
|
-
* @returns {HTMLElement} html element
|
|
169
|
-
*/
|
|
170
|
-
render() {
|
|
171
|
-
return (index.h("vega-flex", { direction: "row", gap: "size-16", justifyContent: "space-between", alignItems: "center", class: "calendar-switch-panel", ref: (node) => (this.switchPanelRef = node) },
|
|
172
|
-
this.renderDateSwitch(),
|
|
173
|
-
index.h("div", { class: "calendar-view-switch-container" },
|
|
174
|
-
this.renderViewSwitch(),
|
|
175
|
-
this.renderMoreActionMenu())));
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* The `renderDateSwitch` function returns a container with buttons for switching dates and displaying the current date.
|
|
179
|
-
*
|
|
180
|
-
* @returns {HTMLDivElement} action button elements container.
|
|
181
|
-
*/
|
|
182
|
-
renderDateSwitch() {
|
|
183
|
-
return (index.h("div", { class: "calendar-date-switch-container" },
|
|
184
|
-
index.h("vega-button", { variant: "secondary", size: "small", ref: (button) => {
|
|
185
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.todayButtonClick);
|
|
186
|
-
} }, "Today"),
|
|
187
|
-
index.h("vega-button-circle", { variant: "secondary", size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('chevron-left'), label: "previous", showTooltip: false, ref: (button) => {
|
|
188
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.prevButtonClick);
|
|
189
|
-
} }),
|
|
190
|
-
index.h("vega-button-circle", { variant: "secondary", size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('chevron-right'), label: "next", showTooltip: false, ref: (button) => {
|
|
191
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.nextButtonClick);
|
|
192
|
-
} }),
|
|
193
|
-
this.renderCurrentPeriod()));
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* The function `renderCurrentPeriod` returns an HTML element displaying the view date content summary info.
|
|
197
|
-
*
|
|
198
|
-
* @returns {HTMLVegaFontElement} The text content inside the element is "Current Date Test".
|
|
199
|
-
*/
|
|
200
|
-
renderCurrentPeriod() {
|
|
201
|
-
return (index.h("vega-font", { class: "calendar-current-date", variant: "font-field-label", color: "text-primary" }, this.getViewDateSummary()));
|
|
94
|
+
this.WEEKDAYS_SHORT = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
95
|
+
this.weekdays = getWeekdays();
|
|
202
96
|
}
|
|
203
97
|
/**
|
|
204
|
-
*
|
|
98
|
+
* Get weekday names.
|
|
205
99
|
*
|
|
206
|
-
* @returns {
|
|
100
|
+
* @returns {string[]} - The weekday strings
|
|
207
101
|
*/
|
|
208
|
-
|
|
209
|
-
return
|
|
210
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, vegaEventId.VegaChange, this.handleViewChange);
|
|
211
|
-
} }));
|
|
102
|
+
getWeekdayNames() {
|
|
103
|
+
return this.WEEKDAYS_SHORT;
|
|
212
104
|
}
|
|
213
105
|
/**
|
|
214
|
-
*
|
|
106
|
+
* Generate calendar dates
|
|
215
107
|
*
|
|
216
|
-
* @
|
|
108
|
+
* @param {CalendarPeriod} period - The calendar period
|
|
109
|
+
* @returns {Date[]} - The date result
|
|
217
110
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
index.h("vega-button-circle", { size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('ellipsis-vertical'), variant: "icon-only" })));
|
|
111
|
+
generateDates(period) {
|
|
112
|
+
const cursor = period.startDate.toDate();
|
|
113
|
+
const dates = [];
|
|
114
|
+
for (let i = 0; i < period.count; i++) {
|
|
115
|
+
dates.push(new Date(cursor));
|
|
116
|
+
cursor.setDate(cursor.getDate() + 1);
|
|
225
117
|
}
|
|
118
|
+
return dates;
|
|
226
119
|
}
|
|
227
120
|
/**
|
|
228
|
-
*
|
|
121
|
+
* Generate calendar head
|
|
229
122
|
*
|
|
230
|
-
* @returns {string}
|
|
123
|
+
* @returns {string[]} - The data of week head
|
|
231
124
|
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
let result = '';
|
|
235
|
-
switch (this.viewMode) {
|
|
236
|
-
case 'day':
|
|
237
|
-
result = `${currentDate.date} ${getMonthName(currentDate.toDate())}, ${currentDate.year}`;
|
|
238
|
-
break;
|
|
239
|
-
case 'week': {
|
|
240
|
-
const start = this.currentPeriod.startDate;
|
|
241
|
-
const end = this.currentPeriod.endDate;
|
|
242
|
-
result = `${start.date} ${getMonthName(start.toDate())}${start.year === end.year ? '' : ', ' + start.year} - ${end.date} ${getMonthName(end.toDate())}, ${end.year}`;
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
case 'month':
|
|
246
|
-
result = `${getMonthName(currentDate.toDate())}, ${currentDate.year}`;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
return result;
|
|
125
|
+
generateWeekHead() {
|
|
126
|
+
return this.weekdays.map((day) => this.getWeekdayNames()[day]);
|
|
250
127
|
}
|
|
251
128
|
}
|
|
252
|
-
(() => {
|
|
253
|
-
internalIconManager.VegaInternalIconManager.register({
|
|
254
|
-
'chevron-right': chevronRight,
|
|
255
|
-
'chevron-left': chevronLeft,
|
|
256
|
-
'ellipsis-vertical': ellipsisVertical,
|
|
257
|
-
});
|
|
258
|
-
})();
|
|
259
|
-
VegaCalendarSwitchPanelRenderer.views = [
|
|
260
|
-
{ text: 'Day', key: 'day' },
|
|
261
|
-
{ text: 'Week', key: 'week' },
|
|
262
|
-
{ text: 'Month', key: 'month' },
|
|
263
|
-
];
|
|
264
|
-
__decorate$n([
|
|
265
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
266
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "viewMode", void 0);
|
|
267
|
-
__decorate$n([
|
|
268
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
269
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "calendarView", void 0);
|
|
270
|
-
__decorate$n([
|
|
271
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
272
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "currentPeriod", void 0);
|
|
273
|
-
__decorate$n([
|
|
274
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
275
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "moreActionDropdownProps", void 0);
|
|
276
|
-
__decorate$n([
|
|
277
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
278
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "moreActionClickEmitter", void 0);
|
|
279
|
-
__decorate$n([
|
|
280
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
281
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "currentPeriodController", void 0);
|
|
282
|
-
__decorate$n([
|
|
283
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
284
|
-
], VegaCalendarSwitchPanelRenderer.prototype, "calendarViewController", void 0);
|
|
285
129
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Calendar view
|
|
132
|
+
*/
|
|
133
|
+
class CalendarView {
|
|
134
|
+
constructor(weekdays, dateItems) {
|
|
135
|
+
this._weekdays = weekdays;
|
|
136
|
+
this._dateItems = dateItems;
|
|
137
|
+
}
|
|
294
138
|
/**
|
|
295
|
-
*
|
|
139
|
+
* The week head of the calendar view
|
|
296
140
|
*
|
|
297
|
-
* @
|
|
141
|
+
* @type {string[]}
|
|
298
142
|
*/
|
|
299
|
-
|
|
300
|
-
return
|
|
301
|
-
? this.monthViewRenderer.render()
|
|
302
|
-
: this.viewWithTimeRenderer.render()));
|
|
143
|
+
get weekdays() {
|
|
144
|
+
return this._weekdays;
|
|
303
145
|
}
|
|
304
|
-
}
|
|
305
|
-
__decorate$m([
|
|
306
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
307
|
-
], VegaCalendarViewRenderer.prototype, "viewMode", void 0);
|
|
308
|
-
__decorate$m([
|
|
309
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
310
|
-
], VegaCalendarViewRenderer.prototype, "monthViewRenderer", void 0);
|
|
311
|
-
__decorate$m([
|
|
312
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
313
|
-
], VegaCalendarViewRenderer.prototype, "viewWithTimeRenderer", void 0);
|
|
314
|
-
|
|
315
|
-
var __decorate$l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
316
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
317
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
318
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
319
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
320
|
-
};
|
|
321
|
-
/** The code provided is defining a TypeScript class called `VegaCalendarMonthViewRenderer` that extends `VegaSlimmer`. This class is responsible for rendering a month view of a calendar component. */
|
|
322
|
-
class VegaCalendarMonthViewRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
323
146
|
/**
|
|
324
|
-
*
|
|
147
|
+
* The date items of the calendar view
|
|
325
148
|
*
|
|
326
|
-
* @
|
|
149
|
+
* @type {CalendarDate[][]}
|
|
327
150
|
*/
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return (index.h("div", { class: "calendar-view-month-container" },
|
|
331
|
-
index.h("div", { class: "calendar-view-row calendar-view-title border-divider-bottom" }, weekHead.map((title) => (index.h("div", { key: title }, title)))),
|
|
332
|
-
this.renderMonthViewContent()));
|
|
151
|
+
get dateItems() {
|
|
152
|
+
return this._dateItems;
|
|
333
153
|
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Day view calendar generator
|
|
158
|
+
*/
|
|
159
|
+
class DayViewGenerator extends CalendarViewGenerator {
|
|
334
160
|
/**
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* @returns {HTMLElement[]} month view content and event content
|
|
161
|
+
* @inheritDoc
|
|
338
162
|
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
353
|
-
onDblClick: (e) => this.handleDateBlockClick(e, item) },
|
|
354
|
-
this.renderDateBlock(item),
|
|
355
|
-
this.monthEventRenderer.render(item, eventsArray[itemIndex], displayEventsArray[itemIndex], itemIndex)));
|
|
356
|
-
})));
|
|
357
|
-
});
|
|
163
|
+
generate(period) {
|
|
164
|
+
return new CalendarView([this.generateWeekHead()[period.current.toDate().getDay()]], [[period.current]]);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Calendar date class
|
|
170
|
+
*/
|
|
171
|
+
class CalendarDate {
|
|
172
|
+
constructor(year, month, date) {
|
|
173
|
+
this._date = date;
|
|
174
|
+
this._month = month;
|
|
175
|
+
this._year = year;
|
|
358
176
|
}
|
|
359
177
|
/**
|
|
360
|
-
*
|
|
178
|
+
* Create a calendar date from a Date object
|
|
361
179
|
*
|
|
362
|
-
* @param {
|
|
363
|
-
* @returns {
|
|
180
|
+
* @param {Date} date - The Date object
|
|
181
|
+
* @returns {CalendarDate} - Return a CalendarDate object
|
|
364
182
|
*/
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
return (index.h("div", { class: "date" },
|
|
368
|
-
isMonthFirstDay && index.h("div", { class: "month-block" }, getMonthName(item.toDate(), true)),
|
|
369
|
-
index.h("div", { role: "button", tabIndex: 0, class: "grid-col",
|
|
370
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
371
|
-
onDblClick: (e) => this.goToCurrentDayView(e, item) }, item.date)));
|
|
183
|
+
static from(date) {
|
|
184
|
+
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
372
185
|
}
|
|
373
186
|
/**
|
|
374
|
-
*
|
|
187
|
+
* The year of the calendar date
|
|
375
188
|
*
|
|
376
|
-
* @
|
|
377
|
-
* @param {CalendarDate} calendarDate the calendar date object
|
|
189
|
+
* @type {number}
|
|
378
190
|
*/
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
191
|
+
get year() {
|
|
192
|
+
return this._year;
|
|
193
|
+
}
|
|
194
|
+
set year(value) {
|
|
195
|
+
this._year = value;
|
|
382
196
|
}
|
|
383
197
|
/**
|
|
384
|
-
*
|
|
198
|
+
* The month of the calendar date
|
|
385
199
|
*
|
|
386
|
-
* @
|
|
387
|
-
* @param {CalendarDate} calendarDate the calendar date object
|
|
200
|
+
* @type {number}
|
|
388
201
|
*/
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
202
|
+
get month() {
|
|
203
|
+
return this._month;
|
|
204
|
+
}
|
|
205
|
+
set month(value) {
|
|
206
|
+
this._month = value;
|
|
395
207
|
}
|
|
396
208
|
/**
|
|
397
|
-
*
|
|
209
|
+
* The date of the calendar date
|
|
398
210
|
*
|
|
399
|
-
* @
|
|
400
|
-
* @returns {boolean} true or false
|
|
211
|
+
* @type {number}
|
|
401
212
|
*/
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
213
|
+
get date() {
|
|
214
|
+
return this._date;
|
|
215
|
+
}
|
|
216
|
+
set date(value) {
|
|
217
|
+
this._date = value;
|
|
405
218
|
}
|
|
406
|
-
}
|
|
407
|
-
__decorate$l([
|
|
408
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
409
|
-
], VegaCalendarMonthViewRenderer.prototype, "viewMode", void 0);
|
|
410
|
-
__decorate$l([
|
|
411
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
412
|
-
], VegaCalendarMonthViewRenderer.prototype, "calendarView", void 0);
|
|
413
|
-
__decorate$l([
|
|
414
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
415
|
-
], VegaCalendarMonthViewRenderer.prototype, "currentPeriod", void 0);
|
|
416
|
-
__decorate$l([
|
|
417
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
418
|
-
], VegaCalendarMonthViewRenderer.prototype, "calendarViewController", void 0);
|
|
419
|
-
__decorate$l([
|
|
420
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
421
|
-
], VegaCalendarMonthViewRenderer.prototype, "currentPeriodController", void 0);
|
|
422
|
-
__decorate$l([
|
|
423
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
424
|
-
], VegaCalendarMonthViewRenderer.prototype, "monthEventRenderer", void 0);
|
|
425
|
-
__decorate$l([
|
|
426
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
427
|
-
], VegaCalendarMonthViewRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
428
|
-
|
|
429
|
-
var __decorate$k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
430
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
431
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
432
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
433
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
434
|
-
};
|
|
435
|
-
/** The `VegaCalendarViewWithTimeRenderer` class in TypeScript React renders a day view for a calendar component with title, content, and hour blocks. */
|
|
436
|
-
class VegaCalendarViewWithTimeRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
437
219
|
/**
|
|
438
|
-
*
|
|
220
|
+
* Verify whether the calendar date is today
|
|
439
221
|
*
|
|
440
|
-
* @returns {
|
|
441
|
-
* specific day in the week. The content includes the title and the main content of the calendar view
|
|
442
|
-
* for that day.
|
|
222
|
+
* @returns {boolean} - Return true if the calendar date is today. Otherwise, return false.
|
|
443
223
|
*/
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
224
|
+
isToday() {
|
|
225
|
+
const today = new Date();
|
|
226
|
+
return (today.getFullYear() === this.year &&
|
|
227
|
+
today.getMonth() + 1 === this.month &&
|
|
228
|
+
today.getDate() === this.date);
|
|
448
229
|
}
|
|
449
230
|
/**
|
|
450
|
-
*
|
|
231
|
+
* Convert the calendar date to a Date object
|
|
451
232
|
*
|
|
452
|
-
* @returns {
|
|
233
|
+
* @returns {Date} - Return a Date object
|
|
453
234
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
const weekHead = this.calendarView.weekdays;
|
|
457
|
-
return (index.h("div", { class: "calendar-view-title-container" },
|
|
458
|
-
index.h("div", { class: "calendar-view-row" },
|
|
459
|
-
index.h("div", { class: "time-line-empty" }),
|
|
460
|
-
index.h("div", { class: "calendar-view-title" }, source.map((item, index$1) => (index.h("div", { key: item.date, class: { active: item.isToday() } },
|
|
461
|
-
index.h("div", null, weekHead[index$1]),
|
|
462
|
-
index.h("div", { class: "week-day" }, item.date)))))),
|
|
463
|
-
index.h("div", { class: "calendar-view-row calendar-view-event-all-container border-divider-bottom" },
|
|
464
|
-
index.h("div", { class: "time-line-all" }, "All Day"),
|
|
465
|
-
this.dayViewFullDayEventRenderer.render())));
|
|
235
|
+
toDate() {
|
|
236
|
+
return new Date(this.year, this.month - 1, this.date);
|
|
466
237
|
}
|
|
467
238
|
/**
|
|
468
|
-
*
|
|
239
|
+
* Compare with another calendar date
|
|
469
240
|
*
|
|
470
|
-
* @
|
|
241
|
+
* @param {CalendarDate} date - The calendar date to compare with
|
|
242
|
+
* @returns {DateCompareResult} - Return a DateCompareResult object
|
|
471
243
|
*/
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
244
|
+
compare(date) {
|
|
245
|
+
const { year, month } = date;
|
|
246
|
+
const result = {
|
|
247
|
+
isPreviousMonth: false,
|
|
248
|
+
inMonth: false,
|
|
249
|
+
isNextMonth: false,
|
|
250
|
+
};
|
|
251
|
+
if (this.year === year) {
|
|
252
|
+
if (this.month < month) {
|
|
253
|
+
result.isPreviousMonth = true;
|
|
254
|
+
}
|
|
255
|
+
else if (this.month > month) {
|
|
256
|
+
result.isNextMonth = true;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
result.inMonth = true;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else if (this.year > year) {
|
|
263
|
+
result.isNextMonth = true;
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
result.isPreviousMonth = true;
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
484
269
|
}
|
|
485
270
|
/**
|
|
486
|
-
* The function
|
|
271
|
+
* The function "equal" compares the year, month, and date of two CalendarDate objects and returns true if they are equal.
|
|
487
272
|
*
|
|
488
|
-
* @param {CalendarDate} calendarDate
|
|
489
|
-
*
|
|
273
|
+
* @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
|
|
274
|
+
* `CalendarDate` object passed as a parameter. The method returns `true` if all three values (year, month, date) are equal
|
|
275
|
+
* @returns {boolean} The date is same day with current
|
|
490
276
|
*/
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
return
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
277
|
+
equal(calendarDate) {
|
|
278
|
+
const { year, month, date } = calendarDate;
|
|
279
|
+
return this._year === year && this._month === month && this._date === date;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Calendar week view generator
|
|
285
|
+
*/
|
|
286
|
+
class WeekViewGenerator extends CalendarViewGenerator {
|
|
287
|
+
/**
|
|
288
|
+
* @inheritDoc
|
|
289
|
+
*/
|
|
290
|
+
generate(period) {
|
|
291
|
+
const dates = this.generateDates(period);
|
|
292
|
+
const showWeekends = period.showWeekends;
|
|
293
|
+
let weekDays = this.generateWeekHead();
|
|
294
|
+
let dateItems = [dates.map(CalendarDate.from)];
|
|
295
|
+
if (showWeekends === false) {
|
|
296
|
+
weekDays = weekDays.slice(1, 6);
|
|
297
|
+
dateItems = dateItems.map((items) => items.slice(1, 6));
|
|
298
|
+
}
|
|
299
|
+
return new CalendarView(weekDays, dateItems);
|
|
500
300
|
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Calendar month view generator
|
|
305
|
+
*/
|
|
306
|
+
class MonthViewGenerator extends CalendarViewGenerator {
|
|
501
307
|
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
* @param {CalendarDate} calendarDate the calendar date object
|
|
308
|
+
* @inheritDoc
|
|
505
309
|
*/
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
|
|
310
|
+
generate(period) {
|
|
311
|
+
const showWeekends = period.showWeekends;
|
|
312
|
+
let calendarDates = [];
|
|
313
|
+
let week = [];
|
|
314
|
+
const dates = this.generateDates(period);
|
|
315
|
+
dates.forEach((date, i) => {
|
|
316
|
+
if (!(i % 7)) {
|
|
317
|
+
calendarDates[i / 7] = week = [];
|
|
318
|
+
}
|
|
319
|
+
const item = CalendarDate.from(date);
|
|
320
|
+
week.push(item);
|
|
321
|
+
});
|
|
322
|
+
let weekDays = this.generateWeekHead();
|
|
323
|
+
if (showWeekends === false) {
|
|
324
|
+
weekDays = weekDays.slice(1, 6);
|
|
325
|
+
calendarDates = calendarDates.map((items) => items.slice(1, 6));
|
|
326
|
+
}
|
|
327
|
+
return new CalendarView(weekDays, calendarDates);
|
|
509
328
|
}
|
|
510
329
|
}
|
|
511
|
-
__decorate$k([
|
|
512
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
513
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "viewMode", void 0);
|
|
514
|
-
__decorate$k([
|
|
515
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
516
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "timeLineRenderer", void 0);
|
|
517
|
-
__decorate$k([
|
|
518
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
519
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "dayViewTimedEventRenderer", void 0);
|
|
520
|
-
__decorate$k([
|
|
521
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
522
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "dayViewFullDayEventRenderer", void 0);
|
|
523
|
-
__decorate$k([
|
|
524
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
525
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "calendarView", void 0);
|
|
526
|
-
__decorate$k([
|
|
527
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
528
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "calendarViewController", void 0);
|
|
529
|
-
__decorate$k([
|
|
530
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
531
|
-
], VegaCalendarViewWithTimeRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
532
330
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
331
|
+
/**
|
|
332
|
+
* CalendarPeriod is an abstract class that represents a period of date for calendar.
|
|
333
|
+
*/
|
|
334
|
+
class CalendarPeriod {
|
|
335
|
+
constructor(count, current) {
|
|
336
|
+
this._count = count;
|
|
337
|
+
this._current = current ? current : CalendarDate.from(new Date());
|
|
338
|
+
this.calculatePeriod(this._current);
|
|
339
|
+
}
|
|
541
340
|
/**
|
|
542
|
-
*
|
|
341
|
+
* The current date of the period.
|
|
543
342
|
*
|
|
544
|
-
* @
|
|
545
|
-
* @returns {HTMLElement} the html element
|
|
343
|
+
* @type {CalendarDate}
|
|
546
344
|
*/
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
return (index.h("div", { class: {
|
|
550
|
-
'time-marker-container': true,
|
|
551
|
-
'hidden': !isVisible,
|
|
552
|
-
} },
|
|
553
|
-
index.h("div", { class: "time-marker", style: { top: this.getTimeMarkerPosition() }, ref: (div) => (this.timeMarkerRef = div) }, source.map((item) => {
|
|
554
|
-
return index.h("div", { key: item.date, class: { active: item.isToday() } });
|
|
555
|
-
}))));
|
|
345
|
+
get current() {
|
|
346
|
+
return this._current;
|
|
556
347
|
}
|
|
557
348
|
/**
|
|
558
|
-
*
|
|
349
|
+
* The start date of the period
|
|
559
350
|
*
|
|
560
|
-
* @
|
|
351
|
+
* @type {CalendarDate}
|
|
561
352
|
*/
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return (index.h("div", { class: "time-line", ref: (div) => (this.timeLineRef = div) },
|
|
565
|
-
index.h("div", { class: "hour-empty" }),
|
|
566
|
-
timeLineSource.map((time, index$1) => {
|
|
567
|
-
return (index.h("div", { key: time },
|
|
568
|
-
index.h("div", { class: "time-text", "data-time": index$1 === 0 ? 24 : index$1 }, time)));
|
|
569
|
-
})));
|
|
353
|
+
get startDate() {
|
|
354
|
+
return this._startDate;
|
|
570
355
|
}
|
|
571
356
|
/**
|
|
572
|
-
*
|
|
357
|
+
* The end date of the period
|
|
573
358
|
*
|
|
574
|
-
* @
|
|
359
|
+
* @type {CalendarDate}
|
|
575
360
|
*/
|
|
576
|
-
|
|
577
|
-
this.
|
|
578
|
-
this.syncTimeMarkerPosition(viewMode);
|
|
361
|
+
get endDate() {
|
|
362
|
+
return this._endDate;
|
|
579
363
|
}
|
|
580
364
|
/**
|
|
581
|
-
*
|
|
365
|
+
* The count of the period
|
|
366
|
+
*
|
|
367
|
+
* @type {number}
|
|
582
368
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
369
|
+
get count() {
|
|
370
|
+
return this._count;
|
|
585
371
|
}
|
|
586
372
|
/**
|
|
587
|
-
*
|
|
373
|
+
* This function returns the type of the object.
|
|
374
|
+
*
|
|
375
|
+
* @type {string}
|
|
588
376
|
*/
|
|
589
|
-
|
|
590
|
-
this.
|
|
377
|
+
get type() {
|
|
378
|
+
return this._type;
|
|
591
379
|
}
|
|
592
380
|
/**
|
|
593
|
-
*
|
|
381
|
+
* This function returns the showWeekends of the object.
|
|
594
382
|
*
|
|
595
|
-
* @
|
|
383
|
+
* @type {boolean}
|
|
596
384
|
*/
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
const minutesOneDay = 24 * 60;
|
|
600
|
-
return ((now.getHours() * 60 + now.getMinutes()) / minutesOneDay) * 100 + '%';
|
|
385
|
+
get showWeekends() {
|
|
386
|
+
return this._showWeekends;
|
|
601
387
|
}
|
|
602
388
|
/**
|
|
603
|
-
*
|
|
389
|
+
* Go to a specific date.
|
|
604
390
|
*
|
|
605
|
-
* @
|
|
391
|
+
* @param {CalendarDate} date - The date to go to.
|
|
392
|
+
* @returns {this} - The current period.
|
|
606
393
|
*/
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
if (this.timeFormat === '12-hour') {
|
|
610
|
-
timeLine.push('12 AM');
|
|
611
|
-
for (let i = 1; i < 12; i++) {
|
|
612
|
-
timeLine.push(`${i} AM`);
|
|
613
|
-
}
|
|
614
|
-
timeLine.push('12 PM');
|
|
615
|
-
for (let i = 1; i < 12; i++) {
|
|
616
|
-
timeLine.push(`${i} PM`);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
for (let i = 0; i < 24; i++) {
|
|
621
|
-
timeLine.push(date.pad(i));
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
return timeLine;
|
|
394
|
+
goTo(date) {
|
|
395
|
+
return this.createBy(date);
|
|
625
396
|
}
|
|
626
|
-
/*
|
|
627
|
-
* The below method is e2e-test covered in
|
|
628
|
-
* @see{module:vega-calendar-scroll-to-current-time}
|
|
629
|
-
*/
|
|
630
|
-
/* istanbul ignore next */
|
|
631
397
|
/**
|
|
632
|
-
*
|
|
398
|
+
* Go to now.
|
|
633
399
|
*
|
|
634
|
-
* @
|
|
400
|
+
* @returns {this} - The current period.
|
|
635
401
|
*/
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
if (viewMode !== 'month') {
|
|
639
|
-
this.timeMarkerPositionTimer = setInterval(() => {
|
|
640
|
-
if (this.timeMarkerRef) {
|
|
641
|
-
this.timeMarkerRef.style.top = this.getTimeMarkerPosition();
|
|
642
|
-
}
|
|
643
|
-
}, 60 * 1000);
|
|
644
|
-
}
|
|
402
|
+
now() {
|
|
403
|
+
return this.createBy(CalendarDate.from(new Date()));
|
|
645
404
|
}
|
|
646
|
-
/*
|
|
647
|
-
* The below method is e2e-test covered in
|
|
648
|
-
* @see{module:vega-calendar-scroll-to-current-time}
|
|
649
|
-
*/
|
|
650
|
-
/* istanbul ignore next */
|
|
651
405
|
/**
|
|
652
|
-
*
|
|
406
|
+
* Calculate the period start date and end date.
|
|
653
407
|
*
|
|
654
|
-
* @param {
|
|
408
|
+
* @param {CalendarDate} date - The date to calculate the period from.
|
|
655
409
|
*/
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
var _a, _b;
|
|
661
|
-
const hour = new Date().getHours();
|
|
662
|
-
(_b = (_a = this.timeLineRef) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-time='${hour < 23 ? hour + 1 : hour}']`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'end' });
|
|
663
|
-
}, 0);
|
|
410
|
+
calculatePeriod(date) {
|
|
411
|
+
const cursor = date.toDate();
|
|
412
|
+
if (this.count > 1) {
|
|
413
|
+
cursor.setDate(cursor.getDate() - getWeekdays().indexOf(cursor.getDay()));
|
|
664
414
|
}
|
|
415
|
+
this._startDate = CalendarDate.from(cursor);
|
|
416
|
+
cursor.setDate(cursor.getDate() + this.count - 1);
|
|
417
|
+
this._endDate = CalendarDate.from(cursor);
|
|
665
418
|
}
|
|
666
419
|
}
|
|
667
|
-
__decorate$j([
|
|
668
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
669
|
-
], VegaCalendarTimeLineRenderer.prototype, "timeFormat", void 0);
|
|
670
|
-
__decorate$j([
|
|
671
|
-
globalSlimmerRegistry.MapToComponentField()
|
|
672
|
-
], VegaCalendarTimeLineRenderer.prototype, "viewMode", void 0);
|
|
673
|
-
__decorate$j([
|
|
674
|
-
globalSlimmerRegistry.MapToComponentMethod('watchViewModeChange')
|
|
675
|
-
], VegaCalendarTimeLineRenderer.prototype, "updateTimeLine", null);
|
|
676
|
-
__decorate$j([
|
|
677
|
-
globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
|
|
678
|
-
], VegaCalendarTimeLineRenderer.prototype, "clearTimer", null);
|
|
679
|
-
__decorate$j([
|
|
680
|
-
globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
|
|
681
|
-
], VegaCalendarTimeLineRenderer.prototype, "updateTimeLineIfComponentAddBack", null);
|
|
682
420
|
|
|
683
421
|
/**
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
* @param {number} firstWeekDay - The first week day (0: Sunday, 1: Monday, ...)
|
|
687
|
-
* @returns {number[]} - The week days array
|
|
422
|
+
* Period of day.
|
|
688
423
|
*/
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
424
|
+
class DayPeriod extends CalendarPeriod {
|
|
425
|
+
constructor(current, showWeekends) {
|
|
426
|
+
super(DayPeriod.DISPLAY_DATE_COUNT, current);
|
|
427
|
+
this._type = 'day';
|
|
428
|
+
this._showWeekends = true;
|
|
429
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* @inheritDoc
|
|
433
|
+
*/
|
|
434
|
+
next() {
|
|
435
|
+
const nextDate = this.current.toDate();
|
|
436
|
+
nextDate.setDate(nextDate.getDate() + 1);
|
|
437
|
+
let calendarDate = CalendarDate.from(nextDate);
|
|
438
|
+
if (this._showWeekends === false) {
|
|
439
|
+
calendarDate = getClosestWorkday(calendarDate);
|
|
440
|
+
}
|
|
441
|
+
return this.createBy(calendarDate);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* @inheritDoc
|
|
445
|
+
*/
|
|
446
|
+
previous() {
|
|
447
|
+
const previousDate = this.current.toDate();
|
|
448
|
+
previousDate.setDate(previousDate.getDate() - 1);
|
|
449
|
+
let calendarDate = CalendarDate.from(previousDate);
|
|
450
|
+
if (this._showWeekends === false) {
|
|
451
|
+
calendarDate = getClosestWorkday(calendarDate, DateDirection.PREVIOUS);
|
|
452
|
+
}
|
|
453
|
+
return this.createBy(calendarDate);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Go to now.
|
|
457
|
+
*
|
|
458
|
+
* @returns {this} - The current period.
|
|
459
|
+
*/
|
|
460
|
+
now() {
|
|
461
|
+
let calendarDate = CalendarDate.from(new Date());
|
|
462
|
+
if (this._showWeekends === false) {
|
|
463
|
+
calendarDate = getClosestWorkday(calendarDate);
|
|
464
|
+
}
|
|
465
|
+
return this.createBy(calendarDate);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* @inheritDoc
|
|
469
|
+
*/
|
|
470
|
+
createBy(current) {
|
|
471
|
+
return new DayPeriod(current, this._showWeekends);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
DayPeriod.DISPLAY_DATE_COUNT = 1;
|
|
693
475
|
|
|
694
476
|
/**
|
|
695
|
-
*
|
|
477
|
+
* Period of the week
|
|
696
478
|
*/
|
|
697
|
-
class
|
|
698
|
-
constructor() {
|
|
699
|
-
|
|
700
|
-
this.
|
|
479
|
+
class WeekPeriod extends CalendarPeriod {
|
|
480
|
+
constructor(current, showWeekends) {
|
|
481
|
+
super(WeekPeriod.DISPLAY_DATE_COUNT, current);
|
|
482
|
+
this._type = 'week';
|
|
483
|
+
this._showWeekends = true;
|
|
484
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
701
485
|
}
|
|
702
486
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
* @returns {string[]} - The weekday strings
|
|
487
|
+
* @inheritDoc
|
|
706
488
|
*/
|
|
707
|
-
|
|
708
|
-
|
|
489
|
+
next() {
|
|
490
|
+
const nextWeekStartDate = this.current.toDate();
|
|
491
|
+
nextWeekStartDate.setDate(nextWeekStartDate.getDate() - getWeekdays().indexOf(nextWeekStartDate.getDay()) + 7);
|
|
492
|
+
return this.createBy(CalendarDate.from(nextWeekStartDate));
|
|
709
493
|
}
|
|
710
494
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* @param {CalendarPeriod} period - The calendar period
|
|
714
|
-
* @returns {Date[]} - The date result
|
|
495
|
+
* @inheritDoc
|
|
715
496
|
*/
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
dates.push(new Date(cursor));
|
|
721
|
-
cursor.setDate(cursor.getDate() + 1);
|
|
722
|
-
}
|
|
723
|
-
return dates;
|
|
497
|
+
previous() {
|
|
498
|
+
const previousWeekStartDate = this.current.toDate();
|
|
499
|
+
previousWeekStartDate.setDate(previousWeekStartDate.getDate() - getWeekdays().indexOf(previousWeekStartDate.getDay()) - 7);
|
|
500
|
+
return this.createBy(CalendarDate.from(previousWeekStartDate));
|
|
724
501
|
}
|
|
725
502
|
/**
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
* @returns {string[]} - The data of week head
|
|
503
|
+
* @inheritDoc
|
|
729
504
|
*/
|
|
730
|
-
|
|
731
|
-
return
|
|
505
|
+
createBy(current) {
|
|
506
|
+
return new WeekPeriod(current, this._showWeekends);
|
|
732
507
|
}
|
|
733
508
|
}
|
|
509
|
+
WeekPeriod.DISPLAY_DATE_COUNT = 7;
|
|
734
510
|
|
|
735
511
|
/**
|
|
736
|
-
*
|
|
512
|
+
* Period of month
|
|
737
513
|
*/
|
|
738
|
-
class
|
|
739
|
-
constructor(
|
|
740
|
-
|
|
741
|
-
this.
|
|
514
|
+
class MonthPeriod extends CalendarPeriod {
|
|
515
|
+
constructor(current, showWeekends) {
|
|
516
|
+
super(MonthPeriod.DISPLAY_DATE_COUNT, MonthPeriod.getMonthFirstDay(current));
|
|
517
|
+
this._type = 'month';
|
|
518
|
+
this._showWeekends = true;
|
|
519
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* The function `getMonthFirstDay` returns the first day of a given month in a calendar.
|
|
523
|
+
*
|
|
524
|
+
* @param {CalendarDate} [calendarDate] - The `calendarDate` parameter is an optional parameter of
|
|
525
|
+
* type `CalendarDate`. It represents a specific date in the calendar. If a `calendarDate` is
|
|
526
|
+
* provided, the function will use that date to determine the first day of the month. If no
|
|
527
|
+
* `calendarDate` is provided, the function
|
|
528
|
+
* @returns {CalendarDate} A new `CalendarDate` object representing the first day of the month from the provided
|
|
529
|
+
* `calendarDate` parameter or the current date if no parameter is provided.
|
|
530
|
+
*/
|
|
531
|
+
static getMonthFirstDay(calendarDate) {
|
|
532
|
+
const date = calendarDate || CalendarDate.from(new Date());
|
|
533
|
+
return new CalendarDate(date.year, date.month, 1);
|
|
742
534
|
}
|
|
743
535
|
/**
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
* @type {string[]}
|
|
536
|
+
* @inheritDoc
|
|
747
537
|
*/
|
|
748
|
-
|
|
749
|
-
|
|
538
|
+
next() {
|
|
539
|
+
const next = this.current.toDate();
|
|
540
|
+
next.setMonth(next.getMonth() + 1);
|
|
541
|
+
return this.createBy(CalendarDate.from(next));
|
|
750
542
|
}
|
|
751
543
|
/**
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
* @type {CalendarDate[][]}
|
|
544
|
+
* @inheritDoc
|
|
755
545
|
*/
|
|
756
|
-
|
|
757
|
-
|
|
546
|
+
previous() {
|
|
547
|
+
const previous = this.current.toDate();
|
|
548
|
+
previous.setMonth(previous.getMonth() - 1);
|
|
549
|
+
return this.createBy(CalendarDate.from(previous));
|
|
758
550
|
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Day view calendar generator
|
|
763
|
-
*/
|
|
764
|
-
class DayViewGenerator extends CalendarViewGenerator {
|
|
765
551
|
/**
|
|
766
552
|
* @inheritDoc
|
|
767
553
|
*/
|
|
768
|
-
|
|
769
|
-
return new
|
|
554
|
+
createBy(current) {
|
|
555
|
+
return new MonthPeriod(current, this._showWeekends);
|
|
770
556
|
}
|
|
771
557
|
}
|
|
558
|
+
MonthPeriod.DISPLAY_DATE_COUNT = 6 * 7;
|
|
772
559
|
|
|
560
|
+
var DateDirection;
|
|
561
|
+
(function (DateDirection) {
|
|
562
|
+
DateDirection["PREVIOUS"] = "-1";
|
|
563
|
+
DateDirection["NEXT"] = "1";
|
|
564
|
+
})(DateDirection || (DateDirection = {}));
|
|
773
565
|
/**
|
|
774
|
-
*
|
|
566
|
+
* get month name from the month number
|
|
567
|
+
*
|
|
568
|
+
* @param {Date} date the date object
|
|
569
|
+
* @param {boolean} isShortName short or long name
|
|
570
|
+
* @returns {string} the month English name
|
|
775
571
|
*/
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
572
|
+
function getMonthName(date, isShortName = false) {
|
|
573
|
+
return date.toLocaleDateString('en-US', { month: isShortName ? 'short' : 'long' });
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* The function `getTimeIndex` calculates the index of a given time string based on a specified time unit.
|
|
577
|
+
*
|
|
578
|
+
* @param {string} timeString - A string representing a time in the format "HH:MM", where HH is the hour and MM is the minutes.
|
|
579
|
+
* @param {number} [unit=15] - The `unit` parameter in the `getTimeIndex` function is used to specify
|
|
580
|
+
* the interval in minutes for dividing the day. By default, it is set to 15 minutes, meaning that the
|
|
581
|
+
* day will be divided into 15-minute intervals.
|
|
582
|
+
* @returns {number} the index of the given time string based on the specified time unit.
|
|
583
|
+
*/
|
|
584
|
+
function getTimeIndex(timeString, unit = 15) {
|
|
585
|
+
const [hour, minutes] = timeString.split(':');
|
|
586
|
+
return Math.round((Number(hour) * 60 + Number(minutes)) / unit);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Returns a string that includes the event key for a calendar event slot.
|
|
590
|
+
*
|
|
591
|
+
* @param {string} eventKey - represents the key or identifier of a calendar event.
|
|
592
|
+
* @returns {string} a string that is a concatenation of 'vega-calendar-event-slot-' and the eventKey parameter.
|
|
593
|
+
*/
|
|
594
|
+
function getCalendarEventSlotName(eventKey) {
|
|
595
|
+
return 'vega-calendar-event-slot-' + eventKey;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Returns the closest workday to a given calendar date based on a specified direction.
|
|
599
|
+
*
|
|
600
|
+
* @param {Date} date - The starting date from which you want to find the closest workday.
|
|
601
|
+
* @param {'-1' | '1'} [direction=1] - Determines whether to find the closest workday in the past or future. It can have two possible values:
|
|
602
|
+
* @returns {Date} The closest workday to the input date
|
|
603
|
+
*/
|
|
604
|
+
function getClosestWorkday(date, direction = DateDirection.NEXT) {
|
|
605
|
+
const day = date.toDate().getDay();
|
|
606
|
+
if (day === 0 || day === 6) {
|
|
607
|
+
let nextWorkdayGap = day === 0 ? 1 : 2;
|
|
608
|
+
if (direction === DateDirection.PREVIOUS) {
|
|
609
|
+
nextWorkdayGap = day === 0 ? -2 : -1;
|
|
610
|
+
}
|
|
611
|
+
return CalendarDate.from(new Date(date.year, date.month - 1, date.date + nextWorkdayGap));
|
|
612
|
+
}
|
|
613
|
+
return date;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const ellipsisVertical = {
|
|
617
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M48 464a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm0-160a48 48 0 1 1 0-96 48 48 0 1 1 0 96zM0 96a48 48 0 1 1 96 0A48 48 0 1 1 0 96z"/></svg>`,
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
var __decorate$n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
621
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
622
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
623
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
624
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
625
|
+
};
|
|
626
|
+
/** The `VegaCalendarSwitchPanelRenderer` class in TypeScript React renders a calendar switch panel with date navigation, view selection, and action buttons. */
|
|
627
|
+
class VegaCalendarSwitchPanelRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
628
|
+
constructor() {
|
|
629
|
+
super(...arguments);
|
|
630
|
+
/**
|
|
631
|
+
* This function is responsible for updating the `viewMode` property of the `VegaCalendarSwitchPanelRenderer` class with the value extracted from the `input` parameter.
|
|
632
|
+
*
|
|
633
|
+
* @param {NotifyObserverPayload<VegaCalendarViewModeType>} input mark which view should be selected
|
|
634
|
+
*/
|
|
635
|
+
this.handleViewChange = (input) => {
|
|
636
|
+
this.currentPeriodController.updateCalendarPeriod(input.detail, this.currentPeriod.current);
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* reset view content to today
|
|
640
|
+
*/
|
|
641
|
+
this.todayButtonClick = () => {
|
|
642
|
+
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.now());
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* update view content after click next button
|
|
646
|
+
*/
|
|
647
|
+
this.nextButtonClick = () => {
|
|
648
|
+
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.next());
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* update view content after click previous button
|
|
652
|
+
*/
|
|
653
|
+
this.prevButtonClick = () => {
|
|
654
|
+
this.currentPeriodController.setCurrentPeriod(this.currentPeriod.previous());
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* The more action menu item click
|
|
658
|
+
*
|
|
659
|
+
* @param {NotifyObserverPayload<string>} payload The object contains the menu item key
|
|
660
|
+
*/
|
|
661
|
+
this.moreActionMenuClick = (payload) => {
|
|
662
|
+
this.moreActionClickEmitter.emit(payload.detail);
|
|
663
|
+
};
|
|
781
664
|
}
|
|
782
665
|
/**
|
|
783
|
-
*
|
|
666
|
+
* get the switch panel container element
|
|
784
667
|
*
|
|
785
|
-
* @
|
|
786
|
-
* @returns {CalendarDate} - Return a CalendarDate object
|
|
668
|
+
* @returns {HTMLElement} container element
|
|
787
669
|
*/
|
|
788
|
-
|
|
789
|
-
return
|
|
670
|
+
getSwitchPanelRef() {
|
|
671
|
+
return this.switchPanelRef;
|
|
790
672
|
}
|
|
791
673
|
/**
|
|
792
|
-
*
|
|
674
|
+
* calendar switch panel with date switch, view switch, add new button, and more action components.
|
|
793
675
|
*
|
|
794
|
-
* @
|
|
676
|
+
* @returns {HTMLElement} html element
|
|
795
677
|
*/
|
|
796
|
-
|
|
797
|
-
return this.
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
678
|
+
render() {
|
|
679
|
+
return (index.h("vega-flex", { direction: "row", gap: "size-16", justifyContent: "space-between", alignItems: "center", class: "calendar-switch-panel", ref: (node) => (this.switchPanelRef = node) },
|
|
680
|
+
this.renderDateSwitch(),
|
|
681
|
+
index.h("div", { class: "calendar-view-switch-container" },
|
|
682
|
+
this.renderViewSwitch(),
|
|
683
|
+
this.renderMoreActionMenu())));
|
|
801
684
|
}
|
|
802
685
|
/**
|
|
803
|
-
* The
|
|
686
|
+
* The `renderDateSwitch` function returns a container with buttons for switching dates and displaying the current date.
|
|
804
687
|
*
|
|
805
|
-
* @
|
|
688
|
+
* @returns {HTMLDivElement} action button elements container.
|
|
806
689
|
*/
|
|
807
|
-
|
|
808
|
-
return
|
|
690
|
+
renderDateSwitch() {
|
|
691
|
+
return (index.h("div", { class: "calendar-date-switch-container" },
|
|
692
|
+
index.h("vega-button", { variant: "secondary", size: "small", ref: (button) => {
|
|
693
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.todayButtonClick);
|
|
694
|
+
}, label: this.translationSlimmer.t('Today') }),
|
|
695
|
+
index.h("vega-button-circle", { variant: "secondary", size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('chevron-left'), label: "previous", showTooltip: false, ref: (button) => {
|
|
696
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.prevButtonClick);
|
|
697
|
+
} }),
|
|
698
|
+
index.h("vega-button-circle", { variant: "secondary", size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('chevron-right'), label: "next", showTooltip: false, ref: (button) => {
|
|
699
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(button, vegaEventId.VegaClick, this.nextButtonClick);
|
|
700
|
+
} }),
|
|
701
|
+
this.renderCurrentPeriod()));
|
|
809
702
|
}
|
|
810
|
-
|
|
811
|
-
|
|
703
|
+
/**
|
|
704
|
+
* The function `renderCurrentPeriod` returns an HTML element displaying the view date content summary info.
|
|
705
|
+
*
|
|
706
|
+
* @returns {HTMLVegaFontElement} The text content inside the element is "Current Date Test".
|
|
707
|
+
*/
|
|
708
|
+
renderCurrentPeriod() {
|
|
709
|
+
return (index.h("vega-font", { class: "calendar-current-date", variant: "font-field-label", color: "text-primary" }, this.getViewDateSummary()));
|
|
812
710
|
}
|
|
813
711
|
/**
|
|
814
|
-
* The
|
|
712
|
+
* The function `renderViewSwitch` returns a JSX element for rendering a segment control component in a TypeScript React application.
|
|
815
713
|
*
|
|
816
|
-
* @
|
|
714
|
+
* @returns {HTMLElement} An HTMLElement containing a vega-segment-control element with specific attributes and event handling.
|
|
817
715
|
*/
|
|
818
|
-
|
|
819
|
-
return this.
|
|
716
|
+
renderViewSwitch() {
|
|
717
|
+
return (index.h("vega-segment-control", { segments: VegaCalendarSwitchPanelRenderer.views.map((item) => (Object.assign(Object.assign({}, item), { text: this.translationSlimmer.t(item.text) }))), size: "small", variant: "text-only", selected: this.viewMode, ref: (node) => {
|
|
718
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, vegaEventId.VegaChange, this.handleViewChange);
|
|
719
|
+
} }));
|
|
820
720
|
}
|
|
821
|
-
|
|
822
|
-
|
|
721
|
+
/**
|
|
722
|
+
* Render an more action button if dropdown source is not empty
|
|
723
|
+
*
|
|
724
|
+
* @returns {Nullable<HTMLElement>} the additional element
|
|
725
|
+
*/
|
|
726
|
+
renderMoreActionMenu() {
|
|
727
|
+
var _a, _b;
|
|
728
|
+
if ((_b = (_a = this.moreActionDropdownProps) === null || _a === void 0 ? void 0 : _a.source) === null || _b === void 0 ? void 0 : _b.length) {
|
|
729
|
+
return (index.h("vega-dropdown", Object.assign({ alignment: "end", trigger: "click" }, this.moreActionDropdownProps, { ref: (node) => {
|
|
730
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, vegaEventId.VegaDropdownClick, this.moreActionMenuClick);
|
|
731
|
+
} }),
|
|
732
|
+
index.h("vega-button-circle", { size: "small", icon: internalIconManager.VegaInternalIconManager.getIconKey('ellipsis-vertical'), variant: "icon-only" })));
|
|
733
|
+
}
|
|
823
734
|
}
|
|
824
735
|
/**
|
|
825
|
-
*
|
|
736
|
+
* Get the view content date summary info, such as `January, 2024` or `10 January, 2024` or `28 December, 2023 - 3 January, 2024`
|
|
826
737
|
*
|
|
827
|
-
* @returns {
|
|
738
|
+
* @returns {string} string
|
|
828
739
|
*/
|
|
829
|
-
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
740
|
+
getViewDateSummary() {
|
|
741
|
+
const currentDate = this.currentPeriod.current;
|
|
742
|
+
let result = '';
|
|
743
|
+
switch (this.viewMode) {
|
|
744
|
+
case 'day': {
|
|
745
|
+
const monthName = this.translationSlimmer.t(getMonthName(currentDate.toDate()));
|
|
746
|
+
result = `${currentDate.date} ${monthName}, ${currentDate.year}`;
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
case 'week': {
|
|
750
|
+
const weekItems = this.calendarView.dateItems[0];
|
|
751
|
+
const start = weekItems[0];
|
|
752
|
+
const end = weekItems[weekItems.length - 1];
|
|
753
|
+
const [startMonthName, endMonthName] = [start, end].map((item) => this.translationSlimmer.t(getMonthName(item.toDate())));
|
|
754
|
+
result = `${start.date} ${startMonthName}${start.year === end.year ? '' : ', ' + start.year} - ${end.date} ${endMonthName}, ${end.year}`;
|
|
755
|
+
break;
|
|
756
|
+
}
|
|
757
|
+
case 'month': {
|
|
758
|
+
const monthName = this.translationSlimmer.t(getMonthName(currentDate.toDate()));
|
|
759
|
+
result = `${monthName}, ${currentDate.year}`;
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
return result;
|
|
834
764
|
}
|
|
765
|
+
}
|
|
766
|
+
(() => {
|
|
767
|
+
internalIconManager.VegaInternalIconManager.register({
|
|
768
|
+
'chevron-right': chevronRight,
|
|
769
|
+
'chevron-left': chevronLeft,
|
|
770
|
+
'ellipsis-vertical': ellipsisVertical,
|
|
771
|
+
});
|
|
772
|
+
})();
|
|
773
|
+
VegaCalendarSwitchPanelRenderer.views = [
|
|
774
|
+
{ text: 'Day', key: 'day' },
|
|
775
|
+
{ text: 'Week', key: 'week' },
|
|
776
|
+
{ text: 'Month', key: 'month' },
|
|
777
|
+
];
|
|
778
|
+
__decorate$n([
|
|
779
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
780
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "viewMode", void 0);
|
|
781
|
+
__decorate$n([
|
|
782
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
783
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "calendarView", void 0);
|
|
784
|
+
__decorate$n([
|
|
785
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
786
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "currentPeriod", void 0);
|
|
787
|
+
__decorate$n([
|
|
788
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
789
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "moreActionDropdownProps", void 0);
|
|
790
|
+
__decorate$n([
|
|
791
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
792
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "moreActionClickEmitter", void 0);
|
|
793
|
+
__decorate$n([
|
|
794
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
795
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "currentPeriodController", void 0);
|
|
796
|
+
__decorate$n([
|
|
797
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
798
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "calendarViewController", void 0);
|
|
799
|
+
__decorate$n([
|
|
800
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
801
|
+
], VegaCalendarSwitchPanelRenderer.prototype, "translationSlimmer", void 0);
|
|
802
|
+
|
|
803
|
+
var __decorate$m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
804
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
805
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
806
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
807
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
808
|
+
};
|
|
809
|
+
/** renders different views based on the specified view mode using month, week, and day view render. */
|
|
810
|
+
class VegaCalendarViewRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
835
811
|
/**
|
|
836
|
-
*
|
|
812
|
+
* render the calendar month/week/day view
|
|
837
813
|
*
|
|
838
|
-
* @returns {
|
|
814
|
+
* @returns {HTMLElement} html element
|
|
839
815
|
*/
|
|
840
|
-
|
|
841
|
-
return
|
|
816
|
+
render() {
|
|
817
|
+
return (index.h("div", { class: `calendar-view calendar-view-${this.viewMode} ${this.showWeekends === false ? 'calendar-hide-weekends' : ''}` }, this.viewMode === 'month'
|
|
818
|
+
? this.monthViewRenderer.render()
|
|
819
|
+
: this.viewWithTimeRenderer.render()));
|
|
842
820
|
}
|
|
821
|
+
}
|
|
822
|
+
__decorate$m([
|
|
823
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
824
|
+
], VegaCalendarViewRenderer.prototype, "viewMode", void 0);
|
|
825
|
+
__decorate$m([
|
|
826
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
827
|
+
], VegaCalendarViewRenderer.prototype, "showWeekends", void 0);
|
|
828
|
+
__decorate$m([
|
|
829
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
830
|
+
], VegaCalendarViewRenderer.prototype, "monthViewRenderer", void 0);
|
|
831
|
+
__decorate$m([
|
|
832
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
833
|
+
], VegaCalendarViewRenderer.prototype, "viewWithTimeRenderer", void 0);
|
|
834
|
+
|
|
835
|
+
var __decorate$l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
836
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
837
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
838
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
839
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
840
|
+
};
|
|
841
|
+
/** The code provided is defining a TypeScript class called `VegaCalendarMonthViewRenderer` that extends `VegaSlimmer`. This class is responsible for rendering a month view of a calendar component. */
|
|
842
|
+
class VegaCalendarMonthViewRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
843
843
|
/**
|
|
844
|
-
*
|
|
844
|
+
* the HTML elements that represent the month view of a calendar component.
|
|
845
845
|
*
|
|
846
|
-
* @
|
|
847
|
-
* @returns {DateCompareResult} - Return a DateCompareResult object
|
|
846
|
+
* @returns {HTMLElement} the month view calendar content
|
|
848
847
|
*/
|
|
849
|
-
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
isNextMonth: false,
|
|
855
|
-
};
|
|
856
|
-
if (this.year === year) {
|
|
857
|
-
if (this.month < month) {
|
|
858
|
-
result.isPreviousMonth = true;
|
|
859
|
-
}
|
|
860
|
-
else if (this.month > month) {
|
|
861
|
-
result.isNextMonth = true;
|
|
862
|
-
}
|
|
863
|
-
else {
|
|
864
|
-
result.inMonth = true;
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
else if (this.year > year) {
|
|
868
|
-
result.isNextMonth = true;
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
result.isPreviousMonth = true;
|
|
872
|
-
}
|
|
873
|
-
return result;
|
|
848
|
+
render() {
|
|
849
|
+
const weekHead = this.calendarView.weekdays;
|
|
850
|
+
return (index.h("div", { class: "calendar-view-month-container" },
|
|
851
|
+
index.h("div", { class: "calendar-view-row calendar-view-title border-divider-bottom" }, weekHead.map((title) => (index.h("div", { key: title }, this.translationSlimmer.t(title))))),
|
|
852
|
+
this.renderMonthViewContent()));
|
|
874
853
|
}
|
|
875
854
|
/**
|
|
876
|
-
*
|
|
855
|
+
* generating the HTML elements that represent the content of the month view in a calendar component
|
|
877
856
|
*
|
|
878
|
-
* @
|
|
879
|
-
* `CalendarDate` object passed as a parameter. The method returns `true` if all three values (year, month, date) are equal
|
|
880
|
-
* @returns {boolean} The date is same day with current
|
|
881
|
-
*/
|
|
882
|
-
equal(calendarDate) {
|
|
883
|
-
const { year, month, date } = calendarDate;
|
|
884
|
-
return this._year === year && this._month === month && this._date === date;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Calendar week view generator
|
|
890
|
-
*/
|
|
891
|
-
class WeekViewGenerator extends CalendarViewGenerator {
|
|
892
|
-
/**
|
|
893
|
-
* @inheritDoc
|
|
857
|
+
* @returns {HTMLElement[]} month view content and event content
|
|
894
858
|
*/
|
|
895
|
-
|
|
896
|
-
const
|
|
897
|
-
|
|
859
|
+
renderMonthViewContent() {
|
|
860
|
+
const monthSource = this.calendarView.dateItems;
|
|
861
|
+
const currentDate = this.currentPeriod.current;
|
|
862
|
+
return monthSource.map((dateArray, index$1) => {
|
|
863
|
+
const eventsArray = this.monthEventRenderer.getCurrentRowEvents(dateArray);
|
|
864
|
+
const displayEventsArray = this.monthEventRenderer.filterRowDisplayEvents(eventsArray);
|
|
865
|
+
return (index.h("div", { key: index$1, class: "calendar-view-row border-divider-bottom" }, dateArray.map((item, itemIndex) => {
|
|
866
|
+
return (index.h("div", { class: {
|
|
867
|
+
'row-cell border-divider-right': true,
|
|
868
|
+
'current-month-day': item.compare(currentDate).inMonth,
|
|
869
|
+
'active': item.isToday(),
|
|
870
|
+
'disabled': false,
|
|
871
|
+
}, key: `${item.month}-${item.date}`,
|
|
872
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
873
|
+
onDblClick: (e) => this.handleDateBlockClick(e, item) },
|
|
874
|
+
this.renderDateBlock(item),
|
|
875
|
+
this.monthEventRenderer.render(item, eventsArray[itemIndex], displayEventsArray[itemIndex], itemIndex)));
|
|
876
|
+
})));
|
|
877
|
+
});
|
|
898
878
|
}
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
* Calendar month view generator
|
|
903
|
-
*/
|
|
904
|
-
class MonthViewGenerator extends CalendarViewGenerator {
|
|
905
879
|
/**
|
|
906
|
-
*
|
|
880
|
+
* It takes a `CalendarDate` object as a parameter and returns an HTML element representing a date block in the calendar view.
|
|
881
|
+
*
|
|
882
|
+
* @param {CalendarDate} item the day object
|
|
883
|
+
* @returns {HTMLElement} the date block element
|
|
907
884
|
*/
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
const item = CalendarDate.from(date);
|
|
917
|
-
week.push(item);
|
|
918
|
-
});
|
|
919
|
-
return new CalendarView(this.generateWeekHead(), calendarDates);
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
/**
|
|
924
|
-
* CalendarPeriod is an abstract class that represents a period of date for calendar.
|
|
925
|
-
*/
|
|
926
|
-
class CalendarPeriod {
|
|
927
|
-
constructor(count, current) {
|
|
928
|
-
this._count = count;
|
|
929
|
-
this._current = current ? current : CalendarDate.from(new Date());
|
|
930
|
-
this.calculatePeriod(this._current);
|
|
885
|
+
renderDateBlock(item) {
|
|
886
|
+
const isMonthFirstDay = item.date === 1;
|
|
887
|
+
return (index.h("div", { class: "date" },
|
|
888
|
+
isMonthFirstDay && index.h("div", { class: "month-block" }, getMonthName(item.toDate(), true)),
|
|
889
|
+
index.h("div", { role: "button", tabIndex: 0, class: "grid-col",
|
|
890
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
891
|
+
onDblClick: (e) => this.goToCurrentDayView(e, item) }, item.date)));
|
|
931
892
|
}
|
|
932
893
|
/**
|
|
933
|
-
*
|
|
894
|
+
* switch to current date day view
|
|
934
895
|
*
|
|
935
|
-
* @
|
|
896
|
+
* @param {MouseEvent} e the double click event object
|
|
897
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
936
898
|
*/
|
|
937
|
-
|
|
938
|
-
|
|
899
|
+
goToCurrentDayView(e, calendarDate) {
|
|
900
|
+
e.stopPropagation();
|
|
901
|
+
this.currentPeriodController.updateCalendarPeriod('day', calendarDate);
|
|
939
902
|
}
|
|
940
903
|
/**
|
|
941
|
-
*
|
|
904
|
+
* emit vega click event when click the date block
|
|
942
905
|
*
|
|
943
|
-
* @
|
|
906
|
+
* @param {MouseEvent} e the mouse event object
|
|
907
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
944
908
|
*/
|
|
945
|
-
|
|
946
|
-
|
|
909
|
+
handleDateBlockClick(e, calendarDate) {
|
|
910
|
+
const { target, clientX, clientY } = e;
|
|
911
|
+
if (this.isMonthBlockBlankArea(target)) {
|
|
912
|
+
const { year, month, date } = calendarDate;
|
|
913
|
+
this.dateDblClickEmitter.emit({
|
|
914
|
+
year,
|
|
915
|
+
month,
|
|
916
|
+
date,
|
|
917
|
+
hour: 0,
|
|
918
|
+
mouseEventInfo: { clientX, clientY },
|
|
919
|
+
});
|
|
920
|
+
}
|
|
947
921
|
}
|
|
948
922
|
/**
|
|
949
|
-
*
|
|
923
|
+
* determine if the clicked element is blank area
|
|
950
924
|
*
|
|
951
|
-
* @
|
|
925
|
+
* @param {HTMLElement} element the target element
|
|
926
|
+
* @returns {boolean} true or false
|
|
952
927
|
*/
|
|
953
|
-
|
|
954
|
-
|
|
928
|
+
isMonthBlockBlankArea(element) {
|
|
929
|
+
// the more button and the calendar event component should not trigger dateDblClick event
|
|
930
|
+
return !element.classList.contains('more-button') && element.tagName !== 'VEGA-CALENDAR-EVENT';
|
|
955
931
|
}
|
|
932
|
+
}
|
|
933
|
+
__decorate$l([
|
|
934
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
935
|
+
], VegaCalendarMonthViewRenderer.prototype, "viewMode", void 0);
|
|
936
|
+
__decorate$l([
|
|
937
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
938
|
+
], VegaCalendarMonthViewRenderer.prototype, "calendarView", void 0);
|
|
939
|
+
__decorate$l([
|
|
940
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
941
|
+
], VegaCalendarMonthViewRenderer.prototype, "currentPeriod", void 0);
|
|
942
|
+
__decorate$l([
|
|
943
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
944
|
+
], VegaCalendarMonthViewRenderer.prototype, "currentPeriodController", void 0);
|
|
945
|
+
__decorate$l([
|
|
946
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
947
|
+
], VegaCalendarMonthViewRenderer.prototype, "monthEventRenderer", void 0);
|
|
948
|
+
__decorate$l([
|
|
949
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
950
|
+
], VegaCalendarMonthViewRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
951
|
+
__decorate$l([
|
|
952
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
953
|
+
], VegaCalendarMonthViewRenderer.prototype, "translationSlimmer", void 0);
|
|
954
|
+
|
|
955
|
+
var __decorate$k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
956
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
957
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
958
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
959
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
960
|
+
};
|
|
961
|
+
/** The `VegaCalendarViewWithTimeRenderer` class in TypeScript React renders a day view for a calendar component with title, content, and hour blocks. */
|
|
962
|
+
class VegaCalendarViewWithTimeRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
956
963
|
/**
|
|
957
|
-
* The
|
|
964
|
+
* The render function in TypeScript React returns an array of HTMLElements containing the week calendar view for a specific day.
|
|
958
965
|
*
|
|
959
|
-
* @
|
|
966
|
+
* @returns {HTMLElement} An array of HTMLElement elements containing the rendered content of a calendar view for a
|
|
967
|
+
* specific day in the week. The content includes the title and the main content of the calendar view
|
|
968
|
+
* for that day.
|
|
960
969
|
*/
|
|
961
|
-
|
|
962
|
-
return
|
|
970
|
+
render() {
|
|
971
|
+
return (index.h("div", { class: "calendar-view-container" },
|
|
972
|
+
this.renderViewTitle(),
|
|
973
|
+
this.renderViewContent()));
|
|
963
974
|
}
|
|
964
975
|
/**
|
|
965
|
-
*
|
|
976
|
+
* The function `renderViewTitle` renders a calendar view title and events based on the provided source data.
|
|
966
977
|
*
|
|
967
|
-
* @
|
|
978
|
+
* @returns {HTMLElement} The `renderViewTitle` function returns an HTML element (HTMLElement) that contains a calendar view title container with rows for each day's information.
|
|
968
979
|
*/
|
|
969
|
-
|
|
970
|
-
|
|
980
|
+
renderViewTitle() {
|
|
981
|
+
const source = this.calendarView.dateItems[0];
|
|
982
|
+
const weekHead = this.calendarView.weekdays;
|
|
983
|
+
return (index.h("div", { class: "calendar-view-title-container" },
|
|
984
|
+
index.h("div", { class: "calendar-view-row" },
|
|
985
|
+
index.h("div", { class: "time-line-empty" }),
|
|
986
|
+
index.h("div", { class: "calendar-view-title" }, source.map((item, index$1) => (index.h("div", { key: item.date, class: { active: item.isToday() } },
|
|
987
|
+
index.h("div", null, this.translationSlimmer.t(weekHead[index$1])),
|
|
988
|
+
index.h("div", { class: "week-day" }, item.date)))))),
|
|
989
|
+
index.h("div", { class: "calendar-view-row calendar-view-event-all-container border-divider-bottom" },
|
|
990
|
+
index.h("div", { class: "time-line-all" }, this.translationSlimmer.t('All Day')),
|
|
991
|
+
this.dayViewFullDayEventRenderer.render())));
|
|
971
992
|
}
|
|
972
993
|
/**
|
|
973
|
-
*
|
|
994
|
+
* The `renderViewContent` function in TypeScript React renders a calendar view with day blocks and time markers based on the provided data.
|
|
974
995
|
*
|
|
975
|
-
* @
|
|
976
|
-
* @returns {this} - The current period.
|
|
996
|
+
* @returns {HTMLElement} An HTMLElement containing a calendar view row with day containers, a timeline renderer, a content container, a day list, and hour blocks for each item in the source array.
|
|
977
997
|
*/
|
|
978
|
-
|
|
979
|
-
|
|
998
|
+
renderViewContent() {
|
|
999
|
+
const source = this.calendarView.dateItems[0];
|
|
1000
|
+
return (index.h("div", { class: "calendar-view-row calendar-view-day-container" },
|
|
1001
|
+
this.timeLineRenderer.render(),
|
|
1002
|
+
index.h("div", { class: "calendar-view-content-container" },
|
|
1003
|
+
index.h("div", { class: "calendar-view-content" }, source.map((item) => {
|
|
1004
|
+
return (index.h("div", { class: "grid-col border-divider-left", key: item.date },
|
|
1005
|
+
index.h("div", { class: "hour-empty border-divider-top" }),
|
|
1006
|
+
this.renderHourBlock(item)));
|
|
1007
|
+
})),
|
|
1008
|
+
this.dayViewTimedEventRenderer.render(),
|
|
1009
|
+
this.timeLineRenderer.renderTimeMarker(source))));
|
|
980
1010
|
}
|
|
981
1011
|
/**
|
|
982
|
-
*
|
|
1012
|
+
* The function `renderHourBlock` returns an array of HTML elements representing hour blocks with time information.
|
|
983
1013
|
*
|
|
984
|
-
* @
|
|
1014
|
+
* @param {CalendarDate} calendarDate then current calendar date object
|
|
1015
|
+
* @returns {HTMLElement[]} An array of HTMLElements is being returned. Each HTMLElement represents an hour block with a time value inside a div element.
|
|
985
1016
|
*/
|
|
986
|
-
|
|
987
|
-
|
|
1017
|
+
renderHourBlock(calendarDate) {
|
|
1018
|
+
const timeLineSource = Array(24).fill('');
|
|
1019
|
+
return timeLineSource.map((_item, index$1) => {
|
|
1020
|
+
return (index.h("div", { class: "grid-cell border-divider-top",
|
|
1021
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
1022
|
+
onDblClick: (e) => {
|
|
1023
|
+
this.handleDateBlockClick(calendarDate, index$1, e);
|
|
1024
|
+
} }));
|
|
1025
|
+
});
|
|
988
1026
|
}
|
|
989
1027
|
/**
|
|
990
|
-
*
|
|
1028
|
+
* emit vega click event when click the date block
|
|
991
1029
|
*
|
|
992
|
-
* @param {CalendarDate}
|
|
1030
|
+
* @param {CalendarDate} calendarDate the calendar date object
|
|
993
1031
|
*/
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
}
|
|
999
|
-
this._startDate = CalendarDate.from(cursor);
|
|
1000
|
-
cursor.setDate(cursor.getDate() + this.count - 1);
|
|
1001
|
-
this._endDate = CalendarDate.from(cursor);
|
|
1032
|
+
handleDateBlockClick(calendarDate, hour, e) {
|
|
1033
|
+
const { year, month, date } = calendarDate;
|
|
1034
|
+
const { clientX, clientY } = e;
|
|
1035
|
+
this.dateDblClickEmitter.emit({ year, month, date, hour, mouseEventInfo: { clientX, clientY } });
|
|
1002
1036
|
}
|
|
1003
1037
|
}
|
|
1038
|
+
__decorate$k([
|
|
1039
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1040
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "viewMode", void 0);
|
|
1041
|
+
__decorate$k([
|
|
1042
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1043
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "timeLineRenderer", void 0);
|
|
1044
|
+
__decorate$k([
|
|
1045
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1046
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "dayViewTimedEventRenderer", void 0);
|
|
1047
|
+
__decorate$k([
|
|
1048
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1049
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "dayViewFullDayEventRenderer", void 0);
|
|
1050
|
+
__decorate$k([
|
|
1051
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1052
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "calendarView", void 0);
|
|
1053
|
+
__decorate$k([
|
|
1054
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1055
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "dateDblClickEmitter", void 0);
|
|
1056
|
+
__decorate$k([
|
|
1057
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1058
|
+
], VegaCalendarViewWithTimeRenderer.prototype, "translationSlimmer", void 0);
|
|
1004
1059
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1060
|
+
var __decorate$j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1061
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1062
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1063
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1064
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1065
|
+
};
|
|
1066
|
+
/** The `VegaCalendarTimeLineRenderer` class in TypeScript React renders a time line with custom time format options and includes methods for rendering time markers and the time line itself. */
|
|
1067
|
+
class VegaCalendarTimeLineRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
1013
1068
|
/**
|
|
1014
|
-
*
|
|
1069
|
+
* takes an array of `CalendarDate` objects as input and returns an HTML element
|
|
1070
|
+
*
|
|
1071
|
+
* @param {CalendarDate[]} source
|
|
1072
|
+
* @returns {HTMLElement} the html element
|
|
1015
1073
|
*/
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
|
|
1074
|
+
renderTimeMarker(source) {
|
|
1075
|
+
const isVisible = source.findIndex((calendarDate) => calendarDate.isToday()) >= 0;
|
|
1076
|
+
return (index.h("div", { class: {
|
|
1077
|
+
'time-marker-container': true,
|
|
1078
|
+
'hidden': !isVisible,
|
|
1079
|
+
} },
|
|
1080
|
+
index.h("div", { class: "time-marker", style: { top: this.getTimeMarkerPosition() }, ref: (div) => (this.timeMarkerRef = div) }, source.map((item) => {
|
|
1081
|
+
return index.h("div", { key: item.date, class: { active: item.isToday() } });
|
|
1082
|
+
}))));
|
|
1020
1083
|
}
|
|
1021
1084
|
/**
|
|
1022
|
-
*
|
|
1085
|
+
* rendering the time line component as an HTML element
|
|
1086
|
+
*
|
|
1087
|
+
* @returns {HTMLElement} the html element
|
|
1023
1088
|
*/
|
|
1024
|
-
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
|
|
1089
|
+
render() {
|
|
1090
|
+
const timeLineSource = this.getTimeLineTitles();
|
|
1091
|
+
return (index.h("div", { class: "time-line", ref: (div) => (this.timeLineRef = div) },
|
|
1092
|
+
index.h("div", { class: "hour-empty" }),
|
|
1093
|
+
timeLineSource.map((time, index$1) => {
|
|
1094
|
+
return (index.h("div", { key: time },
|
|
1095
|
+
index.h("div", { class: "time-text", "data-time": index$1 === 0 ? 24 : index$1 }, time)));
|
|
1096
|
+
})));
|
|
1028
1097
|
}
|
|
1029
1098
|
/**
|
|
1030
|
-
*
|
|
1099
|
+
* scroll to current time line block if change view mode to week or day
|
|
1100
|
+
*
|
|
1101
|
+
* @param {VegaCalendarViewModeType} viewMode the view mode
|
|
1031
1102
|
*/
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}
|
|
1036
|
-
DayPeriod.DISPLAY_DATE_COUNT = 1;
|
|
1037
|
-
|
|
1038
|
-
/**
|
|
1039
|
-
* Period of the week
|
|
1040
|
-
*/
|
|
1041
|
-
class WeekPeriod extends CalendarPeriod {
|
|
1042
|
-
constructor(current) {
|
|
1043
|
-
super(WeekPeriod.DISPLAY_DATE_COUNT, current);
|
|
1044
|
-
this._type = 'week';
|
|
1103
|
+
updateTimeLine(viewMode) {
|
|
1104
|
+
this.scrollToTargetTimeBlock(viewMode);
|
|
1105
|
+
this.syncTimeMarkerPosition(viewMode);
|
|
1045
1106
|
}
|
|
1046
1107
|
/**
|
|
1047
|
-
*
|
|
1108
|
+
* remove setInterval when component destroy
|
|
1048
1109
|
*/
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
nextWeekStartDate.setDate(nextWeekStartDate.getDate() - getWeekdays().indexOf(nextWeekStartDate.getDay()) + 7);
|
|
1052
|
-
return this.createBy(CalendarDate.from(nextWeekStartDate));
|
|
1110
|
+
clearTimer() {
|
|
1111
|
+
clearInterval(this.timeMarkerPositionTimer);
|
|
1053
1112
|
}
|
|
1054
1113
|
/**
|
|
1055
|
-
*
|
|
1114
|
+
* Add the time mark position update logic if the component add back to page
|
|
1056
1115
|
*/
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
previousWeekStartDate.setDate(previousWeekStartDate.getDate() - getWeekdays().indexOf(previousWeekStartDate.getDay()) - 7);
|
|
1060
|
-
return this.createBy(CalendarDate.from(previousWeekStartDate));
|
|
1116
|
+
updateTimeLineIfComponentAddBack() {
|
|
1117
|
+
this.syncTimeMarkerPosition(this.viewMode);
|
|
1061
1118
|
}
|
|
1062
1119
|
/**
|
|
1063
|
-
*
|
|
1120
|
+
* Should display the current time block in the view if the default view mode is not month
|
|
1064
1121
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
WeekPeriod.DISPLAY_DATE_COUNT = 7;
|
|
1070
|
-
|
|
1071
|
-
/**
|
|
1072
|
-
* Period of month
|
|
1073
|
-
*/
|
|
1074
|
-
class MonthPeriod extends CalendarPeriod {
|
|
1075
|
-
constructor(current) {
|
|
1076
|
-
super(MonthPeriod.DISPLAY_DATE_COUNT, MonthPeriod.getMonthFirstDay(current));
|
|
1077
|
-
this._type = 'month';
|
|
1122
|
+
displayCurrentTimeBlockByDefault() {
|
|
1123
|
+
this.scrollToTargetTimeBlock(this.viewMode);
|
|
1078
1124
|
}
|
|
1079
1125
|
/**
|
|
1080
|
-
* The function `
|
|
1126
|
+
* The function `getTimeMarkerPosition` calculates the position of the current time marker as a percentage of the day.
|
|
1081
1127
|
*
|
|
1082
|
-
* @
|
|
1083
|
-
* type `CalendarDate`. It represents a specific date in the calendar. If a `calendarDate` is
|
|
1084
|
-
* provided, the function will use that date to determine the first day of the month. If no
|
|
1085
|
-
* `calendarDate` is provided, the function
|
|
1086
|
-
* @returns {CalendarDate} A new `CalendarDate` object representing the first day of the month from the provided
|
|
1087
|
-
* `calendarDate` parameter or the current date if no parameter is provided.
|
|
1128
|
+
* @returns {string} a string representing the current time marker position as a percentage of the day.
|
|
1088
1129
|
*/
|
|
1089
|
-
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1130
|
+
getTimeMarkerPosition() {
|
|
1131
|
+
const now = new Date();
|
|
1132
|
+
const minutesOneDay = 24 * 60;
|
|
1133
|
+
return ((now.getHours() * 60 + now.getMinutes()) / minutesOneDay) * 100 + '%';
|
|
1092
1134
|
}
|
|
1093
1135
|
/**
|
|
1094
|
-
*
|
|
1136
|
+
* The function `getTimeLineTitles` generates a time line array based on the specified time format (24-hour) and stores it in the `timeLineSource` property.
|
|
1137
|
+
*
|
|
1138
|
+
* @returns {string[]} returns an array of strings representing the time line
|
|
1095
1139
|
*/
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
|
|
1140
|
+
getTimeLineTitles() {
|
|
1141
|
+
const timeLine = [];
|
|
1142
|
+
if (this.timeFormat === '12-hour') {
|
|
1143
|
+
timeLine.push('12 AM');
|
|
1144
|
+
for (let i = 1; i < 12; i++) {
|
|
1145
|
+
timeLine.push(`${i} AM`);
|
|
1146
|
+
}
|
|
1147
|
+
timeLine.push('12 PM');
|
|
1148
|
+
for (let i = 1; i < 12; i++) {
|
|
1149
|
+
timeLine.push(`${i} PM`);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
else {
|
|
1153
|
+
for (let i = 0; i < 24; i++) {
|
|
1154
|
+
timeLine.push(`${date.pad(i)}`);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return timeLine;
|
|
1100
1158
|
}
|
|
1159
|
+
/*
|
|
1160
|
+
* The below method is e2e-test covered in
|
|
1161
|
+
* @see{module:vega-calendar-scroll-to-current-time}
|
|
1162
|
+
*/
|
|
1163
|
+
/* istanbul ignore next */
|
|
1101
1164
|
/**
|
|
1102
|
-
*
|
|
1165
|
+
* Update the time marker position with the time
|
|
1166
|
+
*
|
|
1167
|
+
* @param {VegaCalendarViewModeType} viewMode view mode value
|
|
1103
1168
|
*/
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1169
|
+
syncTimeMarkerPosition(viewMode) {
|
|
1170
|
+
clearInterval(this.timeMarkerPositionTimer);
|
|
1171
|
+
if (viewMode !== 'month') {
|
|
1172
|
+
this.timeMarkerPositionTimer = setInterval(() => {
|
|
1173
|
+
if (this.timeMarkerRef) {
|
|
1174
|
+
this.timeMarkerRef.style.top = this.getTimeMarkerPosition();
|
|
1175
|
+
}
|
|
1176
|
+
}, 60 * 1000);
|
|
1177
|
+
}
|
|
1108
1178
|
}
|
|
1179
|
+
/*
|
|
1180
|
+
* The below method is e2e-test covered in
|
|
1181
|
+
* @see{module:vega-calendar-scroll-to-current-time}
|
|
1182
|
+
*/
|
|
1183
|
+
/* istanbul ignore next */
|
|
1109
1184
|
/**
|
|
1110
|
-
*
|
|
1185
|
+
* scroll the time line in to current view
|
|
1186
|
+
*
|
|
1187
|
+
* @param {VegaCalendarViewModeType} viewMode view mode value
|
|
1111
1188
|
*/
|
|
1112
|
-
|
|
1113
|
-
|
|
1189
|
+
scrollToTargetTimeBlock(viewMode) {
|
|
1190
|
+
if (viewMode !== 'month') {
|
|
1191
|
+
// add setTimeout here to make sure call the scroll into view after time line rendered.
|
|
1192
|
+
const oneFrame = 16;
|
|
1193
|
+
setTimeout(() => {
|
|
1194
|
+
var _a, _b;
|
|
1195
|
+
const hour = new Date().getHours();
|
|
1196
|
+
(_b = (_a = this.timeLineRef) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-time='${hour < 23 ? hour + 1 : hour}']`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'end' });
|
|
1197
|
+
}, oneFrame);
|
|
1198
|
+
}
|
|
1114
1199
|
}
|
|
1115
1200
|
}
|
|
1116
|
-
|
|
1201
|
+
__decorate$j([
|
|
1202
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1203
|
+
], VegaCalendarTimeLineRenderer.prototype, "timeFormat", void 0);
|
|
1204
|
+
__decorate$j([
|
|
1205
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1206
|
+
], VegaCalendarTimeLineRenderer.prototype, "viewMode", void 0);
|
|
1207
|
+
__decorate$j([
|
|
1208
|
+
globalSlimmerRegistry.MapToComponentMethod('watchViewModeChange')
|
|
1209
|
+
], VegaCalendarTimeLineRenderer.prototype, "updateTimeLine", null);
|
|
1210
|
+
__decorate$j([
|
|
1211
|
+
globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
|
|
1212
|
+
], VegaCalendarTimeLineRenderer.prototype, "clearTimer", null);
|
|
1213
|
+
__decorate$j([
|
|
1214
|
+
globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
|
|
1215
|
+
], VegaCalendarTimeLineRenderer.prototype, "updateTimeLineIfComponentAddBack", null);
|
|
1216
|
+
__decorate$j([
|
|
1217
|
+
globalSlimmerRegistry.MapToComponentMethod('componentDidLoad')
|
|
1218
|
+
], VegaCalendarTimeLineRenderer.prototype, "displayCurrentTimeBlockByDefault", null);
|
|
1117
1219
|
|
|
1118
1220
|
var __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1119
1221
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1174,6 +1276,9 @@ __decorate$i([
|
|
|
1174
1276
|
__decorate$i([
|
|
1175
1277
|
globalSlimmerRegistry.MapToComponentField()
|
|
1176
1278
|
], VegaCalendarViewController.prototype, "currentPeriod", void 0);
|
|
1279
|
+
__decorate$i([
|
|
1280
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1281
|
+
], VegaCalendarViewController.prototype, "showWeekends", void 0);
|
|
1177
1282
|
__decorate$i([
|
|
1178
1283
|
globalSlimmerRegistry.MapToComponentField()
|
|
1179
1284
|
], VegaCalendarViewController.prototype, "currentPeriodController", void 0);
|
|
@@ -1209,13 +1314,14 @@ class VegaCalendarCurrentPeriodController extends globalSlimmerRegistry.VegaSlim
|
|
|
1209
1314
|
updateCalendarPeriod(viewMode, date) {
|
|
1210
1315
|
switch (viewMode) {
|
|
1211
1316
|
case 'month':
|
|
1212
|
-
this.setCurrentPeriod(new MonthPeriod(date));
|
|
1317
|
+
this.setCurrentPeriod(new MonthPeriod(date, this.showWeekends));
|
|
1213
1318
|
break;
|
|
1214
1319
|
case 'week':
|
|
1215
|
-
this.setCurrentPeriod(new WeekPeriod(date));
|
|
1320
|
+
this.setCurrentPeriod(new WeekPeriod(date, this.showWeekends));
|
|
1216
1321
|
break;
|
|
1217
1322
|
case 'day':
|
|
1218
|
-
this.
|
|
1323
|
+
date = this.showWeekends === false ? getClosestWorkday(date) : date;
|
|
1324
|
+
this.setCurrentPeriod(new DayPeriod(date, this.showWeekends));
|
|
1219
1325
|
break;
|
|
1220
1326
|
}
|
|
1221
1327
|
}
|
|
@@ -1257,6 +1363,12 @@ class VegaCalendarCurrentPeriodController extends globalSlimmerRegistry.VegaSlim
|
|
|
1257
1363
|
this.updateCalendarPeriod(viewMode, this.currentPeriod.current);
|
|
1258
1364
|
}
|
|
1259
1365
|
}
|
|
1366
|
+
/**
|
|
1367
|
+
* The calendar period should update when the property showWeekends change
|
|
1368
|
+
*/
|
|
1369
|
+
updateCurrentPeriodAfterHideWeekEndsChange() {
|
|
1370
|
+
this.updateCalendarPeriod(this.viewMode, this.currentPeriod.current);
|
|
1371
|
+
}
|
|
1260
1372
|
/**
|
|
1261
1373
|
* The function `getStartDateAndEndDate` returns an array of `VegaCalendarDateType` objects based on the `startDate` and `endDate` properties of the `currentPeriod` object.
|
|
1262
1374
|
*
|
|
@@ -1290,6 +1402,9 @@ __decorate$h([
|
|
|
1290
1402
|
__decorate$h([
|
|
1291
1403
|
globalSlimmerRegistry.MapToComponentField({ writable: true })
|
|
1292
1404
|
], VegaCalendarCurrentPeriodController.prototype, "viewMode", void 0);
|
|
1405
|
+
__decorate$h([
|
|
1406
|
+
globalSlimmerRegistry.MapToComponentField()
|
|
1407
|
+
], VegaCalendarCurrentPeriodController.prototype, "showWeekends", void 0);
|
|
1293
1408
|
__decorate$h([
|
|
1294
1409
|
globalSlimmerRegistry.MapToComponentMethod('componentWillLoad')
|
|
1295
1410
|
], VegaCalendarCurrentPeriodController.prototype, "initialCurrentPeriod", null);
|
|
@@ -1299,6 +1414,9 @@ __decorate$h([
|
|
|
1299
1414
|
__decorate$h([
|
|
1300
1415
|
globalSlimmerRegistry.MapToComponentMethod('watchViewModeChange')
|
|
1301
1416
|
], VegaCalendarCurrentPeriodController.prototype, "updateCurrentPeriodByViewMode", null);
|
|
1417
|
+
__decorate$h([
|
|
1418
|
+
globalSlimmerRegistry.MapToComponentMethod('watchShowWeekendsChange')
|
|
1419
|
+
], VegaCalendarCurrentPeriodController.prototype, "updateCurrentPeriodAfterHideWeekEndsChange", null);
|
|
1302
1420
|
|
|
1303
1421
|
var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1304
1422
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1443,7 +1561,9 @@ class VegaCalendarMonthEventRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
1443
1561
|
}
|
|
1444
1562
|
if (removeItems.length) {
|
|
1445
1563
|
rowEvents.forEach((items) => {
|
|
1446
|
-
if (items.length &&
|
|
1564
|
+
if (items.length &&
|
|
1565
|
+
items[items.length - 1] &&
|
|
1566
|
+
removeItems.includes(items[items.length - 1])) {
|
|
1447
1567
|
result.push(items.slice(0, items.length - 1));
|
|
1448
1568
|
}
|
|
1449
1569
|
else {
|
|
@@ -2021,7 +2141,7 @@ class CalendarEvent {
|
|
|
2021
2141
|
this._eventSpansDays = 1;
|
|
2022
2142
|
this.repeatPattern = null;
|
|
2023
2143
|
this._event = eventOptions;
|
|
2024
|
-
this._eventKey = eventKey ||
|
|
2144
|
+
this._eventKey = eventKey || createPublicApiRuntimeMetricsSlimmer.generateUUID();
|
|
2025
2145
|
this.checkEventRequireField(eventOptions);
|
|
2026
2146
|
this.initDate(eventOptions);
|
|
2027
2147
|
this.initEventSpansDays();
|
|
@@ -2494,7 +2614,7 @@ class VegaCalendarEventResponsiveController extends pageResizeObserverSlimmer.Pa
|
|
|
2494
2614
|
// The debounce method will case this method called after component disconnect, then the slimmer will get issue to get viewMode from component class, this issue will catch in spec.ts
|
|
2495
2615
|
try {
|
|
2496
2616
|
const eventContainerRef = this.monthEventRenderer.getMonthEventContainerRef();
|
|
2497
|
-
if (this.viewMode === 'month' && eventContainerRef) {
|
|
2617
|
+
if (this.viewMode === 'month' && eventContainerRef && eventContainerRef.parentElement) {
|
|
2498
2618
|
const maxContainerHeight = eventContainerRef.parentElement.getBoundingClientRect().height;
|
|
2499
2619
|
const count = Math.floor((maxContainerHeight - VegaCalendarEventResponsiveController.monthDateTitleHeight) /
|
|
2500
2620
|
VegaCalendarEventItemRenderer.backgroundColorModeEventHeight);
|
|
@@ -2679,7 +2799,7 @@ class VegaCalendarDayViewEventLayoutRenderer extends globalSlimmerRegistry.VegaS
|
|
|
2679
2799
|
top: `${(100 / VegaCalendarDayViewEventLayoutRenderer.totalNumberOfCells) * startIndex}%`,
|
|
2680
2800
|
width: `calc(100% - ${left * 100}%)`,
|
|
2681
2801
|
height: `${(100 / VegaCalendarDayViewEventLayoutRenderer.totalNumberOfCells) * (endIndex - startIndex)}%`,
|
|
2682
|
-
zIndex: columnIndex > 0 ? `${columnIndex}` :
|
|
2802
|
+
zIndex: columnIndex > 0 ? `${columnIndex}` : undefined,
|
|
2683
2803
|
};
|
|
2684
2804
|
}
|
|
2685
2805
|
}
|
|
@@ -3114,7 +3234,7 @@ class VegaCalendarFullDayEventLayoutGenerator extends VegaCalendarBaseEventLayou
|
|
|
3114
3234
|
*/
|
|
3115
3235
|
generate(calendarEvents) {
|
|
3116
3236
|
const allShouldOrderLongEvents = this.collectAllShouldOrderLongEvents(calendarEvents);
|
|
3117
|
-
const layoutRows = [
|
|
3237
|
+
const layoutRows = [this.createNewLayoutCell()];
|
|
3118
3238
|
allShouldOrderLongEvents.forEach((eventView) => {
|
|
3119
3239
|
this.addCurrentEventToLayout(layoutRows, eventView);
|
|
3120
3240
|
});
|
|
@@ -3323,7 +3443,7 @@ __decorate$8([
|
|
|
3323
3443
|
globalSlimmerRegistry.MapToComponentMethod('watchViewModeChange')
|
|
3324
3444
|
], VegaCalendarFullDayEventMoreButtonRenderer.prototype, "resetShowAllFlag", null);
|
|
3325
3445
|
|
|
3326
|
-
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 .calendar-view-event-all .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;margin-left:2px;padding:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-event-all .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-container .calendar-view-event-all .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-container .calendar-view-event-all .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-container .calendar-view-event-all .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 .event-all-col{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}.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}.calendar-event-slot-container{display:none}";
|
|
3446
|
+
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-weekday-columns:7}.calendar-view.calendar-hide-weekends{--calendar-weekday-columns:5}.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(var(--calendar-weekday-columns), 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(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-event-all{grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-day-container .calendar-view-content{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .time-marker-container .time-marker{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .day-event-container{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), 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 .calendar-view-event-all .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;margin-left:2px;padding:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-event-all .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-container .calendar-view-event-all .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-container .calendar-view-event-all .more-button{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-container .calendar-view-event-all .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 .event-all-col{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}.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}.calendar-event-slot-container{display:none}";
|
|
3327
3447
|
|
|
3328
3448
|
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3329
3449
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3347,6 +3467,7 @@ const VegaCalendar = class {
|
|
|
3347
3467
|
this.vegaMoreActionClick = index.createEvent(this, "vegaMoreActionClick", 7);
|
|
3348
3468
|
this.moreActionClick = index.createEvent(this, "moreActionClick", 7);
|
|
3349
3469
|
this.globalSlimmer = {};
|
|
3470
|
+
this.translationSlimmer = new translationSlimmer.TranslationSlimmer();
|
|
3350
3471
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.VegaComponentUsageRuntimeMetricsSlimmer();
|
|
3351
3472
|
this.renderer = new VegaCalendarRenderer();
|
|
3352
3473
|
this.switchPanelRenderer = new VegaCalendarSwitchPanelRenderer();
|
|
@@ -3378,22 +3499,28 @@ const VegaCalendar = class {
|
|
|
3378
3499
|
/**
|
|
3379
3500
|
* Specifies the current view mode of the calendar.
|
|
3380
3501
|
*
|
|
3381
|
-
* @
|
|
3502
|
+
* @vegaVersion 2.14.0
|
|
3382
3503
|
*/
|
|
3383
3504
|
/* eslint-disable-next-line @stencil/strict-mutable */
|
|
3384
3505
|
this.viewMode = 'month';
|
|
3385
3506
|
/**
|
|
3386
3507
|
* Specifies the time format of the calendar.
|
|
3387
3508
|
*
|
|
3388
|
-
* @
|
|
3509
|
+
* @vegaVersion 2.14.0
|
|
3389
3510
|
*/
|
|
3390
3511
|
this.timeFormat = '24-hour';
|
|
3391
3512
|
/**
|
|
3392
3513
|
* Controls the visibility of the calendar's event color bar.
|
|
3393
3514
|
*
|
|
3394
|
-
* @
|
|
3515
|
+
* @vegaVersion 2.21.0
|
|
3395
3516
|
*/
|
|
3396
3517
|
this.showEventColorBar = true;
|
|
3518
|
+
/**
|
|
3519
|
+
* Controls the visibility of the weekend columns in the calendar.
|
|
3520
|
+
*
|
|
3521
|
+
* @vegaVersion 2.28.0
|
|
3522
|
+
*/
|
|
3523
|
+
this.showWeekends = true;
|
|
3397
3524
|
}
|
|
3398
3525
|
/**
|
|
3399
3526
|
* Tracks changes to the current period state.
|
|
@@ -3431,6 +3558,11 @@ const VegaCalendar = class {
|
|
|
3431
3558
|
*/
|
|
3432
3559
|
watchShowEventColorBar(newValue) {
|
|
3433
3560
|
}
|
|
3561
|
+
/**
|
|
3562
|
+
* Monitors changes in the visibility of the weekend columns in the calendar.
|
|
3563
|
+
*/
|
|
3564
|
+
watchShowWeekendsChange() {
|
|
3565
|
+
}
|
|
3434
3566
|
render() {
|
|
3435
3567
|
return component.sanitizeVegaComponent(index.h(index.Host, null, this.renderer.render()), this.host);
|
|
3436
3568
|
}
|
|
@@ -3440,12 +3572,16 @@ const VegaCalendar = class {
|
|
|
3440
3572
|
"viewMode": ["watchViewModeChange"],
|
|
3441
3573
|
"events": ["watchEventsChange"],
|
|
3442
3574
|
"timeFormat": ["watchTimeFormat"],
|
|
3443
|
-
"showEventColorBar": ["watchShowEventColorBar"]
|
|
3575
|
+
"showEventColorBar": ["watchShowEventColorBar"],
|
|
3576
|
+
"showWeekends": ["watchShowWeekendsChange"]
|
|
3444
3577
|
}; }
|
|
3445
3578
|
};
|
|
3446
3579
|
__decorate$7([
|
|
3447
3580
|
componentUsageRuntimeMetrics.InjectVegaGlobalSlimmer()
|
|
3448
3581
|
], VegaCalendar.prototype, "globalSlimmer", void 0);
|
|
3582
|
+
__decorate$7([
|
|
3583
|
+
globalSlimmerRegistry.InjectVegaSlimmer()
|
|
3584
|
+
], VegaCalendar.prototype, "translationSlimmer", void 0);
|
|
3449
3585
|
__decorate$7([
|
|
3450
3586
|
globalSlimmerRegistry.InjectVegaSlimmer()
|
|
3451
3587
|
], VegaCalendar.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
@@ -3596,13 +3732,14 @@ class VegaCalendarEventRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
3596
3732
|
* @returns {HTMLAnchorElement} event element
|
|
3597
3733
|
*/
|
|
3598
3734
|
renderNormalEvent() {
|
|
3599
|
-
const { variant
|
|
3735
|
+
const { variant, disabled } = this.calendarEvent;
|
|
3736
|
+
const variantText = variant || 'primary';
|
|
3600
3737
|
const isMonthEvent = !this.host.classList.contains('day-event');
|
|
3601
3738
|
const classMap = {
|
|
3602
3739
|
'slot-container': this.slotMode,
|
|
3603
3740
|
'event-container': true,
|
|
3604
3741
|
'disabled': disabled,
|
|
3605
|
-
[
|
|
3742
|
+
[variantText]: true,
|
|
3606
3743
|
};
|
|
3607
3744
|
if (isMonthEvent) {
|
|
3608
3745
|
return (index.h("div", { role: "button", tabIndex: 0, class: classMap, ref: (node) => (this.slotContainerRef = node) },
|