@globalpayments/vega 2.67.0 → 2.68.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-ab28f910.js → app-globals-f7106a22.js} +15 -14
- package/dist/cjs/{child-nodes-event-prevent-slimmer-eb803b14.js → child-nodes-event-prevent-slimmer-f8840f1b.js} +1 -1
- package/dist/cjs/{code-block-ab97a0a0.js → code-block-39074880.js} +514 -319
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-5630341e.js → component-value-history-controller-slimmer.abstract-ddedf543.js} +2 -2
- package/dist/cjs/{design-token-847739f1.js → design-token-e14a4e66.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-d0f0f2c0.js → dto-renderer-manager-b7969d6c.js} +1587 -1563
- package/dist/cjs/{element-appender-slimmer-aead9bbb.js → element-appender-slimmer-7ee27ab3.js} +5 -5
- package/dist/cjs/{event-emit-slimmer-d21a0935.js → event-emit-slimmer-7afe8d78.js} +1 -1
- package/dist/cjs/{token-extension-aa8d5cce.js → function-extension-f0e845f2.js} +1019 -96
- package/dist/cjs/{image-annotation-action-d84de785.js → image-annotation-action-7f0626c8.js} +15 -25
- package/dist/cjs/index.cjs.js +36 -24
- package/dist/cjs/{internal-vega-event-manager-4d1ce667.js → internal-vega-event-manager-45d451de.js} +5 -2
- package/dist/cjs/{language-extension-d257e65d.js → language-extension-d0103d1a.js} +5 -5
- package/dist/cjs/loader.cjs.js +8 -8
- package/dist/cjs/{public-rules-d2b9b8f0.js → public-rules-8b67eaba.js} +3 -3
- package/dist/cjs/{range-d610028e.js → range-002671b6.js} +1 -1
- package/dist/cjs/{responsive-format-facade-71e7b74c.js → responsive-format-facade-347db035.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-a8fe5f50.js → rich-text-editor-required-rule-5392bd8a.js} +1 -1
- package/dist/cjs/{style-formatter-6facb42b.js → style-formatter-0a09f0dd.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +7 -7
- package/dist/cjs/vega-app-header-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-banner.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-calendar_4.cjs.entry.js +307 -269
- package/dist/cjs/vega-card.cjs.entry.js +7 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +6 -6
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-dialog_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-divider.cjs.entry.js +7 -7
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +24 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-flex.cjs.entry.js +8 -8
- package/dist/cjs/vega-font.cjs.entry.js +7 -7
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-grid.cjs.entry.js +7 -7
- package/dist/cjs/vega-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +38 -14
- package/dist/cjs/vega-input.cjs.entry.js +14 -3
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +7 -7
- package/dist/cjs/vega-popover_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +2 -2
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +93 -16
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +107 -54
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +10 -10
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_8.cjs.entry.js +11 -11
- package/dist/cjs/vega-textarea.cjs.entry.js +24 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega.cjs.js +8 -8
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/calendar-event-sorter.js +3 -3
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/layout/day-view-timed-event-layout-column.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.js +3 -4
- package/dist/collection/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.js +11 -3
- package/dist/collection/components/vega-field-label/vega-field-label.js +42 -0
- package/dist/collection/components/vega-input/vega-input.js +48 -2
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-renderer.js +16 -5
- package/dist/collection/components/vega-input-select/vega-input-select.css +2 -44
- package/dist/collection/components/vega-input-select/vega-input-select.js +81 -1
- package/dist/collection/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-extensions-styles-controller.js +60 -0
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +7 -1
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +17 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor-registry.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +30 -6
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +10 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.js +28 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/paste-content-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +87 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +27 -9
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +1 -12
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +14 -5
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +7 -37
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +14 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +19 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +44 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +51 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-new-paragraph-interceptor.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-paste-content-interceptor.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/function-block-insert-paragraph-strategy.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/insert-function-block-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/paste-plain-text-strategy.js +68 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/actions/insert-function-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/actions/paste-plain-text-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +73 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-content-strategy.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-logic-control-block-strategy.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +75 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +71 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +5 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +8 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +9 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +0 -12
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +12 -10
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +2 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.js +32 -2
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-style.test.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.css +3 -0
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +1 -1
- package/dist/collection/components/vega-table/vega-table.css +2 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +88 -2
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/calendar/calendar-date-time.js +136 -0
- package/dist/collection/helpers/calendar/calendar-date.js +10 -4
- package/dist/collection/helpers/calendar/calendar-event.js +38 -193
- package/dist/collection/helpers/calendar/calendar-time.js +120 -0
- package/dist/collection/helpers/calendar/index.js +2 -0
- package/dist/collection/helpers/calendar/test/calendar-date-time.test.js +27 -0
- package/dist/collection/helpers/calendar/test/calendar-event.test.js +24 -22
- package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +2 -2
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +2 -2
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +6 -6
- package/dist/collection/helpers/calendar/test/calendar-time.test.js +45 -0
- package/dist/collection/helpers/calendar/test/utils.test.js +1 -29
- package/dist/collection/helpers/calendar/utils.js +0 -66
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +5 -2
- package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +2 -0
- package/dist/esm/{app-globals-37a60cc1.js → app-globals-2f689986.js} +6 -5
- package/dist/esm/{child-nodes-event-prevent-slimmer-735cb880.js → child-nodes-event-prevent-slimmer-76331524.js} +1 -1
- package/dist/esm/{code-block-11b2bc1c.js → code-block-e8839202.js} +511 -318
- package/dist/esm/{component-value-history-controller-slimmer.abstract-16c5cb96.js → component-value-history-controller-slimmer.abstract-c6f94113.js} +2 -2
- package/dist/esm/{design-token-297dc528.js → design-token-e9e6b011.js} +1 -1
- package/dist/esm/{dto-renderer-manager-a1a3b6d2.js → dto-renderer-manager-7abc53bf.js} +1587 -1565
- package/dist/esm/{element-appender-slimmer-f7233708.js → element-appender-slimmer-8dbc8387.js} +2 -2
- package/dist/esm/{event-emit-slimmer-28fd360c.js → event-emit-slimmer-4e28e9f8.js} +1 -1
- package/dist/esm/{token-extension-b690953f.js → function-extension-eb1d062f.js} +1018 -97
- package/dist/esm/{image-annotation-action-fc46c920.js → image-annotation-action-7957653a.js} +14 -24
- package/dist/esm/index.js +9 -9
- package/dist/esm/{internal-vega-event-manager-a5a5938d.js → internal-vega-event-manager-516aa721.js} +5 -2
- package/dist/esm/{language-extension-314a2b18.js → language-extension-3331131f.js} +3 -3
- package/dist/esm/loader.js +8 -8
- package/dist/esm/{public-rules-c6a6946d.js → public-rules-e613dead.js} +3 -3
- package/dist/esm/{range-b78254de.js → range-adf206fd.js} +1 -1
- package/dist/esm/{responsive-format-facade-a41e1be7.js → responsive-format-facade-b0712993.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-d50c24da.js → rich-text-editor-required-rule-43857573.js} +1 -1
- package/dist/esm/{style-formatter-f7effaac.js → style-formatter-a20a1ef4.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +7 -7
- package/dist/esm/vega-app-header-button.entry.js +8 -8
- package/dist/esm/vega-banner.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +8 -8
- package/dist/esm/vega-breadcrumb.entry.js +3 -3
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button-link.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +8 -8
- package/dist/esm/vega-calendar_4.entry.js +307 -269
- package/dist/esm/vega-card.entry.js +7 -7
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +6 -6
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +8 -8
- package/dist/esm/vega-dialog_2.entry.js +9 -9
- package/dist/esm/vega-divider.entry.js +7 -7
- package/dist/esm/vega-dropdown_5.entry.js +9 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +24 -5
- package/dist/esm/vega-file-uploader.entry.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +6 -6
- package/dist/esm/vega-flex.entry.js +8 -8
- package/dist/esm/vega-font.entry.js +7 -7
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-grid.entry.js +7 -7
- package/dist/esm/vega-icon.entry.js +6 -6
- package/dist/esm/vega-image-uploader.entry.js +7 -7
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +3 -3
- package/dist/esm/vega-input-passcode.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +6 -6
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +38 -14
- package/dist/esm/vega-input.entry.js +14 -3
- package/dist/esm/vega-item-toggle.entry.js +2 -2
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +6 -6
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +7 -7
- package/dist/esm/vega-popover_2.entry.js +9 -9
- package/dist/esm/vega-progress-tracker.entry.js +2 -2
- package/dist/esm/vega-radio_2.entry.js +3 -3
- package/dist/esm/vega-rich-text-content.entry.js +93 -16
- package/dist/esm/vega-rich-text-editor_4.entry.js +107 -54
- package/dist/esm/vega-segment-control.entry.js +2 -2
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +3 -3
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-tab-group_2.entry.js +3 -3
- package/dist/esm/vega-table_8.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +25 -5
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +7 -7
- package/dist/esm/vega.js +8 -8
- package/dist/sri/vega-sri-manifest.json +273 -273
- package/dist/types/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.d.ts +1 -0
- package/dist/types/components/vega-field-label/types.d.ts +12 -0
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +13 -1
- package/dist/types/components/vega-input/vega-input.d.ts +14 -2
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-renderer.d.ts +3 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +25 -0
- package/dist/types/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-extensions-styles-controller.d.ts +26 -0
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor-registry.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor.abstract.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +9 -2
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/paste-content-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +0 -11
- package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +19 -3
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +36 -3
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-new-paragraph-interceptor.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-paste-content-interceptor.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/function-block-insert-paragraph-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/insert-function-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/paste-plain-text-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/actions/insert-function-block-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/actions/paste-plain-text-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +48 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-content-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-logic-control-block-strategy.d.ts +32 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +3 -4
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +2 -11
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/annotation-style.test.d.ts +1 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +26 -0
- package/dist/types/components.d.ts +65 -3
- package/dist/types/helpers/calendar/calendar-date-time.d.ts +76 -0
- package/dist/types/helpers/calendar/calendar-event.d.ts +18 -57
- package/dist/types/helpers/calendar/calendar-time.d.ts +64 -0
- package/dist/types/helpers/calendar/index.d.ts +2 -0
- package/dist/types/helpers/calendar/test/calendar-date-time.test.d.ts +1 -0
- package/dist/types/helpers/calendar/test/calendar-time.test.d.ts +1 -0
- package/dist/types/helpers/calendar/utils.d.ts +0 -25
- package/dist/types/types/components.type.d.ts +1 -1
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-6f7d42a0.entry.js → p-00376f71.entry.js} +1 -1
- package/dist/vega/p-018d70a5.js +1 -0
- package/dist/vega/p-0849f85e.js +1 -0
- package/dist/vega/{p-b431f9d5.entry.js → p-0a55f984.entry.js} +1 -1
- package/dist/vega/p-0f7dec29.entry.js +1 -0
- package/dist/vega/{p-47cae62d.entry.js → p-113d305b.entry.js} +1 -1
- package/dist/vega/{p-015cdbe7.entry.js → p-115b42e6.entry.js} +1 -1
- package/dist/vega/p-16358fec.entry.js +1 -0
- package/dist/vega/{p-af5bfe34.js → p-16d68187.js} +1 -1
- package/dist/vega/{p-92a22562.entry.js → p-18e8c54a.entry.js} +1 -1
- package/dist/vega/{p-6f6ccf67.entry.js → p-1922303e.entry.js} +1 -1
- package/dist/vega/{p-74d61782.entry.js → p-19256107.entry.js} +1 -1
- package/dist/vega/{p-59298f5e.entry.js → p-1dcb1fcd.entry.js} +2 -2
- package/dist/vega/{p-7f69081b.entry.js → p-1dd7f8b2.entry.js} +1 -1
- package/dist/vega/{p-d006e732.entry.js → p-22fe8c61.entry.js} +1 -1
- package/dist/vega/{p-524693d8.entry.js → p-238afe1b.entry.js} +1 -1
- package/dist/vega/p-240d9d35.entry.js +1 -0
- package/dist/vega/{p-b82d3915.entry.js → p-24419ebe.entry.js} +1 -1
- package/dist/vega/p-2478f65e.js +1 -0
- package/dist/vega/{p-358e9800.entry.js → p-2c945862.entry.js} +1 -1
- package/dist/vega/{p-5f58d1da.entry.js → p-2e32fbe6.entry.js} +1 -1
- package/dist/vega/p-2f04d2ac.js +1 -0
- package/dist/vega/{p-a73dc4b3.entry.js → p-30a8d9d6.entry.js} +1 -1
- package/dist/vega/{p-e6cccee4.js → p-369810ae.js} +1 -1
- package/dist/vega/p-3ad87199.entry.js +1 -0
- package/dist/vega/{p-fe2e859f.entry.js → p-3b800f1b.entry.js} +1 -1
- package/dist/vega/p-437f865f.js +1 -0
- package/dist/vega/{p-de624f7d.entry.js → p-48bc03fa.entry.js} +1 -1
- package/dist/vega/{p-46830028.entry.js → p-54ddd06f.entry.js} +1 -1
- package/dist/vega/{p-5a0524ab.entry.js → p-56636a58.entry.js} +1 -1
- package/dist/vega/{p-fc8c5869.entry.js → p-56f77466.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-ab1001f5.entry.js → p-61d9cdf9.entry.js} +1 -1
- package/dist/vega/{p-39b9c57b.entry.js → p-626246b4.entry.js} +1 -1
- package/dist/vega/{p-ff3bb4e2.entry.js → p-634499cb.entry.js} +1 -1
- package/dist/vega/p-6609d87e.entry.js +1 -0
- package/dist/vega/p-69d27eaf.entry.js +1 -0
- package/dist/vega/{p-7efb5ebe.entry.js → p-705dad87.entry.js} +1 -1
- package/dist/vega/{p-8d574fbd.entry.js → p-75b5894f.entry.js} +1 -1
- package/dist/vega/{p-00071542.entry.js → p-76b1dae4.entry.js} +1 -1
- package/dist/vega/{p-54b62ecf.js → p-7747c163.js} +1 -1
- package/dist/vega/{p-0ed53cce.entry.js → p-787caad3.entry.js} +1 -1
- package/dist/vega/{p-129c0ce1.js → p-79e6e12c.js} +1 -1
- package/dist/vega/{p-cc519f53.entry.js → p-7dde3be9.entry.js} +1 -1
- package/dist/vega/p-8233d814.entry.js +1 -0
- package/dist/vega/{p-5e32866d.entry.js → p-83a50ac2.entry.js} +1 -1
- package/dist/vega/p-8506e8c3.js +1 -0
- package/dist/vega/{p-47fa359b.js → p-85407fb9.js} +1 -1
- package/dist/vega/{p-892cbe7c.entry.js → p-880569ec.entry.js} +1 -1
- package/dist/vega/{p-0113a83c.entry.js → p-8dba59a6.entry.js} +1 -1
- package/dist/vega/p-94e167b8.entry.js +1 -0
- package/dist/vega/{p-b2aaab66.entry.js → p-98fb9eaa.entry.js} +1 -1
- package/dist/vega/{p-3288a65b.entry.js → p-99bf5993.entry.js} +1 -1
- package/dist/vega/p-a211ae63.js +1 -0
- package/dist/vega/{p-fef846d5.entry.js → p-a2506cb5.entry.js} +1 -1
- package/dist/vega/{p-4e33fff6.entry.js → p-a6fb5a40.entry.js} +1 -1
- package/dist/vega/{p-bee1cc34.entry.js → p-b5060e84.entry.js} +1 -1
- package/dist/vega/{p-616cd622.entry.js → p-b78670c9.entry.js} +1 -1
- package/dist/vega/{p-d5761532.entry.js → p-b8558278.entry.js} +1 -1
- package/dist/vega/{p-8d655fd2.entry.js → p-bb0f2b5f.entry.js} +1 -1
- package/dist/vega/{p-a7631c6b.js → p-bb37a401.js} +1 -1
- package/dist/vega/p-bccee21e.js +1 -0
- package/dist/vega/{p-2553031f.entry.js → p-bd0e55a2.entry.js} +1 -1
- package/dist/vega/{p-65693321.entry.js → p-c0223a17.entry.js} +1 -1
- package/dist/vega/{p-2d430dc4.entry.js → p-c26332ae.entry.js} +1 -1
- package/dist/vega/{p-7f9ec104.entry.js → p-c54148fb.entry.js} +1 -1
- package/dist/vega/{p-276b1163.entry.js → p-d3905af1.entry.js} +2 -2
- package/dist/vega/p-d4893487.js +1 -0
- package/dist/vega/{p-d1dacaeb.entry.js → p-d67200e8.entry.js} +1 -1
- package/dist/vega/{p-725f0a2c.js → p-db57dddc.js} +1 -1
- package/dist/vega/{p-ed8bc4f0.entry.js → p-de02f404.entry.js} +1 -1
- package/dist/vega/{p-d4452dbc.entry.js → p-de8c5fae.entry.js} +1 -1
- package/dist/vega/{p-7b145620.js → p-de97c6d9.js} +1 -1
- package/dist/vega/{p-34800282.entry.js → p-e0979451.entry.js} +1 -1
- package/dist/vega/{p-1a3cb65e.entry.js → p-e6351dab.entry.js} +1 -1
- package/dist/vega/{p-8d096fea.entry.js → p-f0fb3fdd.entry.js} +1 -1
- package/dist/vega/{p-ea05a2fc.entry.js → p-f3399ef1.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-019f7f95.js +0 -1
- package/dist/vega/p-03a1e82e.entry.js +0 -1
- package/dist/vega/p-0d1eca78.entry.js +0 -1
- package/dist/vega/p-16370cfb.js +0 -1
- package/dist/vega/p-3a7f177a.entry.js +0 -1
- package/dist/vega/p-41c3fcb4.js +0 -1
- package/dist/vega/p-81105691.entry.js +0 -1
- package/dist/vega/p-822c6092.js +0 -1
- package/dist/vega/p-8edf3513.js +0 -1
- package/dist/vega/p-a1b7a179.entry.js +0 -1
- package/dist/vega/p-ab8f99e9.entry.js +0 -1
- package/dist/vega/p-bf7f755b.js +0 -1
- package/dist/vega/p-bf9476cd.entry.js +0 -1
- package/dist/vega/p-c6ce2869.js +0 -1
- package/dist/vega/p-d0e6454e.entry.js +0 -1
- package/dist/vega/p-d88e88a7.js +0 -1
- package/dist/vega/p-f360c9ba.js +0 -1
|
@@ -6,11 +6,11 @@ import { D as DomNodeSubjectObserverFactory, a as VegaClick, f as VegaChange, V
|
|
|
6
6
|
import { a as VegaInternalIconManager } from './internal-icon-manager-f0486245.js';
|
|
7
7
|
import { c as createEnterKeyHandlerToTriggerClick } from './accessibility-e5fd0fab.js';
|
|
8
8
|
import { p as pad } from './date-c55b97f0.js';
|
|
9
|
-
import { c as createEventEmitSlimmer } from './event-emit-slimmer-
|
|
9
|
+
import { c as createEventEmitSlimmer } from './event-emit-slimmer-4e28e9f8.js';
|
|
10
10
|
import { V as VegaInternalTranslation } from './translation-f10b1e19.js';
|
|
11
11
|
import { s as stateBackgroundColorFormatter } from './state-background-color-formatter-0f01d27a.js';
|
|
12
12
|
import { q as isBackgroundColorTokenType } from './type-guard-12f7654b.js';
|
|
13
|
-
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-
|
|
13
|
+
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-76331524.js';
|
|
14
14
|
import { y as VegaInternalCalendarMonthEventsChange, z as VegaInternalCalendarEventPreviewHide, A as VegaInternalCalendarEventPreviewClear, B as VegaInternalCalendarEventPreviewUpdate } from './vega-internal-event-id-5c3e5f7f.js';
|
|
15
15
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
16
16
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
@@ -26,7 +26,7 @@ import { S as SubStateObserverSlimmer } from './sub-state-observer-slimmer-3504e
|
|
|
26
26
|
import { b as parsePixelStringToNumber } from './pixel-f32c07ce.js';
|
|
27
27
|
import { f as findParent } from './ui-bb99c0c2.js';
|
|
28
28
|
import './dynamic-slimmer-90b8af32.js';
|
|
29
|
-
import './internal-vega-event-manager-
|
|
29
|
+
import './internal-vega-event-manager-516aa721.js';
|
|
30
30
|
import './try-get-document-bef0f526.js';
|
|
31
31
|
import './static-subject-title-52f93124.js';
|
|
32
32
|
import './breakpoints-d9faf11c.js';
|
|
@@ -748,70 +748,6 @@ var WeekdayLongNames;
|
|
|
748
748
|
WeekdayLongNames["fri"] = "Friday";
|
|
749
749
|
WeekdayLongNames["sat"] = "Saturday";
|
|
750
750
|
})(WeekdayLongNames || (WeekdayLongNames = {}));
|
|
751
|
-
/**
|
|
752
|
-
* Format display time
|
|
753
|
-
*
|
|
754
|
-
* @param {TimeFormat} timeFormat - The time format (24-hour or 12-hour)
|
|
755
|
-
* @param {string} timeString - The time string to format
|
|
756
|
-
* @returns {string} - The formatted time string
|
|
757
|
-
*/
|
|
758
|
-
const formatDisplayTime = (timeFormat, timeString) => {
|
|
759
|
-
const [hour, minutes] = timeString.split(':');
|
|
760
|
-
if (timeFormat === '24-hour') {
|
|
761
|
-
return `${hour.padStart(2, '0')}:${minutes.padStart(2, '0')}`;
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
const hourNum = Number(hour);
|
|
765
|
-
const amPm = hourNum >= 12 ? 'pm' : 'am';
|
|
766
|
-
const minutesResult = minutes.padStart(2, '0');
|
|
767
|
-
if (hourNum > 12) {
|
|
768
|
-
return `${hourNum - 12}:${minutesResult} ${VegaInternalTranslation.t('pm')}`;
|
|
769
|
-
}
|
|
770
|
-
else if (hourNum === 0) {
|
|
771
|
-
return `12:${minutesResult} ${VegaInternalTranslation.t('am')}`;
|
|
772
|
-
}
|
|
773
|
-
else {
|
|
774
|
-
return `${hourNum}:${minutesResult} ${VegaInternalTranslation.t(amPm)}`;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
/**
|
|
779
|
-
* Gets current date parts in the specified timezone
|
|
780
|
-
*
|
|
781
|
-
* @param {string} timezone - The IANA timezone identifier
|
|
782
|
-
* @param {Date} date - The date to get parts for
|
|
783
|
-
* @returns {DateParts} - An object with year, month, and date properties for the specified timezone
|
|
784
|
-
*/
|
|
785
|
-
function getCurrentDatePartsInTimezone(timezone, date) {
|
|
786
|
-
if (timezone && timezone !== getSystemTimezone()) {
|
|
787
|
-
try {
|
|
788
|
-
const formatter = new Intl.DateTimeFormat([], {
|
|
789
|
-
timeZone: timezone,
|
|
790
|
-
year: 'numeric',
|
|
791
|
-
month: '2-digit',
|
|
792
|
-
day: '2-digit',
|
|
793
|
-
});
|
|
794
|
-
const parts = formatter.formatToParts(date);
|
|
795
|
-
const yearPart = parts.find((part) => part.type === 'year');
|
|
796
|
-
const monthPart = parts.find((part) => part.type === 'month');
|
|
797
|
-
const dayPart = parts.find((part) => part.type === 'day');
|
|
798
|
-
if (yearPart && monthPart && dayPart) {
|
|
799
|
-
const year = parseInt(yearPart.value, 10);
|
|
800
|
-
const month = parseInt(monthPart.value, 10);
|
|
801
|
-
const date = parseInt(dayPart.value, 10);
|
|
802
|
-
return { year, month, date };
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
catch (_a) {
|
|
806
|
-
LogUtility.warn('Invalid timezone:', timezone);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
return {
|
|
810
|
-
year: date.getFullYear(),
|
|
811
|
-
month: date.getMonth() + 1,
|
|
812
|
-
date: date.getDate(),
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
751
|
/**
|
|
816
752
|
* Get the system timezone identifier
|
|
817
753
|
*
|
|
@@ -900,6 +836,259 @@ class DayViewGenerator extends CalendarViewGenerator {
|
|
|
900
836
|
}
|
|
901
837
|
}
|
|
902
838
|
|
|
839
|
+
/**
|
|
840
|
+
* CalendarTime represents hours/minutes in 24-hour format and centralizes parsing/formatting logic.
|
|
841
|
+
*/
|
|
842
|
+
class CalendarTime {
|
|
843
|
+
constructor(hours, minutes) {
|
|
844
|
+
this._hours = hours;
|
|
845
|
+
this._minutes = minutes;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Parse a raw time string into a CalendarTime instance.
|
|
849
|
+
*
|
|
850
|
+
* @param {string} rawTime - Source time value such as "9:00" or "9am".
|
|
851
|
+
* @returns {CalendarTime} Parsed time.
|
|
852
|
+
*/
|
|
853
|
+
static fromString(rawTime) {
|
|
854
|
+
const normalized = this.convertTimeTo24Hour(rawTime);
|
|
855
|
+
const [hourPart, minutePart] = normalized.split(':');
|
|
856
|
+
return new CalendarTime(Number(hourPart), Number(minutePart));
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Build a CalendarTime from a Date instance while preserving hours/minutes.
|
|
860
|
+
*
|
|
861
|
+
* @param {Date} date - The source date.
|
|
862
|
+
* @returns {CalendarTime} Time representation extracted from the date.
|
|
863
|
+
*/
|
|
864
|
+
static fromDate(date) {
|
|
865
|
+
return new CalendarTime(date.getHours(), date.getMinutes());
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Calculate the duration in the requested precision between two CalendarTime values, accounting for overnight spans.
|
|
869
|
+
*
|
|
870
|
+
* @param {CalendarTime} start - Start time of the interval.
|
|
871
|
+
* @param {CalendarTime} end - End time of the interval.
|
|
872
|
+
* @param {'minutes' | 'hours'} precision - Desired unit of measure for the result (defaults to minutes).
|
|
873
|
+
* @returns {number} Duration expressed in the requested precision.
|
|
874
|
+
*/
|
|
875
|
+
static calculateDuration(start, end, precision = 'minutes') {
|
|
876
|
+
const startMinutes = start.totalMinutes;
|
|
877
|
+
let endMinutes = end.totalMinutes;
|
|
878
|
+
if (end.hours === 0 && start.hours !== 0) {
|
|
879
|
+
endMinutes += 24 * 60;
|
|
880
|
+
}
|
|
881
|
+
const durationMinutes = endMinutes - startMinutes;
|
|
882
|
+
return precision === 'hours' ? durationMinutes / 60 : durationMinutes;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Normalize various time inputs (e.g. 9am, 9:30 PM) to a 24-hour HH:mm string.
|
|
886
|
+
*
|
|
887
|
+
* @param {string} timeString - User supplied time value.
|
|
888
|
+
* @returns {string} 24-hour formatted string.
|
|
889
|
+
*/
|
|
890
|
+
static convertTimeTo24Hour(timeString) {
|
|
891
|
+
const normalized = timeString.toLocaleLowerCase();
|
|
892
|
+
if (normalized.includes('am') || normalized.includes('pm')) {
|
|
893
|
+
const isAm = normalized.includes('am');
|
|
894
|
+
const cleaned = normalized.replace('am', '').replace('pm', '').trim();
|
|
895
|
+
const [rawHour, rawMinutes] = cleaned.split(':');
|
|
896
|
+
const minutes = rawMinutes.padStart(2, '0');
|
|
897
|
+
if (isAm) {
|
|
898
|
+
return `${rawHour === '12' ? '00' : rawHour}:${minutes}`;
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
const convertedHour = rawHour === '12' ? '12' : `${Number(rawHour) + 12}`;
|
|
902
|
+
return `${convertedHour}:${minutes}`;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
return timeString;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Hour component in 24-hour clock.
|
|
909
|
+
*
|
|
910
|
+
* @returns {number} Hours between 0-23.
|
|
911
|
+
*/
|
|
912
|
+
get hours() {
|
|
913
|
+
return this._hours;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Minute component.
|
|
917
|
+
*
|
|
918
|
+
* @returns {number} Minutes between 0-59.
|
|
919
|
+
*/
|
|
920
|
+
get minutes() {
|
|
921
|
+
return this._minutes;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Total minutes elapsed since midnight for this time value.
|
|
925
|
+
*
|
|
926
|
+
* @returns {number} Minutes from 00:00.
|
|
927
|
+
*/
|
|
928
|
+
get totalMinutes() {
|
|
929
|
+
return this._hours * 60 + this._minutes;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Format the time into a string using a simple formatter.
|
|
933
|
+
*
|
|
934
|
+
* @param {TimeStringFormat} format - time string Format. Defaults to 'hh:mm'.
|
|
935
|
+
* @returns {string} Formatted time string.
|
|
936
|
+
*/
|
|
937
|
+
toString(format = 'hh:mm') {
|
|
938
|
+
const defaultHours = this._hours.toString().padStart(2, '0');
|
|
939
|
+
const defaultMinutes = this._minutes.toString().padStart(2, '0');
|
|
940
|
+
const normalizedFormat = format.toLowerCase();
|
|
941
|
+
switch (normalizedFormat) {
|
|
942
|
+
case 'hh:m':
|
|
943
|
+
return `${defaultHours}:${this._minutes}`;
|
|
944
|
+
case 'h:mm':
|
|
945
|
+
return `${this._hours}:${defaultMinutes}`;
|
|
946
|
+
case 'h:m':
|
|
947
|
+
return `${this._hours}:${this._minutes}`;
|
|
948
|
+
case '12-hour': {
|
|
949
|
+
const amPm = this._hours >= 12 ? 'pm' : 'am';
|
|
950
|
+
const hour12 = this._hours % 12 || 12;
|
|
951
|
+
return `${hour12}:${defaultMinutes} ${VegaInternalTranslation.t(amPm)}`;
|
|
952
|
+
}
|
|
953
|
+
default:
|
|
954
|
+
return `${defaultHours}:${defaultMinutes}`;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* CalendarDateTime centralizes timezone-aware conversions between native Date instances and calendar helpers.
|
|
961
|
+
*/
|
|
962
|
+
class CalendarDateTime {
|
|
963
|
+
constructor(date, timezone) {
|
|
964
|
+
this.originalDate = date;
|
|
965
|
+
this.timezone = timezone;
|
|
966
|
+
this.syncDateTime();
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Build a CalendarDateTime from a native Date while the specific timezone.
|
|
970
|
+
*
|
|
971
|
+
* @param {Date} date - The native Date object to convert.
|
|
972
|
+
* @param {string} timezone - The timezone to apply.
|
|
973
|
+
* @returns {CalendarDateTime} A timezone-aware CalendarDateTime instance.
|
|
974
|
+
*/
|
|
975
|
+
static fromDate(date, timezone) {
|
|
976
|
+
return new CalendarDateTime(date, timezone);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Build a CalendarDateTime from a date input (Date or string) and optional time metadata.
|
|
980
|
+
*
|
|
981
|
+
* @param {string | Date} date - The input date value (string or Date).
|
|
982
|
+
* @param {CalendarDateTimeOptions} options - Additional options for time, timezone, seconds, etc.
|
|
983
|
+
* @returns {CalendarDateTime} A timezone-aware CalendarDateTime instance.
|
|
984
|
+
*/
|
|
985
|
+
static fromInitDataSource(date, options) {
|
|
986
|
+
const baseDate = new Date(date);
|
|
987
|
+
if (options.time) {
|
|
988
|
+
const calendarTime = CalendarTime.fromString(options.time);
|
|
989
|
+
baseDate.setHours(calendarTime.hours, calendarTime.minutes, 0, 0);
|
|
990
|
+
}
|
|
991
|
+
else if (options.endTimeMissing) {
|
|
992
|
+
baseDate.setHours(23, 59, 59, 0);
|
|
993
|
+
}
|
|
994
|
+
return CalendarDateTime.fromDate(baseDate, options.timezone);
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Get the CalendarDate instance representing the date portion.
|
|
998
|
+
*
|
|
999
|
+
* @returns {CalendarDate} The CalendarDate object.
|
|
1000
|
+
*/
|
|
1001
|
+
get calendarDate() {
|
|
1002
|
+
return this.date;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Get the CalendarTime instance representing the time portion.
|
|
1006
|
+
*
|
|
1007
|
+
* @returns {CalendarTime} The CalendarTime object.
|
|
1008
|
+
*/
|
|
1009
|
+
get calendarTime() {
|
|
1010
|
+
return this.time;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Get a native Date object representing this CalendarDateTime.
|
|
1014
|
+
*
|
|
1015
|
+
* @returns {Date} The native Date object.
|
|
1016
|
+
*/
|
|
1017
|
+
toDate() {
|
|
1018
|
+
return this.date.toDate();
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Set a new timezone and update CalendarDate/CalendarTime accordingly.
|
|
1022
|
+
*
|
|
1023
|
+
* @param {string} newTimezone - The new timezone to set.
|
|
1024
|
+
*/
|
|
1025
|
+
setTimezone(newTimezone) {
|
|
1026
|
+
this.timezone = newTimezone;
|
|
1027
|
+
this.syncDateTime();
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Sync CalendarDate and CalendarTime with the current originalDate and timezone.
|
|
1031
|
+
*/
|
|
1032
|
+
syncDateTime() {
|
|
1033
|
+
const normalized = this.convertDateToTimezone(this.originalDate);
|
|
1034
|
+
this.date = new CalendarDate(normalized.getFullYear(), normalized.getMonth() + 1, normalized.getDate());
|
|
1035
|
+
this.time = CalendarTime.fromDate(normalized);
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Convert a Date to the specific timezone.
|
|
1039
|
+
*
|
|
1040
|
+
* @param {Date} date - The date to convert.
|
|
1041
|
+
* @returns {Date} The date adjusted to the specific timezone.
|
|
1042
|
+
*/
|
|
1043
|
+
convertDateToTimezone(date) {
|
|
1044
|
+
if (this.timezone === getSystemTimezone()) {
|
|
1045
|
+
return date;
|
|
1046
|
+
}
|
|
1047
|
+
try {
|
|
1048
|
+
const formatter = new Intl.DateTimeFormat([], {
|
|
1049
|
+
timeZone: this.timezone,
|
|
1050
|
+
year: 'numeric',
|
|
1051
|
+
month: '2-digit',
|
|
1052
|
+
day: '2-digit',
|
|
1053
|
+
hour: '2-digit',
|
|
1054
|
+
minute: '2-digit',
|
|
1055
|
+
second: '2-digit',
|
|
1056
|
+
hour12: false,
|
|
1057
|
+
});
|
|
1058
|
+
const parts = formatter.formatToParts(date);
|
|
1059
|
+
const yearPart = this.findDateTimeFormatPart(parts, 'year');
|
|
1060
|
+
const monthPart = this.findDateTimeFormatPart(parts, 'month');
|
|
1061
|
+
const dayPart = this.findDateTimeFormatPart(parts, 'day');
|
|
1062
|
+
const hourPart = this.findDateTimeFormatPart(parts, 'hour');
|
|
1063
|
+
const minutePart = this.findDateTimeFormatPart(parts, 'minute');
|
|
1064
|
+
const secondPart = this.findDateTimeFormatPart(parts, 'second');
|
|
1065
|
+
if (yearPart && monthPart && dayPart && hourPart && minutePart && secondPart) {
|
|
1066
|
+
const year = parseInt(yearPart.value, 10);
|
|
1067
|
+
const month = parseInt(monthPart.value, 10);
|
|
1068
|
+
const day = parseInt(dayPart.value, 10);
|
|
1069
|
+
const hour = parseInt(hourPart.value, 10);
|
|
1070
|
+
const minute = parseInt(minutePart.value, 10);
|
|
1071
|
+
const second = parseInt(secondPart.value, 10);
|
|
1072
|
+
return new Date(year, month - 1, day, hour, minute, second);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
catch (_a) {
|
|
1076
|
+
LogUtility.warn('Invalid timezone:', this.timezone);
|
|
1077
|
+
}
|
|
1078
|
+
return date;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Find a specific part in the Intl.DateTimeFormatPart array.
|
|
1082
|
+
*
|
|
1083
|
+
* @param {Intl.DateTimeFormatPart[]} parts - The array of date/time format parts.
|
|
1084
|
+
* @param {DateTimeFormatPartType} type - The type of part to find (e.g., 'year', 'month').
|
|
1085
|
+
* @returns {Intl.DateTimeFormatPart | undefined} The matching part, if found.
|
|
1086
|
+
*/
|
|
1087
|
+
findDateTimeFormatPart(parts, type) {
|
|
1088
|
+
return parts.find((part) => part.type === type);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
903
1092
|
/**
|
|
904
1093
|
* Calendar date class
|
|
905
1094
|
*/
|
|
@@ -917,8 +1106,7 @@ class CalendarDate {
|
|
|
917
1106
|
* @returns {CalendarDate} - Return a CalendarDate object
|
|
918
1107
|
*/
|
|
919
1108
|
static from(currentDate, timezone = getSystemTimezone()) {
|
|
920
|
-
|
|
921
|
-
return new CalendarDate(year, month, date);
|
|
1109
|
+
return CalendarDateTime.fromDate(currentDate, timezone).calendarDate;
|
|
922
1110
|
}
|
|
923
1111
|
/**
|
|
924
1112
|
* The year of the calendar date
|
|
@@ -960,7 +1148,13 @@ class CalendarDate {
|
|
|
960
1148
|
* @returns {boolean} - Return true if the calendar date is today. Otherwise, return false.
|
|
961
1149
|
*/
|
|
962
1150
|
isToday(timezone = getSystemTimezone()) {
|
|
963
|
-
|
|
1151
|
+
if (timezone === getSystemTimezone()) {
|
|
1152
|
+
const today = new Date();
|
|
1153
|
+
return (today.getFullYear() === this.year &&
|
|
1154
|
+
today.getMonth() + 1 === this.month &&
|
|
1155
|
+
today.getDate() === this.date);
|
|
1156
|
+
}
|
|
1157
|
+
const { year, month, date } = CalendarDateTime.fromDate(new Date(), timezone).calendarDate;
|
|
964
1158
|
return year === this.year && month === this.month && date === this.date;
|
|
965
1159
|
}
|
|
966
1160
|
/**
|
|
@@ -2515,7 +2709,7 @@ class CalendarEvent {
|
|
|
2515
2709
|
* @returns {Date} The `startDate` property of type `Date` is being returned.
|
|
2516
2710
|
*/
|
|
2517
2711
|
get startDate() {
|
|
2518
|
-
return this.
|
|
2712
|
+
return this._startDateTime.toDate();
|
|
2519
2713
|
}
|
|
2520
2714
|
/**
|
|
2521
2715
|
* The function returns the end date property of an object.
|
|
@@ -2523,23 +2717,23 @@ class CalendarEvent {
|
|
|
2523
2717
|
* @returns {Date} The `endDate` property of type `Date` is being returned.
|
|
2524
2718
|
*/
|
|
2525
2719
|
get endDate() {
|
|
2526
|
-
return this.
|
|
2720
|
+
return this._endDateTime.toDate();
|
|
2527
2721
|
}
|
|
2528
2722
|
/**
|
|
2529
|
-
* This function returns the start time as a
|
|
2723
|
+
* This function returns the start time as a CalendarTime.
|
|
2530
2724
|
*
|
|
2531
|
-
* @returns {
|
|
2725
|
+
* @returns {CalendarTime} The event start time.
|
|
2532
2726
|
*/
|
|
2533
2727
|
get startTime() {
|
|
2534
|
-
return this.
|
|
2728
|
+
return this._startDateTime.calendarTime;
|
|
2535
2729
|
}
|
|
2536
2730
|
/**
|
|
2537
|
-
* This function returns the end time as a
|
|
2731
|
+
* This function returns the end time as a CalendarTime.
|
|
2538
2732
|
*
|
|
2539
|
-
* @returns {
|
|
2733
|
+
* @returns {CalendarTime} The event end time.
|
|
2540
2734
|
*/
|
|
2541
2735
|
get endTime() {
|
|
2542
|
-
return this.
|
|
2736
|
+
return this._endDateTime.calendarTime;
|
|
2543
2737
|
}
|
|
2544
2738
|
/**
|
|
2545
2739
|
* This function returns the number of days that an event spans.
|
|
@@ -2564,7 +2758,7 @@ class CalendarEvent {
|
|
|
2564
2758
|
const endDate = this._eventSpansDays > 1
|
|
2565
2759
|
? new Date(startDate.year, startDate.month - 1, startDate.date + (this._eventSpansDays - 1))
|
|
2566
2760
|
: startDate.toDate();
|
|
2567
|
-
const result = new CalendarEvent(Object.assign(Object.assign({}, this._event), { startDate: startDate.toDate(), endDate: endDate, startTime: this.startTime, endTime: this.endTime }), eventKey);
|
|
2761
|
+
const result = new CalendarEvent(Object.assign(Object.assign({}, this._event), { startDate: startDate.toDate(), endDate: endDate, startTime: this.startTime.toString(), endTime: this.endTime.toString() }), eventKey);
|
|
2568
2762
|
return result;
|
|
2569
2763
|
}
|
|
2570
2764
|
/**
|
|
@@ -2607,8 +2801,8 @@ class CalendarEvent {
|
|
|
2607
2801
|
*/
|
|
2608
2802
|
generateDateTimeString(viewDate, timeFormat) {
|
|
2609
2803
|
const weekDay = VegaInternalTranslation.t(Object.values(WeekdayLongNames)[viewDate.toDate().getDay()]);
|
|
2610
|
-
const startTime =
|
|
2611
|
-
const endTime =
|
|
2804
|
+
const startTime = this.startTime.toString(timeFormat);
|
|
2805
|
+
const endTime = this.endTime.toString(timeFormat);
|
|
2612
2806
|
return `${weekDay}, ${viewDate.date} ${viewDate.getMonthName(true)} ${viewDate.year} ${startTime} - ${endTime}`;
|
|
2613
2807
|
}
|
|
2614
2808
|
/**
|
|
@@ -2616,13 +2810,8 @@ class CalendarEvent {
|
|
|
2616
2810
|
*
|
|
2617
2811
|
* @returns {number} the minutes
|
|
2618
2812
|
*/
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
const [endHour, endMinutes] = this.endTime.split(':');
|
|
2622
|
-
const now = CalendarDate.from(new Date(), this._timezone);
|
|
2623
|
-
const startDate = new Date(now.year, now.month, now.date, Number(startHour), Number(startMinutes));
|
|
2624
|
-
const endDate = new Date(now.year, now.month, now.date, Number(endHour) === 0 && Number(startHour) !== 0 ? 24 : Number(endHour), Number(endMinutes));
|
|
2625
|
-
return (endDate.valueOf() - startDate.valueOf()) / (60 * 1000);
|
|
2813
|
+
getEventMinutes() {
|
|
2814
|
+
return CalendarTime.calculateDuration(this.startTime, this.endTime, 'minutes');
|
|
2626
2815
|
}
|
|
2627
2816
|
/**
|
|
2628
2817
|
* This function returns an array of repeat series based on a given calendar period.
|
|
@@ -2646,36 +2835,8 @@ class CalendarEvent {
|
|
|
2646
2835
|
*/
|
|
2647
2836
|
updateTimezone(timezone) {
|
|
2648
2837
|
this._timezone = timezone;
|
|
2649
|
-
this.
|
|
2650
|
-
this.
|
|
2651
|
-
this.initRepeatPattern();
|
|
2652
|
-
}
|
|
2653
|
-
/**
|
|
2654
|
-
* The function `convertTimeTo24Hour` converts a time string from 12-hour format to 24-hour format in TypeScript.
|
|
2655
|
-
*
|
|
2656
|
-
* @param {string} timeString - The `convertTimeTo24Hour` function you provided is used to convert a
|
|
2657
|
-
* time string from 12-hour format to 24-hour format. The function checks if the input time string is
|
|
2658
|
-
* in 12-hour format and contains either 'am' or 'pm'.
|
|
2659
|
-
* @returns {string} The `convertTimeTo24Hour` function returns a string representing the input time string
|
|
2660
|
-
* converted to 24-hour format. If the input time string is in 12-hour format and contains 'am' or
|
|
2661
|
-
* 'pm', it converts it to 24-hour format. If the input time string is not in 12-hour format or does
|
|
2662
|
-
* not contain 'am' or 'pm', it returns the original input
|
|
2663
|
-
*/
|
|
2664
|
-
convertTimeTo24Hour(timeString) {
|
|
2665
|
-
timeString = timeString.toLocaleLowerCase();
|
|
2666
|
-
if (timeString.indexOf('am') > 0 || timeString.indexOf('pm') > 0) {
|
|
2667
|
-
if (timeString.indexOf('am') > 0) {
|
|
2668
|
-
timeString = timeString.replace('am', '').trim();
|
|
2669
|
-
const [hour, minutes] = timeString.split(':');
|
|
2670
|
-
return `${hour === '12' ? '00' : hour}:${minutes}`;
|
|
2671
|
-
}
|
|
2672
|
-
else {
|
|
2673
|
-
timeString = timeString.replace('pm', '').trim();
|
|
2674
|
-
const [hour, minutes] = timeString.split(':');
|
|
2675
|
-
return `${hour === '12' ? '12' : Number(hour) + 12}:${minutes}`;
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
return timeString;
|
|
2838
|
+
this._startDateTime.setTimezone(timezone);
|
|
2839
|
+
this._endDateTime.setTimezone(timezone);
|
|
2679
2840
|
}
|
|
2680
2841
|
/**
|
|
2681
2842
|
* The function `checkEventRequireField` validates the required fields of a calendar event item in TypeScript.
|
|
@@ -2707,164 +2868,41 @@ class CalendarEvent {
|
|
|
2707
2868
|
*/
|
|
2708
2869
|
initDate(eventOptions) {
|
|
2709
2870
|
const { startDate, startTime, endDate, endTime } = eventOptions;
|
|
2710
|
-
|
|
2711
|
-
this.
|
|
2712
|
-
this.processEndDate(endDate || '', endTime || '', originalDateParts);
|
|
2713
|
-
this._endTime = this.formatTimeForDisplay(this._endDate, endTime || '');
|
|
2871
|
+
this.processStartDate(startDate, startTime);
|
|
2872
|
+
this.processEndDate(endDate, endTime, startDate);
|
|
2714
2873
|
}
|
|
2715
2874
|
/**
|
|
2716
|
-
*
|
|
2875
|
+
* Parse the supplied start date/time, normalize into calendar wrappers.
|
|
2717
2876
|
*
|
|
2718
|
-
* @param {string | Date} startDate -
|
|
2719
|
-
* @param {string} startTime -
|
|
2720
|
-
* @returns {DateParts | undefined} originalDateParts information
|
|
2877
|
+
* @param {string | Date} startDate - Raw start date value from the event payload.
|
|
2878
|
+
* @param {string} startTime - Optional textual time component to parse.
|
|
2721
2879
|
*/
|
|
2722
2880
|
processStartDate(startDate, startTime) {
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
year: startDate.getFullYear(),
|
|
2728
|
-
month: startDate.getMonth(),
|
|
2729
|
-
date: startDate.getDate(),
|
|
2730
|
-
};
|
|
2731
|
-
tempDate = startDate;
|
|
2732
|
-
}
|
|
2733
|
-
else if (startDate && typeof startDate === 'string') {
|
|
2734
|
-
const [month, day, year] = startDate.split('/');
|
|
2735
|
-
originalDateParts = {
|
|
2736
|
-
year: Number(year),
|
|
2737
|
-
month: Number(month) - 1,
|
|
2738
|
-
date: Number(day),
|
|
2739
|
-
};
|
|
2740
|
-
tempDate = new Date(originalDateParts.year, originalDateParts.month, originalDateParts.date);
|
|
2741
|
-
}
|
|
2742
|
-
if (startTime && originalDateParts && tempDate) {
|
|
2743
|
-
const { timeHours, timeMinutes } = this.getCurrentHourAndMinutes(startTime);
|
|
2744
|
-
tempDate = new Date(originalDateParts.year, originalDateParts.month, originalDateParts.date, timeHours, timeMinutes, 0);
|
|
2745
|
-
}
|
|
2746
|
-
if (tempDate) {
|
|
2747
|
-
this._startDate = this.convertDateToTimezone(tempDate);
|
|
2748
|
-
}
|
|
2749
|
-
return originalDateParts;
|
|
2750
|
-
}
|
|
2751
|
-
/**
|
|
2752
|
-
* Process end date
|
|
2753
|
-
*
|
|
2754
|
-
* @param {string | Date} endDate - End date (string or Date object)
|
|
2755
|
-
* @param {string} endTime - End time string
|
|
2756
|
-
* @param {DateParts | undefined} fallbackDateParts - Default date parts to use when endDate is empty
|
|
2757
|
-
*/
|
|
2758
|
-
processEndDate(endDate, endTime, fallbackDateParts) {
|
|
2759
|
-
let tempDate;
|
|
2760
|
-
if (endDate && typeof endDate === 'object') {
|
|
2761
|
-
tempDate = endDate;
|
|
2762
|
-
}
|
|
2763
|
-
else if (endDate && typeof endDate === 'string') {
|
|
2764
|
-
const [month, day, year] = endDate.split('/');
|
|
2765
|
-
tempDate = new Date(Number(year), Number(month) - 1, Number(day), 23, 59, 59);
|
|
2766
|
-
}
|
|
2767
|
-
else {
|
|
2768
|
-
if (fallbackDateParts) {
|
|
2769
|
-
tempDate = new Date(fallbackDateParts.year, fallbackDateParts.month, fallbackDateParts.date, 23, 59, 59);
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
if (endTime && tempDate) {
|
|
2773
|
-
const { timeHours, timeMinutes } = this.getCurrentHourAndMinutes(endTime, 23, 59);
|
|
2774
|
-
tempDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate(), timeHours, timeMinutes, 59);
|
|
2775
|
-
}
|
|
2776
|
-
if (tempDate) {
|
|
2777
|
-
this._endDate = this.convertDateToTimezone(tempDate);
|
|
2778
|
-
}
|
|
2779
|
-
}
|
|
2780
|
-
/**
|
|
2781
|
-
* Format time for display
|
|
2782
|
-
*
|
|
2783
|
-
* @param {Date} date - Date object
|
|
2784
|
-
* @param {string} originalTime - Original time string
|
|
2785
|
-
* @returns {string} Formatted time string
|
|
2786
|
-
*/
|
|
2787
|
-
formatTimeForDisplay(date, originalTime) {
|
|
2788
|
-
const shouldUseOriginalTime = Boolean(originalTime) && this._timezone === getSystemTimezone();
|
|
2789
|
-
if (shouldUseOriginalTime) {
|
|
2790
|
-
const convertedTime = this.convertTimeTo24Hour(originalTime);
|
|
2791
|
-
const [hour, minutes] = convertedTime.split(':');
|
|
2792
|
-
return `${date.getHours().toString().padStart(hour.length, '0')}:${date
|
|
2793
|
-
.getMinutes()
|
|
2794
|
-
.toString()
|
|
2795
|
-
.padStart(minutes.length, '0')}`;
|
|
2796
|
-
}
|
|
2797
|
-
else {
|
|
2798
|
-
return `${date.getHours()}:${date.getMinutes()}`;
|
|
2799
|
-
}
|
|
2800
|
-
}
|
|
2801
|
-
/**
|
|
2802
|
-
* Parses a time string and extracts hour and minute values.
|
|
2803
|
-
* If the time string is empty or invalid, returns the provided default values.
|
|
2804
|
-
*
|
|
2805
|
-
* @param {string} time - The time string to parse (e.g., "14:30", "2:30 PM")
|
|
2806
|
-
* @param {number} defaultHours - Default hour value to use when time is empty (default: 0)
|
|
2807
|
-
* @param {number} defaultMinutes - Default minute value to use when time is empty (default: 0)
|
|
2808
|
-
* @returns {CalendarTimeHourMinutes} An object containing timeHours and timeMinutes as numbers
|
|
2809
|
-
*/
|
|
2810
|
-
getCurrentHourAndMinutes(time, defaultHours = 0, defaultMinutes = 0) {
|
|
2811
|
-
let timeHours = defaultHours;
|
|
2812
|
-
let timeMinutes = defaultMinutes;
|
|
2813
|
-
if (time) {
|
|
2814
|
-
const timeString = this.convertTimeTo24Hour(time).split(':');
|
|
2815
|
-
timeHours = Number(timeString[0]);
|
|
2816
|
-
timeMinutes = Number(timeString[1]);
|
|
2817
|
-
}
|
|
2818
|
-
return { timeHours, timeMinutes };
|
|
2881
|
+
this._startDateTime = CalendarDateTime.fromInitDataSource(startDate, {
|
|
2882
|
+
timezone: this._timezone,
|
|
2883
|
+
time: startTime,
|
|
2884
|
+
});
|
|
2819
2885
|
}
|
|
2820
2886
|
/**
|
|
2821
|
-
*
|
|
2887
|
+
* Parse the supplied end date/time, normalize into calendar wrappers.
|
|
2822
2888
|
*
|
|
2823
|
-
* @param {Date}
|
|
2824
|
-
* @
|
|
2889
|
+
* @param {string | Date | undefined} endDate - The raw end date value from the event payload.
|
|
2890
|
+
* @param {string | undefined} endTime - The optional textual end time component to parse.
|
|
2891
|
+
* @param {string | Date} originStartDate - The start date value to use as fallback if endDate is missing.
|
|
2825
2892
|
*/
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
month: '2-digit',
|
|
2833
|
-
day: '2-digit',
|
|
2834
|
-
hour: '2-digit',
|
|
2835
|
-
minute: '2-digit',
|
|
2836
|
-
second: '2-digit',
|
|
2837
|
-
hour12: false,
|
|
2838
|
-
});
|
|
2839
|
-
const targetParts = targetFormatter.formatToParts(date);
|
|
2840
|
-
const getYear = targetParts.find((part) => part.type === 'year');
|
|
2841
|
-
const getMonth = targetParts.find((part) => part.type === 'month');
|
|
2842
|
-
const getDay = targetParts.find((part) => part.type === 'day');
|
|
2843
|
-
const getHour = targetParts.find((part) => part.type === 'hour');
|
|
2844
|
-
const getMinute = targetParts.find((part) => part.type === 'minute');
|
|
2845
|
-
const getSecond = targetParts.find((part) => part.type === 'second');
|
|
2846
|
-
if (getYear && getMonth && getDay && getHour && getMinute && getSecond) {
|
|
2847
|
-
const year = parseInt(getYear.value, 10);
|
|
2848
|
-
const month = parseInt(getMonth.value, 10);
|
|
2849
|
-
const day = parseInt(getDay.value, 10);
|
|
2850
|
-
const hour = parseInt(getHour.value, 10);
|
|
2851
|
-
const minute = parseInt(getMinute.value, 10);
|
|
2852
|
-
const second = parseInt(getSecond.value, 10);
|
|
2853
|
-
return new Date(year, month - 1, day, hour, minute, second);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
catch (error) {
|
|
2857
|
-
LogUtility.warn('Invalid timezone:', this._timezone);
|
|
2858
|
-
}
|
|
2859
|
-
}
|
|
2860
|
-
return date;
|
|
2893
|
+
processEndDate(endDate, endTime, originStartDate) {
|
|
2894
|
+
this._endDateTime = CalendarDateTime.fromInitDataSource(endDate || originStartDate, {
|
|
2895
|
+
timezone: this._timezone,
|
|
2896
|
+
time: endTime,
|
|
2897
|
+
endTimeMissing: !endTime && !endDate,
|
|
2898
|
+
});
|
|
2861
2899
|
}
|
|
2862
2900
|
/**
|
|
2863
2901
|
* The function initializes a repeat pattern controller for a calendar event with specified start and end dates and repeat options.
|
|
2864
2902
|
*/
|
|
2865
2903
|
initRepeatPattern() {
|
|
2866
2904
|
if (this._event.repeatOptions && this._event.repeatOptions.frequency) {
|
|
2867
|
-
this.repeatPattern = calendarEventRepeatPatternFactory.getPattern(this.
|
|
2905
|
+
this.repeatPattern = calendarEventRepeatPatternFactory.getPattern(this.startDate, this._event.repeatOptions, this._timezone);
|
|
2868
2906
|
}
|
|
2869
2907
|
}
|
|
2870
2908
|
/**
|
|
@@ -3037,7 +3075,7 @@ class VegaCalendarEventItemRenderer extends VegaSlimmer {
|
|
|
3037
3075
|
* @returns {HTMLVegaCalendarEventElement} calendar event element
|
|
3038
3076
|
*/
|
|
3039
3077
|
render(item, classMap, targetCalendarViewDate, isGroupEvent = false) {
|
|
3040
|
-
return (h("vega-calendar-event", { "data-calendar-ref": this.host, key: `${item.eventKey}-${item.startTime}-${item.endTime}`, calendarEvent: item, class: classMap, onKeyDown: createEnterKeyHandlerToTriggerClick(),
|
|
3078
|
+
return (h("vega-calendar-event", { "data-calendar-ref": this.host, key: `${item.eventKey}-${item.startTime.toString()}-${item.endTime.toString()}`, calendarEvent: item, class: classMap, onKeyDown: createEnterKeyHandlerToTriggerClick(),
|
|
3041
3079
|
// eslint-disable-next-line react/jsx-no-bind
|
|
3042
3080
|
onClick: () => {
|
|
3043
3081
|
this.handleEventClick(item);
|
|
@@ -3491,7 +3529,7 @@ class VegaCalendarDayViewTimedEventLayoutColumn extends VegaCalendarBaseEventLay
|
|
|
3491
3529
|
*/
|
|
3492
3530
|
getIndexRangeFromEvent(eventItem) {
|
|
3493
3531
|
const { startTime, endTime } = eventItem;
|
|
3494
|
-
return [getTimeIndex(startTime), getTimeIndex(endTime)];
|
|
3532
|
+
return [getTimeIndex(startTime.toString()), getTimeIndex(endTime.toString())];
|
|
3495
3533
|
}
|
|
3496
3534
|
}
|
|
3497
3535
|
VegaCalendarDayViewTimedEventLayoutColumn.defaultSlots = Array(96).fill(null);
|
|
@@ -3575,10 +3613,10 @@ class VegaCalendarEventSorter {
|
|
|
3575
3613
|
*/
|
|
3576
3614
|
sortCalendarEventByTime(events) {
|
|
3577
3615
|
return events.sort((eventA, eventB) => {
|
|
3578
|
-
const eventAStartIndex = getTimeIndex(eventA.startTime);
|
|
3579
|
-
const eventBStartIndex = getTimeIndex(eventB.startTime);
|
|
3616
|
+
const eventAStartIndex = getTimeIndex(eventA.startTime.toString());
|
|
3617
|
+
const eventBStartIndex = getTimeIndex(eventB.startTime.toString());
|
|
3580
3618
|
if (eventAStartIndex === eventBStartIndex) {
|
|
3581
|
-
return getTimeIndex(eventB.endTime) - getTimeIndex(eventA.endTime);
|
|
3619
|
+
return getTimeIndex(eventB.endTime.toString()) - getTimeIndex(eventA.endTime.toString());
|
|
3582
3620
|
}
|
|
3583
3621
|
else {
|
|
3584
3622
|
return eventAStartIndex - eventBStartIndex;
|
|
@@ -4779,7 +4817,7 @@ class VegaCalendarEventRenderer extends VegaSlimmer {
|
|
|
4779
4817
|
this.slotMode ? this.getSlotElement() : this.defaultNormalMonthEventContentRender()));
|
|
4780
4818
|
}
|
|
4781
4819
|
else {
|
|
4782
|
-
const eventDuration = this.calendarEvent.
|
|
4820
|
+
const eventDuration = this.calendarEvent.getEventMinutes();
|
|
4783
4821
|
return (h("div", { part: "event-container", class: Object.assign(Object.assign({}, classMap), { 'vertical': eventDuration > 30, 'duration-half-an-hour': eventDuration === 30, 'event-bg-color': !disabled, 'bg-disabled': disabled }), role: "button", tabIndex: 0, ref: (node) => (this.slotContainerRef = node) },
|
|
4784
4822
|
!this.slotMode && this.renderEventStatus(),
|
|
4785
4823
|
h("div", { class: "cover-block" }),
|
|
@@ -4813,7 +4851,7 @@ class VegaCalendarEventRenderer extends VegaSlimmer {
|
|
|
4813
4851
|
*/
|
|
4814
4852
|
defaultNormalMonthEventContentRender() {
|
|
4815
4853
|
const { startTime, title } = this.calendarEvent;
|
|
4816
|
-
return h("div", { class: "event-title" }, `${
|
|
4854
|
+
return h("div", { class: "event-title" }, `${startTime.toString(this.timeFormat)} ${title}`);
|
|
4817
4855
|
}
|
|
4818
4856
|
/**
|
|
4819
4857
|
* Render the day view timed event.
|
|
@@ -4830,7 +4868,7 @@ class VegaCalendarEventRenderer extends VegaSlimmer {
|
|
|
4830
4868
|
}, ref: (node) => (this.eventTitleContainerRef = node) }, title),
|
|
4831
4869
|
h("div", { class: "event-time" },
|
|
4832
4870
|
h("vega-icon", { size: "size-12", icon: VegaInternalIconManager.getIconKey('clock-three') }),
|
|
4833
|
-
h("span", null, `${
|
|
4871
|
+
h("span", null, `${startTime.toString(this.timeFormat)} - ${endTime.toString(this.timeFormat)}`))));
|
|
4834
4872
|
}
|
|
4835
4873
|
/**
|
|
4836
4874
|
* Return a slot element if the calendar is not a repeat event
|