@heartlandone/vega 2.71.0 → 2.72.0-RTE-table-preview
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-837be7a6.js → app-globals-4d077e56.js} +19 -17
- package/dist/cjs/{child-nodes-event-prevent-slimmer-f8840f1b.js → child-nodes-event-prevent-slimmer-871855df.js} +1 -1
- package/dist/cjs/{code-block-bb4cbafa.js → code-block-bf3642ef.js} +29 -67
- package/dist/cjs/column-operation-1cac8386.js +1325 -0
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-cf7b4bda.js → component-value-history-controller-slimmer.abstract-ebecb74a.js} +28 -7
- package/dist/cjs/{date-required-rule-4e1f84fd.js → date-required-rule-99cca681.js} +3 -3
- package/dist/cjs/{design-token-00fe8d2f.js → design-token-ac429fe9.js} +6 -7
- package/dist/cjs/{dom-node-subject-observer-factory-f040608b.js → dom-node-subject-observer-factory-1c8f7880.js} +5 -1
- package/dist/cjs/{dto-renderer-manager-c917dade.js → dto-renderer-manager-04428a77.js} +6 -4
- package/dist/cjs/{element-appender-slimmer-f8e89f37.js → element-appender-slimmer-1b062054.js} +52 -14
- package/dist/cjs/{event-emit-slimmer-7afe8d78.js → event-emit-slimmer-f7255138.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-f865d397.js → form-field-controller-slimmer-57525f26.js} +3 -3
- package/dist/cjs/{image-annotation-action-8843adbf.js → image-annotation-action-7fa5d30d.js} +3 -3
- package/dist/cjs/index-58ea899e.js +12 -8
- package/dist/cjs/{index-4b896e76.js → index-c7fbf32b.js} +2 -2
- package/dist/cjs/index.cjs.js +37 -36
- package/dist/cjs/{inject-keyboard-manager-13c66257.js → inject-keyboard-manager-a6101379.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-45d451de.js → internal-vega-event-manager-0e1ba774.js} +3 -2
- package/dist/cjs/{keyboard-manager-af0d08a6.js → keyboard-manager-d8adb0ed.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-62f072cd.js → keyboard-manager-slimmer-15e65357.js} +1 -1
- package/dist/cjs/{language-extension-99c6fb40.js → language-extension-6ad0b5a0.js} +4 -4
- package/dist/cjs/loader.cjs.js +15 -13
- package/dist/cjs/month-view-generator-706c5477.js +102 -0
- package/dist/cjs/{public-rules-759c745b.js → public-rules-76bcf49c.js} +15 -15
- package/dist/cjs/{range-0b597850.js → range-449bcdd0.js} +1 -1
- package/dist/cjs/{responsive-format-facade-1d9c13a9.js → responsive-format-facade-e61c7f7e.js} +4 -4
- package/dist/cjs/{rich-text-editor-required-rule-92d0640e.js → rich-text-editor-required-rule-40216fee.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-07a95352.js → string-format-strategy.abstract-a8264fca.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-8236b5e1.js → string-input-formatter-slimmer-4332d1c7.js} +4 -4
- package/dist/cjs/{string-mask-strategy-6bdad95e.js → string-mask-strategy-4e7d3780.js} +2 -2
- package/dist/cjs/{style-formatter-1daa8371.js → style-formatter-e2a0ad27.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-78682046.js → sub-state-notify-slimmer-9fe1ab65.js} +2 -2
- package/dist/cjs/{sub-state-observer-slimmer-73aecfff.js → sub-state-observer-slimmer-2f6f4d28.js} +2 -2
- package/dist/cjs/{function-extension-28a4d781.js → table-extension-1f162c4c.js} +1950 -20
- package/dist/cjs/{time-required-rule-ccf178e7.js → time-required-rule-9d39a620.js} +3 -3
- package/dist/cjs/{type-guard-f12b5bae.js → type-guard-69d2cf01.js} +1224 -1
- package/dist/cjs/{valid-credit-card-number-rule-ce5c9147.js → valid-credit-card-number-rule-9f40d1d9.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +13 -12
- package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -17
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +17 -16
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +17 -16
- package/dist/cjs/vega-button-group_2.cjs.entry.js +60 -10
- package/dist/cjs/vega-button-link.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +17 -15
- package/dist/cjs/vega-calendar_4.cjs.entry.js +87 -909
- package/dist/cjs/vega-card.cjs.entry.js +16 -15
- package/dist/cjs/vega-carousel.cjs.entry.js +16 -14
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-chip.cjs.entry.js +18 -17
- package/dist/cjs/vega-code-block.cjs.entry.js +13 -13
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -6
- package/dist/cjs/vega-combo-box.cjs.entry.js +13 -13
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1759 -1568
- package/dist/cjs/vega-dialog_2.cjs.entry.js +22 -21
- package/dist/cjs/vega-divider.cjs.entry.js +12 -11
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +21 -31
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-flag-icon.cjs.entry.js +12 -11
- package/dist/cjs/vega-flex.cjs.entry.js +17 -16
- package/dist/cjs/vega-font.cjs.entry.js +16 -15
- package/dist/cjs/vega-form.cjs.entry.js +9 -9
- package/dist/cjs/vega-grid.cjs.entry.js +16 -15
- package/dist/cjs/vega-icon.cjs.entry.js +16 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -16
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +14 -14
- package/dist/cjs/vega-input-numeric.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-passcode.cjs.entry.js +12 -12
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +19 -18
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +16 -15
- package/dist/cjs/vega-input.cjs.entry.js +11 -11
- package/dist/cjs/{vega-internal-event-id-6d4a2c53.js → vega-internal-event-id-a5ef414b.js} +6 -4
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +20 -19
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +13 -11
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +15 -13
- package/dist/cjs/vega-popover_2.cjs.entry.js +24 -23
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +905 -0
- package/dist/cjs/vega-radio_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +9 -8
- package/dist/cjs/{vega-rich-text-editor_4.cjs.entry.js → vega-rich-text-editor_5.cjs.entry.js} +766 -279
- package/dist/cjs/vega-rich-text-table-selection-widget.cjs.entry.js +184 -0
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -16
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +18 -16
- package/dist/cjs/vega-signature-capture.cjs.entry.js +15 -14
- package/dist/cjs/vega-stepper.cjs.entry.js +7 -7
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +39 -38
- package/dist/cjs/vega-textarea.cjs.entry.js +7 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +40 -39
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +6 -6
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +16 -14
- package/dist/cjs/vega.cjs.js +15 -13
- package/dist/collection/collection-manifest.json +23 -13
- package/dist/collection/components/vega-button/vega-button.css +4 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.js +7 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.js +25 -2
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +31 -2
- package/dist/collection/components/vega-button-group/vega-button-group.js +37 -0
- package/dist/collection/components/vega-button-link/vega-button-link.css +4 -0
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +149 -0
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-format-controller.js +3 -1
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-keyboard-controller.js +1 -1
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-value-controller.js +10 -26
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +107 -445
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.js +5 -1
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.js +24 -17
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.js +15 -20
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.js +6 -17
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/constants.js +14 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/dto/calendar-selection.js +126 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-allow-repick-controller.js +70 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.js +204 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-min-max-date-controller.js +56 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-selection-controller.js +191 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-state-base.abstract.js +54 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-today-controller.js +37 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.js +76 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +192 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +168 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +669 -278
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +667 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker.css +0 -11
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +23 -40
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +3 -15
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-popover/vega-popover.js +14 -4
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +75 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.js +88 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.js +153 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +125 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.js +40 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +94 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.js +43 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.css +79 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +84 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +69 -153
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +88 -85
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +11 -63
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +15 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.js +133 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +120 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.js +40 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +63 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +59 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +59 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +103 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +145 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.js +78 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.js +109 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.js +132 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +118 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +348 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +229 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/utils.js +102 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.js +83 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.css +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +80 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +86 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +101 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +75 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +166 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.js +5 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +12 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +16 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +23 -2
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-style.test.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +9 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +15 -15
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.js +89 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.js +79 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.js +128 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-dto.test.js +517 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-test-utils.js +172 -0
- package/dist/collection/components/vega-rich-text-editor/test/spec-utils.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +4 -0
- package/dist/collection/constants/regex.js +1 -0
- package/dist/collection/constants/ui.js +3 -0
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/calendar/calendar-date.js +273 -1
- package/dist/collection/helpers/calendar/calendar-period/calendar-period.abstract.js +9 -0
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +16 -4
- package/dist/collection/helpers/calendar/test/calendar-date.test.js +73 -0
- package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +9 -0
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +41 -0
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +11 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +3 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +3 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +5 -2
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +2 -1
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +7 -0
- package/dist/collection/helpers/ui/element-appender.js +35 -5
- package/dist/collection/types/type-guard.js +10 -0
- package/dist/collection/utils/date.js +14 -3
- package/dist/collection/utils/e2e-utils.js +8 -2
- package/dist/collection/utils/spec-utils.js +4 -3
- package/dist/collection/utils/test/date.test.js +2 -0
- package/dist/esm/{app-globals-fd4b7d97.js → app-globals-e7a8d0cc.js} +9 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-76331524.js → child-nodes-event-prevent-slimmer-9ae34332.js} +1 -1
- package/dist/esm/{code-block-ecb4491b.js → code-block-3d3a9030.js} +30 -68
- package/dist/esm/column-operation-4a93bf52.js +1300 -0
- package/dist/esm/{component-value-history-controller-slimmer.abstract-5d618b88.js → component-value-history-controller-slimmer.abstract-d84e7bab.js} +28 -7
- package/dist/esm/{date-required-rule-8944f3bf.js → date-required-rule-a9980386.js} +1 -1
- package/dist/esm/{design-token-2d77e8f5.js → design-token-1575f6d9.js} +4 -5
- package/dist/esm/{dom-node-subject-observer-factory-dca87b70.js → dom-node-subject-observer-factory-f81f215f.js} +4 -2
- package/dist/esm/{dto-renderer-manager-d862ae78.js → dto-renderer-manager-23784148.js} +5 -5
- package/dist/esm/{element-appender-slimmer-6791c332.js → element-appender-slimmer-1a50e184.js} +51 -13
- package/dist/esm/{event-emit-slimmer-4e28e9f8.js → event-emit-slimmer-966716fa.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-bf071b75.js → form-field-controller-slimmer-0020997d.js} +4 -4
- package/dist/esm/{image-annotation-action-d0af138c.js → image-annotation-action-dba16587.js} +3 -3
- package/dist/esm/index-090d31ca.js +12 -8
- package/dist/esm/{index-c943d263.js → index-d72e7fb3.js} +2 -2
- package/dist/esm/index.js +21 -21
- package/dist/esm/{inject-keyboard-manager-ffd351b9.js → inject-keyboard-manager-9241968c.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-516aa721.js → internal-vega-event-manager-4f51b17c.js} +3 -2
- package/dist/esm/{keyboard-manager-5d8f3582.js → keyboard-manager-89acac79.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f39214e4.js → keyboard-manager-slimmer-e303cb7d.js} +1 -1
- package/dist/esm/{language-extension-8f51f5ff.js → language-extension-710fe56d.js} +2 -2
- package/dist/esm/loader.js +17 -15
- package/dist/esm/month-view-generator-4bec99fd.js +98 -0
- package/dist/esm/{page-resize-observer-slimmer-0bf7fbf3.js → page-resize-observer-slimmer-8744cb44.js} +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{public-rules-d10e76f4.js → public-rules-522ba4b1.js} +15 -15
- package/dist/esm/{range-f7b9e2fb.js → range-cdd85d30.js} +1 -1
- package/dist/esm/{responsive-format-facade-267935ae.js → responsive-format-facade-405f90d2.js} +6 -6
- package/dist/esm/{rich-text-editor-required-rule-774b822b.js → rich-text-editor-required-rule-7d2d9615.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-452f4398.js → string-format-strategy.abstract-75540c16.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-3acd240c.js → string-input-formatter-slimmer-96ccc8cf.js} +4 -4
- package/dist/esm/{string-mask-strategy-6232a1c1.js → string-mask-strategy-4a18ed1a.js} +2 -2
- package/dist/esm/{style-formatter-3f88c491.js → style-formatter-52cd20f7.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-56380f02.js → sub-state-notify-slimmer-97953a87.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-3504e2f2.js → sub-state-observer-slimmer-3f2b954f.js} +2 -2
- package/dist/esm/{function-extension-8d39db56.js → table-extension-164b0d6c.js} +1952 -23
- package/dist/esm/{time-required-rule-a01163b5.js → time-required-rule-8ec1faf5.js} +1 -1
- package/dist/esm/{type-guard-12f7654b.js → type-guard-b48aec98.js} +1204 -2
- package/dist/esm/{ui-8424715a.js → ui-28fd4193.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-81443274.js → valid-credit-card-number-rule-96eaf9b1.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +15 -14
- package/dist/esm/vega-app-header-button.entry.js +20 -19
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +19 -18
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +19 -18
- package/dist/esm/vega-button-group_2.entry.js +60 -10
- package/dist/esm/vega-button-link.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +19 -17
- package/dist/esm/vega-calendar_4.entry.js +46 -868
- package/dist/esm/vega-card.entry.js +18 -17
- package/dist/esm/vega-carousel.entry.js +18 -16
- package/dist/esm/vega-checkbox_2.entry.js +9 -9
- package/dist/esm/vega-chip.entry.js +20 -19
- package/dist/esm/vega-code-block.entry.js +14 -14
- package/dist/esm/vega-color-picker.entry.js +8 -8
- package/dist/esm/vega-combo-box.entry.js +15 -15
- package/dist/esm/vega-date-picker_2.entry.js +1746 -1555
- package/dist/esm/vega-dialog_2.entry.js +18 -17
- package/dist/esm/vega-divider.entry.js +14 -13
- package/dist/esm/vega-dropdown_5.entry.js +21 -31
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +8 -8
- package/dist/esm/vega-flag-icon.entry.js +14 -13
- package/dist/esm/vega-flex.entry.js +19 -18
- package/dist/esm/vega-font.entry.js +18 -17
- package/dist/esm/vega-form.entry.js +11 -11
- package/dist/esm/vega-grid.entry.js +18 -17
- package/dist/esm/vega-icon.entry.js +18 -17
- package/dist/esm/vega-image-uploader.entry.js +19 -17
- package/dist/esm/vega-input-credit-card.entry.js +16 -16
- package/dist/esm/vega-input-numeric.entry.js +15 -15
- package/dist/esm/vega-input-passcode.entry.js +14 -14
- package/dist/esm/vega-input-phone-number.entry.js +18 -17
- package/dist/esm/vega-input-range.entry.js +9 -9
- package/dist/esm/vega-input-select.entry.js +17 -16
- package/dist/esm/vega-input.entry.js +13 -13
- package/dist/esm/{vega-internal-event-id-5c3e5f7f.js → vega-internal-event-id-54ce7562.js} +4 -3
- package/dist/esm/vega-item-toggle.entry.js +4 -4
- package/dist/esm/vega-left-nav_5.entry.js +18 -17
- package/dist/esm/vega-loader-wrapper_2.entry.js +13 -11
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +17 -15
- package/dist/esm/vega-popover_2.entry.js +24 -23
- package/dist/esm/vega-progress-tracker_2.entry.js +900 -0
- package/dist/esm/vega-radio_2.entry.js +12 -12
- package/dist/esm/vega-rich-text-content.entry.js +10 -9
- package/dist/esm/{vega-rich-text-editor_4.entry.js → vega-rich-text-editor_5.entry.js} +767 -281
- package/dist/esm/vega-rich-text-table-selection-widget.entry.js +180 -0
- package/dist/esm/vega-segment-control.entry.js +5 -5
- package/dist/esm/vega-selection-chip_2.entry.js +20 -18
- package/dist/esm/vega-selection-tile_2.entry.js +10 -10
- package/dist/esm/vega-sidenav_3.entry.js +16 -14
- package/dist/esm/vega-signature-capture.entry.js +17 -16
- package/dist/esm/vega-stepper.entry.js +9 -9
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_11.entry.js +16 -15
- package/dist/esm/vega-text.entry.js +2 -2
- package/dist/esm/vega-textarea.entry.js +9 -9
- package/dist/esm/vega-time-picker_2.entry.js +21 -20
- package/dist/esm/vega-toggle-switch.entry.js +8 -8
- package/dist/esm/vega-tooltip_2.entry.js +18 -16
- package/dist/esm/vega.js +17 -15
- package/dist/sri/vega-sri-manifest.json +342 -346
- package/dist/types/components/vega-button-group/types.d.ts +2 -1
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.d.ts +1 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.d.ts +11 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/vega-button-group-item.d.ts +7 -0
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +8 -0
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.d.ts +60 -0
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-value-controller.d.ts +3 -4
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +29 -124
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.d.ts +1 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.d.ts +5 -5
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.d.ts +2 -3
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.d.ts +1 -4
- package/dist/types/components/vega-date-picker/types.d.ts +9 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/constants.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/dto/calendar-selection.d.ts +62 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-allow-repick-controller.d.ts +31 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.d.ts +78 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-min-max-date-controller.d.ts +20 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-selection-controller.d.ts +75 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-state-base.abstract.d.ts +29 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-today-controller.d.ts +15 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +18 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +40 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +32 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +182 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +6 -14
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +0 -4
- package/dist/types/components/vega-popover/vega-popover.d.ts +2 -1
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +55 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.d.ts +27 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.d.ts +63 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.d.ts +39 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.d.ts +21 -0
- package/dist/types/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.d.ts +21 -0
- package/dist/types/components/vega-progress-tracker/type.d.ts +1 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.d.ts +12 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +22 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +24 -10
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -6
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +64 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +78 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +51 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +65 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +142 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.d.ts +85 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/utils/utils.d.ts +53 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +26 -3
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +19 -6
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-dto.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-test-utils.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/test/spec-utils.d.ts +4 -0
- package/dist/types/components.d.ts +286 -6
- package/dist/types/constants/regex.d.ts +1 -0
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/calendar/calendar-date.d.ts +86 -2
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +7 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +3 -1
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +5 -2
- package/dist/types/helpers/ui/element-appender.d.ts +14 -0
- package/dist/types/types/components.type.d.ts +5 -0
- package/dist/types/types/type-guard.d.ts +8 -0
- package/dist/types/utils/date.d.ts +11 -2
- package/dist/types/utils/e2e-utils.d.ts +7 -0
- package/dist/types/utils/spec-utils.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-09561e90.entry.js +1 -0
- package/dist/vega/p-095c778c.entry.js +1 -0
- package/dist/vega/{p-e6351dab.entry.js → p-0bca50ab.entry.js} +1 -1
- package/dist/vega/{p-7d9cd9c8.js → p-10ac8b57.js} +1 -1
- package/dist/vega/{p-dde03224.entry.js → p-11a7daad.entry.js} +1 -1
- package/dist/vega/{p-447c7590.js → p-1282b67e.js} +1 -1
- package/dist/vega/{p-7b42da4f.entry.js → p-137e5c70.entry.js} +1 -1
- package/dist/vega/p-161b9c5b.js +1 -0
- package/dist/vega/p-174db33b.js +1 -0
- package/dist/vega/p-1815e753.entry.js +1 -0
- package/dist/vega/{p-1bb0c934.js → p-18bcfd7a.js} +1 -1
- package/dist/vega/p-194722fe.entry.js +1 -0
- package/dist/vega/{p-de97c6d9.js → p-1be7c6c4.js} +1 -1
- package/dist/vega/p-1c33d25e.entry.js +1 -0
- package/dist/vega/p-1dd07d64.entry.js +1 -0
- package/dist/vega/{p-a6010b93.entry.js → p-1e0d8228.entry.js} +1 -1
- package/dist/vega/p-207cfa6a.js +1 -0
- package/dist/vega/p-218e29c2.js +1 -0
- package/dist/vega/{p-75b5894f.entry.js → p-2249b040.entry.js} +1 -1
- package/dist/vega/p-23183d4d.js +1 -0
- package/dist/vega/p-238ec2b9.entry.js +1 -0
- package/dist/vega/p-2428457e.entry.js +1 -0
- package/dist/vega/p-263ad7b6.js +1 -0
- package/dist/vega/{p-ea96635b.entry.js → p-2688bc6f.entry.js} +1 -1
- package/dist/vega/{p-8350506e.js → p-26a43b4c.js} +1 -1
- package/dist/vega/p-285815b5.entry.js +1 -0
- package/dist/vega/{p-cac6239b.entry.js → p-2c07b213.entry.js} +1 -1
- package/dist/vega/{p-c0223a17.entry.js → p-31a65402.entry.js} +1 -1
- package/dist/vega/p-34a1a0c5.entry.js +1 -0
- package/dist/vega/{p-19522949.js → p-3d85411d.js} +1 -1
- package/dist/vega/p-3f561dd5.entry.js +1 -0
- package/dist/vega/{p-74168615.js → p-40f39194.js} +1 -1
- package/dist/vega/p-475f7bda.js +1 -0
- package/dist/vega/p-4785203e.entry.js +1 -0
- package/dist/vega/p-5051f0c1.entry.js +1 -0
- package/dist/vega/p-529daab4.entry.js +1 -0
- package/dist/vega/p-53c6ce54.entry.js +1 -0
- package/dist/vega/{p-db57dddc.js → p-5504ebdf.js} +1 -1
- package/dist/vega/p-5585d2b5.js +1 -0
- package/dist/vega/{p-98fb9eaa.entry.js → p-56ce0c4b.entry.js} +1 -1
- package/dist/vega/p-58f5da43.js +1 -0
- package/dist/vega/{p-2f09c6aa.js → p-596895ec.js} +1 -1
- package/dist/vega/{p-fde50319.js → p-5b472921.js} +1 -1
- package/dist/vega/p-5d7e908a.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-a0467b83.js → p-5fb6a3b5.js} +1 -1
- package/dist/vega/p-63c84ff6.entry.js +1 -0
- package/dist/vega/p-6961fac0.entry.js +1 -0
- package/dist/vega/{p-35cd469a.entry.js → p-699e46d1.entry.js} +1 -1
- package/dist/vega/p-6aa7ace9.js +1 -0
- package/dist/vega/p-6b631ff1.entry.js +1 -0
- package/dist/vega/{p-71f9c4d4.js → p-6c1ef2ed.js} +1 -1
- package/dist/vega/p-6ee3b103.js +1 -0
- package/dist/vega/{p-4a467973.js → p-71f2235e.js} +1 -1
- package/dist/vega/p-776b2f3d.entry.js +1 -0
- package/dist/vega/p-7ac32e71.js +1 -0
- package/dist/vega/p-7e6c5eb8.entry.js +1 -0
- package/dist/vega/{p-61d9cdf9.entry.js → p-7eaa8ac0.entry.js} +1 -1
- package/dist/vega/p-8014cb45.entry.js +1 -0
- package/dist/vega/p-877b36ae.entry.js +1 -0
- package/dist/vega/{p-18e8c54a.entry.js → p-883c5174.entry.js} +1 -1
- package/dist/vega/{p-58769a72.entry.js → p-8b969a71.entry.js} +1 -1
- package/dist/vega/p-8f6d42b0.entry.js +1 -0
- package/dist/vega/{p-7c1d08db.entry.js → p-8feb1298.entry.js} +1 -1
- package/dist/vega/p-95188267.entry.js +1 -0
- package/dist/vega/p-96aa0f3b.js +1 -0
- package/dist/vega/p-9a83a6b0.js +1 -0
- package/dist/vega/{p-52efaadb.entry.js → p-9e2cf904.entry.js} +1 -1
- package/dist/vega/p-9e545fde.entry.js +1 -0
- package/dist/vega/p-9f4364ec.entry.js +1 -0
- package/dist/vega/p-a33dc7eb.entry.js +1 -0
- package/dist/vega/p-a3a80712.js +1 -0
- package/dist/vega/{p-924b4e24.js → p-a4ec6575.js} +1 -1
- package/dist/vega/{p-3925c16b.js → p-a8dad05d.js} +1 -1
- package/dist/vega/{p-b9798158.js → p-b47df664.js} +1 -1
- package/dist/vega/{p-652626b6.entry.js → p-b737b93a.entry.js} +1 -1
- package/dist/vega/p-baa44cf5.entry.js +1 -0
- package/dist/vega/p-badc14cc.entry.js +1 -0
- package/dist/vega/{p-3c865f86.entry.js → p-bc2451f7.entry.js} +1 -1
- package/dist/vega/p-bdb5362c.entry.js +1 -0
- package/dist/vega/p-be33db7b.js +1 -0
- package/dist/vega/p-bfe01850.js +1 -0
- package/dist/vega/p-c141b10e.entry.js +1 -0
- package/dist/vega/p-c465b6dd.entry.js +1 -0
- package/dist/vega/{p-8fae8f9e.js → p-d1d0f08a.js} +1 -1
- package/dist/vega/{p-ad65f65f.entry.js → p-d6032515.entry.js} +1 -1
- package/dist/vega/{p-91d71ae9.entry.js → p-d69a6454.entry.js} +1 -1
- package/dist/vega/p-d6cc786a.entry.js +1 -0
- package/dist/vega/p-d85d7862.entry.js +1 -0
- package/dist/vega/p-d991fb11.js +1 -0
- package/dist/vega/{p-c2f21426.entry.js → p-da77d71f.entry.js} +1 -1
- package/dist/vega/{p-9ce249a9.js → p-de70aac1.js} +1 -1
- package/dist/vega/p-e47ae7bc.entry.js +1 -0
- package/dist/vega/p-e8495b6c.entry.js +1 -0
- package/dist/vega/{p-0f7dec29.entry.js → p-e8654ab5.entry.js} +1 -1
- package/dist/vega/p-e94701e2.entry.js +1 -0
- package/dist/vega/{p-3e040167.entry.js → p-e9e1293a.entry.js} +1 -1
- package/dist/vega/p-ef48178e.entry.js +1 -0
- package/dist/vega/{p-8c6b6ad7.entry.js → p-f729743c.entry.js} +1 -1
- package/dist/vega/{p-1f26de89.js → p-fb6b3b98.js} +1 -1
- package/dist/vega/p-fca7c998.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -3
- package/style/vega-icons.css +17266 -0
- package/dist/cjs/date-0a6bb035.js +0 -95
- package/dist/cjs/mobilefriendly-aa2e50e9.js +0 -13
- package/dist/cjs/remote-invocation-registry-fc22fdd0.js +0 -65
- package/dist/cjs/state-background-color-formatter-aa5570f6.js +0 -85
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +0 -252
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.js +0 -282
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-element-appender-controller.js +0 -35
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-mobile-controller.js +0 -53
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-month-year-change-event-controller.js +0 -139
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-zindex-controller.js +0 -49
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.js +0 -341
- package/dist/esm/date-c55b97f0.js +0 -87
- package/dist/esm/mobilefriendly-c5d0573d.js +0 -11
- package/dist/esm/remote-invocation-registry-d69245c2.js +0 -63
- package/dist/esm/state-background-color-formatter-0f01d27a.js +0 -82
- package/dist/esm/vega-progress-tracker.entry.js +0 -248
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.d.ts +0 -96
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-element-appender-controller.d.ts +0 -12
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-mobile-controller.d.ts +0 -18
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-month-year-change-event-controller.d.ts +0 -46
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-zindex-controller.d.ts +0 -15
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.d.ts +0 -97
- package/dist/vega/p-08835909.js +0 -1
- package/dist/vega/p-0cdb38d3.js +0 -1
- package/dist/vega/p-0e5297b9.entry.js +0 -1
- package/dist/vega/p-0feceaac.entry.js +0 -1
- package/dist/vega/p-115b42e6.entry.js +0 -1
- package/dist/vega/p-1372b984.js +0 -1
- package/dist/vega/p-1739a877.entry.js +0 -1
- package/dist/vega/p-1a59703b.entry.js +0 -1
- package/dist/vega/p-1e92737c.entry.js +0 -1
- package/dist/vega/p-235bf01b.entry.js +0 -1
- package/dist/vega/p-257ff60b.entry.js +0 -1
- package/dist/vega/p-25a3fad7.entry.js +0 -1
- package/dist/vega/p-2622f0a8.entry.js +0 -1
- package/dist/vega/p-26c4f07c.entry.js +0 -1
- package/dist/vega/p-2ec7e020.entry.js +0 -1
- package/dist/vega/p-308aa2e3.js +0 -1
- package/dist/vega/p-330c224f.entry.js +0 -1
- package/dist/vega/p-33f3f306.js +0 -1
- package/dist/vega/p-35252108.js +0 -1
- package/dist/vega/p-37020002.entry.js +0 -1
- package/dist/vega/p-379f1b40.entry.js +0 -1
- package/dist/vega/p-38cb2b40.js +0 -1
- package/dist/vega/p-4e13a26f.js +0 -1
- package/dist/vega/p-54e56f0d.entry.js +0 -1
- package/dist/vega/p-5972c101.entry.js +0 -1
- package/dist/vega/p-5d827fe5.js +0 -1
- package/dist/vega/p-5e708ad5.entry.js +0 -1
- package/dist/vega/p-65a9af84.entry.js +0 -1
- package/dist/vega/p-67eb405d.entry.js +0 -1
- package/dist/vega/p-67f159c3.js +0 -1
- package/dist/vega/p-69aec6af.entry.js +0 -1
- package/dist/vega/p-71ddccf2.entry.js +0 -1
- package/dist/vega/p-77e64f26.js +0 -1
- package/dist/vega/p-785d9ac3.entry.js +0 -1
- package/dist/vega/p-796d840c.entry.js +0 -1
- package/dist/vega/p-7a590741.entry.js +0 -1
- package/dist/vega/p-824a06ba.js +0 -1
- package/dist/vega/p-85f9a980.js +0 -1
- package/dist/vega/p-867a4970.js +0 -1
- package/dist/vega/p-880569ec.entry.js +0 -1
- package/dist/vega/p-8ac2f43f.entry.js +0 -1
- package/dist/vega/p-8ff96b8c.entry.js +0 -13
- package/dist/vega/p-9794fd88.entry.js +0 -1
- package/dist/vega/p-9e59345f.entry.js +0 -1
- package/dist/vega/p-a10b9f2e.js +0 -12
- package/dist/vega/p-a630ce73.entry.js +0 -1
- package/dist/vega/p-b1faebe0.js +0 -1
- package/dist/vega/p-b27fcac4.entry.js +0 -1
- package/dist/vega/p-b5ba0c11.js +0 -1
- package/dist/vega/p-b8b9ed2c.js +0 -1
- package/dist/vega/p-b9b81702.entry.js +0 -1
- package/dist/vega/p-bcc396c2.entry.js +0 -1
- package/dist/vega/p-bccee21e.js +0 -1
- package/dist/vega/p-bfb86c3e.entry.js +0 -1
- package/dist/vega/p-c224b44c.js +0 -1
- package/dist/vega/p-c6ae78f2.entry.js +0 -1
- package/dist/vega/p-cbabb07a.entry.js +0 -1
- package/dist/vega/p-fb320b50.entry.js +0 -1
- package/dist/vega/p-ff470366.entry.js +0 -1
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const breakpoints = require('./breakpoints-ebde4837.js');
|
|
4
4
|
const ui = require('./ui-32e69595.js');
|
|
5
5
|
const typography = require('./typography-4560e7f1.js');
|
|
6
|
+
const translation = require('./translation-5f9f9c0c.js');
|
|
7
|
+
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
6
8
|
|
|
7
9
|
const GridRowsRegex = new RegExp(/^([1-9]|1[0-2])(-auto)?$/);
|
|
8
10
|
const GridColumnsRegex = new RegExp(/^([1-9]|1[0-2])(-auto)?$/);
|
|
@@ -10,6 +12,7 @@ const VisaRegex = /^4/;
|
|
|
10
12
|
const MasterCardRegex = /^(5[1-5]|677189)|^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)/;
|
|
11
13
|
const AmexRegex = /^3[47]/;
|
|
12
14
|
const DiscoverRegex = /^(6011|65|64[4-9]|622)/;
|
|
15
|
+
const DateFormatParserRegex = /(\\)?(Y{2,4}|M{1,4}|D{1,2}|d{1,4})/g;
|
|
13
16
|
|
|
14
17
|
/* This file is generated by vega-design 2.0.77 */
|
|
15
18
|
/* eslint-disable */
|
|
@@ -312,6 +315,1196 @@ const BorderMap = {
|
|
|
312
315
|
'border-notification-btn-black': '2px solid rgba(var(--v-border-notification-btn-black, 32, 54, 69, 1))'
|
|
313
316
|
};
|
|
314
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Get a week days array
|
|
320
|
+
*
|
|
321
|
+
* @param {number} firstWeekDay - The first week day (0: Sunday, 1: Monday, ...)
|
|
322
|
+
* @returns {number[]} - The week days array
|
|
323
|
+
*/
|
|
324
|
+
const getWeekdays = (firstWeekDay = 0) => {
|
|
325
|
+
const weekdays = [0, 1, 2, 3, 4, 5, 6];
|
|
326
|
+
return weekdays.concat(weekdays).slice(firstWeekDay, firstWeekDay + 7);
|
|
327
|
+
};
|
|
328
|
+
exports.WeekdayLongNames = void 0;
|
|
329
|
+
(function (WeekdayLongNames) {
|
|
330
|
+
WeekdayLongNames["sun"] = "Sunday";
|
|
331
|
+
WeekdayLongNames["mon"] = "Monday";
|
|
332
|
+
WeekdayLongNames["tue"] = "Tuesday";
|
|
333
|
+
WeekdayLongNames["wed"] = "Wednesday";
|
|
334
|
+
WeekdayLongNames["thu"] = "Thursday";
|
|
335
|
+
WeekdayLongNames["fri"] = "Friday";
|
|
336
|
+
WeekdayLongNames["sat"] = "Saturday";
|
|
337
|
+
})(exports.WeekdayLongNames || (exports.WeekdayLongNames = {}));
|
|
338
|
+
/**
|
|
339
|
+
* Get the system timezone identifier
|
|
340
|
+
*
|
|
341
|
+
* @returns {string} - The system timezone identifier (e.g., "America/New_York")
|
|
342
|
+
*/
|
|
343
|
+
const getSystemTimezone = () => {
|
|
344
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* CalendarTime represents hours/minutes in 24-hour format and centralizes parsing/formatting logic.
|
|
349
|
+
*/
|
|
350
|
+
class CalendarTime {
|
|
351
|
+
constructor(hours, minutes) {
|
|
352
|
+
this._hours = hours;
|
|
353
|
+
this._minutes = minutes;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Parse a raw time string into a CalendarTime instance.
|
|
357
|
+
*
|
|
358
|
+
* @param {string} rawTime - Source time value such as "9:00" or "9am".
|
|
359
|
+
* @returns {CalendarTime} Parsed time.
|
|
360
|
+
*/
|
|
361
|
+
static fromString(rawTime) {
|
|
362
|
+
const normalized = this.convertTimeTo24Hour(rawTime);
|
|
363
|
+
const [hourPart, minutePart] = normalized.split(':');
|
|
364
|
+
return new CalendarTime(Number(hourPart), Number(minutePart));
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Build a CalendarTime from a Date instance while preserving hours/minutes.
|
|
368
|
+
*
|
|
369
|
+
* @param {Date} date - The source date.
|
|
370
|
+
* @returns {CalendarTime} Time representation extracted from the date.
|
|
371
|
+
*/
|
|
372
|
+
static fromDate(date) {
|
|
373
|
+
return new CalendarTime(date.getHours(), date.getMinutes());
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Calculate the duration in the requested precision between two CalendarTime values, accounting for overnight spans.
|
|
377
|
+
*
|
|
378
|
+
* @param {CalendarTime} start - Start time of the interval.
|
|
379
|
+
* @param {CalendarTime} end - End time of the interval.
|
|
380
|
+
* @param {'minutes' | 'hours'} precision - Desired unit of measure for the result (defaults to minutes).
|
|
381
|
+
* @returns {number} Duration expressed in the requested precision.
|
|
382
|
+
*/
|
|
383
|
+
static calculateDuration(start, end, precision = 'minutes') {
|
|
384
|
+
const startMinutes = start.totalMinutes;
|
|
385
|
+
let endMinutes = end.totalMinutes;
|
|
386
|
+
if (end.hours === 0 && start.hours !== 0) {
|
|
387
|
+
endMinutes += 24 * 60;
|
|
388
|
+
}
|
|
389
|
+
const durationMinutes = endMinutes - startMinutes;
|
|
390
|
+
return precision === 'hours' ? durationMinutes / 60 : durationMinutes;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Normalize various time inputs (e.g. 9am, 9:30 PM) to a 24-hour HH:mm string.
|
|
394
|
+
*
|
|
395
|
+
* @param {string} timeString - User supplied time value.
|
|
396
|
+
* @returns {string} 24-hour formatted string.
|
|
397
|
+
*/
|
|
398
|
+
static convertTimeTo24Hour(timeString) {
|
|
399
|
+
const normalized = timeString.toLocaleLowerCase();
|
|
400
|
+
if (normalized.includes('am') || normalized.includes('pm')) {
|
|
401
|
+
const isAm = normalized.includes('am');
|
|
402
|
+
const cleaned = normalized.replace('am', '').replace('pm', '').trim();
|
|
403
|
+
const [rawHour, rawMinutes] = cleaned.split(':');
|
|
404
|
+
const minutes = rawMinutes.padStart(2, '0');
|
|
405
|
+
if (isAm) {
|
|
406
|
+
return `${rawHour === '12' ? '00' : rawHour}:${minutes}`;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
const convertedHour = rawHour === '12' ? '12' : `${Number(rawHour) + 12}`;
|
|
410
|
+
return `${convertedHour}:${minutes}`;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return timeString;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Hour component in 24-hour clock.
|
|
417
|
+
*
|
|
418
|
+
* @returns {number} Hours between 0-23.
|
|
419
|
+
*/
|
|
420
|
+
get hours() {
|
|
421
|
+
return this._hours;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Minute component.
|
|
425
|
+
*
|
|
426
|
+
* @returns {number} Minutes between 0-59.
|
|
427
|
+
*/
|
|
428
|
+
get minutes() {
|
|
429
|
+
return this._minutes;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Total minutes elapsed since midnight for this time value.
|
|
433
|
+
*
|
|
434
|
+
* @returns {number} Minutes from 00:00.
|
|
435
|
+
*/
|
|
436
|
+
get totalMinutes() {
|
|
437
|
+
return this._hours * 60 + this._minutes;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Format the time into a string using a simple formatter.
|
|
441
|
+
*
|
|
442
|
+
* @param {TimeStringFormat} format - time string Format. Defaults to 'hh:mm'.
|
|
443
|
+
* @returns {string} Formatted time string.
|
|
444
|
+
*/
|
|
445
|
+
toString(format = 'hh:mm') {
|
|
446
|
+
const defaultHours = this._hours.toString().padStart(2, '0');
|
|
447
|
+
const defaultMinutes = this._minutes.toString().padStart(2, '0');
|
|
448
|
+
const normalizedFormat = format.toLowerCase();
|
|
449
|
+
switch (normalizedFormat) {
|
|
450
|
+
case 'hh:m':
|
|
451
|
+
return `${defaultHours}:${this._minutes}`;
|
|
452
|
+
case 'h:mm':
|
|
453
|
+
return `${this._hours}:${defaultMinutes}`;
|
|
454
|
+
case 'h:m':
|
|
455
|
+
return `${this._hours}:${this._minutes}`;
|
|
456
|
+
case '12-hour': {
|
|
457
|
+
const amPm = this._hours >= 12 ? 'pm' : 'am';
|
|
458
|
+
const hour12 = this._hours % 12 || 12;
|
|
459
|
+
return `${hour12}:${defaultMinutes} ${translation.VegaInternalTranslation.t(amPm)}`;
|
|
460
|
+
}
|
|
461
|
+
default:
|
|
462
|
+
return `${defaultHours}:${defaultMinutes}`;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* CalendarDateTime centralizes timezone-aware conversions between native Date instances and calendar helpers.
|
|
469
|
+
*/
|
|
470
|
+
class CalendarDateTime {
|
|
471
|
+
constructor(date, timezone) {
|
|
472
|
+
this.originalDate = date;
|
|
473
|
+
this.timezone = timezone;
|
|
474
|
+
this.syncDateTime();
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Build a CalendarDateTime from a native Date while the specific timezone.
|
|
478
|
+
*
|
|
479
|
+
* @param {Date} date - The native Date object to convert.
|
|
480
|
+
* @param {string} timezone - The timezone to apply.
|
|
481
|
+
* @returns {CalendarDateTime} A timezone-aware CalendarDateTime instance.
|
|
482
|
+
*/
|
|
483
|
+
static fromDate(date, timezone) {
|
|
484
|
+
return new CalendarDateTime(date, timezone);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Build a CalendarDateTime from a date input (Date or string) and optional time metadata.
|
|
488
|
+
*
|
|
489
|
+
* @param {string | Date} date - The input date value (string or Date).
|
|
490
|
+
* @param {CalendarDateTimeOptions} options - Additional options for time, timezone, seconds, etc.
|
|
491
|
+
* @returns {CalendarDateTime} A timezone-aware CalendarDateTime instance.
|
|
492
|
+
*/
|
|
493
|
+
static fromInitDataSource(date, options) {
|
|
494
|
+
const baseDate = new Date(date);
|
|
495
|
+
if (options.time) {
|
|
496
|
+
const calendarTime = CalendarTime.fromString(options.time);
|
|
497
|
+
baseDate.setHours(calendarTime.hours, calendarTime.minutes, 0, 0);
|
|
498
|
+
}
|
|
499
|
+
else if (options.endTimeMissing) {
|
|
500
|
+
baseDate.setHours(23, 59, 59, 0);
|
|
501
|
+
}
|
|
502
|
+
return CalendarDateTime.fromDate(baseDate, options.timezone);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Get the CalendarDate instance representing the date portion.
|
|
506
|
+
*
|
|
507
|
+
* @returns {CalendarDate} The CalendarDate object.
|
|
508
|
+
*/
|
|
509
|
+
get calendarDate() {
|
|
510
|
+
return this.date;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Get the CalendarTime instance representing the time portion.
|
|
514
|
+
*
|
|
515
|
+
* @returns {CalendarTime} The CalendarTime object.
|
|
516
|
+
*/
|
|
517
|
+
get calendarTime() {
|
|
518
|
+
return this.time;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Get a native Date object representing this CalendarDateTime.
|
|
522
|
+
*
|
|
523
|
+
* @returns {Date} The native Date object.
|
|
524
|
+
*/
|
|
525
|
+
toDate() {
|
|
526
|
+
return this.date.toDate();
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Set a new timezone and update CalendarDate/CalendarTime accordingly.
|
|
530
|
+
*
|
|
531
|
+
* @param {string} newTimezone - The new timezone to set.
|
|
532
|
+
*/
|
|
533
|
+
setTimezone(newTimezone) {
|
|
534
|
+
this.timezone = newTimezone;
|
|
535
|
+
this.syncDateTime();
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Sync CalendarDate and CalendarTime with the current originalDate and timezone.
|
|
539
|
+
*/
|
|
540
|
+
syncDateTime() {
|
|
541
|
+
const normalized = this.convertDateToTimezone(this.originalDate);
|
|
542
|
+
this.date = new CalendarDate(normalized.getFullYear(), normalized.getMonth() + 1, normalized.getDate());
|
|
543
|
+
this.time = CalendarTime.fromDate(normalized);
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Convert a Date to the specific timezone.
|
|
547
|
+
*
|
|
548
|
+
* @param {Date} date - The date to convert.
|
|
549
|
+
* @returns {Date} The date adjusted to the specific timezone.
|
|
550
|
+
*/
|
|
551
|
+
convertDateToTimezone(date) {
|
|
552
|
+
if (this.timezone === getSystemTimezone()) {
|
|
553
|
+
return date;
|
|
554
|
+
}
|
|
555
|
+
try {
|
|
556
|
+
const formatter = new Intl.DateTimeFormat([], {
|
|
557
|
+
timeZone: this.timezone,
|
|
558
|
+
year: 'numeric',
|
|
559
|
+
month: '2-digit',
|
|
560
|
+
day: '2-digit',
|
|
561
|
+
hour: '2-digit',
|
|
562
|
+
minute: '2-digit',
|
|
563
|
+
second: '2-digit',
|
|
564
|
+
hour12: false,
|
|
565
|
+
});
|
|
566
|
+
const parts = formatter.formatToParts(date);
|
|
567
|
+
const yearPart = this.findDateTimeFormatPart(parts, 'year');
|
|
568
|
+
const monthPart = this.findDateTimeFormatPart(parts, 'month');
|
|
569
|
+
const dayPart = this.findDateTimeFormatPart(parts, 'day');
|
|
570
|
+
const hourPart = this.findDateTimeFormatPart(parts, 'hour');
|
|
571
|
+
const minutePart = this.findDateTimeFormatPart(parts, 'minute');
|
|
572
|
+
const secondPart = this.findDateTimeFormatPart(parts, 'second');
|
|
573
|
+
if (yearPart && monthPart && dayPart && hourPart && minutePart && secondPart) {
|
|
574
|
+
const year = parseInt(yearPart.value, 10);
|
|
575
|
+
const month = parseInt(monthPart.value, 10);
|
|
576
|
+
const day = parseInt(dayPart.value, 10);
|
|
577
|
+
const hour = parseInt(hourPart.value, 10);
|
|
578
|
+
const minute = parseInt(minutePart.value, 10);
|
|
579
|
+
const second = parseInt(secondPart.value, 10);
|
|
580
|
+
return new Date(year, month - 1, day, hour, minute, second);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
catch (_a) {
|
|
584
|
+
globalSlimmerRegistry.LogUtility.warn('Invalid timezone:', this.timezone);
|
|
585
|
+
}
|
|
586
|
+
return date;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Find a specific part in the Intl.DateTimeFormatPart array.
|
|
590
|
+
*
|
|
591
|
+
* @param {Intl.DateTimeFormatPart[]} parts - The array of date/time format parts.
|
|
592
|
+
* @param {DateTimeFormatPartType} type - The type of part to find (e.g., 'year', 'month').
|
|
593
|
+
* @returns {Intl.DateTimeFormatPart | undefined} The matching part, if found.
|
|
594
|
+
*/
|
|
595
|
+
findDateTimeFormatPart(parts, type) {
|
|
596
|
+
return parts.find((part) => part.type === type);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// TODO: Need rename calendar-date as vega-date to manage all date operation in vega project
|
|
601
|
+
// https://gethired.atlassian.net/browse/VD-5918
|
|
602
|
+
/**
|
|
603
|
+
* It returns true if the input is a valid date string, and false otherwise.
|
|
604
|
+
* Note:
|
|
605
|
+
* This is not a strict date validation, it just use Date.parse to check the input string can be parsed to a valid date or not.
|
|
606
|
+
* For strict date validation, please use CalendarDate.fromString method in calendar-date.ts
|
|
607
|
+
* Example:
|
|
608
|
+
* For Chrome: Date.parse('Jan/08/2026') => 1767801600000
|
|
609
|
+
* For Safari: Date.parse('Jan/08/2026') => NaN
|
|
610
|
+
* Format is DD/MM/YYYY: Date.parse('20/11/2024') => NaN
|
|
611
|
+
*
|
|
612
|
+
* @param {string} input - The string to check.
|
|
613
|
+
* @returns {boolean} is a valid date string or not
|
|
614
|
+
*/
|
|
615
|
+
const isDateStr = (input) => !isNaN(Date.parse(input));
|
|
616
|
+
/**
|
|
617
|
+
* Compare if the firstDate is after the secondDate
|
|
618
|
+
*
|
|
619
|
+
* @param {Date} firstDate - The first date to compare.
|
|
620
|
+
* @param {Date} secondDate - The date to compare to.
|
|
621
|
+
* @returns {boolean} Return true if the firstDate is after the secondDate, otherwise it returns false.
|
|
622
|
+
*/
|
|
623
|
+
const compareIsAfter = (firstDate, secondDate) => {
|
|
624
|
+
return firstDate.getTime() > secondDate.getTime();
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* Compare if the firstDate is before the secondDate
|
|
628
|
+
*
|
|
629
|
+
* @param {Date} firstDate - The first date to compare.
|
|
630
|
+
* @param {Date} secondDate - The date to compare to.
|
|
631
|
+
* @returns {boolean} Return true if the firstDate is before the secondDate, otherwise it returns false.
|
|
632
|
+
*/
|
|
633
|
+
const compareIsBefore = (firstDate, secondDate) => {
|
|
634
|
+
return firstDate.getTime() < secondDate.getTime();
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Compare if the first date is before or the same as the second date.
|
|
638
|
+
*
|
|
639
|
+
* @param {Date} firstDate - The first date to compare.
|
|
640
|
+
* @param {Date} secondDate - The date to compare against.
|
|
641
|
+
* @returns {boolean} Return true if the firstDate is before or the same as the secondDate, otherwise it returns false.
|
|
642
|
+
*/
|
|
643
|
+
const compareIsSameOrBefore = (firstDate, secondDate) => {
|
|
644
|
+
return firstDate.getTime() <= secondDate.getTime();
|
|
645
|
+
};
|
|
646
|
+
/**
|
|
647
|
+
* It returns true if the input string is a valid time string in the format specified by the timeFormat parameter
|
|
648
|
+
*
|
|
649
|
+
* @param {string} input - The string to be tested.
|
|
650
|
+
* @param {TimeFormat} timeFormat - '12-hour' | '24-hour'
|
|
651
|
+
* @returns {boolean} A boolean value.
|
|
652
|
+
*/
|
|
653
|
+
const isTimeStr = (input, timeFormat) => {
|
|
654
|
+
return timeFormat === '12-hour'
|
|
655
|
+
? new RegExp(/^(1[012]|0[1-9]):[0-5][0-9] ([AP][M])$/).test(input)
|
|
656
|
+
: new RegExp(/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/).test(input);
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* It takes a number and returns a string
|
|
660
|
+
*
|
|
661
|
+
* @param {number} number - number - The number to pad
|
|
662
|
+
* @param {number} [length=2] - The length of the resulting string.
|
|
663
|
+
* @param {string} [padChar='0'] - The character to pad the number with.
|
|
664
|
+
* @returns {Nullable<string>} A function that takes a number as an argument and returns a nullable string.
|
|
665
|
+
*/
|
|
666
|
+
const pad = (number, length = 2, padChar = '0') => {
|
|
667
|
+
if (number || number === 0) {
|
|
668
|
+
return number.toString().padStart(length, padChar);
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
globalSlimmerRegistry.LogUtility.error(`The input should be a number`);
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* The `convert12HourTo24HourFormat` function takes a time string in 12-hour format and converts it to 24-hour format.
|
|
676
|
+
*
|
|
677
|
+
* @param {string} time the time string need to convert, the time string should be 12-hour or 24-hour format
|
|
678
|
+
* @returns {string} 24 hour format time string
|
|
679
|
+
*/
|
|
680
|
+
const convert12HourTo24HourFormat = (time) => {
|
|
681
|
+
if (isTimeStr(time, '12-hour')) {
|
|
682
|
+
const [hour, minute, amPm] = time.replace(' ', ':').split(':');
|
|
683
|
+
let convertedHour = parseInt(hour, 10);
|
|
684
|
+
if (amPm === 'PM' && convertedHour !== 12) {
|
|
685
|
+
convertedHour += 12;
|
|
686
|
+
}
|
|
687
|
+
else if (amPm === 'AM' && convertedHour === 12) {
|
|
688
|
+
convertedHour = 0;
|
|
689
|
+
}
|
|
690
|
+
return `${pad(convertedHour)}:${minute}`;
|
|
691
|
+
}
|
|
692
|
+
return time;
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
// TODO: Need rename calendar-date as vega-date to manage all date operation in vega project
|
|
696
|
+
// https://gethired.atlassian.net/browse/VD-5918
|
|
697
|
+
/**
|
|
698
|
+
* Calendar date class
|
|
699
|
+
*/
|
|
700
|
+
class CalendarDate {
|
|
701
|
+
constructor(year, month, date) {
|
|
702
|
+
this._date = date;
|
|
703
|
+
this._month = month;
|
|
704
|
+
this._year = year;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Create a calendar date from a Date object
|
|
708
|
+
*
|
|
709
|
+
* @param {Date} currentDate - The Date object to create CalendarDate from
|
|
710
|
+
* @param {string} timezone - Timezone identifier for timezone-aware date creation. If not provided, uses system timezone.
|
|
711
|
+
* @returns {CalendarDate} - Return a CalendarDate object
|
|
712
|
+
*/
|
|
713
|
+
static from(currentDate, timezone = getSystemTimezone()) {
|
|
714
|
+
return CalendarDateTime.fromDate(currentDate, timezone).calendarDate;
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Converts a date string to CalendarDate with optional format and timezone parameters.
|
|
718
|
+
*
|
|
719
|
+
* @param {string} dateString - The string date.
|
|
720
|
+
* @param {string} [format] - The format of string date
|
|
721
|
+
* @param {string} [lang] - lang
|
|
722
|
+
* @returns {Nullable<CalendarDate>} - CalendarDate.
|
|
723
|
+
*/
|
|
724
|
+
static fromString(dateString, format = 'MM/DD/YYYY', lang = 'en-us') {
|
|
725
|
+
if (!dateString)
|
|
726
|
+
return null;
|
|
727
|
+
const formatMatchers = [];
|
|
728
|
+
let formatMatcher = null;
|
|
729
|
+
// Analyze the format and find the corresponding positions for year, month, and day.
|
|
730
|
+
// Data: formatMatchers = [['DD', index: 0, ...], ['MM', index: 3, ...], ['YYYY', index: 7, ...]]
|
|
731
|
+
while ((formatMatcher = DateFormatParserRegex.exec(format)) != null) {
|
|
732
|
+
if (formatMatcher[1] === '\\')
|
|
733
|
+
continue;
|
|
734
|
+
formatMatchers.push(formatMatcher);
|
|
735
|
+
}
|
|
736
|
+
if (formatMatchers.length) {
|
|
737
|
+
const datePattern = {
|
|
738
|
+
year: undefined,
|
|
739
|
+
month: undefined,
|
|
740
|
+
shortMonth: undefined,
|
|
741
|
+
longMonth: undefined,
|
|
742
|
+
day: undefined,
|
|
743
|
+
value: '',
|
|
744
|
+
};
|
|
745
|
+
const firstMatcher = formatMatchers[0];
|
|
746
|
+
if (firstMatcher && firstMatcher.index > 0) {
|
|
747
|
+
datePattern.value += '.*?';
|
|
748
|
+
}
|
|
749
|
+
// According `matchers` to generate a new regex which can parse the date by corresponding year, month and day
|
|
750
|
+
// Data: dateRegex = "(\d{2}).*?(\d{2}).*?(\d{4}).*?"
|
|
751
|
+
// datePattern = {day: 1, longMonth: null, month: 2, shortMonth: null, year: 3, value: "(\d{2}).*?(\d{2}).*?(\d{4}).*?"}
|
|
752
|
+
for (const [k, match] of Object.entries(formatMatchers)) {
|
|
753
|
+
const key = Number(k);
|
|
754
|
+
if (match) {
|
|
755
|
+
const { group, pattern } = this.getPatternByFormatToken(match[0], lang);
|
|
756
|
+
datePattern[group] = key + 1;
|
|
757
|
+
datePattern.value += pattern;
|
|
758
|
+
datePattern.value += '.*?';
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
const dateRegex = new RegExp(`^${datePattern.value}$`);
|
|
762
|
+
if (dateRegex.test(dateString)) {
|
|
763
|
+
// Parse the date
|
|
764
|
+
// Example: parsedDate = ['08-02-2020', '08', '02', '2020']
|
|
765
|
+
const parsedDate = dateRegex.exec(dateString);
|
|
766
|
+
if (parsedDate &&
|
|
767
|
+
datePattern.year &&
|
|
768
|
+
(datePattern.month || datePattern.shortMonth || datePattern.longMonth) &&
|
|
769
|
+
datePattern.day) {
|
|
770
|
+
const year = Number(parsedDate[datePattern.year]);
|
|
771
|
+
let month = 1;
|
|
772
|
+
if (datePattern.month) {
|
|
773
|
+
month = Number(parsedDate[datePattern.month]) - 1;
|
|
774
|
+
}
|
|
775
|
+
else if (datePattern.shortMonth) {
|
|
776
|
+
month = this.shortMonths(lang).indexOf(parsedDate[datePattern.shortMonth]);
|
|
777
|
+
}
|
|
778
|
+
else if (datePattern.longMonth) {
|
|
779
|
+
month = this.longMonths(lang).indexOf(parsedDate[datePattern.longMonth]);
|
|
780
|
+
}
|
|
781
|
+
const day = Number(parsedDate[datePattern.day]);
|
|
782
|
+
const fullYear = Number(pad(year, 4, `${new Date().getFullYear()}`.slice(0, 2)));
|
|
783
|
+
if (isNaN(Date.parse(`${fullYear}-${pad(month + 1)}-${pad(day)}`)))
|
|
784
|
+
return null;
|
|
785
|
+
return this.from(new Date(fullYear, month, day, 0, 0, 0, 0));
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return this.from(new Date(dateString));
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Get regex pattern by format token.
|
|
793
|
+
*
|
|
794
|
+
* @param {string} token - The format token.
|
|
795
|
+
* @param {string} lang - Language.
|
|
796
|
+
* @returns {FormatPatternType} - regex pattern.
|
|
797
|
+
*/
|
|
798
|
+
static getPatternByFormatToken(token, lang) {
|
|
799
|
+
switch (token) {
|
|
800
|
+
case 'YY':
|
|
801
|
+
case 'YYYY':
|
|
802
|
+
return {
|
|
803
|
+
group: 'year',
|
|
804
|
+
pattern: `(\\d{${token.length}})`,
|
|
805
|
+
};
|
|
806
|
+
case 'M':
|
|
807
|
+
return {
|
|
808
|
+
group: 'month',
|
|
809
|
+
pattern: '(\\d{1,2})',
|
|
810
|
+
};
|
|
811
|
+
case 'MM':
|
|
812
|
+
return {
|
|
813
|
+
group: 'month',
|
|
814
|
+
pattern: '(\\d{2})',
|
|
815
|
+
};
|
|
816
|
+
case 'MMM':
|
|
817
|
+
return {
|
|
818
|
+
group: 'shortMonth',
|
|
819
|
+
pattern: `(${this.shortMonths(lang).join('|')})`,
|
|
820
|
+
};
|
|
821
|
+
case 'MMMM':
|
|
822
|
+
return {
|
|
823
|
+
group: 'longMonth',
|
|
824
|
+
pattern: `(${this.longMonths(lang).join('|')})`,
|
|
825
|
+
};
|
|
826
|
+
case 'D':
|
|
827
|
+
return {
|
|
828
|
+
group: 'day',
|
|
829
|
+
pattern: '(\\d{1,2})',
|
|
830
|
+
};
|
|
831
|
+
case 'DD':
|
|
832
|
+
return {
|
|
833
|
+
group: 'day',
|
|
834
|
+
pattern: '(\\d{2})',
|
|
835
|
+
};
|
|
836
|
+
/* istanbul ignore next */
|
|
837
|
+
default: {
|
|
838
|
+
return {
|
|
839
|
+
group: 'unknown',
|
|
840
|
+
pattern: '(.*)',
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Shorts months.
|
|
847
|
+
*
|
|
848
|
+
* @param {string} lang - Language
|
|
849
|
+
* @returns {string[]} - Shorts months.
|
|
850
|
+
*/
|
|
851
|
+
static shortMonths(lang) {
|
|
852
|
+
return this.MONTHS.map((month) => new Date(2019, month).toLocaleString(lang, { month: 'short' }));
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Long months.
|
|
856
|
+
*
|
|
857
|
+
* @param {string} lang - Language
|
|
858
|
+
* @returns {string[]} - Long months.
|
|
859
|
+
*/
|
|
860
|
+
static longMonths(lang) {
|
|
861
|
+
return this.MONTHS.map((month) => new Date(2019, month).toLocaleString(lang, { month: 'long' }));
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* The year of the calendar date
|
|
865
|
+
*
|
|
866
|
+
* @type {number}
|
|
867
|
+
*/
|
|
868
|
+
get year() {
|
|
869
|
+
return this._year;
|
|
870
|
+
}
|
|
871
|
+
set year(value) {
|
|
872
|
+
this._year = value;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* The month of the calendar date
|
|
876
|
+
*
|
|
877
|
+
* @type {number}
|
|
878
|
+
*/
|
|
879
|
+
get month() {
|
|
880
|
+
return this._month;
|
|
881
|
+
}
|
|
882
|
+
set month(value) {
|
|
883
|
+
this._month = value;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* The date of the calendar date
|
|
887
|
+
*
|
|
888
|
+
* @type {number}
|
|
889
|
+
*/
|
|
890
|
+
get date() {
|
|
891
|
+
return this._date;
|
|
892
|
+
}
|
|
893
|
+
set date(value) {
|
|
894
|
+
this._date = value;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Converts CalendarDate to a string with an optional format specifier.
|
|
898
|
+
*
|
|
899
|
+
* @param {string} [format] - The format of string date
|
|
900
|
+
* @param {string} [lang] - Language
|
|
901
|
+
* @returns {string} The string date.
|
|
902
|
+
*/
|
|
903
|
+
toString(format = 'MM/DD/YYYY', lang = 'en-us') {
|
|
904
|
+
let result = '';
|
|
905
|
+
const formatMatchers = [];
|
|
906
|
+
let formatMatcher = null;
|
|
907
|
+
while ((formatMatcher = DateFormatParserRegex.exec(format)) != null) {
|
|
908
|
+
if (formatMatcher[1] === '\\')
|
|
909
|
+
continue;
|
|
910
|
+
formatMatchers.push(formatMatcher);
|
|
911
|
+
}
|
|
912
|
+
if (formatMatchers.length) {
|
|
913
|
+
// add start line of tokens are not at the beginning
|
|
914
|
+
const firstMatcher = formatMatchers[0];
|
|
915
|
+
if (firstMatcher && firstMatcher.index > 0) {
|
|
916
|
+
result += format.substring(0, firstMatcher.index);
|
|
917
|
+
}
|
|
918
|
+
for (const [k, match] of Object.entries(formatMatchers)) {
|
|
919
|
+
const key = Number(k);
|
|
920
|
+
if (match) {
|
|
921
|
+
result += this.getDateItemByFormatToken(match[0], lang);
|
|
922
|
+
const nextMatch = formatMatchers[key + 1];
|
|
923
|
+
if (nextMatch) {
|
|
924
|
+
result += format.substring(match.index + match[0].length, nextMatch.index);
|
|
925
|
+
}
|
|
926
|
+
if (key === formatMatchers.length - 1) {
|
|
927
|
+
result += format.substring(match.index + match[0].length);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
return result.replace(/\\/g, '');
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Verify whether the calendar date is today
|
|
936
|
+
*
|
|
937
|
+
* @param {string} timezone - Timezone to consider when checking today's date. If not provided, uses system timezone.
|
|
938
|
+
* @returns {boolean} - Return true if the calendar date is today. Otherwise, return false.
|
|
939
|
+
*/
|
|
940
|
+
isToday(timezone = getSystemTimezone()) {
|
|
941
|
+
if (timezone === getSystemTimezone()) {
|
|
942
|
+
const today = new Date();
|
|
943
|
+
return (today.getFullYear() === this.year &&
|
|
944
|
+
today.getMonth() + 1 === this.month &&
|
|
945
|
+
today.getDate() === this.date);
|
|
946
|
+
}
|
|
947
|
+
const { year, month, date } = CalendarDateTime.fromDate(new Date(), timezone).calendarDate;
|
|
948
|
+
return year === this.year && month === this.month && date === this.date;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Convert the calendar date to a Date object
|
|
952
|
+
*
|
|
953
|
+
* @returns {Date} - Return a Date object
|
|
954
|
+
*/
|
|
955
|
+
toDate() {
|
|
956
|
+
return new Date(this.year, this.month - 1, this.date);
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Compare with another calendar date
|
|
960
|
+
*
|
|
961
|
+
* @param {CalendarDate} date - The calendar date to compare with
|
|
962
|
+
* @returns {DateCompareResult} - Return a DateCompareResult object
|
|
963
|
+
*/
|
|
964
|
+
compare(date) {
|
|
965
|
+
const { year, month } = date;
|
|
966
|
+
const result = {
|
|
967
|
+
isPreviousMonth: false,
|
|
968
|
+
inMonth: false,
|
|
969
|
+
isNextMonth: false,
|
|
970
|
+
};
|
|
971
|
+
if (this.year === year) {
|
|
972
|
+
if (this.month < month) {
|
|
973
|
+
result.isPreviousMonth = true;
|
|
974
|
+
}
|
|
975
|
+
else if (this.month > month) {
|
|
976
|
+
result.isNextMonth = true;
|
|
977
|
+
}
|
|
978
|
+
else {
|
|
979
|
+
result.inMonth = true;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
else if (this.year > year) {
|
|
983
|
+
result.isNextMonth = true;
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
result.isPreviousMonth = true;
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* The function "equal" compares the year, month, and date of two CalendarDate objects and returns true if they are equal.
|
|
992
|
+
*
|
|
993
|
+
* @param {Nullable<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
|
|
994
|
+
* `CalendarDate` object passed as a parameter. The method returns `true` if all three values (year, month, date) are equal
|
|
995
|
+
* @returns {boolean} The date is same day with current
|
|
996
|
+
*/
|
|
997
|
+
equal(calendarDate) {
|
|
998
|
+
if (!calendarDate)
|
|
999
|
+
return false;
|
|
1000
|
+
const { year, month, date } = calendarDate;
|
|
1001
|
+
return this._year === year && this._month === month && this._date === date;
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Get month name.
|
|
1005
|
+
*
|
|
1006
|
+
* @param {boolean} isShortName - Whether to get the short name or long name of the month
|
|
1007
|
+
* @returns {string} The name of the month
|
|
1008
|
+
*/
|
|
1009
|
+
getMonthName(isShortName = false) {
|
|
1010
|
+
return translation.VegaInternalTranslation.t(this.toDate().toLocaleDateString('en-US', {
|
|
1011
|
+
month: isShortName ? 'short' : 'long',
|
|
1012
|
+
}));
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* To determine if it is larger than a given `CalendarDate`.
|
|
1016
|
+
*
|
|
1017
|
+
* @param {Nullable<CalendarDate>} calendarDate - A `CalendarDate`
|
|
1018
|
+
* @returns {boolean} - Compared result
|
|
1019
|
+
*/
|
|
1020
|
+
isAfter(calendarDate) {
|
|
1021
|
+
if (!calendarDate)
|
|
1022
|
+
return false;
|
|
1023
|
+
return compareIsAfter(this.toDate(), calendarDate.toDate());
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* To determine if it is less than a given `CalendarDate`.
|
|
1027
|
+
*
|
|
1028
|
+
* @param {Nullable<CalendarDate>} calendarDate - A `CalendarDate`
|
|
1029
|
+
* @returns {boolean} - Compared result
|
|
1030
|
+
*/
|
|
1031
|
+
isBefore(calendarDate) {
|
|
1032
|
+
if (!calendarDate)
|
|
1033
|
+
return false;
|
|
1034
|
+
return compareIsBefore(this.toDate(), calendarDate.toDate());
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Get first day of month.
|
|
1038
|
+
*
|
|
1039
|
+
* @returns {CalendarDate} - First day of month.
|
|
1040
|
+
*/
|
|
1041
|
+
firstDateOfMonth() {
|
|
1042
|
+
return CalendarDate.from(new Date(this.year, this.month - 1, 1));
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Get last day of month.
|
|
1046
|
+
*
|
|
1047
|
+
* @returns {CalendarDate} - Last day of month.
|
|
1048
|
+
*/
|
|
1049
|
+
lastDateOfMonth() {
|
|
1050
|
+
return CalendarDate.from(new Date(this.year, this.month, 0));
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Adjusts the calendar date by adding the specified number of years, months, and days.
|
|
1054
|
+
*
|
|
1055
|
+
* @param {number} [years=0] - The number of years to add.
|
|
1056
|
+
* @param {number} [months=0] - The number of months to add.
|
|
1057
|
+
* @param {number} [days=0] - The number of days to add.
|
|
1058
|
+
* @returns {CalendarDate} - A new CalendarDate object with the adjusted date.
|
|
1059
|
+
*/
|
|
1060
|
+
add(years = 0, months = 0, days = 0) {
|
|
1061
|
+
const currentDate = this.toDate();
|
|
1062
|
+
const adjustedDate = new Date(currentDate.getFullYear() + years, currentDate.getMonth() + months, currentDate.getDate() + days);
|
|
1063
|
+
return CalendarDate.from(adjustedDate);
|
|
1064
|
+
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Get year, month and day value by format token.
|
|
1067
|
+
*
|
|
1068
|
+
* @param {string} token - The format token.
|
|
1069
|
+
* @param {string} lang - Language.
|
|
1070
|
+
* @returns {string} - year, month and day value.
|
|
1071
|
+
*/
|
|
1072
|
+
getDateItemByFormatToken(token, lang) {
|
|
1073
|
+
switch (token) {
|
|
1074
|
+
case 'YY':
|
|
1075
|
+
return String(this.year).slice(-2);
|
|
1076
|
+
case 'YYYY':
|
|
1077
|
+
return String(this.year);
|
|
1078
|
+
case 'M':
|
|
1079
|
+
return String(this.month);
|
|
1080
|
+
case 'MM':
|
|
1081
|
+
return `0${this.month}`.slice(-2);
|
|
1082
|
+
case 'MMM':
|
|
1083
|
+
return CalendarDate.shortMonths(lang)[this.month - 1];
|
|
1084
|
+
case 'MMMM':
|
|
1085
|
+
return CalendarDate.longMonths(lang)[this.month - 1];
|
|
1086
|
+
case 'D':
|
|
1087
|
+
return String(this.date);
|
|
1088
|
+
case 'DD':
|
|
1089
|
+
return `0${this.date}`.slice(-2);
|
|
1090
|
+
default:
|
|
1091
|
+
return '';
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
CalendarDate.MONTHS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* CalendarPeriod is an abstract class that represents a period of date for calendar.
|
|
1099
|
+
*/
|
|
1100
|
+
class CalendarPeriod {
|
|
1101
|
+
constructor(count, current, timezone) {
|
|
1102
|
+
this._count = count;
|
|
1103
|
+
this._timezone = timezone || getSystemTimezone();
|
|
1104
|
+
this._current = current ? current : CalendarDate.from(new Date(), this._timezone);
|
|
1105
|
+
this.calculatePeriod(this._current);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* The current date of the period.
|
|
1109
|
+
*
|
|
1110
|
+
* @type {CalendarDate}
|
|
1111
|
+
*/
|
|
1112
|
+
get current() {
|
|
1113
|
+
return this._current;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* The start date of the period
|
|
1117
|
+
*
|
|
1118
|
+
* @type {CalendarDate}
|
|
1119
|
+
*/
|
|
1120
|
+
get startDate() {
|
|
1121
|
+
return this._startDate;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* The end date of the period
|
|
1125
|
+
*
|
|
1126
|
+
* @type {CalendarDate}
|
|
1127
|
+
*/
|
|
1128
|
+
get endDate() {
|
|
1129
|
+
return this._endDate;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* The count of the period
|
|
1133
|
+
*
|
|
1134
|
+
* @type {number}
|
|
1135
|
+
*/
|
|
1136
|
+
get count() {
|
|
1137
|
+
return this._count;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* This function returns the type of the object.
|
|
1141
|
+
*
|
|
1142
|
+
* @type {string}
|
|
1143
|
+
*/
|
|
1144
|
+
get type() {
|
|
1145
|
+
return this._type;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* This function returns the showWeekends of the object.
|
|
1149
|
+
*
|
|
1150
|
+
* @type {boolean}
|
|
1151
|
+
*/
|
|
1152
|
+
get showWeekends() {
|
|
1153
|
+
return this._showWeekends;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* The timezone of the period.
|
|
1157
|
+
*
|
|
1158
|
+
* @type {string | undefined}
|
|
1159
|
+
*/
|
|
1160
|
+
get timezone() {
|
|
1161
|
+
return this._timezone;
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Go to a specific date.
|
|
1165
|
+
*
|
|
1166
|
+
* @param {CalendarDate} date - The date to go to.
|
|
1167
|
+
* @returns {this} - The current period.
|
|
1168
|
+
*/
|
|
1169
|
+
goTo(date) {
|
|
1170
|
+
return this.createBy(date);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Go to now.
|
|
1174
|
+
*
|
|
1175
|
+
* @returns {this} - The current period.
|
|
1176
|
+
*/
|
|
1177
|
+
now() {
|
|
1178
|
+
return this.createBy(CalendarDate.from(new Date(), this._timezone));
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Check the give period is equal to current period
|
|
1182
|
+
*
|
|
1183
|
+
* @param {CalendarPeriod} [period] - Give period to compare
|
|
1184
|
+
* @returns {boolean} compare result
|
|
1185
|
+
*/
|
|
1186
|
+
equal(period) {
|
|
1187
|
+
return this.startDate.equal(period.startDate) && this.endDate.equal(period.endDate);
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Calculate the period start date and end date.
|
|
1191
|
+
*
|
|
1192
|
+
* @param {CalendarDate} date - The date to calculate the period from.
|
|
1193
|
+
*/
|
|
1194
|
+
calculatePeriod(date) {
|
|
1195
|
+
const cursor = date.toDate();
|
|
1196
|
+
if (this.count > 1) {
|
|
1197
|
+
cursor.setDate(cursor.getDate() - getWeekdays().indexOf(cursor.getDay()));
|
|
1198
|
+
}
|
|
1199
|
+
this._startDate = CalendarDate.from(cursor);
|
|
1200
|
+
cursor.setDate(cursor.getDate() + this.count - 1);
|
|
1201
|
+
this._endDate = CalendarDate.from(cursor);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* StateVariantFormatter: Format state token to CSS styles
|
|
1207
|
+
*/
|
|
1208
|
+
class StateVariantFormatter {
|
|
1209
|
+
/**
|
|
1210
|
+
* The function `format` takes an input state variant type and returns formatted CSS styles based on
|
|
1211
|
+
* the input.
|
|
1212
|
+
*
|
|
1213
|
+
* @param {StateVariantType} input - The `format` function takes an `input` parameter of type
|
|
1214
|
+
* `StateVariantType<ManagedStateScopeInput[Flag], State>`. This means that the `input` parameter
|
|
1215
|
+
* should be an object that contains styles for different states, where the keys are state names and
|
|
1216
|
+
* the values are the corresponding styles
|
|
1217
|
+
* @returns {string} The `format` function returns a string that contains CSS styles based on the input
|
|
1218
|
+
* provided. If the input is determined to be a state variant token type, the function generates CSS
|
|
1219
|
+
* styles for each state in the input and returns them joined by newlines. If the input is not a state
|
|
1220
|
+
* variant token type, the function generates CSS styles for the default state and returns them.
|
|
1221
|
+
*/
|
|
1222
|
+
format(input) {
|
|
1223
|
+
if (isStateVariantTokenType(input)) {
|
|
1224
|
+
const stateStyles = [];
|
|
1225
|
+
this.getStates().forEach((state) => {
|
|
1226
|
+
const style = this.formatToken(input[state]);
|
|
1227
|
+
if (style) {
|
|
1228
|
+
stateStyles.push(`:host${state === 'default' ? '' : `(:${state})`}{\n\t${style}\n}`);
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
return stateStyles.join('\n');
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
const style = this.formatToken(input);
|
|
1235
|
+
return `:host{\n\t${style}\n}`;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* The `StateBackgroundColorFormatter` class in TypeScript formats background color tokens
|
|
1242
|
+
* and handles different CSS states.
|
|
1243
|
+
*/
|
|
1244
|
+
class StateBackgroundColorFormatter extends StateVariantFormatter {
|
|
1245
|
+
constructor() {
|
|
1246
|
+
super(...arguments);
|
|
1247
|
+
this.states = ['default', 'hover', 'active', 'focus-visible'];
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* The function `formatToken` takes a `BackgroundColorsTokenType` input, checks if it is a valid
|
|
1251
|
+
* background color token type, and returns the corresponding CSS background color value or logs a
|
|
1252
|
+
* warning if the input is invalid.
|
|
1253
|
+
*
|
|
1254
|
+
* @param {BackgroundColorsTokenType} input - The `input` parameter is of type
|
|
1255
|
+
* `BackgroundColorsTokenType`, which is used to represent different background color tokens.
|
|
1256
|
+
* @returns {string} The `formatToken` function takes a `BackgroundColorsTokenType` input and checks if it is a
|
|
1257
|
+
* valid background color token type. If it is valid, it retrieves the corresponding color value from
|
|
1258
|
+
* the `BackgroundColorMap` and returns a CSS style string with the background color. If the input is
|
|
1259
|
+
* not valid, it logs a warning message using `LogUtility.warn` and returns an empty string.
|
|
1260
|
+
*/
|
|
1261
|
+
formatToken(input) {
|
|
1262
|
+
if (isBackgroundColorTokenType(input)) {
|
|
1263
|
+
const tokenValue = BackgroundColorMap[input];
|
|
1264
|
+
return `background-color: ${tokenValue};`;
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
globalSlimmerRegistry.LogUtility.warn(`The backgroundColor value ${input} is invalid, it must be a value of: `, BackgroundColors);
|
|
1268
|
+
return '';
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* The function `getStates` returns an array of `CssStatesType` objects.
|
|
1273
|
+
*
|
|
1274
|
+
* @returns {CssStatesType[]} An array of objects of type CssStatesType, which represents the states stored in the
|
|
1275
|
+
* variable this.states.
|
|
1276
|
+
*/
|
|
1277
|
+
getStates() {
|
|
1278
|
+
return this.states;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
const StateBackgroundColorFormatter$1 = new StateBackgroundColorFormatter();
|
|
1282
|
+
|
|
1283
|
+
var DateDirection;
|
|
1284
|
+
(function (DateDirection) {
|
|
1285
|
+
DateDirection["PREVIOUS"] = "-1";
|
|
1286
|
+
DateDirection["NEXT"] = "1";
|
|
1287
|
+
})(DateDirection || (DateDirection = {}));
|
|
1288
|
+
/**
|
|
1289
|
+
* The function `getTimeIndex` calculates the index of a given time string based on a specified time unit.
|
|
1290
|
+
*
|
|
1291
|
+
* @param {string} timeString - A string representing a time in the format "HH:MM", where HH is the hour and MM is the minutes.
|
|
1292
|
+
* @param {number} [unit=15] - The `unit` parameter in the `getTimeIndex` function is used to specify
|
|
1293
|
+
* the interval in minutes for dividing the day. By default, it is set to 15 minutes, meaning that the
|
|
1294
|
+
* day will be divided into 15-minute intervals.
|
|
1295
|
+
* @returns {number} the index of the given time string based on the specified time unit.
|
|
1296
|
+
*/
|
|
1297
|
+
function getTimeIndex(timeString, unit = 15) {
|
|
1298
|
+
const [hour, minutes] = timeString.split(':');
|
|
1299
|
+
return Math.round((Number(hour) * 60 + Number(minutes)) / unit);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Returns a string that includes the event key for a calendar event slot.
|
|
1303
|
+
*
|
|
1304
|
+
* @param {string} eventKey - represents the key or identifier of a calendar event.
|
|
1305
|
+
* @returns {string} a string that is a concatenation of 'vega-calendar-event-slot-' and the eventKey parameter.
|
|
1306
|
+
*/
|
|
1307
|
+
function getCalendarEventSlotName(eventKey) {
|
|
1308
|
+
return 'vega-calendar-event-slot-' + eventKey;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Returns the closest workday to a given calendar date based on a specified direction.
|
|
1312
|
+
*
|
|
1313
|
+
* @param {Date} date - The starting date from which you want to find the closest workday.
|
|
1314
|
+
* @param {'-1' | '1'} [direction=1] - Determines whether to find the closest workday in the past or future. It can have two possible values:
|
|
1315
|
+
* @returns {CalendarDate} The closest workday to the input date
|
|
1316
|
+
*/
|
|
1317
|
+
function getClosestWorkday(date, direction = DateDirection.NEXT) {
|
|
1318
|
+
const day = date.toDate().getDay();
|
|
1319
|
+
if (day === 0 || day === 6) {
|
|
1320
|
+
let nextWorkdayGap = day === 0 ? 1 : 2;
|
|
1321
|
+
if (direction === DateDirection.PREVIOUS) {
|
|
1322
|
+
nextWorkdayGap = day === 0 ? -2 : -1;
|
|
1323
|
+
}
|
|
1324
|
+
return CalendarDate.from(new Date(date.year, date.month - 1, date.date + nextWorkdayGap));
|
|
1325
|
+
}
|
|
1326
|
+
return date;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Get event status background color.
|
|
1330
|
+
*
|
|
1331
|
+
* @param {Nullable<string | BackgroundColorsTokenType>} color the background color
|
|
1332
|
+
* @returns {string} background color style string
|
|
1333
|
+
*/
|
|
1334
|
+
function getEventStatusBgColorStyle(color = 'bg-accent6-primary') {
|
|
1335
|
+
if (isBackgroundColorTokenType(color)) {
|
|
1336
|
+
return `.event-bg-color{${StateBackgroundColorFormatter$1.formatToken(color)}}`;
|
|
1337
|
+
}
|
|
1338
|
+
else {
|
|
1339
|
+
return `.event-bg-color{background-color:${color}}`;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Period of day.
|
|
1345
|
+
*/
|
|
1346
|
+
class DayPeriod extends CalendarPeriod {
|
|
1347
|
+
constructor(current, showWeekends, timezone) {
|
|
1348
|
+
super(DayPeriod.DISPLAY_DATE_COUNT, current, timezone);
|
|
1349
|
+
this._type = 'day';
|
|
1350
|
+
this._showWeekends = true;
|
|
1351
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* @inheritDoc
|
|
1355
|
+
*/
|
|
1356
|
+
next() {
|
|
1357
|
+
const nextDate = this.current.toDate();
|
|
1358
|
+
nextDate.setDate(nextDate.getDate() + 1);
|
|
1359
|
+
let calendarDate = CalendarDate.from(nextDate);
|
|
1360
|
+
if (this._showWeekends === false) {
|
|
1361
|
+
calendarDate = getClosestWorkday(calendarDate);
|
|
1362
|
+
}
|
|
1363
|
+
return this.createBy(calendarDate);
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* @inheritDoc
|
|
1367
|
+
*/
|
|
1368
|
+
previous() {
|
|
1369
|
+
const previousDate = this.current.toDate();
|
|
1370
|
+
previousDate.setDate(previousDate.getDate() - 1);
|
|
1371
|
+
let calendarDate = CalendarDate.from(previousDate);
|
|
1372
|
+
if (this._showWeekends === false) {
|
|
1373
|
+
calendarDate = getClosestWorkday(calendarDate, DateDirection.PREVIOUS);
|
|
1374
|
+
}
|
|
1375
|
+
return this.createBy(calendarDate);
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Go to now.
|
|
1379
|
+
*
|
|
1380
|
+
* @returns {this} - The current period.
|
|
1381
|
+
*/
|
|
1382
|
+
now() {
|
|
1383
|
+
let calendarDate = CalendarDate.from(new Date(), this.timezone);
|
|
1384
|
+
if (this._showWeekends === false) {
|
|
1385
|
+
calendarDate = getClosestWorkday(calendarDate);
|
|
1386
|
+
}
|
|
1387
|
+
return this.createBy(calendarDate);
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* @inheritDoc
|
|
1391
|
+
*/
|
|
1392
|
+
createBy(current) {
|
|
1393
|
+
return new DayPeriod(current, this._showWeekends, this.timezone);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
DayPeriod.DISPLAY_DATE_COUNT = 1;
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* Period of the week
|
|
1400
|
+
*/
|
|
1401
|
+
class WeekPeriod extends CalendarPeriod {
|
|
1402
|
+
constructor(current, showWeekends, timezone) {
|
|
1403
|
+
super(WeekPeriod.DISPLAY_DATE_COUNT, current, timezone);
|
|
1404
|
+
this._type = 'week';
|
|
1405
|
+
this._showWeekends = true;
|
|
1406
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* @inheritDoc
|
|
1410
|
+
*/
|
|
1411
|
+
next() {
|
|
1412
|
+
const currentDate = this.current.toDate();
|
|
1413
|
+
currentDate.setDate(currentDate.getDate() + 7);
|
|
1414
|
+
return this.createBy(CalendarDate.from(currentDate));
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* @inheritDoc
|
|
1418
|
+
*/
|
|
1419
|
+
previous() {
|
|
1420
|
+
const currentDate = this.current.toDate();
|
|
1421
|
+
currentDate.setDate(currentDate.getDate() - 7);
|
|
1422
|
+
return this.createBy(CalendarDate.from(currentDate));
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* @inheritDoc
|
|
1426
|
+
*/
|
|
1427
|
+
createBy(current) {
|
|
1428
|
+
return new WeekPeriod(current, this._showWeekends, this.timezone);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
WeekPeriod.DISPLAY_DATE_COUNT = 7;
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* Period of month
|
|
1435
|
+
*/
|
|
1436
|
+
class MonthPeriod extends CalendarPeriod {
|
|
1437
|
+
constructor(current, showWeekends, timezone) {
|
|
1438
|
+
super(MonthPeriod.DISPLAY_DATE_COUNT, current, timezone);
|
|
1439
|
+
this._type = 'month';
|
|
1440
|
+
this._showWeekends = true;
|
|
1441
|
+
this._showWeekends = showWeekends === false ? false : true;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* The function `getMonthFirstDay` returns the first day of a given month in a calendar.
|
|
1445
|
+
*
|
|
1446
|
+
* @param {CalendarDate} [calendarDate] - The `calendarDate` parameter is an optional parameter of
|
|
1447
|
+
* type `CalendarDate`. It represents a specific date in the calendar. If a `calendarDate` is
|
|
1448
|
+
* provided, the function will use that date to determine the first day of the month. If no
|
|
1449
|
+
* `calendarDate` is provided, the function will use the current date considering timezone.
|
|
1450
|
+
* @param {string} [timezone] - The timezone to use when no calendarDate is provided
|
|
1451
|
+
* @returns {CalendarDate} A new `CalendarDate` object representing the first day of the month from the provided
|
|
1452
|
+
* `calendarDate` parameter or the current date if no parameter is provided.
|
|
1453
|
+
*/
|
|
1454
|
+
static getMonthFirstDay(calendarDate, timezone) {
|
|
1455
|
+
const date = calendarDate || CalendarDate.from(new Date(), timezone);
|
|
1456
|
+
return new CalendarDate(date.year, date.month, 1);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Calculate the period start date and end date.
|
|
1460
|
+
*
|
|
1461
|
+
* @param {CalendarDate} date - The date to calculate the period from.
|
|
1462
|
+
*/
|
|
1463
|
+
calculatePeriod(date) {
|
|
1464
|
+
const firstDay = MonthPeriod.getMonthFirstDay(date);
|
|
1465
|
+
const cursor = firstDay.toDate();
|
|
1466
|
+
cursor.setDate(cursor.getDate() - getWeekdays().indexOf(cursor.getDay()));
|
|
1467
|
+
this._startDate = CalendarDate.from(cursor);
|
|
1468
|
+
cursor.setDate(cursor.getDate() + this.count - 1);
|
|
1469
|
+
this._endDate = CalendarDate.from(cursor);
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* @inheritDoc
|
|
1473
|
+
*/
|
|
1474
|
+
next() {
|
|
1475
|
+
const current = this.current.toDate();
|
|
1476
|
+
const year = current.getFullYear();
|
|
1477
|
+
const month = current.getMonth() + 1;
|
|
1478
|
+
const day = current.getDate();
|
|
1479
|
+
// Get the last day of the next month
|
|
1480
|
+
const lastDayOfNextMonth = new Date(year, month + 1, 0).getDate();
|
|
1481
|
+
const nextDay = Math.min(day, lastDayOfNextMonth);
|
|
1482
|
+
const next = new Date(year, month, nextDay);
|
|
1483
|
+
return this.createBy(CalendarDate.from(next));
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* @inheritDoc
|
|
1487
|
+
*/
|
|
1488
|
+
previous() {
|
|
1489
|
+
const current = this.current.toDate();
|
|
1490
|
+
const year = current.getFullYear();
|
|
1491
|
+
const month = current.getMonth() - 1;
|
|
1492
|
+
const day = current.getDate();
|
|
1493
|
+
// Get the last day of the previous month
|
|
1494
|
+
const lastDayOfPreviousMonth = new Date(year, month + 1, 0).getDate();
|
|
1495
|
+
const previousDay = Math.min(day, lastDayOfPreviousMonth);
|
|
1496
|
+
const previous = new Date(year, month, previousDay);
|
|
1497
|
+
return this.createBy(CalendarDate.from(previous));
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* @inheritDoc
|
|
1501
|
+
*/
|
|
1502
|
+
createBy(current) {
|
|
1503
|
+
return new MonthPeriod(current, this._showWeekends, this.timezone);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
MonthPeriod.DISPLAY_DATE_COUNT = 6 * 7;
|
|
1507
|
+
|
|
315
1508
|
/**
|
|
316
1509
|
* Returns true if the input is a string that is one of the four directions.
|
|
317
1510
|
*
|
|
@@ -690,6 +1883,15 @@ const isVegaTableColumnGroupingModelType = (input) => {
|
|
|
690
1883
|
'label' in input &&
|
|
691
1884
|
typeof input.label === 'string');
|
|
692
1885
|
};
|
|
1886
|
+
/**
|
|
1887
|
+
* Check is calendar date type
|
|
1888
|
+
*
|
|
1889
|
+
* @param {unknown} input - Value to test.
|
|
1890
|
+
* @returns {input is CalendarDate} True when input matches the calendar date type.
|
|
1891
|
+
*/
|
|
1892
|
+
const isCalendarDateType = (input) => {
|
|
1893
|
+
return input instanceof CalendarDate;
|
|
1894
|
+
};
|
|
693
1895
|
|
|
694
1896
|
exports.AmexRegex = AmexRegex;
|
|
695
1897
|
exports.BackgroundColorMap = BackgroundColorMap;
|
|
@@ -699,17 +1901,35 @@ exports.BorderColors = BorderColors;
|
|
|
699
1901
|
exports.BorderMap = BorderMap;
|
|
700
1902
|
exports.BorderRadius = BorderRadius;
|
|
701
1903
|
exports.Borders = Borders;
|
|
1904
|
+
exports.CalendarDate = CalendarDate;
|
|
1905
|
+
exports.CalendarDateTime = CalendarDateTime;
|
|
1906
|
+
exports.CalendarTime = CalendarTime;
|
|
702
1907
|
exports.Colors = Colors;
|
|
1908
|
+
exports.DayPeriod = DayPeriod;
|
|
703
1909
|
exports.DiscoverRegex = DiscoverRegex;
|
|
704
1910
|
exports.FillBackgroundColors = FillBackgroundColors;
|
|
705
1911
|
exports.MasterCardRegex = MasterCardRegex;
|
|
1912
|
+
exports.MonthPeriod = MonthPeriod;
|
|
706
1913
|
exports.ShadowMap = ShadowMap;
|
|
707
1914
|
exports.Shadows = Shadows;
|
|
708
1915
|
exports.Spacing = Spacing;
|
|
1916
|
+
exports.StateBackgroundColorFormatter = StateBackgroundColorFormatter$1;
|
|
1917
|
+
exports.StateVariantFormatter = StateVariantFormatter;
|
|
709
1918
|
exports.StrokeBackgroundColors = StrokeBackgroundColors;
|
|
710
1919
|
exports.TextColorMap = TextColorMap;
|
|
711
1920
|
exports.TextColors = TextColors;
|
|
712
1921
|
exports.VisaRegex = VisaRegex;
|
|
1922
|
+
exports.WeekPeriod = WeekPeriod;
|
|
1923
|
+
exports.compareIsAfter = compareIsAfter;
|
|
1924
|
+
exports.compareIsBefore = compareIsBefore;
|
|
1925
|
+
exports.compareIsSameOrBefore = compareIsSameOrBefore;
|
|
1926
|
+
exports.convert12HourTo24HourFormat = convert12HourTo24HourFormat;
|
|
1927
|
+
exports.getCalendarEventSlotName = getCalendarEventSlotName;
|
|
1928
|
+
exports.getClosestWorkday = getClosestWorkday;
|
|
1929
|
+
exports.getEventStatusBgColorStyle = getEventStatusBgColorStyle;
|
|
1930
|
+
exports.getSystemTimezone = getSystemTimezone;
|
|
1931
|
+
exports.getTimeIndex = getTimeIndex;
|
|
1932
|
+
exports.getWeekdays = getWeekdays;
|
|
713
1933
|
exports.isAccordionObserverPayload = isAccordionObserverPayload;
|
|
714
1934
|
exports.isArrayOfType = isArrayOfType;
|
|
715
1935
|
exports.isBackgroundColorTokenType = isBackgroundColorTokenType;
|
|
@@ -720,6 +1940,8 @@ exports.isBorderTokenType = isBorderTokenType;
|
|
|
720
1940
|
exports.isBoxDisplayType = isBoxDisplayType;
|
|
721
1941
|
exports.isBreakpointsForPrefixType = isBreakpointsForPrefixType;
|
|
722
1942
|
exports.isBreakpointsTokenType = isBreakpointsTokenType;
|
|
1943
|
+
exports.isCalendarDateType = isCalendarDateType;
|
|
1944
|
+
exports.isDateStr = isDateStr;
|
|
723
1945
|
exports.isDirectionalBorderRadiusType = isDirectionalBorderRadiusType;
|
|
724
1946
|
exports.isDirectionalSpacingType = isDirectionalSpacingType;
|
|
725
1947
|
exports.isDropdownSourceItemType = isDropdownSourceItemType;
|
|
@@ -734,9 +1956,10 @@ exports.isResponsiveType = isResponsiveType;
|
|
|
734
1956
|
exports.isSelectSourceItemType = isSelectSourceItemType;
|
|
735
1957
|
exports.isShadowsTokenType = isShadowsTokenType;
|
|
736
1958
|
exports.isSpacingTokenType = isSpacingTokenType;
|
|
737
|
-
exports.isStateVariantTokenType = isStateVariantTokenType;
|
|
738
1959
|
exports.isTextAlignType = isTextAlignType;
|
|
739
1960
|
exports.isTextColorTokenType = isTextColorTokenType;
|
|
1961
|
+
exports.isTimeStr = isTimeStr;
|
|
740
1962
|
exports.isTranslocationType = isTranslocationType;
|
|
741
1963
|
exports.isTypographyTokenType = isTypographyTokenType;
|
|
742
1964
|
exports.isVegaTableColumnGroupingModelType = isVegaTableColumnGroupingModelType;
|
|
1965
|
+
exports.pad = pad;
|