@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
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
import { h, H as Host, F as Fragment, r as registerInstance, c as createEvent, g as getElement } from './index-090d31ca.js';
|
|
2
2
|
import { s as sanitizeVegaComponent } from './component-7d906393.js';
|
|
3
|
-
import { D as DateRequiredRule } from './date-required-rule-
|
|
4
|
-
import {
|
|
3
|
+
import { D as DateRequiredRule } from './date-required-rule-a9980386.js';
|
|
4
|
+
import { Z as compareIsSameOrBefore, Q as isDateStr, _ as compareIsBefore, $ as compareIsAfter, a0 as CalendarDate, a1 as MonthPeriod, a2 as isCalendarDateType } from './type-guard-b48aec98.js';
|
|
5
5
|
import { I as InternalFormFieldValidationRule } from './internal-form-field-validation-rule.abstract-f5b6bdbf.js';
|
|
6
|
-
import { c as MapToComponentField, V as VegaSlimmer,
|
|
6
|
+
import { c as MapToComponentField, V as VegaSlimmer, L as LogUtility, M as MapToComponentMethod, I as InjectVegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
|
|
7
7
|
import { V as VegaComponentUsageRuntimeMetricsSlimmer, I as InjectVegaGlobalSlimmer } from './component-usage-runtime-metrics-a84cc93e.js';
|
|
8
|
-
import { F as FormFieldControllerSlimmer } from './form-field-controller-slimmer-
|
|
8
|
+
import { F as FormFieldControllerSlimmer } from './form-field-controller-slimmer-0020997d.js';
|
|
9
9
|
import { a as arrayToClassString, g as getDeviceType, D as DeviceType } from './ui-bb99c0c2.js';
|
|
10
|
-
import { D as DomNodeSubjectObserverFactory, a as VegaClick, d as domNodeSubjectFactory, V as VegaDropdownClick,
|
|
10
|
+
import { D as DomNodeSubjectObserverFactory, a as VegaClick, s as VegaSelectionChange, r as VegaClear, q as VegaMonthYearChange, P as VegaOpen, f as VegaClose, h as VegaChange, d as domNodeSubjectFactory, V as VegaDropdownClick, t as VegaDropdownShow, u as VegaDropdownHide } from './dom-node-subject-observer-factory-f81f215f.js';
|
|
11
11
|
import { a as VegaInternalIconManager } from './internal-icon-manager-f0486245.js';
|
|
12
12
|
import { c as createEnterKeyHandlerToTriggerClick } from './accessibility-e5fd0fab.js';
|
|
13
13
|
import { i as isArrayEqual } from './array-7888f339.js';
|
|
14
|
-
import
|
|
15
|
-
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
16
|
-
import { s as VegaInternalMonthYearChange, t as VegaInternalDropdownUpdateTarget } from './vega-internal-event-id-5c3e5f7f.js';
|
|
17
|
-
import { n as InternalVegaZIndexManager } from './function-extension-8d39db56.js';
|
|
18
|
-
import { F as FORM_ELEMENT_VALUE_CHANGE } from './static-subject-title-52f93124.js';
|
|
19
|
-
import { S as StringMaskStrategy } from './string-mask-strategy-6232a1c1.js';
|
|
20
|
-
import { S as StringInputFormatterSlimmer } from './string-input-formatter-slimmer-3acd240c.js';
|
|
21
|
-
import { E as ElementAppenderSlimmer } from './element-appender-slimmer-6791c332.js';
|
|
14
|
+
import './translation-96e5debd.js';
|
|
22
15
|
import './vega-env-manager-8f8dc473.js';
|
|
16
|
+
import './table-extension-164b0d6c.js';
|
|
23
17
|
import { F as FeatureFlag } from './feature-flag-controller-51659753.js';
|
|
24
18
|
import './wait-for-vega-handler-c2c07ac3.js';
|
|
25
|
-
import './
|
|
26
|
-
import './dto-renderer-manager-d862ae78.js';
|
|
19
|
+
import './dto-renderer-manager-23784148.js';
|
|
27
20
|
import './vega-nonce-manager-497e5eb5.js';
|
|
28
|
-
import './code-block-
|
|
29
|
-
import {
|
|
21
|
+
import './code-block-3d3a9030.js';
|
|
22
|
+
import { t as tryGetDocument } from './try-get-document-bef0f526.js';
|
|
23
|
+
import { F as FORM_ELEMENT_VALUE_CHANGE } from './static-subject-title-52f93124.js';
|
|
24
|
+
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
25
|
+
import { S as StringMaskStrategy } from './string-mask-strategy-4a18ed1a.js';
|
|
26
|
+
import { S as StringInputFormatterSlimmer } from './string-input-formatter-slimmer-96ccc8cf.js';
|
|
27
|
+
import { K as KeyboardManagerSlimmer } from './keyboard-manager-slimmer-e303cb7d.js';
|
|
30
28
|
import { C as ComponentLoadRequired } from './component-load-required-db42032a.js';
|
|
31
|
-
import { c as createEventEmitSlimmer } from './event-emit-slimmer-
|
|
32
|
-
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-
|
|
29
|
+
import { c as createEventEmitSlimmer } from './event-emit-slimmer-966716fa.js';
|
|
30
|
+
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-9ae34332.js';
|
|
33
31
|
import { T as TranslationSlimmer } from './translation-slimmer-c936cb1b.js';
|
|
34
|
-
import {
|
|
32
|
+
import { E as ElementAppenderSlimmer } from './element-appender-slimmer-1a50e184.js';
|
|
33
|
+
import { S as SynchronizeTaskQueue } from './synchronize-task-queue-ac8acc3b.js';
|
|
34
|
+
import { t as VegaInternalDatePickerCalendarClear, u as VegaInternalDatePickerCalendarUpdatePeriodByUser } from './vega-internal-event-id-54ce7562.js';
|
|
35
35
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
36
|
+
import { M as MonthViewGenerator } from './month-view-generator-4bec99fd.js';
|
|
37
|
+
import './breakpoints-d9faf11c.js';
|
|
38
|
+
import './ui-28fd4193.js';
|
|
39
|
+
import './typography-396de03f.js';
|
|
36
40
|
import './string-a953eafc.js';
|
|
37
41
|
import './create-public-api-runtime-metrics-slimmer-bedf3a1e.js';
|
|
38
42
|
import './dynamic-slimmer-90b8af32.js';
|
|
39
|
-
import './page-resize-observer-slimmer-
|
|
40
|
-
import './ui-8424715a.js';
|
|
41
|
-
import './breakpoints-d9faf11c.js';
|
|
42
|
-
import './try-get-document-bef0f526.js';
|
|
43
|
+
import './page-resize-observer-slimmer-8744cb44.js';
|
|
43
44
|
import './mutation-observer-slimmer-58ebc13c.js';
|
|
44
45
|
import './mutation-observer-filters-1a054fb0.js';
|
|
45
|
-
import './sub-state-observer-slimmer-
|
|
46
|
+
import './sub-state-observer-slimmer-3f2b954f.js';
|
|
46
47
|
import './number-4398f2e1.js';
|
|
47
48
|
import './dark-mode-style-controller-de88a117.js';
|
|
48
|
-
import './
|
|
49
|
-
import './
|
|
50
|
-
import './
|
|
49
|
+
import './_commonjsHelpers-9943807e.js';
|
|
50
|
+
import './internal-vega-event-manager-4f51b17c.js';
|
|
51
|
+
import './column-operation-4a93bf52.js';
|
|
52
|
+
import './object-66c37948.js';
|
|
51
53
|
import './base-renderer-101f6d04.js';
|
|
52
|
-
import './
|
|
53
|
-
import './index-c943d263.js';
|
|
54
|
-
import './responsive-format-facade-267935ae.js';
|
|
55
|
-
import './pixel-f32c07ce.js';
|
|
54
|
+
import './timer-9321173b.js';
|
|
56
55
|
import './index-e9da316f.js';
|
|
57
|
-
import './
|
|
58
|
-
import './
|
|
56
|
+
import './string-format-strategy.abstract-75540c16.js';
|
|
57
|
+
import './index-d72e7fb3.js';
|
|
58
|
+
import './keyboard-manager-89acac79.js';
|
|
59
|
+
import './responsive-format-facade-405f90d2.js';
|
|
60
|
+
import './pixel-f32c07ce.js';
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
63
|
* A rule that checks if start date is before than end date
|
|
@@ -265,7 +267,7 @@ const Icons = {
|
|
|
265
267
|
},
|
|
266
268
|
};
|
|
267
269
|
|
|
268
|
-
var __decorate$
|
|
270
|
+
var __decorate$j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
269
271
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
270
272
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
271
273
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -278,9 +280,10 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
278
280
|
return (h("div", { class: "vega-input-prefix" },
|
|
279
281
|
h("vega-icon", { icon: VegaInternalIconManager.getIconKey('calendar'), color: "text-secondary",
|
|
280
282
|
// eslint-disable-next-line react/jsx-no-bind
|
|
281
|
-
onClick: () => {
|
|
283
|
+
onClick: async () => {
|
|
282
284
|
if (!this.disabled) {
|
|
283
|
-
this.focusInput();
|
|
285
|
+
await this.focusInput();
|
|
286
|
+
await this.vegaDatePickerCalendarRenderer.triggerRepick('start');
|
|
284
287
|
}
|
|
285
288
|
} })));
|
|
286
289
|
};
|
|
@@ -289,13 +292,13 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
289
292
|
* on mobile, the input is ready-only to avoid virtual keyboard
|
|
290
293
|
*/
|
|
291
294
|
this.isInputEnabled = () => {
|
|
292
|
-
return !this.readOnly && !this.
|
|
295
|
+
return !this.readOnly && !this.isMobileDevice;
|
|
293
296
|
};
|
|
294
297
|
this.renderLabel = () => {
|
|
295
298
|
return (this.label && (h("vega-field-label", { ref: (e) => {
|
|
296
299
|
/* istanbul ignore next */
|
|
297
|
-
DomNodeSubjectObserverFactory.addUniqueObserverToNode(e, VegaClick, () => {
|
|
298
|
-
this.focusInput();
|
|
300
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(e, VegaClick, async () => {
|
|
301
|
+
await this.focusInput();
|
|
299
302
|
});
|
|
300
303
|
}, isFieldRequired: this.required, disabled: this.disabled, label: this.label })));
|
|
301
304
|
};
|
|
@@ -304,11 +307,11 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
304
307
|
* @see{module:vega-date-picker-click-label-focus-input-e2e}
|
|
305
308
|
*/
|
|
306
309
|
/* istanbul ignore next */
|
|
307
|
-
this.focusInput = () => {
|
|
310
|
+
this.focusInput = async () => {
|
|
308
311
|
var _a, _b;
|
|
309
312
|
(_a = this.vegaDatePickerSingleInputRenderer.getSingleDateInputRef()) === null || _a === void 0 ? void 0 : _a.focus();
|
|
310
313
|
(_b = this.vegaDatePickerRangeInputRenderer.getStartDateInputRef()) === null || _b === void 0 ? void 0 : _b.focus();
|
|
311
|
-
this.
|
|
314
|
+
await this.calendarOpenStateController.showCalendar();
|
|
312
315
|
};
|
|
313
316
|
}
|
|
314
317
|
getDatePickerContainer() {
|
|
@@ -319,119 +322,62 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
319
322
|
'vega-input-container',
|
|
320
323
|
this.size,
|
|
321
324
|
`${this.mode}-mode`,
|
|
322
|
-
this.
|
|
323
|
-
? /* istanbul ignore next */ 'mobile'
|
|
324
|
-
: '',
|
|
325
|
+
this.isMobileDevice ? /* istanbul ignore next */ 'mobile' : '',
|
|
325
326
|
];
|
|
326
327
|
return (h(Host, { class: {
|
|
327
328
|
disabled: this.disabled,
|
|
328
329
|
} },
|
|
329
330
|
this.renderLabel(),
|
|
330
|
-
h("div", { class: arrayToClassString(classNames), ref: (ref) => (this.datePickerContainer = ref) },
|
|
331
|
-
this.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
this.showYearMonthDropdowns && this.monthYearDropdownRenderer.render())));
|
|
331
|
+
h("div", { class: arrayToClassString(classNames), ref: (ref) => (this.datePickerContainer = ref) }, this.mode === 'range'
|
|
332
|
+
? this.vegaDatePickerRangeInputRenderer.render()
|
|
333
|
+
: this.vegaDatePickerSingleInputRenderer.render()),
|
|
334
|
+
this.vegaDatePickerCalendarRenderer.render()));
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
(() => {
|
|
338
338
|
VegaInternalIconManager.register({ calendar: Icons.calendar });
|
|
339
339
|
})();
|
|
340
|
-
__decorate$
|
|
340
|
+
__decorate$j([
|
|
341
341
|
MapToComponentField()
|
|
342
342
|
], VegaDatePickerRenderer.prototype, "disabled", void 0);
|
|
343
|
-
__decorate$
|
|
343
|
+
__decorate$j([
|
|
344
344
|
MapToComponentField()
|
|
345
345
|
], VegaDatePickerRenderer.prototype, "size", void 0);
|
|
346
|
-
__decorate$
|
|
346
|
+
__decorate$j([
|
|
347
347
|
MapToComponentField()
|
|
348
348
|
], VegaDatePickerRenderer.prototype, "mode", void 0);
|
|
349
|
-
__decorate$
|
|
349
|
+
__decorate$j([
|
|
350
350
|
MapToComponentField()
|
|
351
351
|
], VegaDatePickerRenderer.prototype, "label", void 0);
|
|
352
|
-
__decorate$
|
|
352
|
+
__decorate$j([
|
|
353
353
|
MapToComponentField()
|
|
354
354
|
], VegaDatePickerRenderer.prototype, "required", void 0);
|
|
355
|
-
__decorate$
|
|
355
|
+
__decorate$j([
|
|
356
356
|
MapToComponentField()
|
|
357
357
|
], VegaDatePickerRenderer.prototype, "readOnly", void 0);
|
|
358
|
-
__decorate$
|
|
358
|
+
__decorate$j([
|
|
359
359
|
MapToComponentField()
|
|
360
360
|
], VegaDatePickerRenderer.prototype, "autoValidation", void 0);
|
|
361
|
-
__decorate$
|
|
361
|
+
__decorate$j([
|
|
362
362
|
MapToComponentField()
|
|
363
363
|
], VegaDatePickerRenderer.prototype, "host", void 0);
|
|
364
|
-
__decorate$
|
|
364
|
+
__decorate$j([
|
|
365
365
|
MapToComponentField()
|
|
366
|
-
], VegaDatePickerRenderer.prototype, "
|
|
367
|
-
__decorate$
|
|
368
|
-
MapToComponentField()
|
|
369
|
-
], VegaDatePickerRenderer.prototype, "vegaDatePickerMobileController", void 0);
|
|
370
|
-
__decorate$f([
|
|
366
|
+
], VegaDatePickerRenderer.prototype, "isMobileDevice", void 0);
|
|
367
|
+
__decorate$j([
|
|
371
368
|
MapToComponentField()
|
|
372
369
|
], VegaDatePickerRenderer.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
373
|
-
__decorate$
|
|
370
|
+
__decorate$j([
|
|
374
371
|
MapToComponentField()
|
|
375
372
|
], VegaDatePickerRenderer.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
376
|
-
__decorate$
|
|
373
|
+
__decorate$j([
|
|
377
374
|
MapToComponentField()
|
|
378
375
|
], VegaDatePickerRenderer.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
379
|
-
__decorate$
|
|
380
|
-
MapToComponentField()
|
|
381
|
-
], VegaDatePickerRenderer.prototype, "monthYearDropdownRenderer", void 0);
|
|
382
|
-
|
|
383
|
-
var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
384
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
385
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
386
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
387
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
388
|
-
};
|
|
389
|
-
/** The date picker mobile controller slimmer */
|
|
390
|
-
class VegaDatePickerMobileController extends VegaSlimmer {
|
|
391
|
-
constructor() {
|
|
392
|
-
super(...arguments);
|
|
393
|
-
this.isMobileDevice = getDeviceType() === DeviceType.MOBILE;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* The function returns a boolean value indicating whether the device is a mobile device or not.
|
|
397
|
-
*
|
|
398
|
-
* @returns {boolean} A boolean value indicating whether the device is a mobile device or not.
|
|
399
|
-
*/
|
|
400
|
-
getIsMobileDevice() {
|
|
401
|
-
return this.isMobileDevice;
|
|
402
|
-
}
|
|
403
|
-
/*
|
|
404
|
-
* The below method is e2e-test covered in
|
|
405
|
-
* @see{module:vega-date-picker-scroll-in-mobile}
|
|
406
|
-
*/
|
|
407
|
-
/* istanbul ignore next */
|
|
408
|
-
/**
|
|
409
|
-
* The function prevents touchmove events from scrolling the element on mobile devices.
|
|
410
|
-
*/
|
|
411
|
-
preventElementTouchMoveInMobile() {
|
|
412
|
-
const backdrop =
|
|
413
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
414
|
-
this.host.shadowRoot.querySelector('.litepicker-backdrop');
|
|
415
|
-
if (backdrop) {
|
|
416
|
-
backdrop.removeEventListener('touchmove', (e) => e.preventDefault());
|
|
417
|
-
backdrop.addEventListener('touchmove', (e) => e.preventDefault());
|
|
418
|
-
}
|
|
419
|
-
this.vegaDatePickerCalendarRenderer
|
|
420
|
-
.getCalendarContainerRef()
|
|
421
|
-
.removeEventListener('touchmove', (e) => e.preventDefault());
|
|
422
|
-
this.vegaDatePickerCalendarRenderer
|
|
423
|
-
.getCalendarContainerRef()
|
|
424
|
-
.addEventListener('touchmove', (e) => e.preventDefault());
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
__decorate$e([
|
|
428
|
-
MapToComponentField()
|
|
429
|
-
], VegaDatePickerMobileController.prototype, "host", void 0);
|
|
430
|
-
__decorate$e([
|
|
376
|
+
__decorate$j([
|
|
431
377
|
MapToComponentField()
|
|
432
|
-
],
|
|
378
|
+
], VegaDatePickerRenderer.prototype, "calendarOpenStateController", void 0);
|
|
433
379
|
|
|
434
|
-
var __decorate$
|
|
380
|
+
var __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
435
381
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
436
382
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
437
383
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -443,13 +389,14 @@ var __decorate$d = (undefined && undefined.__decorate) || function (decorators,
|
|
|
443
389
|
class VegaDatePickerInputRendererBase extends VegaSlimmer {
|
|
444
390
|
constructor() {
|
|
445
391
|
super(...arguments);
|
|
446
|
-
this.onClickClearIcon = () => {
|
|
392
|
+
this.onClickClearIcon = async () => {
|
|
447
393
|
if (this.mode === 'range') {
|
|
448
394
|
this.vegaDatePickerValueController.setValue(['', '']);
|
|
449
395
|
}
|
|
450
396
|
else {
|
|
451
397
|
this.vegaDatePickerValueController.setValue('');
|
|
452
398
|
}
|
|
399
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
453
400
|
};
|
|
454
401
|
this.isClearIconVisible = () => {
|
|
455
402
|
if (this.mode === 'range') {
|
|
@@ -470,20 +417,23 @@ class VegaDatePickerInputRendererBase extends VegaSlimmer {
|
|
|
470
417
|
h("vega-icon", { icon: "close" })))));
|
|
471
418
|
}
|
|
472
419
|
}
|
|
473
|
-
__decorate$
|
|
420
|
+
__decorate$i([
|
|
474
421
|
MapToComponentField()
|
|
475
422
|
], VegaDatePickerInputRendererBase.prototype, "disabled", void 0);
|
|
476
|
-
__decorate$
|
|
423
|
+
__decorate$i([
|
|
477
424
|
MapToComponentField()
|
|
478
425
|
], VegaDatePickerInputRendererBase.prototype, "showClearIcon", void 0);
|
|
479
|
-
__decorate$
|
|
426
|
+
__decorate$i([
|
|
480
427
|
MapToComponentField()
|
|
481
428
|
], VegaDatePickerInputRendererBase.prototype, "mode", void 0);
|
|
482
|
-
__decorate$
|
|
429
|
+
__decorate$i([
|
|
483
430
|
MapToComponentField()
|
|
484
431
|
], VegaDatePickerInputRendererBase.prototype, "vegaDatePickerValueController", void 0);
|
|
432
|
+
__decorate$i([
|
|
433
|
+
MapToComponentField()
|
|
434
|
+
], VegaDatePickerInputRendererBase.prototype, "calendarOpenStateController", void 0);
|
|
485
435
|
|
|
486
|
-
var __decorate$
|
|
436
|
+
var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
487
437
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
488
438
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
489
439
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -496,10 +446,8 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
496
446
|
return (h("div", { class: "date-picker-input" },
|
|
497
447
|
this.vegaDatePickerRenderer.renderInputPrefix(),
|
|
498
448
|
h("input", { readOnly: !this.vegaDatePickerRenderer.isInputEnabled(), placeholder: this.getSinglePlaceholder(), value: this.vegaDatePickerValueController.getValue(), ref: (ref) => (this.singleDateInputRef = ref), onChange: this.onSingleDateChange, disabled: this.disabled,
|
|
499
|
-
|
|
500
|
-
onClick: () =>
|
|
501
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().show();
|
|
502
|
-
} }),
|
|
449
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
450
|
+
onClick: () => this.calendarOpenStateController.showCalendar() }),
|
|
503
451
|
this.renderClearIcon()));
|
|
504
452
|
};
|
|
505
453
|
this.getSinglePlaceholder = () => {
|
|
@@ -519,7 +467,7 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
519
467
|
this.onSingleDateChange = (e) => {
|
|
520
468
|
const currentTarget = e.currentTarget;
|
|
521
469
|
const date = currentTarget.value;
|
|
522
|
-
if (
|
|
470
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
523
471
|
this.vegaDatePickerValueController.setValue(this.vegaDatePickerFormatController.formatDate(date));
|
|
524
472
|
}
|
|
525
473
|
else {
|
|
@@ -529,36 +477,27 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
529
477
|
}
|
|
530
478
|
};
|
|
531
479
|
}
|
|
532
|
-
componentWillRender() {
|
|
533
|
-
this.oldSingleDateInputRef = this.singleDateInputRef;
|
|
534
|
-
}
|
|
535
480
|
getSingleDateInputRef() {
|
|
536
481
|
return this.singleDateInputRef;
|
|
537
482
|
}
|
|
538
|
-
getOldSingleDateInputRef() {
|
|
539
|
-
return this.oldSingleDateInputRef;
|
|
540
|
-
}
|
|
541
483
|
}
|
|
542
|
-
__decorate$
|
|
484
|
+
__decorate$h([
|
|
543
485
|
MapToComponentField()
|
|
544
486
|
], VegaDatePickerSingleInputRenderer.prototype, "placeholder", void 0);
|
|
545
|
-
__decorate$
|
|
487
|
+
__decorate$h([
|
|
546
488
|
MapToComponentField()
|
|
547
489
|
], VegaDatePickerSingleInputRenderer.prototype, "format", void 0);
|
|
548
|
-
__decorate$
|
|
490
|
+
__decorate$h([
|
|
549
491
|
MapToComponentField()
|
|
550
492
|
], VegaDatePickerSingleInputRenderer.prototype, "vegaDatePickerFormatController", void 0);
|
|
551
|
-
__decorate$
|
|
493
|
+
__decorate$h([
|
|
552
494
|
MapToComponentField()
|
|
553
495
|
], VegaDatePickerSingleInputRenderer.prototype, "vegaDatePickerRenderer", void 0);
|
|
554
|
-
__decorate$
|
|
496
|
+
__decorate$h([
|
|
555
497
|
MapToComponentField()
|
|
556
|
-
], VegaDatePickerSingleInputRenderer.prototype, "
|
|
557
|
-
__decorate$c([
|
|
558
|
-
MapToComponentMethod('componentWillRender')
|
|
559
|
-
], VegaDatePickerSingleInputRenderer.prototype, "componentWillRender", null);
|
|
498
|
+
], VegaDatePickerSingleInputRenderer.prototype, "calendarOpenStateController", void 0);
|
|
560
499
|
|
|
561
|
-
var __decorate$
|
|
500
|
+
var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
562
501
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
563
502
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
564
503
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -571,12 +510,16 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
571
510
|
return (h(Fragment, null,
|
|
572
511
|
h("div", { class: "date-picker-input" },
|
|
573
512
|
this.vegaDatePickerRenderer.renderInputPrefix(),
|
|
574
|
-
h("input", { readOnly: !this.vegaDatePickerRenderer.isInputEnabled(), placeholder: this.getRangePlaceholder()[0], value: this.vegaDatePickerValueController.getValue()[0], ref: (ref) => (this.startDateInputRef = ref), onChange: this.onStartDateChange, disabled: this.disabled
|
|
513
|
+
h("input", { readOnly: !this.vegaDatePickerRenderer.isInputEnabled(), placeholder: this.getRangePlaceholder()[0], value: this.vegaDatePickerValueController.getValue()[0], ref: (ref) => (this.startDateInputRef = ref), onChange: this.onStartDateChange, disabled: this.disabled,
|
|
514
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
515
|
+
onClick: async () => await this.onInputClicked('start') })),
|
|
575
516
|
h("span", { class: {
|
|
576
517
|
'range-input-divider': true,
|
|
577
518
|
} }),
|
|
578
519
|
h("div", { class: "date-picker-input" },
|
|
579
|
-
h("input", { readOnly: !this.vegaDatePickerRenderer.isInputEnabled(), placeholder: this.getRangePlaceholder()[1], value: this.vegaDatePickerValueController.getValue()[1], ref: (ref) => (this.endDateInputRef = ref), onChange: this.onEndDateChange, disabled: this.disabled
|
|
520
|
+
h("input", { readOnly: !this.vegaDatePickerRenderer.isInputEnabled(), placeholder: this.getRangePlaceholder()[1], value: this.vegaDatePickerValueController.getValue()[1], ref: (ref) => (this.endDateInputRef = ref), onChange: this.onEndDateChange, disabled: this.disabled,
|
|
521
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
522
|
+
onClick: async () => await this.onInputClicked('end') }),
|
|
580
523
|
this.renderClearIcon())));
|
|
581
524
|
};
|
|
582
525
|
this.getRangePlaceholder = () => {
|
|
@@ -596,7 +539,7 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
596
539
|
this.onStartDateChange = (e) => {
|
|
597
540
|
const currentTarget = e.currentTarget;
|
|
598
541
|
const date = currentTarget.value;
|
|
599
|
-
if (
|
|
542
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
600
543
|
this.vegaDatePickerValueController.setValue([
|
|
601
544
|
this.vegaDatePickerFormatController.formatDate(date),
|
|
602
545
|
this.vegaDatePickerValueController.getValue()[1],
|
|
@@ -618,7 +561,7 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
618
561
|
this.onEndDateChange = (e) => {
|
|
619
562
|
const currentTarget = e.currentTarget;
|
|
620
563
|
const date = currentTarget.value;
|
|
621
|
-
if (
|
|
564
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
622
565
|
this.vegaDatePickerValueController.setValue([
|
|
623
566
|
this.vegaDatePickerValueController.getValue()[0],
|
|
624
567
|
this.vegaDatePickerFormatController.formatDate(date),
|
|
@@ -634,883 +577,206 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
634
577
|
}
|
|
635
578
|
};
|
|
636
579
|
}
|
|
637
|
-
componentWillRender() {
|
|
638
|
-
this.oldStartDateInputRef = this.startDateInputRef;
|
|
639
|
-
this.oldEndDateInputRef = this.endDateInputRef;
|
|
640
|
-
}
|
|
641
580
|
getStartDateInputRef() {
|
|
642
581
|
return this.startDateInputRef;
|
|
643
582
|
}
|
|
644
583
|
getEndDateInputRef() {
|
|
645
584
|
return this.endDateInputRef;
|
|
646
585
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
getOldEndDateInputRef() {
|
|
651
|
-
return this.oldEndDateInputRef;
|
|
586
|
+
async onInputClicked(type) {
|
|
587
|
+
await this.calendarOpenStateController.showCalendar();
|
|
588
|
+
await this.vegaDatePickerCalendarRenderer.triggerRepick(type);
|
|
652
589
|
}
|
|
653
590
|
}
|
|
654
|
-
__decorate$
|
|
591
|
+
__decorate$g([
|
|
655
592
|
MapToComponentField()
|
|
656
593
|
], VegaDatePickerRangeInputRenderer.prototype, "placeholder", void 0);
|
|
657
|
-
__decorate$
|
|
594
|
+
__decorate$g([
|
|
658
595
|
MapToComponentField()
|
|
659
596
|
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerFormatController", void 0);
|
|
660
|
-
__decorate$
|
|
597
|
+
__decorate$g([
|
|
661
598
|
MapToComponentField()
|
|
662
599
|
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerRenderer", void 0);
|
|
663
|
-
__decorate$
|
|
600
|
+
__decorate$g([
|
|
601
|
+
MapToComponentField()
|
|
602
|
+
], VegaDatePickerRangeInputRenderer.prototype, "calendarOpenStateController", void 0);
|
|
603
|
+
__decorate$g([
|
|
664
604
|
MapToComponentField()
|
|
665
605
|
], VegaDatePickerRangeInputRenderer.prototype, "translationSlimmer", void 0);
|
|
666
|
-
__decorate$
|
|
667
|
-
|
|
668
|
-
], VegaDatePickerRangeInputRenderer.prototype, "
|
|
606
|
+
__decorate$g([
|
|
607
|
+
MapToComponentField()
|
|
608
|
+
], VegaDatePickerRangeInputRenderer.prototype, "allowRepick", void 0);
|
|
609
|
+
__decorate$g([
|
|
610
|
+
MapToComponentField()
|
|
611
|
+
], VegaDatePickerRangeInputRenderer.prototype, "format", void 0);
|
|
612
|
+
__decorate$g([
|
|
613
|
+
MapToComponentField()
|
|
614
|
+
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
669
615
|
|
|
670
|
-
var __decorate$
|
|
616
|
+
var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
671
617
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
672
618
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
673
619
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
674
620
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
675
621
|
};
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
super(...arguments);
|
|
680
|
-
/**
|
|
681
|
-
* The code below is defining a method called `handleClear` which is used to clear the selection in a
|
|
682
|
-
* date picker component. It calls the `clearSelection` method of the `datePicker` object, sets the
|
|
683
|
-
* default value based on the mode, and hides the date picker.
|
|
684
|
-
*/
|
|
685
|
-
this.handleClear = () => {
|
|
686
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().clearSelection();
|
|
687
|
-
this.vegaDatePickerValueController.setDefaultValueByMode();
|
|
688
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().hide();
|
|
689
|
-
};
|
|
690
|
-
/**
|
|
691
|
-
* The code below is defining a private method called `shouldUpdateCalendar` in a TypeScript class.
|
|
692
|
-
* This method takes a parameter `newValue` of type `DatePickerValueType<DatePickerModeType>`.
|
|
693
|
-
*
|
|
694
|
-
* @param {DatePickerValueType<DatePickerModeType>} newValue - The new value of the calendar.
|
|
695
|
-
*/
|
|
696
|
-
this.shouldUpdateCalendar = (newValue) => {
|
|
697
|
-
var _a, _b;
|
|
698
|
-
const startDate = ((_a = this.vegaDatePickerCalendarRenderer.getDatePicker().getStartDate()) === null || _a === void 0 ? void 0 : _a.format(this.format)) || '';
|
|
699
|
-
const endDate = ((_b = this.vegaDatePickerCalendarRenderer.getDatePicker().getEndDate()) === null || _b === void 0 ? void 0 : _b.format(this.format)) || '';
|
|
700
|
-
if ((this.mode === 'single' && newValue !== startDate) ||
|
|
701
|
-
(this.mode === 'range' &&
|
|
702
|
-
!isArrayEqual(newValue, [startDate, endDate]))) {
|
|
703
|
-
this.updateCalendar();
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
/*
|
|
707
|
-
* The below method is e2e-test covered in
|
|
708
|
-
* @param date1
|
|
709
|
-
* @param date2
|
|
710
|
-
* @see{module:vega-date-picker-single-selected}
|
|
711
|
-
* @see{module:vega-date-picker-range-selected}
|
|
712
|
-
* @see{module:vega-date-picker-receive-single-value}
|
|
713
|
-
*/
|
|
714
|
-
/**
|
|
715
|
-
* The code below is defining an event handler function called `onDatePickerSelected`. This function
|
|
716
|
-
* takes two parameters, `date1` and `date2`, both of type `DateTime`.
|
|
717
|
-
*
|
|
718
|
-
* @param {DateTime} date1 - The start date
|
|
719
|
-
* @param {DateTime} date2 - The end date
|
|
720
|
-
*/
|
|
721
|
-
this.onDatePickerSelected = (date1, date2) => {
|
|
722
|
-
if (this.mode === 'range') {
|
|
723
|
-
const startDate = date1.format(this.format);
|
|
724
|
-
const endDate = date2.format(this.format);
|
|
725
|
-
this.vegaDatePickerRangeInputRenderer.getStartDateInputRef().value = startDate;
|
|
726
|
-
this.vegaDatePickerRangeInputRenderer.getEndDateInputRef().value = endDate;
|
|
727
|
-
this.vegaDatePickerValueController.syncUpValueWithCalendar();
|
|
728
|
-
}
|
|
729
|
-
else {
|
|
730
|
-
this.vegaDatePickerSingleInputRenderer.getSingleDateInputRef().value = date1.format(this.format);
|
|
731
|
-
this.vegaDatePickerValueController.syncUpValueWithCalendar();
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
/*
|
|
735
|
-
* The below method is e2e-test covered in
|
|
736
|
-
* @see{module:vega-date-picker-load-mobile-plugin}
|
|
737
|
-
*/
|
|
738
|
-
/**
|
|
739
|
-
* The code below is defining a TypeScript arrow function called `getDefaultLitePickerConfig`. This
|
|
740
|
-
* function returns an object that represents the default configuration for a LitePicker component.
|
|
741
|
-
*
|
|
742
|
-
* @returns {object} - The default lite picker config is being returned.
|
|
743
|
-
*/
|
|
744
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
745
|
-
this.getDefaultLitePickerConfig = () => {
|
|
746
|
-
const defaultConfig = Object.assign(Object.assign({}, this.getModeConfig()), { splitView: false, showTooltip: false, firstDay: 0, minDate: this.minDate, maxDate: this.maxDate, allowRepick: this.allowRepick, format: this.format, plugins: [
|
|
747
|
-
this.vegaDatePickerMobileController.getIsMobileDevice()
|
|
748
|
-
? /* istanbul ignore next */ 'mobilefriendly'
|
|
749
|
-
: null,
|
|
750
|
-
].filter(Boolean), parentEl: this.vegaDatePickerCalendarRenderer.getCalendarContainerRef() });
|
|
751
|
-
if (this.showYearMonthDropdowns) {
|
|
752
|
-
const minYear = this.minDate
|
|
753
|
-
? new Date(this.minDate).getFullYear()
|
|
754
|
-
: new Date().getFullYear() -
|
|
755
|
-
VegaDatePickerCalendarController.DEFAULT_MINIMUM_DROPDOWN_YEAR_BEFORE_CURRENT_YEAR;
|
|
756
|
-
const maxYear = this.maxDate
|
|
757
|
-
? new Date(this.maxDate).getFullYear()
|
|
758
|
-
: new Date().getFullYear() +
|
|
759
|
-
VegaDatePickerCalendarController.DEFAULT_MINIMUM_DROPDOWN_YEAR_AFTER_CURRENT_YEAR;
|
|
760
|
-
defaultConfig['dropdowns'] = {
|
|
761
|
-
months: true,
|
|
762
|
-
years: true,
|
|
763
|
-
minYear: minYear,
|
|
764
|
-
maxYear: maxYear,
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
return defaultConfig;
|
|
768
|
-
};
|
|
769
|
-
/**
|
|
770
|
-
* The code below is defining a method called `getModeConfig` which returns an object with various
|
|
771
|
-
* properties based on the value of the `mode` property.
|
|
772
|
-
*
|
|
773
|
-
* @returns {object} The ModeConfig is being returned.
|
|
774
|
-
*/
|
|
775
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
776
|
-
this.getModeConfig = () => {
|
|
777
|
-
return {
|
|
778
|
-
singleMode: this.mode === 'single',
|
|
779
|
-
numberOfMonths: this.mode === 'single' ? 1 : 2,
|
|
780
|
-
numberOfColumns: this.mode === 'single' ? 1 : 2,
|
|
781
|
-
startDate: this.mode === 'range'
|
|
782
|
-
? this.vegaDatePickerValueController.getValue()[0]
|
|
783
|
-
: this.vegaDatePickerValueController.getValue(),
|
|
784
|
-
endDate: this.mode === 'range' ? this.vegaDatePickerValueController.getValue()[1] : null,
|
|
785
|
-
element: this.mode === 'range'
|
|
786
|
-
? this.vegaDatePickerRangeInputRenderer.getStartDateInputRef()
|
|
787
|
-
: this.vegaDatePickerSingleInputRenderer.getSingleDateInputRef(),
|
|
788
|
-
elementEnd: this.mode === 'range' ? this.vegaDatePickerRangeInputRenderer.getEndDateInputRef() : null,
|
|
789
|
-
};
|
|
790
|
-
};
|
|
622
|
+
class VegaDatePickerCalendarRenderer$1 extends VegaSlimmer {
|
|
623
|
+
componentDidLoad() {
|
|
624
|
+
this.appendCalendarToBodyIfMobile();
|
|
791
625
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
* @see{module:vega-date-picker-change-min-max-date}
|
|
795
|
-
*/
|
|
796
|
-
/* istanbul ignore next */
|
|
797
|
-
/**
|
|
798
|
-
* Update property of minDate when it is changed
|
|
799
|
-
*
|
|
800
|
-
* @param {string} value - The value of minDate.
|
|
801
|
-
*/
|
|
802
|
-
watchMinDate(value) {
|
|
803
|
-
this.minDate = value ? this.vegaDatePickerFormatController.formatDate(value) : '';
|
|
804
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().setOptions({
|
|
805
|
-
minDate: this.minDate ? this.minDate : null,
|
|
806
|
-
});
|
|
807
|
-
this.goToDate();
|
|
626
|
+
getCalendarContentBoxRef() {
|
|
627
|
+
return this.calendarContentBoxRef;
|
|
808
628
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
this.
|
|
822
|
-
|
|
629
|
+
getCalendarRef() {
|
|
630
|
+
return this.calendarRef;
|
|
631
|
+
}
|
|
632
|
+
getMobileModalRef() {
|
|
633
|
+
return this.mobileModalRef;
|
|
634
|
+
}
|
|
635
|
+
async triggerRepick(type) {
|
|
636
|
+
if (this.allowRepick && this.mode === 'range') {
|
|
637
|
+
await this.calendarRef.triggerRepick(type);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
render() {
|
|
641
|
+
return this.isMobileDevice ? this.mobileRender() : this.renderCalendar();
|
|
642
|
+
}
|
|
643
|
+
mobileRender() {
|
|
644
|
+
return (h("vega-modal", { showCloseButton: false, size: VegaDatePickerCalendarRenderer$1.calendarModalSize, padding: "0", isVerticallyCentered: true, backdropColor: "semi", ref: (ref) => {
|
|
645
|
+
this.mobileModalRef = ref;
|
|
646
|
+
this.addModalObserver(ref);
|
|
647
|
+
} }, h("div", { slot: "modal-content" }, this.renderCalendar())));
|
|
648
|
+
}
|
|
649
|
+
renderCalendar() {
|
|
650
|
+
return (h("vega-box", { padding: {
|
|
651
|
+
default: 'size-12',
|
|
652
|
+
S: 'size-32',
|
|
653
|
+
}, corners: "rounded-12", backgroundColor: "bg-primary", shadow: "shadow-dropdown-menu", border: "border-input-field", ref: (ref) => {
|
|
654
|
+
this.calendarContentBoxRef = ref;
|
|
655
|
+
}, class: "date-picker-content-box" },
|
|
656
|
+
h("vega-box", { width: this.getDefaultCalendarDimension('width'), height: this.getDefaultCalendarDimension('height') },
|
|
657
|
+
h("vega-date-picker-calendar", { selection: this.value, mode: this.mode, minDate: this.minDate, maxDate: this.maxDate, clearButton: this.clearButton, format: this.format, staticHeight: this.dropdownConfig.staticHeight !== false, showYearMonthDropdowns: this.showYearMonthDropdowns, timezone: this.timezone, yearMonthDropdownProps: {
|
|
658
|
+
isScreenPosition: FeatureFlag.isEnabled('VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN'),
|
|
659
|
+
}, ref: (ref) => {
|
|
660
|
+
this.calendarRef = ref;
|
|
661
|
+
this.addCalendarObserver(ref);
|
|
662
|
+
},
|
|
663
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
664
|
+
isDateDisabled: (date) => this.isDateDisabled(date) }))));
|
|
665
|
+
}
|
|
666
|
+
addCalendarObserver(calendarRef) {
|
|
667
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaSelectionChange, async (payload) => {
|
|
668
|
+
await this.onCalendarSelected(payload.detail);
|
|
669
|
+
});
|
|
670
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaClear, async () => {
|
|
671
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
672
|
+
});
|
|
673
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaMonthYearChange, async (payload) => {
|
|
674
|
+
this.monthYearChangeEventEmitter.emit(payload.detail);
|
|
823
675
|
});
|
|
824
|
-
this.goToDate();
|
|
825
676
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
677
|
+
addModalObserver(modalRef) {
|
|
678
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(modalRef, VegaOpen, () => {
|
|
679
|
+
this.calendarOpenStateController.updateIsCalendarShowState(true);
|
|
680
|
+
});
|
|
681
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(modalRef, VegaClose, () => {
|
|
682
|
+
this.calendarOpenStateController.updateIsCalendarShowState(false);
|
|
683
|
+
});
|
|
831
684
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
* - Go to the minDate month if only set the minDate and today is before than minDate.
|
|
836
|
-
* - Go to the minDate month if minDate and maxDate are both set and today is after than maxDate.
|
|
837
|
-
* - Go to the maxDate month if only set maxDate and today is after than maxDate.
|
|
838
|
-
* - Go to today month if the value, minDate and maxDate all are empty.
|
|
839
|
-
*/
|
|
840
|
-
goToDate() {
|
|
841
|
-
const date = this.mode === 'range'
|
|
842
|
-
? this.vegaDatePickerValueController.getValue()[0]
|
|
843
|
-
: this.vegaDatePickerValueController.getValue();
|
|
844
|
-
const datePickerCalendar = this.vegaDatePickerCalendarRenderer.getDatePicker();
|
|
845
|
-
const today = new Date();
|
|
846
|
-
if (date) {
|
|
847
|
-
datePickerCalendar.gotoDate(date, 0);
|
|
685
|
+
async onCalendarSelected(value) {
|
|
686
|
+
if (this.mode === 'single') {
|
|
687
|
+
this.vegaDatePickerValueController.setValue(value);
|
|
848
688
|
}
|
|
849
|
-
else if (this.
|
|
850
|
-
|
|
851
|
-
(this.maxDate && compareIsAfter(today, new Date(this.maxDate))))) {
|
|
852
|
-
datePickerCalendar.gotoDate(this.minDate, 0);
|
|
689
|
+
else if (this.mode === 'range') {
|
|
690
|
+
this.vegaDatePickerValueController.setValue(value);
|
|
853
691
|
}
|
|
854
|
-
|
|
855
|
-
|
|
692
|
+
if (this.isCalendarShow) {
|
|
693
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
856
694
|
}
|
|
857
|
-
|
|
858
|
-
|
|
695
|
+
}
|
|
696
|
+
appendCalendarToBodyIfMobile() {
|
|
697
|
+
const document = tryGetDocument();
|
|
698
|
+
if (this.isMobileDevice && document) {
|
|
699
|
+
document.body.append(this.mobileModalRef);
|
|
859
700
|
}
|
|
860
701
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
* The function "updateCalendar" updates the date range in a calendar based on the selected mode
|
|
869
|
-
* (single or range) and the values of the start and end dates.
|
|
870
|
-
*
|
|
871
|
-
* @returns {void} The function does not have a return statement, so it does not return anything.
|
|
872
|
-
*/
|
|
873
|
-
updateCalendar() {
|
|
874
|
-
if (!this.vegaDatePickerCalendarRenderer.getDatePicker())
|
|
875
|
-
return;
|
|
876
|
-
if (this.mode === 'single') {
|
|
877
|
-
const singleDate = this.vegaDatePickerValueController.getValue();
|
|
878
|
-
if (singleDate) {
|
|
879
|
-
this.vegaDatePickerCalendarRenderer
|
|
880
|
-
.getDatePicker()
|
|
881
|
-
.setDate(this.vegaDatePickerValueController.getValue());
|
|
882
|
-
}
|
|
883
|
-
else {
|
|
884
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().clearSelection();
|
|
885
|
-
}
|
|
702
|
+
getDefaultCalendarDimension(type) {
|
|
703
|
+
const dimensions = this.mode === 'range' && !this.isMobileDevice
|
|
704
|
+
? VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForRange
|
|
705
|
+
: VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForSingle;
|
|
706
|
+
// Height can be dynamic
|
|
707
|
+
if (type === 'height' && this.dropdownConfig.staticHeight === false) {
|
|
708
|
+
return 'auto';
|
|
886
709
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().setDateRange(startDate, endDate);
|
|
892
|
-
}
|
|
893
|
-
else {
|
|
894
|
-
// Should only call clearSelection when startDate and endDate are both empty
|
|
895
|
-
if (startDate === '' && endDate === '') {
|
|
896
|
-
this.vegaDatePickerCalendarRenderer.getDatePicker().clearSelection();
|
|
897
|
-
}
|
|
898
|
-
}
|
|
710
|
+
let value = dimensions[type];
|
|
711
|
+
// Extra space for footer when height is static
|
|
712
|
+
if (type === 'height' && this.clearButton) {
|
|
713
|
+
value += 40; // 24px footer + 16px margin
|
|
899
714
|
}
|
|
715
|
+
return `${value}px`;
|
|
900
716
|
}
|
|
901
717
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
718
|
+
VegaDatePickerCalendarRenderer$1.calendarModalSize = 344;
|
|
719
|
+
VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForSingle = {
|
|
720
|
+
width: 280,
|
|
721
|
+
height: 316,
|
|
722
|
+
};
|
|
723
|
+
VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForRange = {
|
|
724
|
+
width: 608,
|
|
725
|
+
height: 324,
|
|
726
|
+
};
|
|
727
|
+
__decorate$f([
|
|
911
728
|
MapToComponentField()
|
|
912
|
-
],
|
|
913
|
-
__decorate$
|
|
729
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "format", void 0);
|
|
730
|
+
__decorate$f([
|
|
914
731
|
MapToComponentField()
|
|
915
|
-
],
|
|
916
|
-
__decorate$
|
|
732
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "value", void 0);
|
|
733
|
+
__decorate$f([
|
|
917
734
|
MapToComponentField()
|
|
918
|
-
],
|
|
919
|
-
__decorate$
|
|
735
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "mode", void 0);
|
|
736
|
+
__decorate$f([
|
|
920
737
|
MapToComponentField()
|
|
921
|
-
],
|
|
922
|
-
__decorate$
|
|
738
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "minDate", void 0);
|
|
739
|
+
__decorate$f([
|
|
923
740
|
MapToComponentField()
|
|
924
|
-
],
|
|
925
|
-
__decorate$
|
|
741
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "maxDate", void 0);
|
|
742
|
+
__decorate$f([
|
|
926
743
|
MapToComponentField()
|
|
927
|
-
],
|
|
928
|
-
__decorate$
|
|
744
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "clearButton", void 0);
|
|
745
|
+
__decorate$f([
|
|
929
746
|
MapToComponentField()
|
|
930
|
-
],
|
|
931
|
-
__decorate$
|
|
747
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "dropdownConfig", void 0);
|
|
748
|
+
__decorate$f([
|
|
932
749
|
MapToComponentField()
|
|
933
|
-
],
|
|
934
|
-
__decorate$
|
|
750
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "showYearMonthDropdowns", void 0);
|
|
751
|
+
__decorate$f([
|
|
935
752
|
MapToComponentField()
|
|
936
|
-
],
|
|
937
|
-
__decorate$
|
|
753
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "timezone", void 0);
|
|
754
|
+
__decorate$f([
|
|
938
755
|
MapToComponentField()
|
|
939
|
-
],
|
|
940
|
-
__decorate$
|
|
941
|
-
|
|
942
|
-
],
|
|
943
|
-
__decorate$
|
|
944
|
-
|
|
945
|
-
],
|
|
946
|
-
__decorate$
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
*/
|
|
962
|
-
!function(t,e){module.exports=e();}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i});},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e,n,i){void 0===e&&(e=null),void 0===n&&(n=null),void 0===i&&(i="en-US"),this.dateInstance="object"==typeof n&&null!==n?n.parse(e instanceof t?e.clone().toJSDate():e):"string"==typeof n?t.parseDateTime(e,n,i):e?t.parseDateTime(e):t.parseDateTime(new Date),this.lang=i;}return t.parseDateTime=function(e,n,i){if(void 0===n&&(n="YYYY-MM-DD"),void 0===i&&(i="en-US"),!e)return new Date(NaN);if(e instanceof Date)return new Date(e);if(e instanceof t)return e.clone().toJSDate();if(/^-?\d{10,}$/.test(e))return t.getDateZeroTime(new Date(Number(e)));if("string"==typeof e){for(var o=[],s=null;null!=(s=t.regex.exec(n));)"\\"!==s[1]&&o.push(s);if(o.length){var r={year:null,month:null,shortMonth:null,longMonth:null,day:null,value:""};o[0].index>0&&(r.value+=".*?");for(var a=0,h=Object.entries(o);a<h.length;a++){var l=h[a],p=l[0],c=l[1],d=Number(p),u=t.formatPatterns(c[0],i),m=u.group,f=u.pattern;r[m]=d+1,r.value+=f,r.value+=".*?";}var g=new RegExp("^"+r.value+"$");if(g.test(e)){var y=g.exec(e),v=Number(y[r.year]),D=null;r.month?D=Number(y[r.month])-1:r.shortMonth?D=t.shortMonths(i).indexOf(y[r.shortMonth]):r.longMonth&&(D=t.longMonths(i).indexOf(y[r.longMonth]));var w=Number(y[r.day])||1;return new Date(v,D,w,0,0,0,0)}}}return t.getDateZeroTime(new Date(e))},t.convertArray=function(e,n){return e.map((function(e){return e instanceof Array?e.map((function(e){return new t(e,n)})):new t(e,n)}))},t.getDateZeroTime=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},t.shortMonths=function(e){return t.MONTH_JS.map((function(t){return new Date(2019,t).toLocaleString(e,{month:"short"})}))},t.longMonths=function(e){return t.MONTH_JS.map((function(t){return new Date(2019,t).toLocaleString(e,{month:"long"})}))},t.formatPatterns=function(e,n){switch(e){case"YY":case"YYYY":return {group:"year",pattern:"(\\d{"+e.length+"})"};case"M":return {group:"month",pattern:"(\\d{1,2})"};case"MM":return {group:"month",pattern:"(\\d{2})"};case"MMM":return {group:"shortMonth",pattern:"("+t.shortMonths(n).join("|")+")"};case"MMMM":return {group:"longMonth",pattern:"("+t.longMonths(n).join("|")+")"};case"D":return {group:"day",pattern:"(\\d{1,2})"};case"DD":return {group:"day",pattern:"(\\d{2})"}}},t.prototype.toJSDate=function(){return this.dateInstance},t.prototype.toLocaleString=function(t,e){return this.dateInstance.toLocaleString(t,e)},t.prototype.toDateString=function(){return this.dateInstance.toDateString()},t.prototype.getSeconds=function(){return this.dateInstance.getSeconds()},t.prototype.getDay=function(){return this.dateInstance.getDay()},t.prototype.getTime=function(){return this.dateInstance.getTime()},t.prototype.getDate=function(){return this.dateInstance.getDate()},t.prototype.getMonth=function(){return this.dateInstance.getMonth()},t.prototype.getFullYear=function(){return this.dateInstance.getFullYear()},t.prototype.setMonth=function(t){return this.dateInstance.setMonth(t)},t.prototype.setHours=function(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.dateInstance.setHours(t,e,n,i);},t.prototype.setSeconds=function(t){return this.dateInstance.setSeconds(t)},t.prototype.setDate=function(t){return this.dateInstance.setDate(t)},t.prototype.setFullYear=function(t){return this.dateInstance.setFullYear(t)},t.prototype.getWeek=function(t){var e=new Date(this.timestamp()),n=(this.getDay()+(7-t))%7;e.setDate(e.getDate()-n);var i=e.getTime();return e.setMonth(0,1),e.getDay()!==t&&e.setMonth(0,1+(4-e.getDay()+7)%7),1+Math.ceil((i-e.getTime())/6048e5)},t.prototype.clone=function(){return new t(this.toJSDate())},t.prototype.isBetween=function(t,e,n){switch(void 0===n&&(n="()"),n){default:case"()":return this.timestamp()>t.getTime()&&this.timestamp()<e.getTime();case"[)":return this.timestamp()>=t.getTime()&&this.timestamp()<e.getTime();case"(]":return this.timestamp()>t.getTime()&&this.timestamp()<=e.getTime();case"[]":return this.timestamp()>=t.getTime()&&this.timestamp()<=e.getTime()}},t.prototype.isBefore=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return t.getTime()>this.getTime();case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return t.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")},t.prototype.isSameOrBefore=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return t.getTime()>=this.getTime();case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")},t.prototype.isAfter=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()>t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(t.getFullYear(),t.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>t.getFullYear()}throw new Error("isAfter: Invalid unit!")},t.prototype.isSameOrAfter=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()>=t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")},t.prototype.isSame=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()===t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")},t.prototype.add=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":this.setSeconds(this.getSeconds()+t);break;case"day":case"days":this.setDate(this.getDate()+t);break;case"month":case"months":this.setMonth(this.getMonth()+t);}return this},t.prototype.subtract=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":this.setSeconds(this.getSeconds()-t);break;case"day":case"days":this.setDate(this.getDate()-t);break;case"month":case"months":this.setMonth(this.getMonth()-t);}return this},t.prototype.diff=function(t,e){void 0===e&&(e="seconds");switch(e){default:case"second":case"seconds":return this.getTime()-t.getTime();case"day":case"days":return Math.round((this.timestamp()-t.getTime())/864e5);case"month":case"months":}},t.prototype.format=function(e,n){if(void 0===n&&(n="en-US"),"object"==typeof e)return e.output(this.clone().toJSDate());for(var i="",o=[],s=null;null!=(s=t.regex.exec(e));)"\\"!==s[1]&&o.push(s);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(var r=0,a=Object.entries(o);r<a.length;r++){var h=a[r],l=h[0],p=h[1],c=Number(l);i+=this.formatTokens(p[0],n),o[c+1]&&(i+=e.substring(p.index+p[0].length,o[c+1].index)),c===o.length-1&&(i+=e.substring(p.index+p[0].length));}}return i.replace(/\\/g,"")},t.prototype.timestamp=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()},t.prototype.formatTokens=function(e,n){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return ("0"+(this.getMonth()+1)).slice(-2);case"MMM":return t.shortMonths(n)[this.getMonth()];case"MMMM":return t.longMonths(n)[this.getMonth()];case"D":return String(this.getDate());case"DD":return ("0"+this.getDate()).slice(-2);default:return ""}},t.regex=/(\\)?(Y{2,4}|M{1,4}|D{1,2}|d{1,4})/g,t.MONTH_JS=[0,1,2,3,4,5,6,7,8,9,10,11],t}();e.DateTime=i;},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return (i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);})(t,e)},function(t,e){function n(){this.constructor=t;}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n);}),s=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),o=0;for(e=0;e<n;e++)for(var s=arguments[e],r=0,a=s.length;r<a;r++,o++)i[o]=s[r];return i};Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),a=n(0),h=n(3),l=n(2),p=function(t){function e(e){var n=t.call(this,e)||this;return n.preventClick=!1,n.bindEvents(),n}return o(e,t),e.prototype.scrollToDate=function(t){if(this.options.scrollToDate){var e=this.options.startDate instanceof a.DateTime?this.options.startDate.clone():null,n=this.options.endDate instanceof a.DateTime?this.options.endDate.clone():null;!this.options.startDate||t&&t!==this.options.element?t&&this.options.endDate&&t===this.options.elementEnd&&(n.setDate(1),this.options.numberOfMonths>1&&n.isAfter(e)&&n.setMonth(n.getMonth()-(this.options.numberOfMonths-1)),this.calendars[0]=n.clone()):(e.setDate(1),this.calendars[0]=e.clone());}},e.prototype.bindEvents=function(){document.addEventListener("click",this.onClick.bind(this),!0),this.ui=document.createElement("div"),this.ui.className=h.litepicker,this.ui.style.display="none",this.ui.addEventListener("mouseenter",this.onMouseEnter.bind(this),!0),this.ui.addEventListener("mouseleave",this.onMouseLeave.bind(this),!1),this.options.autoRefresh?(this.options.element instanceof HTMLElement&&this.options.element.addEventListener("keyup",this.onInput.bind(this),!0),this.options.elementEnd instanceof HTMLElement&&this.options.elementEnd.addEventListener("keyup",this.onInput.bind(this),!0)):(this.options.element instanceof HTMLElement&&this.options.element.addEventListener("change",this.onInput.bind(this),!0),this.options.elementEnd instanceof HTMLElement&&this.options.elementEnd.addEventListener("change",this.onInput.bind(this),!0)),this.options.parentEl?this.options.parentEl instanceof HTMLElement?this.options.parentEl.appendChild(this.ui):document.querySelector(this.options.parentEl).appendChild(this.ui):this.options.inlineMode?this.options.element instanceof HTMLInputElement?this.options.element.parentNode.appendChild(this.ui):this.options.element.appendChild(this.ui):document.body.appendChild(this.ui),this.updateInput(),this.init(),"function"==typeof this.options.setup&&this.options.setup.call(this,this),this.render(),this.options.inlineMode&&this.show();},e.prototype.updateInput=function(){if(this.options.element instanceof HTMLInputElement){var t=this.options.startDate,e=this.options.endDate;if(this.options.singleMode&&t)this.options.element.value=t.format(this.options.format,this.options.lang);else if(!this.options.singleMode&&t&&e){var n=t.format(this.options.format,this.options.lang),i=e.format(this.options.format,this.options.lang);this.options.elementEnd instanceof HTMLInputElement?(this.options.element.value=n,this.options.elementEnd.value=i):this.options.element.value=""+n+this.options.delimiter+i;}t||e||(this.options.element.value="",this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.value=""));}},e.prototype.isSamePicker=function(t){return t.closest("."+h.litepicker)===this.ui},e.prototype.shouldShown=function(t){return !t.disabled&&(t===this.options.element||this.options.elementEnd&&t===this.options.elementEnd)},e.prototype.shouldResetDatePicked=function(){return this.options.singleMode||2===this.datePicked.length},e.prototype.shouldSwapDatePicked=function(){return 2===this.datePicked.length&&this.datePicked[0].getTime()>this.datePicked[1].getTime()},e.prototype.shouldCheckLockDays=function(){return this.options.disallowLockDaysInRange&&2===this.datePicked.length},e.prototype.onClick=function(t){var e=t.target;if(t.target.shadowRoot&&(e=t.composedPath()[0]),e&&this.ui)if(this.shouldShown(e))this.show(e);else if(e.closest("."+h.litepicker)||!this.isShowning()){if(this.isSamePicker(e))if(this.emit("before:click",e),this.preventClick)this.preventClick=!1;else {if(e.classList.contains(h.dayItem)){if(t.preventDefault(),e.classList.contains(h.isLocked))return;if(this.shouldResetDatePicked()&&(this.datePicked.length=0),this.datePicked[this.datePicked.length]=new a.DateTime(e.dataset.time),this.shouldSwapDatePicked()){var n=this.datePicked[1].clone();this.datePicked[1]=this.datePicked[0].clone(),this.datePicked[0]=n.clone();}if(this.shouldCheckLockDays())l.rangeIsLocked(this.datePicked,this.options)&&(this.emit("error:range",this.datePicked),this.datePicked.length=0);return this.render(),this.emit.apply(this,s(["preselect"],s(this.datePicked).map((function(t){return t.clone()})))),void(this.options.autoApply&&(this.options.singleMode&&this.datePicked.length?(this.setDate(this.datePicked[0]),this.hide()):this.options.singleMode||2!==this.datePicked.length||(this.setDateRange(this.datePicked[0],this.datePicked[1]),this.hide())))}if(e.classList.contains(h.buttonPreviousMonth)){t.preventDefault();var i=0,o=this.options.switchingMonths||this.options.numberOfMonths;if(this.options.splitView){var r=e.closest("."+h.monthItem);i=l.findNestedMonthItem(r),o=1;}return this.calendars[i].setMonth(this.calendars[i].getMonth()-o),this.gotoDate(this.calendars[i],i),void this.emit("change:month",this.calendars[i],i)}if(e.classList.contains(h.buttonNextMonth)){t.preventDefault();i=0,o=this.options.switchingMonths||this.options.numberOfMonths;if(this.options.splitView){r=e.closest("."+h.monthItem);i=l.findNestedMonthItem(r),o=1;}return this.calendars[i].setMonth(this.calendars[i].getMonth()+o),this.gotoDate(this.calendars[i],i),void this.emit("change:month",this.calendars[i],i)}e.classList.contains(h.buttonCancel)&&(t.preventDefault(),this.hide(),this.emit("button:cancel")),e.classList.contains(h.buttonApply)&&(t.preventDefault(),this.options.singleMode&&this.datePicked.length?this.setDate(this.datePicked[0]):this.options.singleMode||2!==this.datePicked.length||this.setDateRange(this.datePicked[0],this.datePicked[1]),this.hide(),this.emit("button:apply",this.options.startDate,this.options.endDate));}}else this.hide();},e.prototype.showTooltip=function(t,e){var n=this.ui.querySelector("."+h.containerTooltip);n.style.visibility="visible",n.innerHTML=e;var i=this.ui.getBoundingClientRect(),o=n.getBoundingClientRect(),s=t.getBoundingClientRect(),r=s.top,a=s.left;if(this.options.inlineMode&&this.options.parentEl){var l=this.ui.parentNode.getBoundingClientRect();r-=l.top,a-=l.left;}else r-=i.top,a-=i.left;r-=o.height,a-=o.width/2,a+=s.width/2,n.style.top=r+"px",n.style.left=a+"px",this.emit("tooltip",n,t);},e.prototype.hideTooltip=function(){this.ui.querySelector("."+h.containerTooltip).style.visibility="hidden";},e.prototype.shouldAllowMouseEnter=function(t){return !this.options.singleMode&&!t.classList.contains(h.isLocked)},e.prototype.shouldAllowRepick=function(){return this.options.elementEnd&&this.options.allowRepick&&this.options.startDate&&this.options.endDate},e.prototype.isDayItem=function(t){return t.classList.contains(h.dayItem)},e.prototype.onMouseEnter=function(t){var e=this,n=t.target;if(this.isDayItem(n)&&this.shouldAllowMouseEnter(n)){if(this.shouldAllowRepick()&&(this.triggerElement===this.options.element?this.datePicked[0]=this.options.endDate.clone():this.triggerElement===this.options.elementEnd&&(this.datePicked[0]=this.options.startDate.clone())),1!==this.datePicked.length)return;var i=this.ui.querySelector("."+h.dayItem+'[data-time="'+this.datePicked[0].getTime()+'"]'),o=this.datePicked[0].clone(),s=new a.DateTime(n.dataset.time),r=!1;if(o.getTime()>s.getTime()){var l=o.clone();o=s.clone(),s=l.clone(),r=!0;}if(Array.prototype.slice.call(this.ui.querySelectorAll("."+h.dayItem)).forEach((function(t){var n=new a.DateTime(t.dataset.time),i=e.renderDay(n);n.isBetween(o,s)&&i.classList.add(h.isInRange),t.className=i.className;})),n.classList.add(h.isEndDate),r?(i&&i.classList.add(h.isFlipped),n.classList.add(h.isFlipped)):(i&&i.classList.remove(h.isFlipped),n.classList.remove(h.isFlipped)),this.options.showTooltip){var p=s.diff(o,"day")+1;if("function"==typeof this.options.tooltipNumber&&(p=this.options.tooltipNumber.call(this,p)),p>0){var c=this.pluralSelector(p),d=p+" "+(this.options.tooltipText[c]?this.options.tooltipText[c]:"["+c+"]");this.showTooltip(n,d);var u=window.navigator.userAgent,m=/(iphone|ipad)/i.test(u),f=/OS 1([0-2])/i.test(u);m&&f&&n.dispatchEvent(new Event("click"));}else this.hideTooltip();}}},e.prototype.onMouseLeave=function(t){this.options.allowRepick&&(!this.options.allowRepick||this.options.startDate||this.options.endDate)&&(this.datePicked.length=0,this.render());},e.prototype.onInput=function(t){var e=this.parseInput(),n=e[0],i=e[1],o=this.options.format;if(this.options.elementEnd?n instanceof a.DateTime&&i instanceof a.DateTime&&n.format(o)===this.options.element.value&&i.format(o)===this.options.elementEnd.value:this.options.singleMode?n instanceof a.DateTime&&n.format(o)===this.options.element.value:n instanceof a.DateTime&&i instanceof a.DateTime&&""+n.format(o)+this.options.delimiter+i.format(o)===this.options.element.value){if(i&&n.getTime()>i.getTime()){var s=n.clone();n=i.clone(),i=s.clone();}this.options.startDate=new a.DateTime(n,this.options.format,this.options.lang),i&&(this.options.endDate=new a.DateTime(i,this.options.format,this.options.lang)),this.updateInput(),this.render();var r=n.clone(),h=0;(this.options.elementEnd?n.format(o)===t.target.value:t.target.value.startsWith(n.format(o)))||(r=i.clone(),h=this.options.numberOfMonths-1),this.emit("selected",this.getStartDate(),this.getEndDate()),this.gotoDate(r,h);}},e}(r.Calendar);e.Litepicker=p;},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.findNestedMonthItem=function(t){for(var e=t.parentNode.childNodes,n=0;n<e.length;n+=1){if(e.item(n)===t)return n}return 0},e.dateIsLocked=function(t,e,n){var i=!1;return e.lockDays.length&&(i=e.lockDays.filter((function(n){return n instanceof Array?t.isBetween(n[0],n[1],e.lockDaysInclusivity):n.isSame(t,"day")})).length),i||"function"!=typeof e.lockDaysFilter||(i=e.lockDaysFilter.call(this,t.clone(),null,n)),i},e.rangeIsLocked=function(t,e){var n=!1;return e.lockDays.length&&(n=e.lockDays.filter((function(n){if(n instanceof Array){var i=t[0].toDateString()===n[0].toDateString()&&t[1].toDateString()===n[1].toDateString();return n[0].isBetween(t[0],t[1],e.lockDaysInclusivity)||n[1].isBetween(t[0],t[1],e.lockDaysInclusivity)||i}return n.isBetween(t[0],t[1],e.lockDaysInclusivity)})).length),n||"function"!=typeof e.lockDaysFilter||(n=e.lockDaysFilter.call(this,t[0].clone(),t[1].clone(),t)),n};},function(t,e,n){t.exports={showWeekNumbers:"show-week-numbers",litepicker:"litepicker",containerMain:"container__main",containerMonths:"container__months",columns2:"columns-2",columns3:"columns-3",columns4:"columns-4",splitView:"split-view",monthItemHeader:"month-item-header",buttonPreviousMonth:"button-previous-month",buttonNextMonth:"button-next-month",monthItem:"month-item",monthItemName:"month-item-name",monthItemYear:"month-item-year",resetButton:"reset-button",monthItemWeekdaysRow:"month-item-weekdays-row",noPreviousMonth:"no-previous-month",noNextMonth:"no-next-month",containerDays:"container__days",dayItem:"day-item",isToday:"is-today",isLocked:"is-locked",isInRange:"is-in-range",isStartDate:"is-start-date",isFlipped:"is-flipped",isEndDate:"is-end-date",isHighlighted:"is-highlighted",weekNumber:"week-number",containerFooter:"container__footer",previewDateRange:"preview-date-range",buttonCancel:"button-cancel",buttonApply:"button-apply",containerTooltip:"container__tooltip"};},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);e.Litepicker=i.Litepicker,n(8),window.Litepicker=i.Litepicker,e.default=i.Litepicker;},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return (i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);})(t,e)},function(t,e){function n(){this.constructor=t;}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n);});Object.defineProperty(e,"__esModule",{value:!0});var s=n(6),r=n(0),a=n(3),h=n(2),l=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.render=function(){var t=this;this.emit("before:render",this.ui);var e=document.createElement("div");e.className=a.containerMain;var n=document.createElement("div");n.className=a.containerMonths,a["columns"+this.options.numberOfColumns]&&(n.classList.remove(a.columns2,a.columns3,a.columns4),n.classList.add(a["columns"+this.options.numberOfColumns])),this.options.splitView&&n.classList.add(a.splitView),this.options.showWeekNumbers&&n.classList.add(a.showWeekNumbers);for(var i=this.calendars[0].clone(),o=i.getMonth(),s=i.getMonth()+this.options.numberOfMonths,r=0,h=o;h<s;h+=1){var l=i.clone();l.setDate(1),l.setHours(0,0,0,0),this.options.splitView?l=this.calendars[r].clone():l.setMonth(h),n.appendChild(this.renderMonth(l,r)),r+=1;}if(this.ui.innerHTML="",e.appendChild(n),this.options.resetButton){var p=void 0;"function"==typeof this.options.resetButton?p=this.options.resetButton.call(this):((p=document.createElement("button")).type="button",p.className=a.resetButton,p.innerHTML=this.options.buttonText.reset),p.addEventListener("click",(function(e){e.preventDefault(),t.clearSelection();})),e.querySelector("."+a.monthItem+":last-child").querySelector("."+a.monthItemHeader).appendChild(p);}this.ui.appendChild(e),this.options.autoApply&&!this.options.footerHTML||this.ui.appendChild(this.renderFooter()),this.options.showTooltip&&this.ui.appendChild(this.renderTooltip()),this.ui.dataset.plugins=(this.options.plugins||[]).join("|"),this.emit("render",this.ui);},e.prototype.renderMonth=function(t,e){var n=this,i=t.clone(),o=32-new Date(i.getFullYear(),i.getMonth(),32).getDate(),s=document.createElement("div");s.className=a.monthItem;var l=document.createElement("div");l.className=a.monthItemHeader;var p=document.createElement("div");if(this.options.dropdowns.months){var c=document.createElement("select");c.className=a.monthItemName;for(var d=0;d<12;d+=1){var u=document.createElement("option"),m=new r.DateTime(new Date(t.getFullYear(),d,2,0,0,0)),f=new r.DateTime(new Date(t.getFullYear(),d,1,0,0,0));u.value=String(d),u.text=m.toLocaleString(this.options.lang,{month:"long"}),u.disabled=this.options.minDate&&f.isBefore(new r.DateTime(this.options.minDate),"month")||this.options.maxDate&&f.isAfter(new r.DateTime(this.options.maxDate),"month"),u.selected=f.getMonth()===t.getMonth(),c.appendChild(u);}c.addEventListener("change",(function(t){var e=t.target,i=0;if(n.options.splitView){var o=e.closest("."+a.monthItem);i=h.findNestedMonthItem(o);}n.calendars[i].setMonth(Number(e.value)),n.render(),n.emit("change:month",n.calendars[i],i,t);})),p.appendChild(c);}else {(m=document.createElement("strong")).className=a.monthItemName,m.innerHTML=t.toLocaleString(this.options.lang,{month:"long"}),p.appendChild(m);}if(this.options.dropdowns.years){var g=document.createElement("select");g.className=a.monthItemYear;var y=this.options.dropdowns.minYear,v=this.options.dropdowns.maxYear?this.options.dropdowns.maxYear:(new Date).getFullYear();if(t.getFullYear()>v)(u=document.createElement("option")).value=String(t.getFullYear()),u.text=String(t.getFullYear()),u.selected=!0,u.disabled=!0,g.appendChild(u);for(d=v;d>=y;d-=1){var u=document.createElement("option"),D=new r.DateTime(new Date(d,0,1,0,0,0));u.value=String(d),u.text=String(d),u.disabled=this.options.minDate&&D.isBefore(new r.DateTime(this.options.minDate),"year")||this.options.maxDate&&D.isAfter(new r.DateTime(this.options.maxDate),"year"),u.selected=t.getFullYear()===d,g.appendChild(u);}if(t.getFullYear()<y)(u=document.createElement("option")).value=String(t.getFullYear()),u.text=String(t.getFullYear()),u.selected=!0,u.disabled=!0,g.appendChild(u);if("asc"===this.options.dropdowns.years){var w=Array.prototype.slice.call(g.childNodes).reverse();g.innerHTML="",w.forEach((function(t){t.innerHTML=t.value,g.appendChild(t);}));}g.addEventListener("change",(function(t){var e=t.target,i=0;if(n.options.splitView){var o=e.closest("."+a.monthItem);i=h.findNestedMonthItem(o);}n.calendars[i].setFullYear(Number(e.value)),n.render(),n.emit("change:year",n.calendars[i],i,t);})),p.appendChild(g);}else {var M=document.createElement("span");M.className=a.monthItemYear,M.innerHTML=String(t.getFullYear()),p.appendChild(M);}var T=document.createElement("button");T.type="button",T.className=a.buttonPreviousMonth,T.innerHTML=this.options.buttonText.previousMonth;var k=document.createElement("button");k.type="button",k.className=a.buttonNextMonth,k.innerHTML=this.options.buttonText.nextMonth,l.appendChild(T),l.appendChild(p),l.appendChild(k),this.options.minDate&&i.isSameOrBefore(new r.DateTime(this.options.minDate),"month")&&s.classList.add(a.noPreviousMonth),this.options.maxDate&&i.isSameOrAfter(new r.DateTime(this.options.maxDate),"month")&&s.classList.add(a.noNextMonth);var b=document.createElement("div");b.className=a.monthItemWeekdaysRow,this.options.showWeekNumbers&&(b.innerHTML="<div>W</div>");for(var L=1;L<=7;L+=1){var E=3+this.options.firstDay+L,S=document.createElement("div");S.innerHTML=this.weekdayName(E),S.title=this.weekdayName(E,"long"),b.appendChild(S);}var P=document.createElement("div");P.className=a.containerDays;var x=this.calcSkipDays(i);this.options.showWeekNumbers&&x&&P.appendChild(this.renderWeekNumber(i));for(var I=0;I<x;I+=1){var _=document.createElement("div");P.appendChild(_);}for(I=1;I<=o;I+=1)i.setDate(I),this.options.showWeekNumbers&&i.getDay()===this.options.firstDay&&P.appendChild(this.renderWeekNumber(i)),P.appendChild(this.renderDay(i));return s.appendChild(l),s.appendChild(b),s.appendChild(P),this.emit("render:month",s,t),s},e.prototype.renderDay=function(t){t.setHours();var e=document.createElement("div");if(e.className=a.dayItem,e.innerHTML=String(t.getDate()),e.dataset.time=String(t.getTime()),t.toDateString()===(new Date).toDateString()&&e.classList.add(a.isToday),this.datePicked.length)this.datePicked[0].toDateString()===t.toDateString()&&(e.classList.add(a.isStartDate),this.options.singleMode&&e.classList.add(a.isEndDate)),2===this.datePicked.length&&this.datePicked[1].toDateString()===t.toDateString()&&e.classList.add(a.isEndDate),2===this.datePicked.length&&t.isBetween(this.datePicked[0],this.datePicked[1])&&e.classList.add(a.isInRange);else if(this.options.startDate){var n=this.options.startDate,i=this.options.endDate;n.toDateString()===t.toDateString()&&(e.classList.add(a.isStartDate),this.options.singleMode&&e.classList.add(a.isEndDate)),i&&i.toDateString()===t.toDateString()&&e.classList.add(a.isEndDate),n&&i&&t.isBetween(n,i)&&e.classList.add(a.isInRange);}if(this.options.minDate&&t.isBefore(new r.DateTime(this.options.minDate))&&e.classList.add(a.isLocked),this.options.maxDate&&t.isAfter(new r.DateTime(this.options.maxDate))&&e.classList.add(a.isLocked),this.options.minDays>1&&1===this.datePicked.length){var o=this.options.minDays-1,s=this.datePicked[0].clone().subtract(o,"day"),l=this.datePicked[0].clone().add(o,"day");t.isBetween(s,this.datePicked[0],"(]")&&e.classList.add(a.isLocked),t.isBetween(this.datePicked[0],l,"[)")&&e.classList.add(a.isLocked);}if(this.options.maxDays&&1===this.datePicked.length){var p=this.options.maxDays;s=this.datePicked[0].clone().subtract(p,"day"),l=this.datePicked[0].clone().add(p,"day");t.isSameOrBefore(s)&&e.classList.add(a.isLocked),t.isSameOrAfter(l)&&e.classList.add(a.isLocked);}(this.options.selectForward&&1===this.datePicked.length&&t.isBefore(this.datePicked[0])&&e.classList.add(a.isLocked),this.options.selectBackward&&1===this.datePicked.length&&t.isAfter(this.datePicked[0])&&e.classList.add(a.isLocked),h.dateIsLocked(t,this.options,this.datePicked)&&e.classList.add(a.isLocked),this.options.highlightedDays.length)&&(this.options.highlightedDays.filter((function(e){return e instanceof Array?t.isBetween(e[0],e[1],"[]"):e.isSame(t,"day")})).length&&e.classList.add(a.isHighlighted));return e.tabIndex=e.classList.contains("is-locked")?-1:0,this.emit("render:day",e,t),e},e.prototype.renderFooter=function(){var t=document.createElement("div");if(t.className=a.containerFooter,this.options.footerHTML?t.innerHTML=this.options.footerHTML:t.innerHTML='\n <span class="'+a.previewDateRange+'"></span>\n <button type="button" class="'+a.buttonCancel+'">'+this.options.buttonText.cancel+'</button>\n <button type="button" class="'+a.buttonApply+'">'+this.options.buttonText.apply+"</button>\n ",this.options.singleMode){if(1===this.datePicked.length){var e=this.datePicked[0].format(this.options.format,this.options.lang);t.querySelector("."+a.previewDateRange).innerHTML=e;}}else if(1===this.datePicked.length&&t.querySelector("."+a.buttonApply).setAttribute("disabled",""),2===this.datePicked.length){e=this.datePicked[0].format(this.options.format,this.options.lang);var n=this.datePicked[1].format(this.options.format,this.options.lang);t.querySelector("."+a.previewDateRange).innerHTML=""+e+this.options.delimiter+n;}return this.emit("render:footer",t),t},e.prototype.renderWeekNumber=function(t){var e=document.createElement("div"),n=t.getWeek(this.options.firstDay);return e.className=a.weekNumber,e.innerHTML=53===n&&0===t.getMonth()?"53 / 1":n,e},e.prototype.renderTooltip=function(){var t=document.createElement("div");return t.className=a.containerTooltip,t},e.prototype.weekdayName=function(t,e){return void 0===e&&(e="short"),new Date(1970,0,t,12,0,0,0).toLocaleString(this.options.lang,{weekday:e})},e.prototype.calcSkipDays=function(t){var e=t.getDay()-this.options.firstDay;return e<0&&(e+=7),e},e}(s.LPCore);e.Calendar=l;},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return (i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);})(t,e)},function(t,e){function n(){this.constructor=t;}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n);}),s=this&&this.__assign||function(){return (s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),a=n(0),h=n(1),l=function(t){function e(e){var n=t.call(this)||this;n.datePicked=[],n.calendars=[],n.options={element:null,elementEnd:null,parentEl:null,firstDay:1,format:"YYYY-MM-DD",lang:"en-US",delimiter:" - ",numberOfMonths:1,numberOfColumns:1,startDate:null,endDate:null,zIndex:9999,position:"auto",selectForward:!1,selectBackward:!1,splitView:!1,inlineMode:!1,singleMode:!0,autoApply:!0,allowRepick:!1,showWeekNumbers:!1,showTooltip:!0,scrollToDate:!0,mobileFriendly:!0,resetButton:!1,autoRefresh:!1,lockDaysFormat:"YYYY-MM-DD",lockDays:[],disallowLockDaysInRange:!1,lockDaysInclusivity:"[]",highlightedDaysFormat:"YYYY-MM-DD",highlightedDays:[],dropdowns:{minYear:1990,maxYear:null,months:!1,years:!1},buttonText:{apply:"Apply",cancel:"Cancel",previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',reset:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/>\n </svg>'},tooltipText:{one:"day",other:"days"}},n.options=s(s({},n.options),e.element.dataset),Object.keys(n.options).forEach((function(t){"true"!==n.options[t]&&"false"!==n.options[t]||(n.options[t]="true"===n.options[t]);}));var i=s(s({},n.options.dropdowns),e.dropdowns),o=s(s({},n.options.buttonText),e.buttonText),r=s(s({},n.options.tooltipText),e.tooltipText);n.options=s(s({},n.options),e),n.options.dropdowns=s({},i),n.options.buttonText=s({},o),n.options.tooltipText=s({},r),n.options.elementEnd||(n.options.allowRepick=!1),n.options.lockDays.length&&(n.options.lockDays=a.DateTime.convertArray(n.options.lockDays,n.options.lockDaysFormat)),n.options.highlightedDays.length&&(n.options.highlightedDays=a.DateTime.convertArray(n.options.highlightedDays,n.options.highlightedDaysFormat));var h=n.parseInput(),l=h[0],p=h[1];n.options.startDate&&(n.options.singleMode||n.options.endDate)&&(l=new a.DateTime(n.options.startDate,n.options.format,n.options.lang)),l&&n.options.endDate&&(p=new a.DateTime(n.options.endDate,n.options.format,n.options.lang)),l instanceof a.DateTime&&!isNaN(l.getTime())&&(n.options.startDate=l),n.options.startDate&&p instanceof a.DateTime&&!isNaN(p.getTime())&&(n.options.endDate=p),!n.options.singleMode||n.options.startDate instanceof a.DateTime||(n.options.startDate=null),n.options.singleMode||n.options.startDate instanceof a.DateTime&&n.options.endDate instanceof a.DateTime||(n.options.startDate=null,n.options.endDate=null);for(var c=0;c<n.options.numberOfMonths;c+=1){var d=n.options.startDate instanceof a.DateTime?n.options.startDate.clone():new a.DateTime;if(!n.options.startDate&&(0===c||n.options.splitView)){var u=n.options.maxDate?new a.DateTime(n.options.maxDate):null,m=n.options.minDate?new a.DateTime(n.options.minDate):null,f=n.options.numberOfMonths-1;m&&u&&d.isAfter(u)?(d=m.clone()).setDate(1):!m&&u&&d.isAfter(u)&&((d=u.clone()).setDate(1),d.setMonth(d.getMonth()-f));}d.setDate(1),d.setMonth(d.getMonth()+c),n.calendars[c]=d;}if(n.options.showTooltip)if(n.options.tooltipPluralSelector)n.pluralSelector=n.options.tooltipPluralSelector;else try{var g=new Intl.PluralRules(n.options.lang);n.pluralSelector=g.select.bind(g);}catch(t){n.pluralSelector=function(t){return 0===Math.abs(t)?"one":"other"};}return n}return o(e,t),e.add=function(t,e){h.Litepicker.prototype[t]=e;},e.prototype.DateTime=function(t,e){return t?new a.DateTime(t,e):new a.DateTime},e.prototype.init=function(){var t=this;this.options.plugins&&this.options.plugins.length&&this.options.plugins.forEach((function(e){h.Litepicker.prototype.hasOwnProperty(e)?h.Litepicker.prototype[e].init.call(t,t):console.warn("Litepicker: plugin «"+e+"» not found.");}));},e.prototype.parseInput=function(){var t=this.options.delimiter,e=new RegExp(""+t),n=this.options.element instanceof HTMLInputElement?this.options.element.value.split(t):[];if(this.options.elementEnd){if(this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length)return [new a.DateTime(this.options.element.value,this.options.format),new a.DateTime(this.options.elementEnd.value,this.options.format)]}else if(this.options.singleMode){if(this.options.element instanceof HTMLInputElement&&this.options.element.value.length)return [new a.DateTime(this.options.element.value,this.options.format)]}else if(this.options.element instanceof HTMLInputElement&&e.test(this.options.element.value)&&n.length&&n.length%2==0){var i=n.slice(0,n.length/2).join(t),o=n.slice(n.length/2).join(t);return [new a.DateTime(i,this.options.format),new a.DateTime(o,this.options.format)]}return []},e.prototype.isShowning=function(){return this.ui&&"none"!==this.ui.style.display},e.prototype.findPosition=function(t){var e=t.getBoundingClientRect(),n=this.ui.getBoundingClientRect(),i=this.options.position.split(" "),o=window.scrollX||window.pageXOffset,s=window.scrollY||window.pageYOffset,r=0,a=0;if("auto"!==i[0]&&/top|bottom/.test(i[0]))r=e[i[0]]+s,"top"===i[0]&&(r-=n.height);else {r=e.bottom+s;var h=e.bottom+n.height>window.innerHeight,l=e.top+s-n.height>=n.height;h&&l&&(r=e.top+s-n.height);}if(/left|right/.test(i[0])||i[1]&&"auto"!==i[1]&&/left|right/.test(i[1]))a=/left|right/.test(i[0])?e[i[0]]+o:e[i[1]]+o,"right"!==i[0]&&"right"!==i[1]||(a-=n.width);else {a=e.left+o;h=e.left+n.width>window.innerWidth;var p=e.right+o-n.width>=0;h&&p&&(a=e.right+o-n.width);}return {left:a,top:r}},e}(r.EventEmitter);e.LPCore=l;},function(t,e,n){var i,o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this);}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function p(t,e,n,i){var o,s,r,a;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),r=s[e]),void 0===r)r=s[e]=n,++t._eventsCount;else if("function"==typeof r?r=s[e]=i?[n,r]:[r,n]:i?r.unshift(n):r.push(n),(o=l(t))>0&&r.length>o&&!r.warned){r.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=r.length,a=h,console&&console.warn&&console.warn(a);}return t}function c(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,t));}function d(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=c.bind(i);return o.listener=n,i.wrapFn=o,o}function u(t,e,n){var i=t._events;if(void 0===i)return [];var o=i[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):f(o,o.length)}function m(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t;}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0;},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return !1;if(i){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var h=o[t];if(void 0===h)return !1;if("function"==typeof h)s(h,this,e);else {var l=h.length,p=f(h,l);for(n=0;n<l;++n)s(p[n],this,e);}return !0},a.prototype.addListener=function(t,e){return p(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return p(this,t,e,!0)},a.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var n,i,o,s,r;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){r=n[s].listener,o=s;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop();}(n,o),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,r||e);}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,s=Object.keys(n);for(i=0;i<s.length;++i)"removeListener"!==(o=s[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return u(this,t,!0)},a.prototype.rawListeners=function(t){return u(this,t,!1)},a.listenerCount=function(t,e){return "function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};},function(t,e,n){var i=this&&this.__assign||function(){return (i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=n(1),r=n(2);s.Litepicker.prototype.show=function(t){void 0===t&&(t=null),this.emit("before:show",t);var e=t||this.options.element;if(this.triggerElement=e,!this.isShowning()){if(this.options.inlineMode)return this.ui.style.position="relative",this.ui.style.display="inline-block",this.ui.style.top=null,this.ui.style.left=null,this.ui.style.bottom=null,void(this.ui.style.right=null);this.scrollToDate(t),this.render(),this.ui.style.position="absolute",this.ui.style.display="block",this.ui.style.zIndex=this.options.zIndex;var n=this.findPosition(e);this.ui.style.top=n.top+"px",this.ui.style.left=n.left+"px",this.ui.style.right=null,this.ui.style.bottom=null,this.emit("show",t);}},s.Litepicker.prototype.hide=function(){this.isShowning()&&(this.datePicked.length=0,this.updateInput(),this.options.inlineMode?this.render():(this.ui.style.display="none",this.emit("hide")));},s.Litepicker.prototype.getDate=function(){return this.getStartDate()},s.Litepicker.prototype.getStartDate=function(){return this.options.startDate?this.options.startDate.clone():null},s.Litepicker.prototype.getEndDate=function(){return this.options.endDate?this.options.endDate.clone():null},s.Litepicker.prototype.setDate=function(t,e){void 0===e&&(e=!1);var n=new o.DateTime(t,this.options.format,this.options.lang);r.dateIsLocked(n,this.options,[n])&&!e?this.emit("error:date",n):(this.setStartDate(t),this.options.inlineMode&&this.render(),this.emit("selected",this.getDate()));},s.Litepicker.prototype.setStartDate=function(t){t&&(this.options.startDate=new o.DateTime(t,this.options.format,this.options.lang),this.updateInput());},s.Litepicker.prototype.setEndDate=function(t){t&&(this.options.endDate=new o.DateTime(t,this.options.format,this.options.lang),this.options.startDate.getTime()>this.options.endDate.getTime()&&(this.options.endDate=this.options.startDate.clone(),this.options.startDate=new o.DateTime(t,this.options.format,this.options.lang)),this.updateInput());},s.Litepicker.prototype.setDateRange=function(t,e,n){void 0===n&&(n=!1),this.triggerElement=void 0;var i=new o.DateTime(t,this.options.format,this.options.lang),s=new o.DateTime(e,this.options.format,this.options.lang);(this.options.disallowLockDaysInRange?r.rangeIsLocked([i,s],this.options):r.dateIsLocked(i,this.options,[i,s])||r.dateIsLocked(s,this.options,[i,s]))&&!n?this.emit("error:range",[i,s]):(this.setStartDate(i),this.setEndDate(s),this.options.inlineMode&&this.render(),this.updateInput(),this.emit("selected",this.getStartDate(),this.getEndDate()));},s.Litepicker.prototype.gotoDate=function(t,e){void 0===e&&(e=0);var n=new o.DateTime(t);n.setDate(1),this.calendars[e]=n.clone(),this.render();},s.Litepicker.prototype.setLockDays=function(t){this.options.lockDays=o.DateTime.convertArray(t,this.options.lockDaysFormat),this.render();},s.Litepicker.prototype.setHighlightedDays=function(t){this.options.highlightedDays=o.DateTime.convertArray(t,this.options.highlightedDaysFormat),this.render();},s.Litepicker.prototype.setOptions=function(t){delete t.element,delete t.elementEnd,delete t.parentEl,t.startDate&&(t.startDate=new o.DateTime(t.startDate,this.options.format,this.options.lang)),t.endDate&&(t.endDate=new o.DateTime(t.endDate,this.options.format,this.options.lang));var e=i(i({},this.options.dropdowns),t.dropdowns),n=i(i({},this.options.buttonText),t.buttonText),s=i(i({},this.options.tooltipText),t.tooltipText);this.options=i(i({},this.options),t),this.options.dropdowns=i({},e),this.options.buttonText=i({},n),this.options.tooltipText=i({},s),!this.options.singleMode||this.options.startDate instanceof o.DateTime||(this.options.startDate=null,this.options.endDate=null),this.options.singleMode||this.options.startDate instanceof o.DateTime&&this.options.endDate instanceof o.DateTime||(this.options.startDate=null,this.options.endDate=null);for(var r=0;r<this.options.numberOfMonths;r+=1){var a=this.options.startDate?this.options.startDate.clone():new o.DateTime;a.setDate(1),a.setMonth(a.getMonth()+r),this.calendars[r]=a;}this.options.lockDays.length&&(this.options.lockDays=o.DateTime.convertArray(this.options.lockDays,this.options.lockDaysFormat)),this.options.highlightedDays.length&&(this.options.highlightedDays=o.DateTime.convertArray(this.options.highlightedDays,this.options.highlightedDaysFormat)),this.render(),this.options.inlineMode&&this.show(),this.updateInput();},s.Litepicker.prototype.clearSelection=function(){this.options.startDate=null,this.options.endDate=null,this.datePicked.length=0,this.updateInput(),this.isShowning()&&this.render(),this.emit("clear:selection");},s.Litepicker.prototype.destroy=function(){this.ui&&this.ui.parentNode&&(this.ui.parentNode.removeChild(this.ui),this.ui=null),this.emit("destroy");};}])}));
|
|
963
|
-
});
|
|
756
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isMobileDevice", void 0);
|
|
757
|
+
__decorate$f([
|
|
758
|
+
MapToComponentField()
|
|
759
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isCalendarShow", void 0);
|
|
760
|
+
__decorate$f([
|
|
761
|
+
MapToComponentField()
|
|
762
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isDateDisabled", void 0);
|
|
763
|
+
__decorate$f([
|
|
764
|
+
MapToComponentField()
|
|
765
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "allowRepick", void 0);
|
|
766
|
+
__decorate$f([
|
|
767
|
+
MapToComponentField()
|
|
768
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "monthYearChangeEventEmitter", void 0);
|
|
769
|
+
__decorate$f([
|
|
770
|
+
MapToComponentField()
|
|
771
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "vegaDatePickerValueController", void 0);
|
|
772
|
+
__decorate$f([
|
|
773
|
+
MapToComponentField()
|
|
774
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "calendarOpenStateController", void 0);
|
|
775
|
+
__decorate$f([
|
|
776
|
+
MapToComponentMethod('componentDidLoad')
|
|
777
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "componentDidLoad", null);
|
|
964
778
|
|
|
965
|
-
var __decorate$
|
|
966
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
967
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
968
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
969
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
970
|
-
};
|
|
971
|
-
class VegaDatePickerCalendarRenderer extends VegaSlimmer {
|
|
972
|
-
constructor() {
|
|
973
|
-
super(...arguments);
|
|
974
|
-
this.startMonthYearHeaderRef = {
|
|
975
|
-
month: null,
|
|
976
|
-
year: null,
|
|
977
|
-
};
|
|
978
|
-
this.endMonthYearHeaderRef = {
|
|
979
|
-
month: null,
|
|
980
|
-
year: null,
|
|
981
|
-
};
|
|
982
|
-
this.alterLitePickerHeader = (ui) => {
|
|
983
|
-
if (this.showYearMonthDropdowns) {
|
|
984
|
-
this.monthYearDropdownRenderer.renderMonthYearDropdowns(this.datePicker);
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
this.renderMonthName(ui);
|
|
988
|
-
this.setYearMonthHeaderRef(ui);
|
|
989
|
-
}
|
|
990
|
-
this.renderWeekdays(ui);
|
|
991
|
-
this.renderPrevAndNextMonthButtons(ui);
|
|
992
|
-
};
|
|
993
|
-
this.alterLitePickerFooter = (ui) => {
|
|
994
|
-
this.clearButton && this.renderClearButton(ui);
|
|
995
|
-
};
|
|
996
|
-
this.alterLitePickerHeight = (ui) => {
|
|
997
|
-
if (this.dropdownConfig.staticHeight === false) {
|
|
998
|
-
ui.classList.remove('static-height');
|
|
999
|
-
}
|
|
1000
|
-
else {
|
|
1001
|
-
ui.classList.add('static-height');
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
/**
|
|
1005
|
-
* Update the weekday to a single letter to adapt the vega UI design. e.g. Mon to M | Tue to T | Wed to W
|
|
1006
|
-
* The below method is e2e-test covered in
|
|
1007
|
-
* @see{module:vega-date-picker-render-ui-with-single}
|
|
1008
|
-
*/
|
|
1009
|
-
/* istanbul ignore next */
|
|
1010
|
-
this.renderWeekdays = (ui) => {
|
|
1011
|
-
ui.querySelectorAll('.month-item-weekdays-row').forEach((row) => {
|
|
1012
|
-
Array.from(row.children).forEach((item) => {
|
|
1013
|
-
item.innerText = item.innerText.replace(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/, (match) => this.translationSlimmer.t(`${match}-short`));
|
|
1014
|
-
});
|
|
1015
|
-
});
|
|
1016
|
-
};
|
|
1017
|
-
/**
|
|
1018
|
-
* Update the previous/next month buttons icon to adapt the vega UI design
|
|
1019
|
-
* The below method is e2e-test covered in
|
|
1020
|
-
* @see{module:vega-date-picker-render-ui-with-single}
|
|
1021
|
-
*/
|
|
1022
|
-
/* istanbul ignore next */
|
|
1023
|
-
this.renderPrevAndNextMonthButtons = (ui) => {
|
|
1024
|
-
ui.querySelectorAll('.button-previous-month').forEach((item) => {
|
|
1025
|
-
/**
|
|
1026
|
-
* Calendar will flash when using vega-icon here. Hence use svg here for now
|
|
1027
|
-
* TODO: Use vega-icon instead when deprecated litepicker in https://gethired.atlassian.net/browse/VD-2534
|
|
1028
|
-
*/
|
|
1029
|
-
item.innerHTML = Icons['chevron-left'].icon;
|
|
1030
|
-
item.addEventListener('click', () => {
|
|
1031
|
-
this.emitMonthYearChangeEvent();
|
|
1032
|
-
});
|
|
1033
|
-
});
|
|
1034
|
-
ui.querySelectorAll('.button-next-month').forEach((item) => {
|
|
1035
|
-
item.innerHTML = Icons['chevron-right'].icon;
|
|
1036
|
-
item.addEventListener('click', () => {
|
|
1037
|
-
this.emitMonthYearChangeEvent();
|
|
1038
|
-
});
|
|
1039
|
-
});
|
|
1040
|
-
};
|
|
1041
|
-
this.renderClearButton = (ui) => {
|
|
1042
|
-
// eslint-disable-next-line no-restricted-globals
|
|
1043
|
-
const footerContainer = document.createElement('div');
|
|
1044
|
-
footerContainer.className = 'footer-container';
|
|
1045
|
-
// eslint-disable-next-line no-restricted-globals
|
|
1046
|
-
const clearButton = document.createElement('vega-button-link');
|
|
1047
|
-
clearButton.label = this.translationSlimmer.t('Clear');
|
|
1048
|
-
clearButton.addEventListener('click', this.vegaDatePickerCalendarController.handleClear);
|
|
1049
|
-
footerContainer.append(clearButton);
|
|
1050
|
-
const mainContainer = ui.querySelector('.container__main');
|
|
1051
|
-
if (mainContainer) {
|
|
1052
|
-
mainContainer.append(footerContainer);
|
|
1053
|
-
}
|
|
1054
|
-
};
|
|
1055
|
-
this.getSystemTimeZone = () => {
|
|
1056
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
/*
|
|
1060
|
-
* The below method is e2e-test covered in
|
|
1061
|
-
* @see{module:vega-date-picker-in-popover}
|
|
1062
|
-
*/
|
|
1063
|
-
/* istanbul ignore next */
|
|
1064
|
-
/**
|
|
1065
|
-
* The connectedCallback function checks if the datePicker is null and initializes it if it is.
|
|
1066
|
-
*/
|
|
1067
|
-
connectedCallback() {
|
|
1068
|
-
if (this.datePicker === null) {
|
|
1069
|
-
this.initDatePicker();
|
|
1070
|
-
}
|
|
1071
|
-
// eslint-disable-next-line no-restricted-globals
|
|
1072
|
-
this.calendarContainerRef = document.createElement('vega-date-picker-calendar');
|
|
1073
|
-
// eslint-disable-next-line no-restricted-globals
|
|
1074
|
-
document.body.append(this.calendarContainerRef);
|
|
1075
|
-
}
|
|
1076
|
-
/*
|
|
1077
|
-
* The below method is e2e-test covered in
|
|
1078
|
-
* @see{module:vega-date-picker-disconnected-callback}
|
|
1079
|
-
*/
|
|
1080
|
-
/* istanbul ignore next */
|
|
1081
|
-
/**
|
|
1082
|
-
* The `disconnectedCallback` function destroys the `datePicker` instance and sets it to null.
|
|
1083
|
-
*/
|
|
1084
|
-
disconnectedCallback() {
|
|
1085
|
-
var _a;
|
|
1086
|
-
(_a = this.datePicker) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1087
|
-
this.datePicker = null;
|
|
1088
|
-
this.calendarContainerRef.remove();
|
|
1089
|
-
}
|
|
1090
|
-
/*
|
|
1091
|
-
* call this method to open the date picker dropdown
|
|
1092
|
-
* The below method is e2e-test covered in
|
|
1093
|
-
* @see{module:vega-date-picker-render-ui-with-single}
|
|
1094
|
-
*/
|
|
1095
|
-
/** Import litepicker mobilefriendly module when the device is mobile */
|
|
1096
|
-
async componentWillLoad() {
|
|
1097
|
-
/* istanbul ignore next */ // Spec test can't load the plugin, use e2e test for below
|
|
1098
|
-
if (this.vegaDatePickerMobileController.getIsMobileDevice()) {
|
|
1099
|
-
await import('./mobilefriendly-c5d0573d.js');
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
/** Init date picker when component did load */
|
|
1103
|
-
componentDidLoad() {
|
|
1104
|
-
this.initDatePicker();
|
|
1105
|
-
}
|
|
1106
|
-
/*
|
|
1107
|
-
* The below method is e2e-test covered in
|
|
1108
|
-
* @see{module:vega-date-picker-re-render-in-single-mode}
|
|
1109
|
-
* @see{module:vega-date-picker-re-render-in-range-mode }
|
|
1110
|
-
*/
|
|
1111
|
-
/* istanbul ignore next */
|
|
1112
|
-
/** Refresh date picker when it is updated */
|
|
1113
|
-
componentDidRender() {
|
|
1114
|
-
if (this.requireRefreshLitePicker ||
|
|
1115
|
-
(this.vegaDatePickerSingleInputRenderer.getOldSingleDateInputRef() &&
|
|
1116
|
-
this.vegaDatePickerSingleInputRenderer.getOldSingleDateInputRef() !==
|
|
1117
|
-
this.vegaDatePickerSingleInputRenderer.getSingleDateInputRef()) ||
|
|
1118
|
-
(this.vegaDatePickerRangeInputRenderer.getOldStartDateInputRef() &&
|
|
1119
|
-
this.vegaDatePickerRangeInputRenderer.getOldStartDateInputRef() !==
|
|
1120
|
-
this.vegaDatePickerRangeInputRenderer.getStartDateInputRef()) ||
|
|
1121
|
-
(this.vegaDatePickerRangeInputRenderer.getOldEndDateInputRef() &&
|
|
1122
|
-
this.vegaDatePickerRangeInputRenderer.getOldEndDateInputRef() !==
|
|
1123
|
-
this.vegaDatePickerRangeInputRenderer.getEndDateInputRef())) {
|
|
1124
|
-
this.refreshLitePicker();
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
watchIsDateDisabled() {
|
|
1128
|
-
const dateItems =
|
|
1129
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1130
|
-
this.calendarContainerRef.shadowRoot.querySelectorAll('.day-item');
|
|
1131
|
-
dateItems.forEach((item) => {
|
|
1132
|
-
if (this.isDateDisabled(new Date(Number(item.dataset.time)))) {
|
|
1133
|
-
this.setDisabledDayStyles(item);
|
|
1134
|
-
}
|
|
1135
|
-
else {
|
|
1136
|
-
this.clearDisabledDayStyles(item);
|
|
1137
|
-
}
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
/**
|
|
1141
|
-
* The callback to handle [doOpen]{@link VegaDatePicker.doOpen}
|
|
1142
|
-
*/
|
|
1143
|
-
doOpen() {
|
|
1144
|
-
this.datePicker.show();
|
|
1145
|
-
}
|
|
1146
|
-
/**
|
|
1147
|
-
* The callback to handle [doClose]{@link VegaDatePicker.doClose}
|
|
1148
|
-
*/
|
|
1149
|
-
doClose() {
|
|
1150
|
-
this.datePicker.hide();
|
|
1151
|
-
}
|
|
1152
|
-
/*
|
|
1153
|
-
* The below method is e2e-test covered in
|
|
1154
|
-
* @see{module:vega-date-picker-range-mode-repick-start-date-or-end-date}
|
|
1155
|
-
*/
|
|
1156
|
-
/* istanbul ignore next */
|
|
1157
|
-
/** Update property of allowRepick when it is changed */
|
|
1158
|
-
watchAllowRepick() {
|
|
1159
|
-
this.datePicker.setOptions({
|
|
1160
|
-
allowRepick: this.allowRepick,
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Specifies whether the date picker field is disabled.
|
|
1165
|
-
*/
|
|
1166
|
-
watchDisabled() {
|
|
1167
|
-
this.datePicker.hide();
|
|
1168
|
-
}
|
|
1169
|
-
/*
|
|
1170
|
-
* The below method is e2e-test covered in
|
|
1171
|
-
* @see{module:vega-date-picker-change-mask-format}
|
|
1172
|
-
* @see{module:vega-date-picker-range-mode-change-mask-format}
|
|
1173
|
-
*/
|
|
1174
|
-
/* istanbul ignore next */
|
|
1175
|
-
/**
|
|
1176
|
-
* It is decorated with the `@MapToComponentMethod` decorator,
|
|
1177
|
-
* which indicates that this method should be mapped to a component method called 'format'.
|
|
1178
|
-
*
|
|
1179
|
-
* @param {string} format - The value of the format.
|
|
1180
|
-
*/
|
|
1181
|
-
watchFormat() {
|
|
1182
|
-
this.datePicker.setOptions({
|
|
1183
|
-
format: this.format,
|
|
1184
|
-
});
|
|
1185
|
-
}
|
|
1186
|
-
/*
|
|
1187
|
-
* The below method is e2e-test covered in
|
|
1188
|
-
* @see{module:vega-date-picker-mode-change}
|
|
1189
|
-
*/
|
|
1190
|
-
/* istanbul ignore next */
|
|
1191
|
-
/** Update datePicker settings property of mode is changed */
|
|
1192
|
-
watchMode() {
|
|
1193
|
-
this.requireRefreshLitePicker = true;
|
|
1194
|
-
}
|
|
1195
|
-
/**
|
|
1196
|
-
* Update datePicker settings property if showYearMonthDropdowns is changed
|
|
1197
|
-
*/
|
|
1198
|
-
watchShowYearMonthDropdowns() {
|
|
1199
|
-
this.requireRefreshLitePicker = true;
|
|
1200
|
-
}
|
|
1201
|
-
getStartMonthYearHeaderRef() {
|
|
1202
|
-
return this.startMonthYearHeaderRef;
|
|
1203
|
-
}
|
|
1204
|
-
getEndMonthYearHeaderRef() {
|
|
1205
|
-
return this.endMonthYearHeaderRef;
|
|
1206
|
-
}
|
|
1207
|
-
/**
|
|
1208
|
-
* get the reference of datePicker
|
|
1209
|
-
*
|
|
1210
|
-
* @returns {Litepicker} the reference of datePicker.
|
|
1211
|
-
*/
|
|
1212
|
-
getDatePicker() {
|
|
1213
|
-
return this.datePicker;
|
|
1214
|
-
}
|
|
1215
|
-
getCalendarContainerRef() {
|
|
1216
|
-
return this.calendarContainerRef;
|
|
1217
|
-
}
|
|
1218
|
-
/*
|
|
1219
|
-
* The below method is e2e-test covered in
|
|
1220
|
-
* @see{module:vega-date-picker-re-render-in-single-mode}
|
|
1221
|
-
* @see{module:vega-date-picker-re-render-in-range-mode}
|
|
1222
|
-
*/
|
|
1223
|
-
/* istanbul ignore next */
|
|
1224
|
-
/**
|
|
1225
|
-
* The function refreshLitePicker destroys and initializes a date picker if it exists.
|
|
1226
|
-
*/
|
|
1227
|
-
refreshLitePicker() {
|
|
1228
|
-
if (this.datePicker) {
|
|
1229
|
-
this.datePicker.destroy();
|
|
1230
|
-
this.initDatePicker();
|
|
1231
|
-
this.requireRefreshLitePicker = false;
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
/**
|
|
1235
|
-
* Render date picker calendar month name
|
|
1236
|
-
*
|
|
1237
|
-
* @param {HTMLElement} ui - Calendar dom ref
|
|
1238
|
-
*/
|
|
1239
|
-
renderMonthName(ui) {
|
|
1240
|
-
ui.querySelectorAll('.month-item-name').forEach((item) => {
|
|
1241
|
-
const currentMonthName = item.innerText;
|
|
1242
|
-
item.innerText = this.translationSlimmer.t(currentMonthName);
|
|
1243
|
-
});
|
|
1244
|
-
}
|
|
1245
|
-
setYearMonthHeaderRef(ui) {
|
|
1246
|
-
this.startMonthYearHeaderRef.month = ui.querySelectorAll('.month-item-name')[0];
|
|
1247
|
-
this.endMonthYearHeaderRef.month = ui.querySelectorAll('.month-item-name')[1];
|
|
1248
|
-
this.startMonthYearHeaderRef.year = ui.querySelectorAll('.month-item-year')[0];
|
|
1249
|
-
this.endMonthYearHeaderRef.year = ui.querySelectorAll('.month-item-year')[1];
|
|
1250
|
-
}
|
|
1251
|
-
emitMonthYearChangeEvent() {
|
|
1252
|
-
const monthYearSummary = this.showYearMonthDropdowns
|
|
1253
|
-
? this.vegaDatePickerMonthYearChangeEventController.getMonthYearSummaryWithMonthYearDropdownEnabled()
|
|
1254
|
-
: this.vegaDatePickerMonthYearChangeEventController.getMonthYearSummaryWithMonthYearDropdownDisabled();
|
|
1255
|
-
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalMonthYearChange), monthYearSummary);
|
|
1256
|
-
}
|
|
1257
|
-
resetTodayByTimezone() {
|
|
1258
|
-
if (this.timezone && this.timezone !== this.getSystemTimeZone()) {
|
|
1259
|
-
try {
|
|
1260
|
-
const formattedDate = new Intl.DateTimeFormat([], {
|
|
1261
|
-
timeZone: this.timezone,
|
|
1262
|
-
year: 'numeric',
|
|
1263
|
-
month: '2-digit',
|
|
1264
|
-
day: '2-digit',
|
|
1265
|
-
}).format(new Date());
|
|
1266
|
-
const dateByTimezone = new Date(formattedDate.split('/').join('-')).getTime();
|
|
1267
|
-
const dayItems =
|
|
1268
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1269
|
-
this.calendarContainerRef.shadowRoot.querySelectorAll('.day-item');
|
|
1270
|
-
for (let i = 0; i < dayItems.length; i++) {
|
|
1271
|
-
if (dayItems[i].classList.contains('is-today') &&
|
|
1272
|
-
Number(dayItems[i].dataset.time) !== dateByTimezone) {
|
|
1273
|
-
dayItems[i].classList.remove('is-today');
|
|
1274
|
-
}
|
|
1275
|
-
if (!dayItems[i].classList.contains('is-today') &&
|
|
1276
|
-
Number(dayItems[i].dataset.time) === dateByTimezone) {
|
|
1277
|
-
dayItems[i].classList.add('is-today');
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
catch (_a) {
|
|
1282
|
-
LogUtility.warn('Invalid timezone: ', this.timezone);
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
/*
|
|
1287
|
-
* The below method is e2e-test covered in
|
|
1288
|
-
* @see{module:vega-date-picker-render-ui-with-single}
|
|
1289
|
-
* @see{module:vega-date-picker-render-ui-with-range}
|
|
1290
|
-
*/
|
|
1291
|
-
/**
|
|
1292
|
-
* The function initializes a Litepicker date picker, customizes its appearance and behavior, and
|
|
1293
|
-
* attaches event listeners.
|
|
1294
|
-
*/
|
|
1295
|
-
initDatePicker() {
|
|
1296
|
-
this.datePicker = new litepicker_umd.Litepicker(this.vegaDatePickerCalendarController.getDefaultLitePickerConfig())
|
|
1297
|
-
.on('render', (ui) => {
|
|
1298
|
-
this.alterLitePickerHeader(ui);
|
|
1299
|
-
this.alterLitePickerFooter(ui);
|
|
1300
|
-
this.alterLitePickerHeight(ui);
|
|
1301
|
-
this.litepickerRef = ui;
|
|
1302
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1303
|
-
this.getCalendarContainerRef().shadowRoot.append(this.litepickerRef);
|
|
1304
|
-
/* istanbul ignore next */
|
|
1305
|
-
if (this.vegaDatePickerMobileController.getIsMobileDevice()) {
|
|
1306
|
-
this.vegaDatePickerMobileController.preventElementTouchMoveInMobile();
|
|
1307
|
-
}
|
|
1308
|
-
this.resetTodayByTimezone();
|
|
1309
|
-
})
|
|
1310
|
-
.on('selected', this.vegaDatePickerCalendarController.onDatePickerSelected)
|
|
1311
|
-
.on('before:show', () => {
|
|
1312
|
-
this.vegaDatePickerCalendarController.goToDate();
|
|
1313
|
-
})
|
|
1314
|
-
.on('show', () => {
|
|
1315
|
-
this.vegaDatePickerElementAppenderController.show();
|
|
1316
|
-
})
|
|
1317
|
-
.on('render:day', (node, date) => {
|
|
1318
|
-
const isDisabled = this.isDateDisabled(date.toJSDate());
|
|
1319
|
-
if (isDisabled) {
|
|
1320
|
-
this.setDisabledDayStyles(node);
|
|
1321
|
-
}
|
|
1322
|
-
})
|
|
1323
|
-
.on('mobilefriendly.show',
|
|
1324
|
-
/* istanbul ignore next */ () => {
|
|
1325
|
-
this.vegaDatePickerZIndexController.setZIndex();
|
|
1326
|
-
this.getCalendarContainerRef().style.position = 'fixed';
|
|
1327
|
-
this.getCalendarContainerRef().style.top = '50%';
|
|
1328
|
-
this.getCalendarContainerRef().style.left = '50%';
|
|
1329
|
-
this.getCalendarContainerRef().style.transform = 'translate(-50%, -50%)';
|
|
1330
|
-
this.getCalendarContainerRef().classList.remove('vega-force-hidden');
|
|
1331
|
-
})
|
|
1332
|
-
.on('hide', () => {
|
|
1333
|
-
this.vegaDatePickerValueController.syncUpValueWithCalendar();
|
|
1334
|
-
/* istanbul ignore else */
|
|
1335
|
-
if (!this.vegaDatePickerMobileController.getIsMobileDevice()) {
|
|
1336
|
-
this.vegaDatePickerElementAppenderController.hide();
|
|
1337
|
-
}
|
|
1338
|
-
else {
|
|
1339
|
-
this.getCalendarContainerRef().classList.add('vega-force-hidden');
|
|
1340
|
-
this.vegaDatePickerZIndexController.removeZIndex();
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* Applies styles to disable a specific day in the calendar.
|
|
1346
|
-
*
|
|
1347
|
-
* @param {HTMLElement} dayRef - The reference to the day element to be disabled.
|
|
1348
|
-
*/
|
|
1349
|
-
setDisabledDayStyles(dayRef) {
|
|
1350
|
-
dayRef.classList.add('is-locked');
|
|
1351
|
-
dayRef.classList.add('is-disabled');
|
|
1352
|
-
dayRef.tabIndex = -1;
|
|
1353
|
-
}
|
|
1354
|
-
/**
|
|
1355
|
-
* Clears the styles applied to a day element that mark it as disabled.
|
|
1356
|
-
*
|
|
1357
|
-
* @param {HTMLElement} dayRef - The reference to the day element to be cleared of disabled styles.
|
|
1358
|
-
*/
|
|
1359
|
-
clearDisabledDayStyles(dayRef) {
|
|
1360
|
-
dayRef.classList.remove('is-locked');
|
|
1361
|
-
dayRef.classList.remove('is-disabled');
|
|
1362
|
-
dayRef.tabIndex = 0;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
__decorate$9([
|
|
1366
|
-
MapToComponentField()
|
|
1367
|
-
], VegaDatePickerCalendarRenderer.prototype, "host", void 0);
|
|
1368
|
-
__decorate$9([
|
|
1369
|
-
MapToComponentField()
|
|
1370
|
-
], VegaDatePickerCalendarRenderer.prototype, "clearButton", void 0);
|
|
1371
|
-
__decorate$9([
|
|
1372
|
-
MapToComponentField()
|
|
1373
|
-
], VegaDatePickerCalendarRenderer.prototype, "dropdownConfig", void 0);
|
|
1374
|
-
__decorate$9([
|
|
1375
|
-
MapToComponentField()
|
|
1376
|
-
], VegaDatePickerCalendarRenderer.prototype, "allowRepick", void 0);
|
|
1377
|
-
__decorate$9([
|
|
1378
|
-
MapToComponentField()
|
|
1379
|
-
], VegaDatePickerCalendarRenderer.prototype, "format", void 0);
|
|
1380
|
-
__decorate$9([
|
|
1381
|
-
MapToComponentField()
|
|
1382
|
-
], VegaDatePickerCalendarRenderer.prototype, "showYearMonthDropdowns", void 0);
|
|
1383
|
-
__decorate$9([
|
|
1384
|
-
MapToComponentField()
|
|
1385
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerCalendarController", void 0);
|
|
1386
|
-
__decorate$9([
|
|
1387
|
-
MapToComponentField()
|
|
1388
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerMobileController", void 0);
|
|
1389
|
-
__decorate$9([
|
|
1390
|
-
MapToComponentField()
|
|
1391
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerElementAppenderController", void 0);
|
|
1392
|
-
__decorate$9([
|
|
1393
|
-
MapToComponentField()
|
|
1394
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerZIndexController", void 0);
|
|
1395
|
-
__decorate$9([
|
|
1396
|
-
MapToComponentField()
|
|
1397
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerValueController", void 0);
|
|
1398
|
-
__decorate$9([
|
|
1399
|
-
MapToComponentField()
|
|
1400
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
1401
|
-
__decorate$9([
|
|
1402
|
-
MapToComponentField()
|
|
1403
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
1404
|
-
__decorate$9([
|
|
1405
|
-
MapToComponentField()
|
|
1406
|
-
], VegaDatePickerCalendarRenderer.prototype, "monthYearDropdownRenderer", void 0);
|
|
1407
|
-
__decorate$9([
|
|
1408
|
-
MapToComponentField()
|
|
1409
|
-
], VegaDatePickerCalendarRenderer.prototype, "translationSlimmer", void 0);
|
|
1410
|
-
__decorate$9([
|
|
1411
|
-
MapToComponentField()
|
|
1412
|
-
], VegaDatePickerCalendarRenderer.prototype, "timezone", void 0);
|
|
1413
|
-
__decorate$9([
|
|
1414
|
-
MapToComponentField()
|
|
1415
|
-
], VegaDatePickerCalendarRenderer.prototype, "isDateDisabled", void 0);
|
|
1416
|
-
__decorate$9([
|
|
1417
|
-
MapToComponentField()
|
|
1418
|
-
], VegaDatePickerCalendarRenderer.prototype, "mode", void 0);
|
|
1419
|
-
__decorate$9([
|
|
1420
|
-
MapToComponentField()
|
|
1421
|
-
], VegaDatePickerCalendarRenderer.prototype, "monthYearChangeEventEmitter", void 0);
|
|
1422
|
-
__decorate$9([
|
|
1423
|
-
MapToComponentField()
|
|
1424
|
-
], VegaDatePickerCalendarRenderer.prototype, "vegaDatePickerMonthYearChangeEventController", void 0);
|
|
1425
|
-
__decorate$9([
|
|
1426
|
-
MapToComponentMethod('connectedCallback')
|
|
1427
|
-
], VegaDatePickerCalendarRenderer.prototype, "connectedCallback", null);
|
|
1428
|
-
__decorate$9([
|
|
1429
|
-
MapToComponentMethod('disconnectedCallback')
|
|
1430
|
-
], VegaDatePickerCalendarRenderer.prototype, "disconnectedCallback", null);
|
|
1431
|
-
__decorate$9([
|
|
1432
|
-
MapToComponentMethod('componentWillLoad')
|
|
1433
|
-
], VegaDatePickerCalendarRenderer.prototype, "componentWillLoad", null);
|
|
1434
|
-
__decorate$9([
|
|
1435
|
-
MapToComponentMethod('componentDidLoad')
|
|
1436
|
-
], VegaDatePickerCalendarRenderer.prototype, "componentDidLoad", null);
|
|
1437
|
-
__decorate$9([
|
|
1438
|
-
MapToComponentMethod('componentDidRender')
|
|
1439
|
-
], VegaDatePickerCalendarRenderer.prototype, "componentDidRender", null);
|
|
1440
|
-
__decorate$9([
|
|
1441
|
-
MapToComponentMethod('watchIsDateDisabled')
|
|
1442
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchIsDateDisabled", null);
|
|
1443
|
-
__decorate$9([
|
|
1444
|
-
MapToComponentMethod('doOpen')
|
|
1445
|
-
], VegaDatePickerCalendarRenderer.prototype, "doOpen", null);
|
|
1446
|
-
__decorate$9([
|
|
1447
|
-
MapToComponentMethod('doClose')
|
|
1448
|
-
], VegaDatePickerCalendarRenderer.prototype, "doClose", null);
|
|
1449
|
-
__decorate$9([
|
|
1450
|
-
MapToComponentMethod('watchAllowRepick')
|
|
1451
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchAllowRepick", null);
|
|
1452
|
-
__decorate$9([
|
|
1453
|
-
MapToComponentMethod('watchDisabled')
|
|
1454
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchDisabled", null);
|
|
1455
|
-
__decorate$9([
|
|
1456
|
-
MapToComponentMethod('watchFormat')
|
|
1457
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchFormat", null);
|
|
1458
|
-
__decorate$9([
|
|
1459
|
-
MapToComponentMethod('watchMode')
|
|
1460
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchMode", null);
|
|
1461
|
-
__decorate$9([
|
|
1462
|
-
MapToComponentMethod('watchShowYearMonthDropdowns')
|
|
1463
|
-
], VegaDatePickerCalendarRenderer.prototype, "watchShowYearMonthDropdowns", null);
|
|
1464
|
-
|
|
1465
|
-
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1466
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1467
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1468
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1469
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1470
|
-
};
|
|
1471
|
-
/** The date picker z index controller slimmer */
|
|
1472
|
-
class VegaDatePickerZIndexController extends VegaSlimmer {
|
|
1473
|
-
/*
|
|
1474
|
-
* The below method is e2e-test covered in
|
|
1475
|
-
* @see{module:vega-date-picker-z-index
|
|
1476
|
-
* @see{module:vega-date-picker-z-index-in-mobile}
|
|
1477
|
-
*/
|
|
1478
|
-
/* istanbul ignore next */
|
|
1479
|
-
/**
|
|
1480
|
-
* The function sets the z-index of the backdrop and the litepicker element.
|
|
1481
|
-
*/
|
|
1482
|
-
setZIndex() {
|
|
1483
|
-
const backdrop =
|
|
1484
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1485
|
-
this.host.shadowRoot.querySelector('.litepicker-backdrop');
|
|
1486
|
-
InternalVegaZIndexManager.setZIndex(backdrop, 'base');
|
|
1487
|
-
InternalVegaZIndexManager.setZIndex(this.vegaDatePickerCalendarRenderer.getCalendarContainerRef(), 'base');
|
|
1488
|
-
}
|
|
1489
|
-
/*
|
|
1490
|
-
* The below method is e2e-test covered in
|
|
1491
|
-
* @see{module:vega-date-picker-z-index
|
|
1492
|
-
* @see{module:vega-date-picker-z-index-in-mobile}
|
|
1493
|
-
*/
|
|
1494
|
-
/* istanbul ignore next */
|
|
1495
|
-
/**
|
|
1496
|
-
* The function removes the 'base' z-index from the backdrop and the litepickerRef elements.
|
|
1497
|
-
*/
|
|
1498
|
-
removeZIndex() {
|
|
1499
|
-
const backdrop =
|
|
1500
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1501
|
-
this.host.shadowRoot.querySelector('.litepicker-backdrop');
|
|
1502
|
-
InternalVegaZIndexManager.removeZIndex(backdrop, 'base');
|
|
1503
|
-
InternalVegaZIndexManager.removeZIndex(this.vegaDatePickerCalendarRenderer.getCalendarContainerRef(), 'base');
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
__decorate$8([
|
|
1507
|
-
MapToComponentField()
|
|
1508
|
-
], VegaDatePickerZIndexController.prototype, "host", void 0);
|
|
1509
|
-
__decorate$8([
|
|
1510
|
-
MapToComponentField()
|
|
1511
|
-
], VegaDatePickerZIndexController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1512
|
-
|
|
1513
|
-
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
779
|
+
var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1514
780
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1515
781
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1516
782
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1518,24 +784,6 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1518
784
|
};
|
|
1519
785
|
/** The date picker value controller slimmer */
|
|
1520
786
|
class VegaDatePickerValueController extends VegaSlimmer {
|
|
1521
|
-
constructor() {
|
|
1522
|
-
super(...arguments);
|
|
1523
|
-
// The litepicker logic will clear the input element value if one of the startDate and dateDate is empty
|
|
1524
|
-
// Hence we need sync up the vega-date-picker value with litepicker calendar
|
|
1525
|
-
// Link: https://github.com/wakirin/Litepicker/blob/master/src/litepicker.ts#L119
|
|
1526
|
-
/** Sync up the value of input with the value of the calendar */
|
|
1527
|
-
this.syncUpValueWithCalendar = () => {
|
|
1528
|
-
var _a, _b;
|
|
1529
|
-
const startDate = ((_a = this.vegaDatePickerCalendarRenderer.getDatePicker().getStartDate()) === null || _a === void 0 ? void 0 : _a.format(this.format)) || '';
|
|
1530
|
-
const endDate = ((_b = this.vegaDatePickerCalendarRenderer.getDatePicker().getEndDate()) === null || _b === void 0 ? void 0 : _b.format(this.format)) || '';
|
|
1531
|
-
if (this.mode === 'range' && !isArrayEqual(this.getValue(), [startDate, endDate])) {
|
|
1532
|
-
this.setValue([startDate, endDate]);
|
|
1533
|
-
}
|
|
1534
|
-
if (this.mode === 'single' && this.getValue() !== startDate) {
|
|
1535
|
-
this.setValue(startDate);
|
|
1536
|
-
}
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
787
|
/*
|
|
1540
788
|
* call this method to open the date picker dropdown
|
|
1541
789
|
* The below method is e2e-test covered in
|
|
@@ -1571,10 +819,7 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1571
819
|
isArrayEqual(newValue, oldValue)) {
|
|
1572
820
|
return; // avoid the value changed again by `onDatePickerSelected` in range mode
|
|
1573
821
|
}
|
|
1574
|
-
if (this.valueGuard(newValue)) {
|
|
1575
|
-
this.vegaDatePickerCalendarController.shouldUpdateCalendar(newValue);
|
|
1576
|
-
}
|
|
1577
|
-
else {
|
|
822
|
+
if (!this.valueGuard(newValue)) {
|
|
1578
823
|
this.setDefaultValueByMode();
|
|
1579
824
|
}
|
|
1580
825
|
this.changeEventEmitter.emit(this.value);
|
|
@@ -1636,13 +881,15 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1636
881
|
let isValid;
|
|
1637
882
|
switch (this.mode) {
|
|
1638
883
|
case 'single':
|
|
1639
|
-
isValid =
|
|
884
|
+
isValid =
|
|
885
|
+
(value && typeof value === 'string' && !!CalendarDate.fromString(value, this.format)) ||
|
|
886
|
+
value === '';
|
|
1640
887
|
break;
|
|
1641
888
|
case 'range':
|
|
1642
889
|
isValid =
|
|
1643
890
|
Array.isArray(value) &&
|
|
1644
891
|
value.length === 2 &&
|
|
1645
|
-
value.every((item) =>
|
|
892
|
+
value.every((item) => !!CalendarDate.fromString(item, this.format) || item === '');
|
|
1646
893
|
break;
|
|
1647
894
|
}
|
|
1648
895
|
if (!isValid) {
|
|
@@ -1651,38 +898,41 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1651
898
|
return isValid;
|
|
1652
899
|
}
|
|
1653
900
|
}
|
|
1654
|
-
__decorate$
|
|
901
|
+
__decorate$e([
|
|
1655
902
|
MapToComponentField({ writable: true })
|
|
1656
903
|
], VegaDatePickerValueController.prototype, "value", void 0);
|
|
1657
|
-
__decorate$
|
|
904
|
+
__decorate$e([
|
|
1658
905
|
MapToComponentField()
|
|
1659
906
|
], VegaDatePickerValueController.prototype, "mode", void 0);
|
|
1660
|
-
__decorate$
|
|
907
|
+
__decorate$e([
|
|
1661
908
|
MapToComponentField()
|
|
1662
909
|
], VegaDatePickerValueController.prototype, "format", void 0);
|
|
1663
|
-
__decorate$
|
|
910
|
+
__decorate$e([
|
|
1664
911
|
MapToComponentField()
|
|
1665
912
|
], VegaDatePickerValueController.prototype, "changeEventEmitter", void 0);
|
|
1666
|
-
__decorate$
|
|
913
|
+
__decorate$e([
|
|
1667
914
|
MapToComponentField()
|
|
1668
915
|
], VegaDatePickerValueController.prototype, "host", void 0);
|
|
1669
|
-
__decorate$
|
|
916
|
+
__decorate$e([
|
|
1670
917
|
MapToComponentField()
|
|
1671
|
-
], VegaDatePickerValueController.prototype, "
|
|
1672
|
-
__decorate$
|
|
918
|
+
], VegaDatePickerValueController.prototype, "isCalendarShow", void 0);
|
|
919
|
+
__decorate$e([
|
|
1673
920
|
MapToComponentField()
|
|
1674
921
|
], VegaDatePickerValueController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1675
|
-
__decorate$
|
|
922
|
+
__decorate$e([
|
|
923
|
+
MapToComponentField()
|
|
924
|
+
], VegaDatePickerValueController.prototype, "calendarOpenStateController", void 0);
|
|
925
|
+
__decorate$e([
|
|
1676
926
|
MapToComponentMethod('componentWillLoad')
|
|
1677
927
|
], VegaDatePickerValueController.prototype, "componentWillLoad", null);
|
|
1678
|
-
__decorate$
|
|
928
|
+
__decorate$e([
|
|
1679
929
|
MapToComponentMethod('watchValue')
|
|
1680
930
|
], VegaDatePickerValueController.prototype, "watchValue", null);
|
|
1681
|
-
__decorate$
|
|
931
|
+
__decorate$e([
|
|
1682
932
|
MapToComponentMethod('watchMode')
|
|
1683
933
|
], VegaDatePickerValueController.prototype, "watchMode", null);
|
|
1684
934
|
|
|
1685
|
-
var __decorate$
|
|
935
|
+
var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1686
936
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1687
937
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1688
938
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1706,7 +956,8 @@ class VegaDatePickerFormatController extends StringInputFormatterSlimmer {
|
|
|
1706
956
|
* @returns {string} The formatted date is being returned.
|
|
1707
957
|
*/
|
|
1708
958
|
this.formatDate = (date) => {
|
|
1709
|
-
|
|
959
|
+
const formattedDate = CalendarDate.fromString(date, this.format);
|
|
960
|
+
return formattedDate.toString(this.format);
|
|
1710
961
|
};
|
|
1711
962
|
/**
|
|
1712
963
|
* This function returns a reference to an HTML input element based on the input type specified.
|
|
@@ -1794,62 +1045,29 @@ class VegaDatePickerFormatController extends StringInputFormatterSlimmer {
|
|
|
1794
1045
|
this.setup();
|
|
1795
1046
|
}
|
|
1796
1047
|
}
|
|
1797
|
-
__decorate$
|
|
1048
|
+
__decorate$d([
|
|
1798
1049
|
MapToComponentField()
|
|
1799
1050
|
], VegaDatePickerFormatController.prototype, "format", void 0);
|
|
1800
|
-
__decorate$
|
|
1051
|
+
__decorate$d([
|
|
1801
1052
|
MapToComponentField()
|
|
1802
1053
|
], VegaDatePickerFormatController.prototype, "mode", void 0);
|
|
1803
|
-
__decorate$
|
|
1054
|
+
__decorate$d([
|
|
1804
1055
|
MapToComponentField()
|
|
1805
1056
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1806
|
-
__decorate$
|
|
1057
|
+
__decorate$d([
|
|
1807
1058
|
MapToComponentField()
|
|
1808
1059
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
1809
|
-
__decorate$
|
|
1060
|
+
__decorate$d([
|
|
1810
1061
|
MapToComponentField()
|
|
1811
1062
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
1812
|
-
__decorate$
|
|
1063
|
+
__decorate$d([
|
|
1813
1064
|
MapToComponentMethod('componentDidLoad')
|
|
1814
1065
|
], VegaDatePickerFormatController.prototype, "componentDidLoad", null);
|
|
1815
|
-
__decorate$
|
|
1066
|
+
__decorate$d([
|
|
1816
1067
|
MapToComponentMethod('watchFormat')
|
|
1817
1068
|
], VegaDatePickerFormatController.prototype, "watchFormat", null);
|
|
1818
1069
|
|
|
1819
|
-
var __decorate$
|
|
1820
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1821
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1822
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1823
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1824
|
-
};
|
|
1825
|
-
/** The date picker element appender controller slimmer */
|
|
1826
|
-
class VegaDatePickerElementAppenderController extends ElementAppenderSlimmer {
|
|
1827
|
-
/**
|
|
1828
|
-
* This function sets up the configuration for the Litepicker date picker.
|
|
1829
|
-
*/
|
|
1830
|
-
constructor() {
|
|
1831
|
-
super(() => ({
|
|
1832
|
-
target: this.vegaDatePickerRenderer.getDatePickerContainer(),
|
|
1833
|
-
appendableElement: this.vegaDatePickerCalendarRenderer.getCalendarContainerRef(),
|
|
1834
|
-
positionRelativeTo: this.dropdownConfig.positionRelativeTo,
|
|
1835
|
-
translocation: { X: 0, Y: 8 },
|
|
1836
|
-
placement: ['bottom', 'top'],
|
|
1837
|
-
alignment: ['start', 'end'],
|
|
1838
|
-
isScreenPosition: FeatureFlag.isEnabled('VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN'),
|
|
1839
|
-
}), () => 'none');
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
__decorate$5([
|
|
1843
|
-
MapToComponentField()
|
|
1844
|
-
], VegaDatePickerElementAppenderController.prototype, "dropdownConfig", void 0);
|
|
1845
|
-
__decorate$5([
|
|
1846
|
-
MapToComponentField()
|
|
1847
|
-
], VegaDatePickerElementAppenderController.prototype, "vegaDatePickerRenderer", void 0);
|
|
1848
|
-
__decorate$5([
|
|
1849
|
-
MapToComponentField()
|
|
1850
|
-
], VegaDatePickerElementAppenderController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1851
|
-
|
|
1852
|
-
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1070
|
+
var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1853
1071
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1854
1072
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1855
1073
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -1872,7 +1090,7 @@ class VegaDatePickerKeyboardController extends KeyboardManagerSlimmer {
|
|
|
1872
1090
|
target.vegaDatePickerSingleInputRenderer.getSingleDateInputRef(),
|
|
1873
1091
|
target.vegaDatePickerRangeInputRenderer.getStartDateInputRef(),
|
|
1874
1092
|
target.vegaDatePickerRangeInputRenderer.getEndDateInputRef(),
|
|
1875
|
-
target.vegaDatePickerCalendarRenderer.
|
|
1093
|
+
target.vegaDatePickerCalendarRenderer.getCalendarContentBoxRef(),
|
|
1876
1094
|
],
|
|
1877
1095
|
eventName: 'keydown',
|
|
1878
1096
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
@@ -1886,13 +1104,13 @@ class VegaDatePickerKeyboardController extends KeyboardManagerSlimmer {
|
|
|
1886
1104
|
]);
|
|
1887
1105
|
}
|
|
1888
1106
|
}
|
|
1889
|
-
__decorate$
|
|
1107
|
+
__decorate$c([
|
|
1890
1108
|
MapToComponentField()
|
|
1891
1109
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1892
|
-
__decorate$
|
|
1110
|
+
__decorate$c([
|
|
1893
1111
|
MapToComponentField()
|
|
1894
1112
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
1895
|
-
__decorate$
|
|
1113
|
+
__decorate$c([
|
|
1896
1114
|
MapToComponentField()
|
|
1897
1115
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
1898
1116
|
|
|
@@ -1947,475 +1165,155 @@ const VegaDatePickerRuntimeMetricsPayloadDefinition = [
|
|
|
1947
1165
|
},
|
|
1948
1166
|
];
|
|
1949
1167
|
|
|
1950
|
-
var __decorate$
|
|
1168
|
+
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1951
1169
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1952
1170
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1953
1171
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1954
1172
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1955
1173
|
};
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
super(...arguments);
|
|
1959
|
-
this.startDropdownRef = {
|
|
1960
|
-
month: null,
|
|
1961
|
-
year: null,
|
|
1962
|
-
};
|
|
1963
|
-
this.endDropdownRef = {
|
|
1964
|
-
month: null,
|
|
1965
|
-
year: null,
|
|
1966
|
-
};
|
|
1967
|
-
/* eslint-enable no-restricted-globals */
|
|
1968
|
-
/**
|
|
1969
|
-
* When interacting with open vega-dropdown, prevent it from collapsing since is treated as outside element by litepicker
|
|
1970
|
-
*
|
|
1971
|
-
* @param {MouseEvent} event - Click event
|
|
1972
|
-
*/
|
|
1973
|
-
this.onVegaDropdownContentBoxClick = (event) => {
|
|
1974
|
-
const elementOnClick = event.target;
|
|
1975
|
-
if (elementOnClick.tagName === 'VEGA-DROPDOWN-CONTENT-BOX') {
|
|
1976
|
-
this.datePickerCalendar.classList.remove('vega-force-hidden');
|
|
1977
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1978
|
-
this.datePickerCalendar.shadowRoot.querySelector('.litepicker').style.display =
|
|
1979
|
-
'block';
|
|
1980
|
-
}
|
|
1981
|
-
};
|
|
1982
|
-
/**
|
|
1983
|
-
* Prevent collapsing of dropdown when selecting option. VD-5544
|
|
1984
|
-
*
|
|
1985
|
-
* @param {Event} event - Focus event
|
|
1986
|
-
*/
|
|
1987
|
-
this.onVegaDropdownContentBoxActivate = (event) => {
|
|
1988
|
-
const element = event.target;
|
|
1989
|
-
if (element.tagName === 'VEGA-DROPDOWN-CONTENT-BOX') {
|
|
1990
|
-
this.isMonthsOrYearsDropdownContentBoxOnFocus = true;
|
|
1991
|
-
element.classList.remove('vega-force-hidden');
|
|
1992
|
-
}
|
|
1993
|
-
else {
|
|
1994
|
-
this.isMonthsOrYearsDropdownContentBoxOnFocus = false;
|
|
1995
|
-
}
|
|
1996
|
-
};
|
|
1997
|
-
}
|
|
1998
|
-
getStartDropdownRef() {
|
|
1999
|
-
return this.startDropdownRef;
|
|
2000
|
-
}
|
|
2001
|
-
getEndDropdownRef() {
|
|
2002
|
-
return this.endDropdownRef;
|
|
2003
|
-
}
|
|
1174
|
+
/** The date picker element appender controller slimmer */
|
|
1175
|
+
class VegaDatePickerCalendarOpenStateController extends ElementAppenderSlimmer {
|
|
2004
1176
|
/**
|
|
2005
|
-
*
|
|
2006
|
-
*
|
|
2007
|
-
* @param {Litepicker} datePicker - Litepicker instance
|
|
1177
|
+
* Sets up the configuration the element appender of date picker.
|
|
2008
1178
|
*/
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
this.renderDropdown('year', 'start')),
|
|
2021
|
-
h("div", { class: "end-date-month-year" },
|
|
2022
|
-
this.renderDropdown('month', 'end'),
|
|
2023
|
-
this.renderDropdown('year', 'end'))));
|
|
2024
|
-
}
|
|
2025
|
-
/**
|
|
2026
|
-
* From default months select dropdowns, get passed options and create vega-dropdown component with months as options
|
|
2027
|
-
*
|
|
2028
|
-
* @param {HTMLElement} ui - Litepicker ui
|
|
2029
|
-
*/
|
|
2030
|
-
renderMonthButton(ui) {
|
|
2031
|
-
ui.querySelectorAll('select.month-item-name').forEach((item, index) => {
|
|
2032
|
-
this.syncDropdownOptions('month', item, index);
|
|
2033
|
-
const selectedOptionValue = this.getSelectedOptionFromSelect(item);
|
|
2034
|
-
const value = VegaDatePickerMonthYearDropdownRenderer.monthName[parseInt(selectedOptionValue)];
|
|
2035
|
-
// eslint-disable-next-line no-restricted-globals
|
|
2036
|
-
const monthButton = document.createElement('span');
|
|
2037
|
-
monthButton.classList.add('dropdown-current-value');
|
|
2038
|
-
monthButton.innerText = `${this.translationSlimmer.t(value)}`;
|
|
2039
|
-
this.appendDropdownIconToButton(monthButton);
|
|
2040
|
-
if (item.parentNode) {
|
|
2041
|
-
item.parentNode.replaceChild(monthButton, item);
|
|
2042
|
-
}
|
|
2043
|
-
const dropdown = index === 0 ? this.startDropdownRef.month : this.endDropdownRef.month;
|
|
2044
|
-
if (dropdown) {
|
|
2045
|
-
this.updateDropdownValueAndTarget(monthButton, dropdown, item.value);
|
|
2046
|
-
}
|
|
2047
|
-
monthButton.addEventListener('click', () => {
|
|
2048
|
-
this.setDropdownAsActive(monthButton);
|
|
2049
|
-
});
|
|
2050
|
-
});
|
|
2051
|
-
}
|
|
2052
|
-
/**
|
|
2053
|
-
* From default years select dropdowns, get passed options and create vega-dropdown component with years as options
|
|
2054
|
-
*
|
|
2055
|
-
* @param {HTMLElement} ui - Litepicker ui
|
|
2056
|
-
*/
|
|
2057
|
-
renderYearButton(ui) {
|
|
2058
|
-
ui.querySelectorAll('select.month-item-year').forEach((item, index) => {
|
|
2059
|
-
this.syncDropdownOptions('year', item, index);
|
|
2060
|
-
const value = this.getSelectedOptionFromSelect(item);
|
|
2061
|
-
// eslint-disable-next-line no-restricted-globals
|
|
2062
|
-
const yearButton = document.createElement('span');
|
|
2063
|
-
yearButton.classList.add('dropdown-current-value');
|
|
2064
|
-
yearButton.innerText = `${this.translationSlimmer.t(value)}`;
|
|
2065
|
-
this.appendDropdownIconToButton(yearButton);
|
|
2066
|
-
if (item.parentNode) {
|
|
2067
|
-
item.parentNode.replaceChild(yearButton, item);
|
|
2068
|
-
}
|
|
2069
|
-
const dropdown = index === 0 ? this.startDropdownRef.year : this.endDropdownRef.year;
|
|
2070
|
-
if (dropdown) {
|
|
2071
|
-
this.updateDropdownValueAndTarget(yearButton, dropdown, item.value);
|
|
2072
|
-
}
|
|
2073
|
-
yearButton.addEventListener('click', () => {
|
|
2074
|
-
this.setDropdownAsActive(yearButton);
|
|
2075
|
-
});
|
|
2076
|
-
});
|
|
2077
|
-
}
|
|
2078
|
-
getSelectedOptionFromSelect(select) {
|
|
2079
|
-
const options = Array.from(select.querySelectorAll('option'));
|
|
2080
|
-
const selectedOption = options.find((option) => option.selected);
|
|
2081
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2082
|
-
return selectedOption.value;
|
|
1179
|
+
constructor() {
|
|
1180
|
+
super(() => ({
|
|
1181
|
+
target: this.vegaDatePickerRenderer.getDatePickerContainer(),
|
|
1182
|
+
appendableElement: this.vegaDatePickerCalendarRenderer.getCalendarContentBoxRef(),
|
|
1183
|
+
positionRelativeTo: this.dropdownConfig.positionRelativeTo,
|
|
1184
|
+
translocation: { X: 0, Y: 8 },
|
|
1185
|
+
placement: ['bottom', 'top'],
|
|
1186
|
+
alignment: ['start', 'end'],
|
|
1187
|
+
isScreenPosition: FeatureFlag.isEnabled('VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN'),
|
|
1188
|
+
}), () => 'custom', 'isCalendarShow');
|
|
1189
|
+
this.clearCalendarStateTaskQueue = new SynchronizeTaskQueue();
|
|
2083
1190
|
}
|
|
2084
1191
|
/**
|
|
2085
|
-
*
|
|
2086
|
-
*
|
|
2087
|
-
* @param {MonthOrYearType} type - Month or year dropdown
|
|
2088
|
-
* @param {DateIndexType} dateIndex - start date index for both single or range and end date index for range date picker mode
|
|
1192
|
+
* Since connectedCallback will init element appender again, and it will add `vega-force-hidden` class to calendar,
|
|
1193
|
+
* so we should skip this in mobile side.
|
|
2089
1194
|
*/
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
if (dateIndex === 'start') {
|
|
2094
|
-
this.startDropdownRef[type] = node;
|
|
2095
|
-
}
|
|
2096
|
-
else {
|
|
2097
|
-
this.endDropdownRef[type] = node;
|
|
2098
|
-
}
|
|
2099
|
-
DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, (input) => {
|
|
2100
|
-
this.setDefaultViewValues(type, node);
|
|
2101
|
-
this.monthYearDropdownClick(type, dateIndex, input.detail);
|
|
2102
|
-
});
|
|
2103
|
-
} },
|
|
2104
|
-
h("span", null, type)));
|
|
2105
|
-
}
|
|
2106
|
-
/**
|
|
2107
|
-
* When calendar opens, update sources for the vega-dropdown components for both months and years dropdown
|
|
2108
|
-
*
|
|
2109
|
-
* @param {MonthOrYearType} type - Month or year dropdown
|
|
2110
|
-
* @param {HTMLSelectElement} select - Native select from litepicker ui
|
|
2111
|
-
* @param {number} index - dropdown count
|
|
2112
|
-
*/
|
|
2113
|
-
syncDropdownOptions(type, select, index) {
|
|
2114
|
-
const options = select.querySelectorAll('option');
|
|
2115
|
-
const dropdownOptions = Array.from(options).map((option) => ({
|
|
2116
|
-
key: option.value,
|
|
2117
|
-
label: this.translationSlimmer.t(option.text),
|
|
2118
|
-
disabled: option.disabled ? true : false,
|
|
2119
|
-
}));
|
|
2120
|
-
if (type === 'month') {
|
|
2121
|
-
const dropdown = index === 0 ? this.startDropdownRef.month : this.endDropdownRef.month;
|
|
2122
|
-
if (dropdown) {
|
|
2123
|
-
dropdown.source = dropdownOptions;
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
if (type === 'year') {
|
|
2127
|
-
dropdownOptions.sort((a, b) => Number(a.key) - Number(b.key));
|
|
2128
|
-
const dropdown = index === 0 ? this.startDropdownRef.year : this.endDropdownRef.year;
|
|
2129
|
-
if (dropdown) {
|
|
2130
|
-
dropdown.source = dropdownOptions;
|
|
2131
|
-
}
|
|
1195
|
+
connectedCallback() {
|
|
1196
|
+
if (!this.isMobileDevice) {
|
|
1197
|
+
super.connectedCallback();
|
|
2132
1198
|
}
|
|
2133
1199
|
}
|
|
2134
1200
|
/**
|
|
2135
|
-
*
|
|
2136
|
-
*
|
|
2137
|
-
* @param {HTMLVegaDropdownElement} dropdown - Month or year dropdown
|
|
1201
|
+
* Since it not init the element appender in mobile side, we also not need destroy element appender in disconnectedCallback.
|
|
2138
1202
|
*/
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
});
|
|
2143
|
-
dropdown === null || dropdown === void 0 ? void 0 : dropdown.addEventListener('vegaHide', () => {
|
|
2144
|
-
this.onDropdownHide();
|
|
2145
|
-
});
|
|
2146
|
-
}
|
|
2147
|
-
setDefaultViewValues(type, node) {
|
|
2148
|
-
if (type === 'month') {
|
|
2149
|
-
const yearDropdown = node.nextElementSibling;
|
|
2150
|
-
this.currentStartYearInView = parseInt(yearDropdown.selectedSourceKey);
|
|
2151
|
-
}
|
|
2152
|
-
else {
|
|
2153
|
-
const monthDropdown = node.previousElementSibling;
|
|
2154
|
-
this.currentStartMonthInView = parseInt(monthDropdown.selectedSourceKey);
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
appendDropdownIconToButton(parentElement) {
|
|
2158
|
-
parentElement.innerHTML += `<vega-icon icon='${VegaInternalIconManager.getIconKey('caret-down')}'></vega-icon>`;
|
|
2159
|
-
parentElement.tabIndex = 0;
|
|
2160
|
-
}
|
|
2161
|
-
monthYearDropdownClick(type, dateIndex, detail) {
|
|
2162
|
-
const value = parseInt(detail);
|
|
2163
|
-
this.updateDatePickerOnSelect(type, dateIndex, value);
|
|
2164
|
-
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalMonthYearChange), this.vegaDatePickerMonthYearChangeEventController.getMonthYearSummaryWithMonthYearDropdownEnabled());
|
|
2165
|
-
}
|
|
2166
|
-
updateDropdownValueAndTarget(target, dropdownRef, dropdownSelectedKey) {
|
|
2167
|
-
const parentDiv = target.closest('div');
|
|
2168
|
-
if (parentDiv) {
|
|
2169
|
-
parentDiv.classList.add('dropdown-section');
|
|
2170
|
-
}
|
|
2171
|
-
dropdownRef.selectedSourceKey = dropdownSelectedKey;
|
|
2172
|
-
remoteInvocationRegistry.call(domNodeSubjectFactory.getSubject(dropdownRef, VegaInternalDropdownUpdateTarget), target);
|
|
2173
|
-
}
|
|
2174
|
-
updateDatePickerOnSelect(type, dateIndex, value) {
|
|
2175
|
-
if (type === 'month') {
|
|
2176
|
-
if (this.currentStartYearInView !== null) {
|
|
2177
|
-
if (dateIndex === 'start') {
|
|
2178
|
-
this.datePicker.gotoDate(new Date(this.currentStartYearInView, value, 1));
|
|
2179
|
-
}
|
|
2180
|
-
if (dateIndex === 'end') {
|
|
2181
|
-
this.datePicker.gotoDate(new Date(this.currentStartYearInView, value - 1, 1));
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
}
|
|
2185
|
-
else {
|
|
2186
|
-
if (this.currentStartMonthInView !== null) {
|
|
2187
|
-
if (dateIndex === 'start') {
|
|
2188
|
-
this.datePicker.gotoDate(new Date(value, this.currentStartMonthInView, 1));
|
|
2189
|
-
}
|
|
2190
|
-
if (dateIndex === 'end') {
|
|
2191
|
-
this.datePicker.gotoDate(new Date(value, this.currentStartMonthInView - 1, 1));
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
1203
|
+
disconnectedCallback() {
|
|
1204
|
+
if (!this.isMobileDevice) {
|
|
1205
|
+
super.disconnectedCallback();
|
|
2194
1206
|
}
|
|
2195
1207
|
}
|
|
2196
|
-
setDropdownAsActive(element) {
|
|
2197
|
-
Array.from(this.datePicker.ui.querySelectorAll('.dropdown-current-value.active')).forEach((item) => item.classList.remove('active'));
|
|
2198
|
-
element.classList.add('active');
|
|
2199
|
-
}
|
|
2200
|
-
removeActiveDropdownClass() {
|
|
2201
|
-
Array.from(this.datePicker.ui.querySelectorAll('.dropdown-current-value.active')).forEach((item) => item.classList.remove('active'));
|
|
2202
|
-
}
|
|
2203
|
-
/* eslint-disable no-restricted-globals */
|
|
2204
|
-
onDropdownShow() {
|
|
2205
|
-
document.addEventListener('mouseenter', this.onVegaDropdownContentBoxActivate, true);
|
|
2206
|
-
document.addEventListener('click', this.onVegaDropdownContentBoxClick);
|
|
2207
|
-
}
|
|
2208
|
-
onDropdownHide() {
|
|
2209
|
-
this.isMonthsOrYearsDropdownContentBoxOnFocus = false;
|
|
2210
|
-
this.removeActiveDropdownClass();
|
|
2211
|
-
document.removeEventListener('mouseenter', this.onVegaDropdownContentBoxActivate, true);
|
|
2212
|
-
document.removeEventListener('click', this.onVegaDropdownContentBoxClick);
|
|
2213
|
-
}
|
|
2214
|
-
/**
|
|
2215
|
-
* When you collapse date picker while vega-dropdown is still open, close vega-dropdown too
|
|
2216
|
-
*/
|
|
2217
|
-
initSetup() {
|
|
2218
|
-
const hideLitepicker = this.datePicker.hide.bind(this.datePicker);
|
|
2219
|
-
this.datePicker.hide = async () => {
|
|
2220
|
-
// eslint-disable-next-line no-restricted-globals
|
|
2221
|
-
const activeElement = document.activeElement;
|
|
2222
|
-
if (!this.isMonthsOrYearsDropdownContentBoxOnFocus &&
|
|
2223
|
-
(activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) !== 'VEGA-DROPDOWN-CONTENT-BOX') {
|
|
2224
|
-
await this.closeOpenDropdowns();
|
|
2225
|
-
hideLitepicker();
|
|
2226
|
-
}
|
|
2227
|
-
};
|
|
2228
|
-
}
|
|
2229
1208
|
/**
|
|
2230
|
-
*
|
|
1209
|
+
* Since componentDidLoad will init element appender, and it will add `vega-force-hidden` class to calendar,
|
|
1210
|
+
* so we should skip this in mobile side.
|
|
2231
1211
|
*/
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
.filter(Boolean)
|
|
2237
|
-
.map((dropdown) => {
|
|
2238
|
-
if (dropdown) {
|
|
2239
|
-
void dropdown.hide();
|
|
2240
|
-
}
|
|
2241
|
-
}));
|
|
1212
|
+
componentDidLoad() {
|
|
1213
|
+
if (!this.isMobileDevice) {
|
|
1214
|
+
super.componentDidLoad();
|
|
1215
|
+
}
|
|
2242
1216
|
}
|
|
2243
|
-
}
|
|
2244
|
-
(() => {
|
|
2245
|
-
VegaInternalIconManager.register({
|
|
2246
|
-
'caret-down': Icons['caret-down'],
|
|
2247
|
-
});
|
|
2248
|
-
})();
|
|
2249
|
-
VegaDatePickerMonthYearDropdownRenderer.monthName = [
|
|
2250
|
-
'January',
|
|
2251
|
-
'February',
|
|
2252
|
-
'March',
|
|
2253
|
-
'April',
|
|
2254
|
-
'May',
|
|
2255
|
-
'June',
|
|
2256
|
-
'July',
|
|
2257
|
-
'August',
|
|
2258
|
-
'September',
|
|
2259
|
-
'October',
|
|
2260
|
-
'November',
|
|
2261
|
-
'December',
|
|
2262
|
-
];
|
|
2263
|
-
__decorate$3([
|
|
2264
|
-
MapToComponentField()
|
|
2265
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "host", void 0);
|
|
2266
|
-
__decorate$3([
|
|
2267
|
-
MapToComponentField()
|
|
2268
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "translationSlimmer", void 0);
|
|
2269
|
-
__decorate$3([
|
|
2270
|
-
MapToComponentField()
|
|
2271
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
2272
|
-
__decorate$3([
|
|
2273
|
-
MapToComponentField()
|
|
2274
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2275
|
-
__decorate$3([
|
|
2276
|
-
MapToComponentField()
|
|
2277
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "mode", void 0);
|
|
2278
|
-
__decorate$3([
|
|
2279
|
-
MapToComponentField()
|
|
2280
|
-
], VegaDatePickerMonthYearDropdownRenderer.prototype, "vegaDatePickerMonthYearChangeEventController", void 0);
|
|
2281
|
-
|
|
2282
|
-
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2283
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2284
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2285
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2286
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2287
|
-
};
|
|
2288
|
-
/**
|
|
2289
|
-
* VegaDatePickerMonthYearChangeEventController to handle the month year change event emitter
|
|
2290
|
-
*/
|
|
2291
|
-
class VegaDatePickerMonthYearChangeEventController extends VegaSlimmer {
|
|
2292
1217
|
/**
|
|
2293
|
-
*
|
|
1218
|
+
* We need to clear the calendar state when the property or state of the vega-date-picker is completed,
|
|
1219
|
+
* such as when the user inputs a range value. we can refill the selecting state in calendar according the new value.
|
|
2294
1220
|
*/
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
ChangeManager.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalMonthYearChange), this.observer);
|
|
1221
|
+
async componentDidRender() {
|
|
1222
|
+
await this.clearCalendarStateTaskQueue.runTask();
|
|
2298
1223
|
}
|
|
2299
|
-
/**
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
1224
|
+
/** doOpen */
|
|
1225
|
+
async doOpen() {
|
|
1226
|
+
await this.showCalendar();
|
|
1227
|
+
}
|
|
1228
|
+
/** doClose */
|
|
1229
|
+
async doClose() {
|
|
1230
|
+
await this.hideCalendar();
|
|
1231
|
+
}
|
|
1232
|
+
/** watchDisabled */
|
|
1233
|
+
async watchDisabled() {
|
|
1234
|
+
await this.hideCalendar();
|
|
1235
|
+
}
|
|
1236
|
+
/** watch calendar show state */
|
|
1237
|
+
async watchIsCalendarShow() {
|
|
1238
|
+
await this.clearCalendarSelectingState();
|
|
2306
1239
|
}
|
|
2307
1240
|
/**
|
|
2308
|
-
*
|
|
2309
|
-
*
|
|
2310
|
-
* @returns {DatePickerMonthYearTypes} the month and year summary
|
|
1241
|
+
* Watch isCalendarShow state change to clear selecting state in calendar.
|
|
2311
1242
|
*/
|
|
2312
|
-
|
|
2313
|
-
if (this.
|
|
2314
|
-
|
|
2315
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2316
|
-
month: this.vegaDatePickerCalendarRenderer.getStartMonthYearHeaderRef().month.innerText,
|
|
2317
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2318
|
-
year: this.vegaDatePickerCalendarRenderer.getStartMonthYearHeaderRef().year.innerText,
|
|
2319
|
-
};
|
|
1243
|
+
async showCalendar() {
|
|
1244
|
+
if (this.isMobileDevice) {
|
|
1245
|
+
await this.vegaDatePickerCalendarRenderer.getMobileModalRef().modal('show');
|
|
2320
1246
|
}
|
|
2321
1247
|
else {
|
|
2322
|
-
|
|
2323
|
-
{
|
|
2324
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2325
|
-
month: this.vegaDatePickerCalendarRenderer.getStartMonthYearHeaderRef().month.innerText,
|
|
2326
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2327
|
-
year: this.vegaDatePickerCalendarRenderer.getStartMonthYearHeaderRef().year.innerText,
|
|
2328
|
-
},
|
|
2329
|
-
{
|
|
2330
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2331
|
-
month: this.vegaDatePickerCalendarRenderer.getEndMonthYearHeaderRef().month.innerText,
|
|
2332
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2333
|
-
year: this.vegaDatePickerCalendarRenderer.getEndMonthYearHeaderRef().year.innerText,
|
|
2334
|
-
},
|
|
2335
|
-
];
|
|
1248
|
+
this.show();
|
|
2336
1249
|
}
|
|
2337
1250
|
}
|
|
2338
1251
|
/**
|
|
2339
|
-
*
|
|
2340
|
-
*
|
|
2341
|
-
* @returns {DatePickerMonthYearTypes} the month and year summary
|
|
1252
|
+
* Hide calendar in both mobile and desktop mode.
|
|
2342
1253
|
*/
|
|
2343
|
-
|
|
2344
|
-
if (this.
|
|
2345
|
-
|
|
2346
|
-
month: VegaDatePickerMonthYearDropdownRenderer.monthName[parseInt(
|
|
2347
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2348
|
-
this.monthYearDropdownRenderer.getStartDropdownRef().month
|
|
2349
|
-
.selectedSourceKey)],
|
|
2350
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2351
|
-
year: this.monthYearDropdownRenderer.getStartDropdownRef().year.selectedSourceKey,
|
|
2352
|
-
};
|
|
1254
|
+
async hideCalendar() {
|
|
1255
|
+
if (this.isMobileDevice) {
|
|
1256
|
+
await this.vegaDatePickerCalendarRenderer.getMobileModalRef().modal('hide');
|
|
2353
1257
|
}
|
|
2354
1258
|
else {
|
|
2355
|
-
|
|
2356
|
-
{
|
|
2357
|
-
month: VegaDatePickerMonthYearDropdownRenderer.monthName[parseInt(
|
|
2358
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2359
|
-
this.monthYearDropdownRenderer.getStartDropdownRef().month
|
|
2360
|
-
.selectedSourceKey)],
|
|
2361
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2362
|
-
year: this.monthYearDropdownRenderer.getStartDropdownRef().year
|
|
2363
|
-
.selectedSourceKey,
|
|
2364
|
-
},
|
|
2365
|
-
{
|
|
2366
|
-
month: VegaDatePickerMonthYearDropdownRenderer.monthName[parseInt(
|
|
2367
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2368
|
-
this.monthYearDropdownRenderer.getEndDropdownRef().month
|
|
2369
|
-
.selectedSourceKey)],
|
|
2370
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2371
|
-
year: this.monthYearDropdownRenderer.getEndDropdownRef().year
|
|
2372
|
-
.selectedSourceKey,
|
|
2373
|
-
},
|
|
2374
|
-
];
|
|
1259
|
+
this.hide();
|
|
2375
1260
|
}
|
|
2376
1261
|
}
|
|
2377
1262
|
/**
|
|
2378
|
-
*
|
|
1263
|
+
* Update isCalendarShow state.
|
|
2379
1264
|
*
|
|
2380
|
-
* @
|
|
1265
|
+
* @param {boolean} isShow - is calendar show
|
|
2381
1266
|
*/
|
|
2382
|
-
|
|
2383
|
-
|
|
1267
|
+
updateIsCalendarShowState(isShow) {
|
|
1268
|
+
this.isCalendarShow = isShow;
|
|
2384
1269
|
}
|
|
2385
1270
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
1271
|
+
* Clear selecting state in calendar.
|
|
1272
|
+
*/
|
|
1273
|
+
async clearCalendarSelectingState() {
|
|
1274
|
+
if (!this.isCalendarShow) {
|
|
1275
|
+
const calendar = this.vegaDatePickerCalendarRenderer.getCalendarRef();
|
|
1276
|
+
await this.clearCalendarStateTaskQueue.enqueue({
|
|
1277
|
+
/** Clear the calendar selecting state */
|
|
1278
|
+
run: async () => await calendar.reset(),
|
|
1279
|
+
}, false);
|
|
1280
|
+
}
|
|
2392
1281
|
}
|
|
2393
1282
|
}
|
|
2394
|
-
__decorate$
|
|
2395
|
-
MapToComponentField()
|
|
2396
|
-
], VegaDatePickerMonthYearChangeEventController.prototype, "host", void 0);
|
|
2397
|
-
__decorate$2([
|
|
1283
|
+
__decorate$b([
|
|
2398
1284
|
MapToComponentField()
|
|
2399
|
-
],
|
|
2400
|
-
__decorate$
|
|
1285
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "dropdownConfig", void 0);
|
|
1286
|
+
__decorate$b([
|
|
2401
1287
|
MapToComponentField()
|
|
2402
|
-
],
|
|
2403
|
-
__decorate$
|
|
1288
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "vegaDatePickerRenderer", void 0);
|
|
1289
|
+
__decorate$b([
|
|
2404
1290
|
MapToComponentField()
|
|
2405
|
-
],
|
|
2406
|
-
__decorate$
|
|
1291
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1292
|
+
__decorate$b([
|
|
1293
|
+
MapToComponentField({ writable: true })
|
|
1294
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "isCalendarShow", void 0);
|
|
1295
|
+
__decorate$b([
|
|
2407
1296
|
MapToComponentField()
|
|
2408
|
-
],
|
|
2409
|
-
__decorate$
|
|
2410
|
-
MapToComponentMethod('
|
|
2411
|
-
],
|
|
2412
|
-
__decorate$
|
|
2413
|
-
MapToComponentMethod('
|
|
2414
|
-
],
|
|
1297
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "isMobileDevice", void 0);
|
|
1298
|
+
__decorate$b([
|
|
1299
|
+
MapToComponentMethod('componentDidRender')
|
|
1300
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "componentDidRender", null);
|
|
1301
|
+
__decorate$b([
|
|
1302
|
+
MapToComponentMethod('doOpen')
|
|
1303
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "doOpen", null);
|
|
1304
|
+
__decorate$b([
|
|
1305
|
+
MapToComponentMethod('doClose')
|
|
1306
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "doClose", null);
|
|
1307
|
+
__decorate$b([
|
|
1308
|
+
MapToComponentMethod('watchDisabled')
|
|
1309
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "watchDisabled", null);
|
|
1310
|
+
__decorate$b([
|
|
1311
|
+
MapToComponentMethod('watchIsCalendarShow')
|
|
1312
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "watchIsCalendarShow", null);
|
|
2415
1313
|
|
|
2416
|
-
const vegaDatePickerCss = ":host{display:inline-block;width:100%;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host .vega-input-container{position:relative;display:block;border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));display:flex;align-items:center}:host .vega-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-container .date-picker-input{padding-left:16px;padding-right:16px;width:100%;box-sizing:border-box;display:flex;align-items:center}:host .vega-input-container.default .date-picker-input{padding-left:16px;padding-right:16px}:host .vega-input-container.small .date-picker-input{padding-left:12px;padding-right:12px}:host .vega-input-container.default .date-picker-input input{padding-top:12px;padding-bottom:12px}:host .vega-input-container.small .date-picker-input input{padding-top:8px;padding-bottom:8px}:host .vega-input-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-container.single-mode.error:focus-within,:host .vega-input-container.range-mode.error .date-picker-input:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));border-radius:8px}:host .vega-input-container.range-mode.error .date-picker-input:first-of-type:focus-within{margin:-1px 0 -1px -1px}:host .vega-input-container.range-mode.error .date-picker-input:last-of-type:focus-within{margin:-1px -1px -1px 0}:host .vega-input-container.single-mode:not(.error):focus-within,:host .vega-input-container.range-mode:not(.error) .date-picker-input:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));border-radius:8px}:host .vega-input-container.range-mode .date-picker-input:first-of-type:focus-within{margin:-1px 0 -1px -1px}:host .vega-input-container.range-mode .date-picker-input:last-of-type:focus-within{margin:-1px -1px -1px 0}:host .vega-input-container input{width:100%;box-sizing:content-box;border-width:0px;margin:0px;outline:2px solid transparent;outline-offset:2px;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-left:8px;padding-right:8px;padding-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}.vega-input-clear-icon{width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-input-clear-icon vega-icon{min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0}:host .range-input-divider{width:1px;height:24px;border-style:solid;border-right-width:1px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}:host .vega-input-container.range-mode.mobile .range-input-divider{width:100%;height:1px;border-style:solid;border-right-width:0px;border-top-width:1px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}:host .vega-input-prefix{display:flex;margin-right:8px}:host .vega-input-container.range-mode.mobile.small .vega-input-prefix{margin-right:8px}:host .vega-input-container.range-mode.mobile{flex-direction:column}:host .vega-input-container.range-mode.mobile .date-picker-input:last-of-type{padding-left:40px}:host .vega-input-container.range-mode.mobile.small .date-picker-input:last-of-type{padding-left:36px}:host(.disabled) .vega-input-container{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.disabled) .vega-input-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .vega-input-container input{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}
|
|
1314
|
+
const vegaDatePickerCss = ":host{display:inline-block;width:100%;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host .vega-input-container{position:relative;display:block;border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));display:flex;align-items:center}:host .vega-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-container .date-picker-input{padding-left:16px;padding-right:16px;width:100%;box-sizing:border-box;display:flex;align-items:center}:host .vega-input-container.default .date-picker-input{padding-left:16px;padding-right:16px}:host .vega-input-container.small .date-picker-input{padding-left:12px;padding-right:12px}:host .vega-input-container.default .date-picker-input input{padding-top:12px;padding-bottom:12px}:host .vega-input-container.small .date-picker-input input{padding-top:8px;padding-bottom:8px}:host .vega-input-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-container.single-mode.error:focus-within,:host .vega-input-container.range-mode.error .date-picker-input:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));border-radius:8px}:host .vega-input-container.range-mode.error .date-picker-input:first-of-type:focus-within{margin:-1px 0 -1px -1px}:host .vega-input-container.range-mode.error .date-picker-input:last-of-type:focus-within{margin:-1px -1px -1px 0}:host .vega-input-container.single-mode:not(.error):focus-within,:host .vega-input-container.range-mode:not(.error) .date-picker-input:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));border-radius:8px}:host .vega-input-container.range-mode .date-picker-input:first-of-type:focus-within{margin:-1px 0 -1px -1px}:host .vega-input-container.range-mode .date-picker-input:last-of-type:focus-within{margin:-1px -1px -1px 0}:host .vega-input-container input{width:100%;box-sizing:content-box;border-width:0px;margin:0px;outline:2px solid transparent;outline-offset:2px;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-container input{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-container input::placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-left:8px;padding-right:8px;padding-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}.vega-input-clear-icon{width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-input-clear-icon vega-icon{min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0}:host .range-input-divider{width:1px;height:24px;border-style:solid;border-right-width:1px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}:host .vega-input-container.range-mode.mobile .range-input-divider{width:100%;height:1px;border-style:solid;border-right-width:0px;border-top-width:1px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}:host .vega-input-prefix{display:flex;margin-right:8px}:host .vega-input-container.range-mode.mobile.small .vega-input-prefix{margin-right:8px}:host .vega-input-container.range-mode.mobile{flex-direction:column}:host .vega-input-container.range-mode.mobile .date-picker-input:last-of-type{padding-left:40px}:host .vega-input-container.range-mode.mobile.small .date-picker-input:last-of-type{padding-left:36px}:host(.disabled) .vega-input-container{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.disabled) .vega-input-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .vega-input-container input{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}";
|
|
2417
1315
|
|
|
2418
|
-
var __decorate$
|
|
1316
|
+
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2419
1317
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2420
1318
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2421
1319
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2434,19 +1332,16 @@ const VegaDatePicker = class {
|
|
|
2434
1332
|
this.monthYearChange = createEvent(this, "monthYearChange", 7);
|
|
2435
1333
|
this.globalSlimmers = {};
|
|
2436
1334
|
this.translationSlimmer = new TranslationSlimmer();
|
|
2437
|
-
this.
|
|
2438
|
-
this.vegaDatePickerCalendarController = new VegaDatePickerCalendarController();
|
|
2439
|
-
this.vegaDatePickerZIndexController = new VegaDatePickerZIndexController();
|
|
1335
|
+
this.calendarOpenStateController = new VegaDatePickerCalendarOpenStateController();
|
|
2440
1336
|
this.vegaDatePickerValueController = new VegaDatePickerValueController();
|
|
2441
1337
|
this.vegaDatePickerFormatController = new VegaDatePickerFormatController('single');
|
|
2442
1338
|
this.startInputFormatController = new VegaDatePickerFormatController('rangeStart');
|
|
2443
1339
|
this.endInputFormatController = new VegaDatePickerFormatController('rangeEnd');
|
|
2444
|
-
this.vegaDatePickerElementAppenderController = new VegaDatePickerElementAppenderController();
|
|
2445
1340
|
this.vegaDatePickerKeyboardController = new VegaDatePickerKeyboardController();
|
|
2446
1341
|
this.vegaDatePickerRenderer = new VegaDatePickerRenderer();
|
|
2447
1342
|
this.vegaDatePickerSingleInputRenderer = new VegaDatePickerSingleInputRenderer();
|
|
2448
1343
|
this.vegaDatePickerRangeInputRenderer = new VegaDatePickerRangeInputRenderer();
|
|
2449
|
-
this.vegaDatePickerCalendarRenderer = new VegaDatePickerCalendarRenderer();
|
|
1344
|
+
this.vegaDatePickerCalendarRenderer = new VegaDatePickerCalendarRenderer$1();
|
|
2450
1345
|
this.formFieldController = new FormFieldControllerSlimmer({
|
|
2451
1346
|
propertyRules: [
|
|
2452
1347
|
{
|
|
@@ -2481,12 +1376,12 @@ const VegaDatePicker = class {
|
|
|
2481
1376
|
].filter(Boolean);
|
|
2482
1377
|
},
|
|
2483
1378
|
});
|
|
2484
|
-
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaMonthYearChange);
|
|
2485
1379
|
this.changeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaChange);
|
|
2486
|
-
this.
|
|
1380
|
+
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaMonthYearChange);
|
|
1381
|
+
this.inputEventPrevent = new ChildNodesEventPreventSlimmer([VegaChange, VegaClear, VegaMonthYearChange], () => this.vegaDatePickerCalendarRenderer.getCalendarRef());
|
|
2487
1382
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaDatePickerRuntimeMetricsPayloadDefinition);
|
|
2488
|
-
this.
|
|
2489
|
-
this.
|
|
1383
|
+
this.isMobileDevice = getDeviceType() === DeviceType.MOBILE;
|
|
1384
|
+
this.isCalendarShow = false;
|
|
2490
1385
|
/**
|
|
2491
1386
|
* Specifies the selection mode of the date picker.
|
|
2492
1387
|
*
|
|
@@ -2607,6 +1502,8 @@ const VegaDatePicker = class {
|
|
|
2607
1502
|
*/
|
|
2608
1503
|
this.isDateDisabled = () => false;
|
|
2609
1504
|
}
|
|
1505
|
+
watchIsCalendarShow() {
|
|
1506
|
+
}
|
|
2610
1507
|
/*
|
|
2611
1508
|
* The below method is e2e-test covered in
|
|
2612
1509
|
* @see{module:vega-date-picker-mode-change}
|
|
@@ -2649,8 +1546,6 @@ const VegaDatePicker = class {
|
|
|
2649
1546
|
}
|
|
2650
1547
|
watchDisabled() {
|
|
2651
1548
|
}
|
|
2652
|
-
watchIsDateDisabled() {
|
|
2653
|
-
}
|
|
2654
1549
|
/**
|
|
2655
1550
|
* Invoke this method to close the calendar dropdown
|
|
2656
1551
|
* associated with the date picker.
|
|
@@ -2676,6 +1571,7 @@ const VegaDatePicker = class {
|
|
|
2676
1571
|
}
|
|
2677
1572
|
get host() { return getElement(this); }
|
|
2678
1573
|
static get watchers() { return {
|
|
1574
|
+
"isCalendarShow": ["watchIsCalendarShow"],
|
|
2679
1575
|
"mode": ["watchMode"],
|
|
2680
1576
|
"value": ["watchValue"],
|
|
2681
1577
|
"format": ["watchFormat"],
|
|
@@ -2684,110 +1580,1405 @@ const VegaDatePicker = class {
|
|
|
2684
1580
|
"maxDate": ["watchMaxDate"],
|
|
2685
1581
|
"allowRepick": ["watchAllowRepick"],
|
|
2686
1582
|
"showYearMonthDropdowns": ["watchShowYearMonthDropdowns"],
|
|
2687
|
-
"disabled": ["watchDisabled"]
|
|
2688
|
-
"isDateDisabled": ["watchIsDateDisabled"]
|
|
1583
|
+
"disabled": ["watchDisabled"]
|
|
2689
1584
|
}; }
|
|
2690
1585
|
};
|
|
2691
|
-
__decorate$
|
|
1586
|
+
__decorate$a([
|
|
2692
1587
|
InjectVegaGlobalSlimmer()
|
|
2693
1588
|
], VegaDatePicker.prototype, "globalSlimmers", void 0);
|
|
2694
|
-
__decorate$
|
|
1589
|
+
__decorate$a([
|
|
2695
1590
|
InjectVegaSlimmer()
|
|
2696
1591
|
], VegaDatePicker.prototype, "translationSlimmer", void 0);
|
|
2697
|
-
__decorate$
|
|
2698
|
-
InjectVegaSlimmer()
|
|
2699
|
-
], VegaDatePicker.prototype, "vegaDatePickerMobileController", void 0);
|
|
2700
|
-
__decorate$1([
|
|
2701
|
-
InjectVegaSlimmer()
|
|
2702
|
-
], VegaDatePicker.prototype, "vegaDatePickerCalendarController", void 0);
|
|
2703
|
-
__decorate$1([
|
|
1592
|
+
__decorate$a([
|
|
2704
1593
|
InjectVegaSlimmer()
|
|
2705
|
-
], VegaDatePicker.prototype, "
|
|
2706
|
-
__decorate$
|
|
1594
|
+
], VegaDatePicker.prototype, "calendarOpenStateController", void 0);
|
|
1595
|
+
__decorate$a([
|
|
2707
1596
|
InjectVegaSlimmer()
|
|
2708
1597
|
], VegaDatePicker.prototype, "vegaDatePickerValueController", void 0);
|
|
2709
|
-
__decorate$
|
|
1598
|
+
__decorate$a([
|
|
2710
1599
|
InjectVegaSlimmer()
|
|
2711
1600
|
], VegaDatePicker.prototype, "vegaDatePickerFormatController", void 0);
|
|
2712
|
-
__decorate$
|
|
1601
|
+
__decorate$a([
|
|
2713
1602
|
InjectVegaSlimmer()
|
|
2714
1603
|
], VegaDatePicker.prototype, "startInputFormatController", void 0);
|
|
2715
|
-
__decorate$
|
|
1604
|
+
__decorate$a([
|
|
2716
1605
|
InjectVegaSlimmer()
|
|
2717
1606
|
], VegaDatePicker.prototype, "endInputFormatController", void 0);
|
|
2718
|
-
__decorate$
|
|
2719
|
-
InjectVegaSlimmer()
|
|
2720
|
-
], VegaDatePicker.prototype, "vegaDatePickerElementAppenderController", void 0);
|
|
2721
|
-
__decorate$1([
|
|
1607
|
+
__decorate$a([
|
|
2722
1608
|
InjectVegaSlimmer()
|
|
2723
1609
|
], VegaDatePicker.prototype, "vegaDatePickerKeyboardController", void 0);
|
|
2724
|
-
__decorate$
|
|
1610
|
+
__decorate$a([
|
|
2725
1611
|
InjectVegaSlimmer()
|
|
2726
1612
|
], VegaDatePicker.prototype, "vegaDatePickerRenderer", void 0);
|
|
2727
|
-
__decorate$
|
|
1613
|
+
__decorate$a([
|
|
2728
1614
|
InjectVegaSlimmer()
|
|
2729
1615
|
], VegaDatePicker.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
2730
|
-
__decorate$
|
|
1616
|
+
__decorate$a([
|
|
2731
1617
|
InjectVegaSlimmer()
|
|
2732
1618
|
], VegaDatePicker.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
2733
|
-
__decorate$
|
|
1619
|
+
__decorate$a([
|
|
2734
1620
|
InjectVegaSlimmer()
|
|
2735
1621
|
], VegaDatePicker.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
2736
|
-
__decorate$
|
|
1622
|
+
__decorate$a([
|
|
2737
1623
|
InjectVegaSlimmer()
|
|
2738
1624
|
], VegaDatePicker.prototype, "formFieldController", void 0);
|
|
2739
|
-
__decorate$
|
|
2740
|
-
InjectVegaSlimmer()
|
|
2741
|
-
], VegaDatePicker.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2742
|
-
__decorate$1([
|
|
1625
|
+
__decorate$a([
|
|
2743
1626
|
InjectVegaSlimmer()
|
|
2744
1627
|
], VegaDatePicker.prototype, "changeEventEmitter", void 0);
|
|
2745
|
-
__decorate$
|
|
1628
|
+
__decorate$a([
|
|
1629
|
+
InjectVegaSlimmer()
|
|
1630
|
+
], VegaDatePicker.prototype, "monthYearChangeEventEmitter", void 0);
|
|
1631
|
+
__decorate$a([
|
|
2746
1632
|
InjectVegaSlimmer()
|
|
2747
1633
|
], VegaDatePicker.prototype, "inputEventPrevent", void 0);
|
|
2748
|
-
__decorate$
|
|
1634
|
+
__decorate$a([
|
|
2749
1635
|
InjectVegaSlimmer()
|
|
2750
1636
|
], VegaDatePicker.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
2751
|
-
__decorate$
|
|
2752
|
-
InjectVegaSlimmer()
|
|
2753
|
-
], VegaDatePicker.prototype, "monthYearDropdownRenderer", void 0);
|
|
2754
|
-
__decorate$1([
|
|
2755
|
-
InjectVegaSlimmer()
|
|
2756
|
-
], VegaDatePicker.prototype, "vegaDatePickerMonthYearChangeEventController", void 0);
|
|
2757
|
-
__decorate$1([
|
|
1637
|
+
__decorate$a([
|
|
2758
1638
|
ComponentLoadRequired()
|
|
2759
1639
|
], VegaDatePicker.prototype, "watchValue", null);
|
|
2760
1640
|
VegaDatePicker.style = vegaDatePickerCss;
|
|
2761
1641
|
|
|
2762
|
-
const vegaDatePickerCalendarCss = ":host{--vega-litepicker-container-width:calc(var(--vega-litepicker-day-width) * 7);--vega-litepicker-day-width:40px;--vega-litepicker-day-height:40px}.litepicker{display:none}.litepicker button{border-width:0px;background:none}.litepicker .container__main{display:flex;flex-direction:column;padding:32px;border-radius:12px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));box-shadow:var(--v-shadow-dropdown-menu, 0px 2px 4px -2px rgba(0, 0, 0, 0.1), 0px 4px 6px -1px rgba(0, 0, 0, 0.1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1))}@media screen and (min-width: 320px) and (max-width: 350px){.litepicker .container__main{padding:12px}}.litepicker .container__months{display:flex}.litepicker .container__months.columns-2{width:100%}@media (min-width: 320px){.litepicker .container__months.columns-2{flex-direction:column}}@media (min-width: 768px){.litepicker .container__months.columns-2{flex-direction:row}}.litepicker .container__months .month-item{box-sizing:content-box;position:relative;width:var(--vega-litepicker-container-width);z-index:1}@media (min-width: 768px){.litepicker .container__months.columns-2 .month-item:first-of-type{padding-right:32px}}@media (min-width: 768px){.litepicker .container__months.columns-2 .month-item:last-of-type{padding-left:32px}}.litepicker .container__months .month-item:nth-child(2)::before{background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:32px;margin-bottom:32px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:none;width:1px;content:\"\"}@media (min-width: 768px){.litepicker .container__months .month-item:nth-child(2)::before{display:block}}.litepicker .container__months .month-item-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:32px;text-align:center;font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}.litepicker .container__months .month-item-header div>.month-item-name{margin-right:5px}.litepicker .container__months .month-item-header .button-previous-month,.litepicker .container__months .month-item-header .button-next-month{visibility:hidden;text-decoration:none;cursor:default}.litepicker .container__months .month-item-header .button-previous-month *,.litepicker .container__months .month-item-header .button-next-month *{pointer-events:none}.litepicker .container__months .month-item-header .button-previous-month>svg,.litepicker .container__months .month-item-header .button-previous-month>img{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.litepicker .container__months .month-item-header .button-next-month>svg,.litepicker .container__months .month-item-header .button-next-month>img{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.litepicker .container__months .month-item-weekdays-row{display:flex;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.litepicker .container__months .month-item-weekdays-row>div{padding-top:12px;padding-bottom:12px;padding-left:8px;padding-right:8px;display:flex;align-items:center;justify-content:center;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;width:var(--vega-litepicker-day-width)}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__months .month-item-weekdays-row>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__months .month-item-weekdays-row>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__months .month-item-weekdays-row>div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.litepicker .container__months .month-item:first-child .button-previous-month{visibility:visible}.litepicker .container__months .month-item:last-child .button-next-month{visibility:visible}.litepicker .container__months .month-item.no-previous-month .button-previous-month{visibility:hidden}.litepicker .container__months .month-item.no-next-month .button-next-month{visibility:hidden}.litepicker .container__days{display:flex;flex-wrap:wrap;justify-content:flex-start;text-align:center}.litepicker.static-height .container__days{align-content:flex-start;height:calc(var(--vega-litepicker-day-height) * 6)}.litepicker .container__days>div,.litepicker .container__days>a{padding:4px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--vega-litepicker-day-height);width:var(--vega-litepicker-day-width)}.litepicker .container__days .day-item{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;text-align:center;border-radius:9999px;cursor:default}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.litepicker .container__days .day-item:not(.is-locked):active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));border-width:0px}.litepicker .day-item.is-start-date.is-end-date.is-locked:active{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}.litepicker .container__days .day-item:hover:before{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));border-radius:9999px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;content:\" \";z-index:-1}.litepicker .container__days .day-item.is-locked:hover:before,html.dark .litepicker .container__days .day-item.is-locked:hover:before{border-style:none}.litepicker .container__days .day-item:hover{position:relative}.litepicker .container__days .day-item.is-today{color:rgba(var(--v-text-link, 19, 98, 226, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.litepicker .container__days .day-item.is-in-range{border-radius:0px;position:relative;z-index:2;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.litepicker .container__days .day-item:not(.is-locked).is-in-range:hover:before{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));border-radius:9999px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;content:\" \";z-index:-1}.litepicker .container__days .day-item.is-start-date{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-radius:9999px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));position:relative}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__days .day-item.is-start-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__days .day-item.is-start-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__days .day-item.is-start-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.litepicker .container__days .day-item.is-start-date:hover:before{z-index:2}.litepicker .container__days .day-item.is-start-date:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-top-left-radius:9999px;border-bottom-left-radius:9999px;content:\" \";z-index:-1;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.litepicker .container__days .day-item.is-start-date.is-flipped{border-radius:9999px;position:relative}.litepicker .container__days .day-item.is-start-date.is-flipped:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;content:\" \";z-index:-1}.litepicker .container__days .day-item.is-end-date{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-radius:9999px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));position:relative}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .container__days .day-item.is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .container__days .day-item.is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .container__days .day-item.is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.litepicker .container__days .day-item.is-end-date:hover:before{z-index:2}.litepicker .container__days .day-item.is-end-date:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;content:\" \";z-index:-1;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.litepicker .container__days .day-item.is-end-date.is-flipped{border-radius:9999px;position:relative}.litepicker .container__days .day-item.is-end-date.is-flipped:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-top-left-radius:9999px;border-bottom-left-radius:9999px;content:\" \";z-index:-1}.litepicker .container__days .day-item.is-start-date.is-end-date{border-radius:9999px}.litepicker .container__days .day-item.is-start-date.is-end-date:after,html.dark .litepicker .container__days .day-item.is-start-date.is-end-date:after{background:none}.litepicker .container__tooltip{display:none}.litepicker .container__days .day-item.is-locked{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));cursor:not-allowed}.litepicker .container__days .day-item.is-disabled{text-decoration:line-through}.litepicker.mobilefriendly[data-plugins*=mobilefriendly] .container__days>div{height:var(--vega-litepicker-day-height)}.litepicker .clear-button{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.litepicker .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.litepicker .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.litepicker .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}.litepicker .footer-container{margin-top:16px;height:24px}:host(.vega-force-hidden){display:none !important}.litepicker{left:initial !important;top:initial !important;position:initial !important}:host{position:absolute}.button-next-month svg,.button-previous-month svg{width:12px;height:16px}.litepicker .month-item-header>div.dropdown-section{display:flex;gap:12px}.litepicker .month-item-header>div.dropdown-section .dropdown-current-value{position:relative;display:flex;gap:4px;align-items:center;cursor:pointer}.litepicker .month-item-header>div.dropdown-section .dropdown-current-value.active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}.litepicker .month-item-header>div.dropdown-section .dropdown-current-value.active:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}.litepicker .month-item-header>div.dropdown-section .dropdown-current-value.active:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}.litepicker .month-item-header>div.dropdown-section .dropdown-current-value.active:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}";
|
|
1642
|
+
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1643
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1644
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1645
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1646
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1647
|
+
};
|
|
1648
|
+
class VegaDatePickerCalendarRenderer extends VegaSlimmer {
|
|
1649
|
+
render() {
|
|
1650
|
+
return (h("div", { class: {
|
|
1651
|
+
'calendar': true,
|
|
1652
|
+
'static-height': this.staticHeight,
|
|
1653
|
+
} },
|
|
1654
|
+
h("div", { class: "container__main" },
|
|
1655
|
+
this.renderContainer(),
|
|
1656
|
+
this.renderFooter())));
|
|
1657
|
+
}
|
|
1658
|
+
renderContainer() {
|
|
1659
|
+
const shouldRenderRangeMonth = this.shouldRenderRangeMonth();
|
|
1660
|
+
return (h("div", { class: {
|
|
1661
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1662
|
+
'container__months': true,
|
|
1663
|
+
'columns-2': shouldRenderRangeMonth,
|
|
1664
|
+
} }, shouldRenderRangeMonth ? this.renderRangeMonth() : this.monthItemRenderer.render('start')));
|
|
1665
|
+
}
|
|
1666
|
+
renderRangeMonth() {
|
|
1667
|
+
return (h(Fragment, null,
|
|
1668
|
+
this.monthItemRenderer.render('start'),
|
|
1669
|
+
this.monthItemRenderer.render('end')));
|
|
1670
|
+
}
|
|
1671
|
+
renderFooter() {
|
|
1672
|
+
return (this.clearButton && (h("div", { class: "footer-container" },
|
|
1673
|
+
h("vega-button-link", { ref: (ref) => {
|
|
1674
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
1675
|
+
this.clearCalendar();
|
|
1676
|
+
});
|
|
1677
|
+
}, label: this.translationSlimmer.t('Clear') }))));
|
|
1678
|
+
}
|
|
1679
|
+
shouldRenderRangeMonth() {
|
|
1680
|
+
return this.mode === 'range' && !this.isMobileDevice;
|
|
1681
|
+
}
|
|
1682
|
+
clearCalendar() {
|
|
1683
|
+
this.clearEventEmitter.emit();
|
|
1684
|
+
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), {});
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
__decorate$9([
|
|
1688
|
+
MapToComponentField()
|
|
1689
|
+
], VegaDatePickerCalendarRenderer.prototype, "host", void 0);
|
|
1690
|
+
__decorate$9([
|
|
1691
|
+
MapToComponentField()
|
|
1692
|
+
], VegaDatePickerCalendarRenderer.prototype, "clearButton", void 0);
|
|
1693
|
+
__decorate$9([
|
|
1694
|
+
MapToComponentField()
|
|
1695
|
+
], VegaDatePickerCalendarRenderer.prototype, "monthItemRenderer", void 0);
|
|
1696
|
+
__decorate$9([
|
|
1697
|
+
MapToComponentField()
|
|
1698
|
+
], VegaDatePickerCalendarRenderer.prototype, "staticHeight", void 0);
|
|
1699
|
+
__decorate$9([
|
|
1700
|
+
MapToComponentField()
|
|
1701
|
+
], VegaDatePickerCalendarRenderer.prototype, "translationSlimmer", void 0);
|
|
1702
|
+
__decorate$9([
|
|
1703
|
+
MapToComponentField()
|
|
1704
|
+
], VegaDatePickerCalendarRenderer.prototype, "mode", void 0);
|
|
1705
|
+
__decorate$9([
|
|
1706
|
+
MapToComponentField()
|
|
1707
|
+
], VegaDatePickerCalendarRenderer.prototype, "clearEventEmitter", void 0);
|
|
1708
|
+
__decorate$9([
|
|
1709
|
+
MapToComponentField()
|
|
1710
|
+
], VegaDatePickerCalendarRenderer.prototype, "isMobileDevice", void 0);
|
|
1711
|
+
|
|
1712
|
+
const MonthNames = [
|
|
1713
|
+
'January',
|
|
1714
|
+
'February',
|
|
1715
|
+
'March',
|
|
1716
|
+
'April',
|
|
1717
|
+
'May',
|
|
1718
|
+
'June',
|
|
1719
|
+
'July',
|
|
1720
|
+
'August',
|
|
1721
|
+
'September',
|
|
1722
|
+
'October',
|
|
1723
|
+
'November',
|
|
1724
|
+
'December',
|
|
1725
|
+
];
|
|
2763
1726
|
|
|
2764
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1727
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2765
1728
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2766
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2767
|
-
|
|
2768
|
-
else
|
|
2769
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2770
|
-
if (d = decorators[i])
|
|
2771
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1729
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1730
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2772
1731
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2773
1732
|
};
|
|
2774
|
-
|
|
2775
|
-
constructor(
|
|
2776
|
-
|
|
2777
|
-
this.
|
|
2778
|
-
|
|
1733
|
+
class VegaDatePickerCalendarYearMonthSwitcherRenderer extends VegaSlimmer {
|
|
1734
|
+
constructor() {
|
|
1735
|
+
super(...arguments);
|
|
1736
|
+
this.startDropdownRef = {
|
|
1737
|
+
month: null,
|
|
1738
|
+
year: null,
|
|
1739
|
+
};
|
|
1740
|
+
this.endDropdownRef = {
|
|
1741
|
+
month: null,
|
|
1742
|
+
year: null,
|
|
1743
|
+
};
|
|
2779
1744
|
}
|
|
2780
|
-
render() {
|
|
2781
|
-
return h(
|
|
1745
|
+
render(period, type) {
|
|
1746
|
+
return (h("vega-flex", { gap: 'size-8', justifyContent: 'center' },
|
|
1747
|
+
this.showYearMonthDropdowns
|
|
1748
|
+
? this.renderMonthDropdownSwitcher(period, type)
|
|
1749
|
+
: this.renderCurrentMonth(period),
|
|
1750
|
+
this.showYearMonthDropdowns
|
|
1751
|
+
? this.renderYearDropdownSwitcher(period, type)
|
|
1752
|
+
: this.renderCurrentYear(period)));
|
|
1753
|
+
}
|
|
1754
|
+
getMonthDropdownOptions(type) {
|
|
1755
|
+
let currentYear = this.currentPeriod.current.year;
|
|
1756
|
+
const currentMonth = this.currentPeriod.current.month;
|
|
1757
|
+
if (type === 'end' && currentMonth === 12)
|
|
1758
|
+
currentYear += 1;
|
|
1759
|
+
return MonthNames.map((month, index) => {
|
|
1760
|
+
return {
|
|
1761
|
+
key: `${index}`,
|
|
1762
|
+
label: this.translationSlimmer.t(month),
|
|
1763
|
+
disabled: this.isDisabledMonth(currentYear, index + 1),
|
|
1764
|
+
};
|
|
1765
|
+
});
|
|
2782
1766
|
}
|
|
2783
|
-
|
|
1767
|
+
isDisabledMonth(year, month) {
|
|
1768
|
+
var _a, _b, _c, _d;
|
|
1769
|
+
const startMonth = (_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.month;
|
|
1770
|
+
const startYear = (_b = this.minCalendarDate) === null || _b === void 0 ? void 0 : _b.year;
|
|
1771
|
+
const endMonth = (_c = this.maxCalendarDate) === null || _c === void 0 ? void 0 : _c.month;
|
|
1772
|
+
const endYear = (_d = this.maxCalendarDate) === null || _d === void 0 ? void 0 : _d.year;
|
|
1773
|
+
return (year < startYear ||
|
|
1774
|
+
year > endYear ||
|
|
1775
|
+
(year === startYear && startMonth > month) ||
|
|
1776
|
+
(year === endYear && endMonth < month));
|
|
1777
|
+
}
|
|
1778
|
+
getYearDropdownOptions() {
|
|
1779
|
+
var _a, _b, _c, _d;
|
|
1780
|
+
const currentYear = new Date().getFullYear();
|
|
1781
|
+
const startYear = ((_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.year) ||
|
|
1782
|
+
Math.min(((_b = this.maxCalendarDate) === null || _b === void 0 ? void 0 : _b.year) || currentYear, currentYear) -
|
|
1783
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_BEFORE_CURRENT_YEAR;
|
|
1784
|
+
const endYear = ((_c = this.maxCalendarDate) === null || _c === void 0 ? void 0 : _c.year) ||
|
|
1785
|
+
Math.max(((_d = this.minCalendarDate) === null || _d === void 0 ? void 0 : _d.year) || currentYear, currentYear) +
|
|
1786
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_AFTER_CURRENT_YEAR;
|
|
1787
|
+
const years = [];
|
|
1788
|
+
for (let year = startYear; year <= endYear; year++) {
|
|
1789
|
+
years.push({ key: String(year), label: String(year) });
|
|
1790
|
+
}
|
|
1791
|
+
return years;
|
|
1792
|
+
}
|
|
1793
|
+
renderMonthDropdownSwitcher(period, type) {
|
|
1794
|
+
const { month } = period.current;
|
|
1795
|
+
const monthIndex = month - 1;
|
|
1796
|
+
return (h("vega-dropdown", { trigger: "click", selectType: "single", source: this.getMonthDropdownOptions(type), selectedSourceKey: monthIndex.toString(), "max-height": "300", isScreenPosition: this.yearMonthDropdownProps.isScreenPosition, ref: (node) => {
|
|
1797
|
+
if (type === 'start') {
|
|
1798
|
+
this.startDropdownRef.month = node;
|
|
1799
|
+
}
|
|
1800
|
+
else {
|
|
1801
|
+
this.endDropdownRef.month = node;
|
|
1802
|
+
}
|
|
1803
|
+
this.onDropdownShowOrHide(node);
|
|
1804
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, (payload) => {
|
|
1805
|
+
const selectedMonth = parseInt(payload.detail);
|
|
1806
|
+
this.setDateBasedOnSelectedMonth(period, selectedMonth, type);
|
|
1807
|
+
});
|
|
1808
|
+
} }, this.renderCurrentMonth(period)));
|
|
1809
|
+
}
|
|
1810
|
+
renderYearDropdownSwitcher(period, type) {
|
|
1811
|
+
const { year } = period.current;
|
|
1812
|
+
return (h("vega-dropdown", { trigger: "click", selectType: "single", source: this.getYearDropdownOptions(), selectedSourceKey: year.toString(), "max-height": "300", isScreenPosition: this.yearMonthDropdownProps.isScreenPosition, ref: (node) => {
|
|
1813
|
+
if (type === 'start') {
|
|
1814
|
+
this.startDropdownRef.year = node;
|
|
1815
|
+
}
|
|
1816
|
+
else {
|
|
1817
|
+
this.endDropdownRef.year = node;
|
|
1818
|
+
}
|
|
1819
|
+
this.onDropdownShowOrHide(node);
|
|
1820
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, (payload) => {
|
|
1821
|
+
this.setDateBasedOnSelectedYear(period, parseInt(payload.detail), type);
|
|
1822
|
+
});
|
|
1823
|
+
} }, this.renderCurrentYear(period)));
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Control ui when dropdown shows or closes
|
|
1827
|
+
*
|
|
1828
|
+
* @param {HTMLVegaDropdownElement} dropdown - Month or year dropdown
|
|
1829
|
+
*/
|
|
1830
|
+
onDropdownShowOrHide(dropdown) {
|
|
1831
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(dropdown, VegaDropdownShow, async () => {
|
|
1832
|
+
await this.closeOpenDropdowns(dropdown);
|
|
1833
|
+
dropdown.classList.add('active');
|
|
1834
|
+
});
|
|
1835
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(dropdown, VegaDropdownHide, () => {
|
|
1836
|
+
const parentElement = dropdown.closest('.calendar');
|
|
1837
|
+
if (parentElement) {
|
|
1838
|
+
const dropdown = parentElement.querySelector('vega-dropdown.active');
|
|
1839
|
+
dropdown && dropdown.classList.remove('active');
|
|
1840
|
+
}
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
renderCurrentMonth(period) {
|
|
1844
|
+
return (h("div", { class: "month-item-name" },
|
|
1845
|
+
h("span", null, this.translationSlimmer.t(period.current.getMonthName())),
|
|
1846
|
+
this.renderDropdownSwitchIcon()));
|
|
1847
|
+
}
|
|
1848
|
+
renderCurrentYear(period) {
|
|
1849
|
+
return (h("div", { class: "month-item-year" },
|
|
1850
|
+
h("span", null, period.current.year),
|
|
1851
|
+
this.renderDropdownSwitchIcon()));
|
|
1852
|
+
}
|
|
1853
|
+
renderDropdownSwitchIcon() {
|
|
1854
|
+
return (this.showYearMonthDropdowns && (h("vega-icon", { icon: VegaInternalIconManager.getIconKey('caret-down') })));
|
|
1855
|
+
}
|
|
1856
|
+
setDateBasedOnSelectedMonth(period, monthIndex, type) {
|
|
1857
|
+
const { year } = period.current;
|
|
1858
|
+
const date = type === 'start' ? new Date(year, monthIndex, 1) : new Date(year, monthIndex - 1, 1);
|
|
1859
|
+
const newPeriod = new MonthPeriod(CalendarDate.from(date));
|
|
1860
|
+
this.currentPeriodController.updateCalendarPeriod(newPeriod);
|
|
1861
|
+
}
|
|
1862
|
+
setDateBasedOnSelectedYear(period, year, type) {
|
|
1863
|
+
const { month } = period.current;
|
|
1864
|
+
const startMonthIndex = month - 1;
|
|
1865
|
+
const endMonthIndex = startMonthIndex - 1;
|
|
1866
|
+
const date = type === 'start' ? new Date(year, startMonthIndex, 1) : new Date(year, endMonthIndex, 1);
|
|
1867
|
+
const newPeriod = new MonthPeriod(CalendarDate.from(date));
|
|
1868
|
+
this.currentPeriodController.updateCalendarPeriod(newPeriod);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Close any open vega-dropdown and ignore currently clicked one
|
|
1872
|
+
*
|
|
1873
|
+
* * @param {HTMLVegaDropdownElement} dropdownToIgnore - Dropdown to ignore
|
|
1874
|
+
*/
|
|
1875
|
+
async closeOpenDropdowns(dropdownToIgnore) {
|
|
1876
|
+
const dropdowns = [this.startDropdownRef, this.endDropdownRef];
|
|
1877
|
+
await Promise.all(dropdowns
|
|
1878
|
+
.flatMap((ref) => [ref.month, ref.year])
|
|
1879
|
+
.filter((dropdown) => Boolean(dropdown) && dropdown !== dropdownToIgnore)
|
|
1880
|
+
.map((dropdown) => dropdown.hide()));
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
(() => {
|
|
1884
|
+
VegaInternalIconManager.register({
|
|
1885
|
+
'caret-down': Icons['caret-down'],
|
|
1886
|
+
});
|
|
1887
|
+
})();
|
|
1888
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_BEFORE_CURRENT_YEAR = 10;
|
|
1889
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_AFTER_CURRENT_YEAR = 10;
|
|
1890
|
+
__decorate$8([
|
|
1891
|
+
MapToComponentField()
|
|
1892
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "currentPeriodController", void 0);
|
|
1893
|
+
__decorate$8([
|
|
1894
|
+
MapToComponentField()
|
|
1895
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "showYearMonthDropdowns", void 0);
|
|
1896
|
+
__decorate$8([
|
|
1897
|
+
MapToComponentField()
|
|
1898
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "translationSlimmer", void 0);
|
|
1899
|
+
__decorate$8([
|
|
1900
|
+
MapToComponentField()
|
|
1901
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "minCalendarDate", void 0);
|
|
1902
|
+
__decorate$8([
|
|
1903
|
+
MapToComponentField()
|
|
1904
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "maxCalendarDate", void 0);
|
|
1905
|
+
__decorate$8([
|
|
1906
|
+
MapToComponentField()
|
|
1907
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "yearMonthDropdownProps", void 0);
|
|
1908
|
+
__decorate$8([
|
|
1909
|
+
MapToComponentField()
|
|
1910
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "currentPeriod", void 0);
|
|
1911
|
+
|
|
1912
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1913
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1914
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1915
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1916
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2784
1917
|
};
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
1918
|
+
/**
|
|
1919
|
+
* Date picker calendar state base abstract class
|
|
1920
|
+
*/
|
|
1921
|
+
class VegaDatePickerCalendarStateBaseAbstract extends VegaSlimmer {
|
|
1922
|
+
/** connectedCallback */
|
|
1923
|
+
connectedCallback() {
|
|
1924
|
+
this.initCalendarClearObserver();
|
|
1925
|
+
}
|
|
1926
|
+
/** disconnectedCallback */
|
|
1927
|
+
disconnectedCallback() {
|
|
1928
|
+
this.removeCalendarClearObserver();
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Initialize calendar clear observer
|
|
1932
|
+
*/
|
|
1933
|
+
initCalendarClearObserver() {
|
|
1934
|
+
this.calendarClearObserver = new Observer(this.canAcceptClearEvent.bind(this), this.clear.bind(this));
|
|
1935
|
+
ChangeManager.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), this.calendarClearObserver);
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Remove calendar clear observer
|
|
1939
|
+
*/
|
|
1940
|
+
removeCalendarClearObserver() {
|
|
1941
|
+
ChangeManager.unregister(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), this.calendarClearObserver);
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Check if can accept form reset event
|
|
1945
|
+
*
|
|
1946
|
+
* @returns {boolean} - true if can accept, false otherwise.
|
|
1947
|
+
*/
|
|
1948
|
+
canAcceptClearEvent() {
|
|
1949
|
+
return true;
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
__decorate$7([
|
|
1953
|
+
MapToComponentField()
|
|
1954
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "host", void 0);
|
|
1955
|
+
__decorate$7([
|
|
1956
|
+
MapToComponentMethod('connectedCallback')
|
|
1957
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "connectedCallback", null);
|
|
1958
|
+
__decorate$7([
|
|
1959
|
+
MapToComponentMethod('disconnectedCallback')
|
|
1960
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "disconnectedCallback", null);
|
|
1961
|
+
|
|
1962
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1963
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1964
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1965
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1966
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1967
|
+
};
|
|
1968
|
+
/** Current period controller. */
|
|
1969
|
+
class VegaDatePickerCalendarCurrentPeriodController extends VegaDatePickerCalendarStateBaseAbstract {
|
|
1970
|
+
/** connectedCallback */
|
|
1971
|
+
connectedCallback() {
|
|
1972
|
+
super.connectedCallback();
|
|
1973
|
+
this.initCalendarPeriodUpdateObserver();
|
|
1974
|
+
}
|
|
1975
|
+
/** disconnectedCallback */
|
|
1976
|
+
disconnectedCallback() {
|
|
1977
|
+
super.disconnectedCallback();
|
|
1978
|
+
this.removeCalendarPeriodUpdateObserver();
|
|
1979
|
+
}
|
|
1980
|
+
/** componentWillLoad */
|
|
1981
|
+
componentWillLoad() {
|
|
1982
|
+
this.setCurrentMonthPeriod();
|
|
1983
|
+
}
|
|
1984
|
+
/** Listen maxDate changed */
|
|
1985
|
+
watchMaxCalendarDate() {
|
|
1986
|
+
this.setCurrentMonthPeriod();
|
|
1987
|
+
}
|
|
1988
|
+
/** Listen minDate changed */
|
|
1989
|
+
watchMinCalendarDate() {
|
|
1990
|
+
this.setCurrentMonthPeriod();
|
|
1991
|
+
}
|
|
1992
|
+
/** Listen currentPeriod changed */
|
|
1993
|
+
watchCurrentPeriod() {
|
|
1994
|
+
this.monthYearChangeEventEmitter.emit(this.getCurrentYearMonthByPeriod());
|
|
1995
|
+
}
|
|
1996
|
+
/** reset current period */
|
|
1997
|
+
resetCurrentPeriod() {
|
|
1998
|
+
this.setCurrentMonthPeriod();
|
|
1999
|
+
}
|
|
2000
|
+
/** Clear current period */
|
|
2001
|
+
clear() {
|
|
2002
|
+
this.setCurrentMonthPeriod();
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* Goto next month period while single mode.
|
|
2006
|
+
* Goto next two month period while range mode.
|
|
2007
|
+
*/
|
|
2008
|
+
gotoNextPeriod() {
|
|
2009
|
+
const period = this.isRangeView()
|
|
2010
|
+
? this.currentPeriod.next().next()
|
|
2011
|
+
: this.currentPeriod.next();
|
|
2012
|
+
this.updateCalendarPeriod(period);
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Goto previous month period while single mode.
|
|
2016
|
+
* Goto previous two month period while range mode.
|
|
2017
|
+
*/
|
|
2018
|
+
gotoPreviousPeriod() {
|
|
2019
|
+
const period = this.isRangeView()
|
|
2020
|
+
? this.currentPeriod.previous().previous()
|
|
2021
|
+
: this.currentPeriod.previous();
|
|
2022
|
+
this.updateCalendarPeriod(period);
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* set current period
|
|
2026
|
+
*
|
|
2027
|
+
* @param {MonthPeriod} period current period
|
|
2028
|
+
*/
|
|
2029
|
+
updateCalendarPeriod(period) {
|
|
2030
|
+
if (!this.currentPeriod || !this.currentPeriod.equal(period)) {
|
|
2031
|
+
this.currentPeriod = period;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* Current period follow below rules:
|
|
2036
|
+
* - Go to the value date month if the value is set.
|
|
2037
|
+
* - Go to the minDate month if only set the minDate and today is before than minDate.
|
|
2038
|
+
* - Go to the minDate month if minDate and maxDate are both set and today is after than maxDate.
|
|
2039
|
+
* - Go to the maxDate month if only set maxDate and today is after than maxDate.
|
|
2040
|
+
* - Go to today month if the value, minDate and maxDate all are empty.
|
|
2041
|
+
*/
|
|
2042
|
+
setCurrentMonthPeriod() {
|
|
2043
|
+
let currentDate;
|
|
2044
|
+
const startDate = this.calendarSelection.startDate;
|
|
2045
|
+
if (isCalendarDateType(startDate)) {
|
|
2046
|
+
currentDate = startDate;
|
|
2047
|
+
}
|
|
2048
|
+
else if (this.minCalendarDate &&
|
|
2049
|
+
(this.today.isBefore(this.minCalendarDate) ||
|
|
2050
|
+
(this.maxCalendarDate && this.today.isAfter(this.maxCalendarDate)))) {
|
|
2051
|
+
currentDate = this.minCalendarDate;
|
|
2052
|
+
}
|
|
2053
|
+
else if (this.maxCalendarDate && this.today.isAfter(this.maxCalendarDate)) {
|
|
2054
|
+
currentDate = this.maxCalendarDate;
|
|
2055
|
+
}
|
|
2056
|
+
else {
|
|
2057
|
+
currentDate = this.today;
|
|
2058
|
+
}
|
|
2059
|
+
this.updateCalendarPeriod(new MonthPeriod(currentDate, true, this.timezone));
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Check is range view
|
|
2063
|
+
*
|
|
2064
|
+
* @returns {boolean} -
|
|
2065
|
+
*/
|
|
2066
|
+
isRangeView() {
|
|
2067
|
+
return this.mode === 'range' && !this.isMobileDevice;
|
|
2068
|
+
}
|
|
2069
|
+
/**
|
|
2070
|
+
* Get current year month by period
|
|
2071
|
+
*
|
|
2072
|
+
* @returns {DatePickerMonthYearTypes} - month and year info
|
|
2073
|
+
*/
|
|
2074
|
+
getCurrentYearMonthByPeriod() {
|
|
2075
|
+
const startMonthYear = {
|
|
2076
|
+
month: MonthNames[this.currentPeriod.current.month - 1],
|
|
2077
|
+
year: `${this.currentPeriod.current.year}`,
|
|
2078
|
+
};
|
|
2079
|
+
if (this.mode === 'range') {
|
|
2080
|
+
return [
|
|
2081
|
+
startMonthYear,
|
|
2082
|
+
{
|
|
2083
|
+
month: MonthNames[this.currentPeriod.endDate.month - 1],
|
|
2084
|
+
year: `${this.currentPeriod.endDate.year}`,
|
|
2085
|
+
},
|
|
2086
|
+
];
|
|
2087
|
+
}
|
|
2088
|
+
else {
|
|
2089
|
+
return startMonthYear;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Initialize calendar clear observer
|
|
2094
|
+
*/
|
|
2095
|
+
initCalendarPeriodUpdateObserver() {
|
|
2096
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser, this.setCurrentMonthPeriod.bind(this));
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Remove calendar clear observer
|
|
2100
|
+
*/
|
|
2101
|
+
removeCalendarPeriodUpdateObserver() {
|
|
2102
|
+
DomNodeSubjectObserverFactory.removeUniqueObserverFromNode(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
__decorate$6([
|
|
2106
|
+
MapToComponentField({ writable: true })
|
|
2107
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "currentPeriod", void 0);
|
|
2108
|
+
__decorate$6([
|
|
2109
|
+
MapToComponentField()
|
|
2110
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "host", void 0);
|
|
2111
|
+
__decorate$6([
|
|
2112
|
+
MapToComponentField()
|
|
2113
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "today", void 0);
|
|
2114
|
+
__decorate$6([
|
|
2115
|
+
MapToComponentField()
|
|
2116
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "mode", void 0);
|
|
2117
|
+
__decorate$6([
|
|
2118
|
+
MapToComponentField()
|
|
2119
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "format", void 0);
|
|
2120
|
+
__decorate$6([
|
|
2121
|
+
MapToComponentField()
|
|
2122
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "timezone", void 0);
|
|
2123
|
+
__decorate$6([
|
|
2124
|
+
MapToComponentField()
|
|
2125
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "minCalendarDate", void 0);
|
|
2126
|
+
__decorate$6([
|
|
2127
|
+
MapToComponentField()
|
|
2128
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "maxCalendarDate", void 0);
|
|
2129
|
+
__decorate$6([
|
|
2130
|
+
MapToComponentField()
|
|
2131
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "isMobileDevice", void 0);
|
|
2132
|
+
__decorate$6([
|
|
2133
|
+
MapToComponentField()
|
|
2134
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2135
|
+
__decorate$6([
|
|
2136
|
+
MapToComponentField()
|
|
2137
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "calendarSelection", void 0);
|
|
2138
|
+
__decorate$6([
|
|
2139
|
+
MapToComponentMethod('connectedCallback')
|
|
2140
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "connectedCallback", null);
|
|
2141
|
+
__decorate$6([
|
|
2142
|
+
MapToComponentMethod('disconnectedCallback')
|
|
2143
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "disconnectedCallback", null);
|
|
2144
|
+
__decorate$6([
|
|
2145
|
+
MapToComponentMethod('componentWillLoad')
|
|
2146
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "componentWillLoad", null);
|
|
2147
|
+
__decorate$6([
|
|
2148
|
+
MapToComponentMethod('watchMaxCalendarDate')
|
|
2149
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchMaxCalendarDate", null);
|
|
2150
|
+
__decorate$6([
|
|
2151
|
+
MapToComponentMethod('watchMinCalendarDate')
|
|
2152
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchMinCalendarDate", null);
|
|
2153
|
+
__decorate$6([
|
|
2154
|
+
MapToComponentMethod('watchCurrentPeriod')
|
|
2155
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchCurrentPeriod", null);
|
|
2156
|
+
__decorate$6([
|
|
2157
|
+
MapToComponentMethod('reset')
|
|
2158
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "resetCurrentPeriod", null);
|
|
2159
|
+
|
|
2160
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2161
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2162
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2163
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2164
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2165
|
+
};
|
|
2166
|
+
/** Today controller */
|
|
2167
|
+
class VegaDatePickerCalendarTodayController extends VegaSlimmer {
|
|
2168
|
+
/** connectedCallback */
|
|
2169
|
+
connectedCallback() {
|
|
2170
|
+
this.setToday();
|
|
2171
|
+
}
|
|
2172
|
+
/** Listen time zone changed */
|
|
2173
|
+
watchTimezone() {
|
|
2174
|
+
this.setToday();
|
|
2175
|
+
}
|
|
2176
|
+
/**
|
|
2177
|
+
* Sets the current date based on the provided timezone or the system timezone if none is provided.
|
|
2178
|
+
*/
|
|
2179
|
+
setToday() {
|
|
2180
|
+
this.today = CalendarDate.from(new Date(), this.timezone);
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
__decorate$5([
|
|
2184
|
+
MapToComponentField()
|
|
2185
|
+
], VegaDatePickerCalendarTodayController.prototype, "timezone", void 0);
|
|
2186
|
+
__decorate$5([
|
|
2187
|
+
MapToComponentField({ writable: true })
|
|
2188
|
+
], VegaDatePickerCalendarTodayController.prototype, "today", void 0);
|
|
2189
|
+
__decorate$5([
|
|
2190
|
+
MapToComponentMethod('connectedCallback')
|
|
2191
|
+
], VegaDatePickerCalendarTodayController.prototype, "connectedCallback", null);
|
|
2192
|
+
__decorate$5([
|
|
2193
|
+
MapToComponentMethod('watchTimezone')
|
|
2194
|
+
], VegaDatePickerCalendarTodayController.prototype, "watchTimezone", null);
|
|
2195
|
+
|
|
2196
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2197
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2198
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2199
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2200
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2201
|
+
};
|
|
2202
|
+
class VegaDatePickerMonthItemRenderer extends VegaSlimmer {
|
|
2203
|
+
constructor() {
|
|
2204
|
+
super(...arguments);
|
|
2205
|
+
this.monthViewGenerator = new MonthViewGenerator();
|
|
2206
|
+
}
|
|
2207
|
+
render(type) {
|
|
2208
|
+
const period = type === 'end' ? this.currentPeriod.next() : this.currentPeriod;
|
|
2209
|
+
const periodView = this.monthViewGenerator.generate(period);
|
|
2210
|
+
return (h("div", { class: "month-item" },
|
|
2211
|
+
this.renderMonthHeader(period, type),
|
|
2212
|
+
this.renderWeek(periodView),
|
|
2213
|
+
this.renderDays(periodView, period)));
|
|
2214
|
+
}
|
|
2215
|
+
renderMonthHeader(period, type) {
|
|
2216
|
+
return (h("vega-grid", { class: "month-item-header", column: '3-auto', row: 1 },
|
|
2217
|
+
this.renderPrevIcon(period, type),
|
|
2218
|
+
this.yearMonthSwitcherRender.render(period, type),
|
|
2219
|
+
this.renderNextIcon(period, type)));
|
|
2220
|
+
}
|
|
2221
|
+
renderPrevIcon(period, type) {
|
|
2222
|
+
var _a;
|
|
2223
|
+
const firstDateOfMonth = period.current.firstDateOfMonth();
|
|
2224
|
+
const lockedPreviousPeriod = this.isBeforeMinDate(firstDateOfMonth) || ((_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.equal(firstDateOfMonth));
|
|
2225
|
+
const needHide = !this.isMobileDevice && this.mode === 'range' && type === 'end';
|
|
2226
|
+
return lockedPreviousPeriod || needHide ? (h("div", { class: "locked-month-button" })) : (h("vega-button-circle", { class: "button-previous-month", variant: "icon-only", icon: VegaInternalIconManager.getIconKey('chevron-left'), ref: (ref) => {
|
|
2227
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
2228
|
+
this.currentPeriodController.gotoPreviousPeriod();
|
|
2229
|
+
});
|
|
2230
|
+
}, size: this.getNavigationIconSize() }));
|
|
2231
|
+
}
|
|
2232
|
+
renderNextIcon(period, type) {
|
|
2233
|
+
var _a;
|
|
2234
|
+
const lastDateOfMonth = period.current.lastDateOfMonth();
|
|
2235
|
+
const lockedNextPeriod = this.isAfterMaxDate(lastDateOfMonth) || ((_a = this.maxCalendarDate) === null || _a === void 0 ? void 0 : _a.equal(lastDateOfMonth));
|
|
2236
|
+
const needHide = !this.isMobileDevice && this.mode === 'range' && type === 'start';
|
|
2237
|
+
return lockedNextPeriod || needHide ? (h("div", { class: "locked-month-button" })) : (h("vega-button-circle", { class: "button-next-month", variant: "icon-only", icon: VegaInternalIconManager.getIconKey('chevron-right'), ref: (ref) => {
|
|
2238
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
2239
|
+
this.currentPeriodController.gotoNextPeriod();
|
|
2240
|
+
});
|
|
2241
|
+
}, size: this.getNavigationIconSize() }));
|
|
2242
|
+
}
|
|
2243
|
+
renderWeek(periodView) {
|
|
2244
|
+
return (h("vega-grid", { class: "month-item-weekdays-row", column: '7-auto', row: 1 }, periodView.weekdays.map((weekDay) => {
|
|
2245
|
+
return (h("div", { key: weekDay }, this.translationSlimmer.t(`${weekDay}-short`)));
|
|
2246
|
+
})));
|
|
2247
|
+
}
|
|
2248
|
+
renderDays(periodView, period) {
|
|
2249
|
+
return (h("vega-grid", { class: "container__days", column: '7-auto', row: this.staticHeight ? 6 : '6-auto' }, periodView.dateItems
|
|
2250
|
+
.flat()
|
|
2251
|
+
.filter((day) => day.month <= period.current.month || day.year < period.current.year)
|
|
2252
|
+
.map((day) => this.renderDay(day, period))));
|
|
2253
|
+
}
|
|
2254
|
+
renderDay(day, period) {
|
|
2255
|
+
const isCurrentMonth = day.month === period.current.month;
|
|
2256
|
+
const isLockedDate = this.isBeforeMinDate(day) || this.isAfterMaxDate(day);
|
|
2257
|
+
const currentRangeDates = this.getCurrentRangeDates();
|
|
2258
|
+
const isDisabled = this.isDateDisabled(day.toDate());
|
|
2259
|
+
const isInRange = day.isAfter(currentRangeDates[0]) && day.isBefore(currentRangeDates[1]);
|
|
2260
|
+
const canInterActive = isCurrentMonth && !isLockedDate && !isDisabled;
|
|
2261
|
+
return (h("div", { key: `${day.month}-${day.date}`, class: isCurrentMonth && {
|
|
2262
|
+
'day-item': true,
|
|
2263
|
+
'is-today': day.equal(this.today),
|
|
2264
|
+
'is-start-date': day.equal(currentRangeDates[0]),
|
|
2265
|
+
'is-in-range': isInRange,
|
|
2266
|
+
'is-end-date': day.equal(currentRangeDates[1]),
|
|
2267
|
+
'is-locked': isLockedDate,
|
|
2268
|
+
'is-disabled': isDisabled,
|
|
2269
|
+
},
|
|
2270
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2271
|
+
onClick: () => canInterActive && this.selectionController.onDayClick(day),
|
|
2272
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2273
|
+
onMouseEnter: () => canInterActive && this.selectionController.onDayHover(day), onKeyDown: createEnterKeyHandlerToTriggerClick(), role: "menuitem", "aria-label": day.date, tabIndex: canInterActive ? 0 : -1 }, isCurrentMonth ? day.date : ''));
|
|
2274
|
+
}
|
|
2275
|
+
getCurrentRangeDates() {
|
|
2276
|
+
const startDate = this.calendarSelection.startDate;
|
|
2277
|
+
const endDate = this.calendarSelection.endDate;
|
|
2278
|
+
if (isCalendarDateType(startDate) && !endDate && this.hoverDate) {
|
|
2279
|
+
return this.hoverDate.isBefore(startDate)
|
|
2280
|
+
? [this.hoverDate, startDate]
|
|
2281
|
+
: [startDate, this.hoverDate];
|
|
2282
|
+
}
|
|
2283
|
+
else if (!isCalendarDateType(startDate) && endDate && this.hoverDate) {
|
|
2284
|
+
return this.hoverDate.isBefore(endDate) ? [this.hoverDate, endDate] : [endDate, this.hoverDate];
|
|
2285
|
+
}
|
|
2286
|
+
else {
|
|
2287
|
+
return [startDate, endDate];
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
isBeforeMinDate(day) {
|
|
2291
|
+
return this.minCalendarDate && day.isBefore(this.minCalendarDate);
|
|
2292
|
+
}
|
|
2293
|
+
isAfterMaxDate(day) {
|
|
2294
|
+
return this.maxCalendarDate && day.isAfter(this.maxCalendarDate);
|
|
2295
|
+
}
|
|
2296
|
+
getNavigationIconSize() {
|
|
2297
|
+
if (this.size === 'large')
|
|
2298
|
+
return 'default';
|
|
2299
|
+
if (this.size === 'small')
|
|
2300
|
+
return 'extra-small';
|
|
2301
|
+
return 'small';
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
(() => {
|
|
2305
|
+
VegaInternalIconManager.register({
|
|
2306
|
+
'chevron-left': Icons['chevron-left'],
|
|
2307
|
+
'chevron-right': Icons['chevron-right'],
|
|
2308
|
+
});
|
|
2309
|
+
})();
|
|
2310
|
+
__decorate$4([
|
|
2311
|
+
MapToComponentField()
|
|
2312
|
+
], VegaDatePickerMonthItemRenderer.prototype, "currentPeriod", void 0);
|
|
2313
|
+
__decorate$4([
|
|
2314
|
+
MapToComponentField()
|
|
2315
|
+
], VegaDatePickerMonthItemRenderer.prototype, "today", void 0);
|
|
2316
|
+
__decorate$4([
|
|
2317
|
+
MapToComponentField()
|
|
2318
|
+
], VegaDatePickerMonthItemRenderer.prototype, "translationSlimmer", void 0);
|
|
2319
|
+
__decorate$4([
|
|
2320
|
+
MapToComponentField()
|
|
2321
|
+
], VegaDatePickerMonthItemRenderer.prototype, "yearMonthSwitcherRender", void 0);
|
|
2322
|
+
__decorate$4([
|
|
2323
|
+
MapToComponentField()
|
|
2324
|
+
], VegaDatePickerMonthItemRenderer.prototype, "mode", void 0);
|
|
2325
|
+
__decorate$4([
|
|
2326
|
+
MapToComponentField()
|
|
2327
|
+
], VegaDatePickerMonthItemRenderer.prototype, "currentPeriodController", void 0);
|
|
2328
|
+
__decorate$4([
|
|
2329
|
+
MapToComponentField()
|
|
2330
|
+
], VegaDatePickerMonthItemRenderer.prototype, "hoverDate", void 0);
|
|
2331
|
+
__decorate$4([
|
|
2332
|
+
MapToComponentField()
|
|
2333
|
+
], VegaDatePickerMonthItemRenderer.prototype, "maxCalendarDate", void 0);
|
|
2334
|
+
__decorate$4([
|
|
2335
|
+
MapToComponentField()
|
|
2336
|
+
], VegaDatePickerMonthItemRenderer.prototype, "minCalendarDate", void 0);
|
|
2337
|
+
__decorate$4([
|
|
2338
|
+
MapToComponentField()
|
|
2339
|
+
], VegaDatePickerMonthItemRenderer.prototype, "selectionController", void 0);
|
|
2340
|
+
__decorate$4([
|
|
2341
|
+
MapToComponentField()
|
|
2342
|
+
], VegaDatePickerMonthItemRenderer.prototype, "calendarSelection", void 0);
|
|
2343
|
+
__decorate$4([
|
|
2344
|
+
MapToComponentField()
|
|
2345
|
+
], VegaDatePickerMonthItemRenderer.prototype, "size", void 0);
|
|
2346
|
+
__decorate$4([
|
|
2347
|
+
MapToComponentField()
|
|
2348
|
+
], VegaDatePickerMonthItemRenderer.prototype, "staticHeight", void 0);
|
|
2349
|
+
__decorate$4([
|
|
2350
|
+
MapToComponentField()
|
|
2351
|
+
], VegaDatePickerMonthItemRenderer.prototype, "isDateDisabled", void 0);
|
|
2352
|
+
__decorate$4([
|
|
2353
|
+
MapToComponentField()
|
|
2354
|
+
], VegaDatePickerMonthItemRenderer.prototype, "isMobileDevice", void 0);
|
|
2355
|
+
|
|
2356
|
+
/** Calendar selection object. */
|
|
2357
|
+
class CalendarSelection {
|
|
2358
|
+
constructor(startDate, endDate, mode) {
|
|
2359
|
+
this.startDate = startDate;
|
|
2360
|
+
this.endDate = endDate;
|
|
2361
|
+
this.mode = mode;
|
|
2362
|
+
if (this.mode === 'range' && this.startDate && this.endDate && this.startDate.isAfter(this.endDate)) {
|
|
2363
|
+
const startDate = this.startDate;
|
|
2364
|
+
this.startDate = this.endDate;
|
|
2365
|
+
this.endDate = startDate;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* Creates a CalendarSelection from a selection value.
|
|
2370
|
+
*
|
|
2371
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - The selection value.
|
|
2372
|
+
* @param {DatePickerModeType} mode - The mode of the date picker.
|
|
2373
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2374
|
+
* @returns {CalendarSelection} - The created CalendarSelection instance.
|
|
2375
|
+
*/
|
|
2376
|
+
static fromSelection(selection, mode, format) {
|
|
2377
|
+
let startDate = null;
|
|
2378
|
+
let endDate = null;
|
|
2379
|
+
if (this.isValidSelection(selection, mode, format)) {
|
|
2380
|
+
if (mode === 'single' && typeof selection === 'string') {
|
|
2381
|
+
const date = CalendarDate.fromString(selection, format);
|
|
2382
|
+
startDate = date;
|
|
2383
|
+
endDate = date;
|
|
2384
|
+
}
|
|
2385
|
+
else if (mode === 'range' && Array.isArray(selection)) {
|
|
2386
|
+
startDate = CalendarDate.fromString(selection[0], format);
|
|
2387
|
+
endDate = CalendarDate.fromString(selection[1], format);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
return new CalendarSelection(startDate, endDate, mode);
|
|
2391
|
+
}
|
|
2392
|
+
/**
|
|
2393
|
+
* Check if the selection is valid.
|
|
2394
|
+
*
|
|
2395
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - The selection value.
|
|
2396
|
+
* @param {DatePickerModeType} mode - The mode of the date picker.
|
|
2397
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2398
|
+
* @returns {boolean} - True if the selection is valid, false otherwise.
|
|
2399
|
+
*/
|
|
2400
|
+
static isValidSelection(selection, mode, format) {
|
|
2401
|
+
let isValid;
|
|
2402
|
+
switch (mode) {
|
|
2403
|
+
case 'single':
|
|
2404
|
+
isValid = this.isValidDateString(selection, format);
|
|
2405
|
+
break;
|
|
2406
|
+
case 'range':
|
|
2407
|
+
isValid =
|
|
2408
|
+
Array.isArray(selection) &&
|
|
2409
|
+
selection.length === 2 &&
|
|
2410
|
+
selection.every((item) => this.isValidDateString(item, format));
|
|
2411
|
+
break;
|
|
2412
|
+
}
|
|
2413
|
+
if (!isValid) {
|
|
2414
|
+
LogUtility.warn(`Invalid date picker calendar selection ${selection} for ${mode} mode`);
|
|
2415
|
+
}
|
|
2416
|
+
return isValid;
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* Check if a date string is valid.
|
|
2420
|
+
*
|
|
2421
|
+
* @param {Nullable<string>} dateString - The date string to check.
|
|
2422
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2423
|
+
* @returns {boolean} - True if the date string is valid, false otherwise.
|
|
2424
|
+
*/
|
|
2425
|
+
static isValidDateString(dateString, format) {
|
|
2426
|
+
return ((dateString && typeof dateString === 'string' && !!CalendarDate.fromString(dateString, format)) ||
|
|
2427
|
+
dateString === '');
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Gets the selection value based on the current calendar selection.
|
|
2431
|
+
*
|
|
2432
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2433
|
+
* @returns {DatePickerValueType<DatePickerModeType>} - The selection value.
|
|
2434
|
+
*/
|
|
2435
|
+
toSelection(format) {
|
|
2436
|
+
var _a, _b, _c;
|
|
2437
|
+
if (this.mode === 'range') {
|
|
2438
|
+
return [((_a = this.startDate) === null || _a === void 0 ? void 0 : _a.toString(format)) || '', ((_b = this.endDate) === null || _b === void 0 ? void 0 : _b.toString(format)) || ''];
|
|
2439
|
+
}
|
|
2440
|
+
else {
|
|
2441
|
+
return ((_c = this.startDate) === null || _c === void 0 ? void 0 : _c.toString(format)) || '';
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* Checks if this calendar selection is equal to another.
|
|
2446
|
+
*
|
|
2447
|
+
* @param {CalendarSelection} other - The other calendar selection to compare with.
|
|
2448
|
+
* @returns {boolean} - True if both selections are equal, false otherwise.
|
|
2449
|
+
*/
|
|
2450
|
+
equals(other) {
|
|
2451
|
+
if (!other)
|
|
2452
|
+
return false;
|
|
2453
|
+
const isStartDateEqual = this.startDate && other.startDate
|
|
2454
|
+
? this.startDate.equal(other.startDate)
|
|
2455
|
+
: this.startDate === this.endDate;
|
|
2456
|
+
const isEndDateEqual = this.endDate && other.endDate
|
|
2457
|
+
? this.endDate.equal(other.endDate)
|
|
2458
|
+
: this.endDate === other.endDate;
|
|
2459
|
+
return isStartDateEqual && isEndDateEqual;
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Checks if the calendar selection is completed.
|
|
2463
|
+
*
|
|
2464
|
+
* @returns {boolean} - True if the selection is completed, false otherwise.
|
|
2465
|
+
*/
|
|
2466
|
+
isCompleted() {
|
|
2467
|
+
return (isCalendarDateType(this.startDate) &&
|
|
2468
|
+
(this.mode === 'range' ? isCalendarDateType(this.endDate) : true));
|
|
2469
|
+
}
|
|
2470
|
+
/**
|
|
2471
|
+
* Checks if the calendar selection is empty.
|
|
2472
|
+
*
|
|
2473
|
+
* @returns {boolean} - True if the selection is empty, false otherwise.
|
|
2474
|
+
*/
|
|
2475
|
+
isEmpty() {
|
|
2476
|
+
return !isCalendarDateType(this.startDate) && !isCalendarDateType(this.endDate);
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2481
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2482
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2483
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2484
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2485
|
+
};
|
|
2486
|
+
/** Selection controller */
|
|
2487
|
+
class VegaDatePickerCalendarSelectionController extends VegaDatePickerCalendarStateBaseAbstract {
|
|
2488
|
+
/** componentWillLoad */
|
|
2489
|
+
componentWillLoad() {
|
|
2490
|
+
this.setCalendarSelectionBySelection(this.selection);
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Listen selection changed
|
|
2494
|
+
*
|
|
2495
|
+
* @param {DatePickerValueType<DatePickerModeType>} newSelection - newSelection.
|
|
2496
|
+
*/
|
|
2497
|
+
watchSelection(newSelection) {
|
|
2498
|
+
const isChangeByUser = !this.isSameSelection(newSelection, this.calendarSelection.toSelection(this.format));
|
|
2499
|
+
// If the user changes the selection via property, we need to update the current period and set the calendar selection.
|
|
2500
|
+
// otherwise, we don't need to update.
|
|
2501
|
+
if (isChangeByUser) {
|
|
2502
|
+
this.setCalendarSelectionBySelection(newSelection);
|
|
2503
|
+
this.notifyPeriodChange();
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
/** Reset selecting range date */
|
|
2507
|
+
resetRange() {
|
|
2508
|
+
const usePrevious = !this.calendarSelection.isCompleted() &&
|
|
2509
|
+
!this.calendarSelection.isEmpty() &&
|
|
2510
|
+
!!this.previousCalendarSelection;
|
|
2511
|
+
this.setCalendarSelectionBySelection(usePrevious ? this.previousCalendarSelection.toSelection(this.format) : this.selection);
|
|
2512
|
+
this.hoverDate = null;
|
|
2513
|
+
}
|
|
2514
|
+
/** Listen calendarSelection changed */
|
|
2515
|
+
watchCalendarSelection() {
|
|
2516
|
+
if (this.calendarSelection.isCompleted() || this.calendarSelection.isEmpty()) {
|
|
2517
|
+
this.setSelection(this.calendarSelection.toSelection(this.format));
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
/** Clear the current selection */
|
|
2521
|
+
clear() {
|
|
2522
|
+
this.setCalendarSelectionByRange(null, null);
|
|
2523
|
+
this.hoverDate = null;
|
|
2524
|
+
}
|
|
2525
|
+
/**
|
|
2526
|
+
* Listen the day be clicked.
|
|
2527
|
+
*
|
|
2528
|
+
* @param {CalendarDate} day - clicked day.
|
|
2529
|
+
*/
|
|
2530
|
+
onDayClick(day) {
|
|
2531
|
+
if (this.mode === 'single') {
|
|
2532
|
+
this.setCalendarSelectionByRange(day, day);
|
|
2533
|
+
}
|
|
2534
|
+
else if (this.mode === 'range') {
|
|
2535
|
+
if (this.calendarSelection.startDate && !this.calendarSelection.endDate) {
|
|
2536
|
+
// It second click of range mode, we should set min date as start and max date as end.
|
|
2537
|
+
// As also, the select action have completed, we should set the value same time.
|
|
2538
|
+
this.setCalendarSelectionByRange(this.calendarSelection.startDate, day);
|
|
2539
|
+
}
|
|
2540
|
+
else if (!this.calendarSelection.startDate && this.calendarSelection.endDate) {
|
|
2541
|
+
this.setCalendarSelectionByRange(this.calendarSelection.endDate, day);
|
|
2542
|
+
}
|
|
2543
|
+
else {
|
|
2544
|
+
// It first click of range mode, we only set start date.
|
|
2545
|
+
this.setCalendarSelectionByRange(day, null);
|
|
2546
|
+
}
|
|
2547
|
+
this.hoverDate = null;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* Listen the day be hovered.
|
|
2552
|
+
* Need set the hoverDate after the first click in range mode.
|
|
2553
|
+
* For repick, we should clear start or end date according the input which have been clicked.
|
|
2554
|
+
* Note: repick is working at hover any day in range.
|
|
2555
|
+
*
|
|
2556
|
+
* @param {CalendarDate} day - hovered day.
|
|
2557
|
+
*/
|
|
2558
|
+
onDayHover(day) {
|
|
2559
|
+
const clickedInputType = this.allowRepickController.getRepickType();
|
|
2560
|
+
if (clickedInputType && this.mode === 'range' && this.calendarSelection.isCompleted()) {
|
|
2561
|
+
clickedInputType === 'start'
|
|
2562
|
+
? this.setCalendarSelectionByRange(null, this.calendarSelection.endDate)
|
|
2563
|
+
: this.setCalendarSelectionByRange(this.calendarSelection.startDate, null);
|
|
2564
|
+
}
|
|
2565
|
+
if (!this.calendarSelection.isEmpty() && !this.calendarSelection.isCompleted()) {
|
|
2566
|
+
this.hoverDate = day;
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
/**
|
|
2570
|
+
* Sets calendar selection for date picker calendar based on selection value.
|
|
2571
|
+
*
|
|
2572
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - selection.
|
|
2573
|
+
*/
|
|
2574
|
+
setCalendarSelectionBySelection(selection) {
|
|
2575
|
+
const calendarSelection = CalendarSelection.fromSelection(selection, this.mode, this.format);
|
|
2576
|
+
if (this.calendarSelection &&
|
|
2577
|
+
(this.calendarSelection.isCompleted() || this.calendarSelection.isEmpty())) {
|
|
2578
|
+
this.previousCalendarSelection = this.calendarSelection;
|
|
2579
|
+
}
|
|
2580
|
+
if (!calendarSelection.equals(this.calendarSelection)) {
|
|
2581
|
+
this.calendarSelection = calendarSelection;
|
|
2582
|
+
}
|
|
2583
|
+
// we should reset the selection while calendarSelection changed from inner,
|
|
2584
|
+
// such as reversed range correction.
|
|
2585
|
+
this.setSelection(calendarSelection.toSelection(this.format));
|
|
2586
|
+
}
|
|
2587
|
+
/**
|
|
2588
|
+
* Sets calendar selection for date picker calendar based on range dates.
|
|
2589
|
+
*
|
|
2590
|
+
* @param {Nullable<CalendarDate>} startDate - startDate.
|
|
2591
|
+
* @param {Nullable<CalendarDate>} endDate - endDate.
|
|
2592
|
+
*/
|
|
2593
|
+
setCalendarSelectionByRange(startDate, endDate) {
|
|
2594
|
+
this.calendarSelection = new CalendarSelection(startDate, endDate, this.mode);
|
|
2595
|
+
}
|
|
2596
|
+
/**
|
|
2597
|
+
* Sets selection for date picker calendar and emits a change event with the new value.
|
|
2598
|
+
*
|
|
2599
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - selection.
|
|
2600
|
+
*/
|
|
2601
|
+
setSelection(selection) {
|
|
2602
|
+
if (!this.isSameSelection(selection, this.selection)) {
|
|
2603
|
+
this.selection = selection;
|
|
2604
|
+
this.vegaSelectionChangeEventEmitter.emit(this.selection);
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* Check the previous selection and current selection is same.
|
|
2609
|
+
*
|
|
2610
|
+
* @param {DatePickerValueType<DatePickerModeType>} previous - New selection.
|
|
2611
|
+
* @param {DatePickerValueType<DatePickerModeType>} current - Old selection.
|
|
2612
|
+
* @returns {boolean} -
|
|
2613
|
+
*/
|
|
2614
|
+
isSameSelection(previous, current) {
|
|
2615
|
+
if (this.mode === 'range' && Array.isArray(previous) && Array.isArray(current)) {
|
|
2616
|
+
return isArrayEqual(previous, current);
|
|
2617
|
+
}
|
|
2618
|
+
return previous === current;
|
|
2619
|
+
}
|
|
2620
|
+
/** Notify to update current period */
|
|
2621
|
+
notifyPeriodChange() {
|
|
2622
|
+
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser), {});
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
__decorate$3([
|
|
2626
|
+
MapToComponentField()
|
|
2627
|
+
], VegaDatePickerCalendarSelectionController.prototype, "host", void 0);
|
|
2628
|
+
__decorate$3([
|
|
2629
|
+
MapToComponentField()
|
|
2630
|
+
], VegaDatePickerCalendarSelectionController.prototype, "mode", void 0);
|
|
2631
|
+
__decorate$3([
|
|
2632
|
+
MapToComponentField()
|
|
2633
|
+
], VegaDatePickerCalendarSelectionController.prototype, "format", void 0);
|
|
2634
|
+
__decorate$3([
|
|
2635
|
+
MapToComponentField({ writable: true })
|
|
2636
|
+
], VegaDatePickerCalendarSelectionController.prototype, "selection", void 0);
|
|
2637
|
+
__decorate$3([
|
|
2638
|
+
MapToComponentField({ writable: true })
|
|
2639
|
+
], VegaDatePickerCalendarSelectionController.prototype, "calendarSelection", void 0);
|
|
2640
|
+
__decorate$3([
|
|
2641
|
+
MapToComponentField({ writable: true })
|
|
2642
|
+
], VegaDatePickerCalendarSelectionController.prototype, "hoverDate", void 0);
|
|
2643
|
+
__decorate$3([
|
|
2644
|
+
MapToComponentField()
|
|
2645
|
+
], VegaDatePickerCalendarSelectionController.prototype, "clearEventEmitter", void 0);
|
|
2646
|
+
__decorate$3([
|
|
2647
|
+
MapToComponentField()
|
|
2648
|
+
], VegaDatePickerCalendarSelectionController.prototype, "vegaSelectionChangeEventEmitter", void 0);
|
|
2649
|
+
__decorate$3([
|
|
2650
|
+
MapToComponentField()
|
|
2651
|
+
], VegaDatePickerCalendarSelectionController.prototype, "allowRepickController", void 0);
|
|
2652
|
+
__decorate$3([
|
|
2653
|
+
MapToComponentMethod('componentWillLoad')
|
|
2654
|
+
], VegaDatePickerCalendarSelectionController.prototype, "componentWillLoad", null);
|
|
2655
|
+
__decorate$3([
|
|
2656
|
+
MapToComponentMethod('watchSelection')
|
|
2657
|
+
], VegaDatePickerCalendarSelectionController.prototype, "watchSelection", null);
|
|
2658
|
+
__decorate$3([
|
|
2659
|
+
MapToComponentMethod('reset')
|
|
2660
|
+
], VegaDatePickerCalendarSelectionController.prototype, "resetRange", null);
|
|
2661
|
+
__decorate$3([
|
|
2662
|
+
MapToComponentMethod('watchCalendarSelection')
|
|
2663
|
+
], VegaDatePickerCalendarSelectionController.prototype, "watchCalendarSelection", null);
|
|
2664
|
+
|
|
2665
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2666
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2667
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2668
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2669
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2670
|
+
};
|
|
2671
|
+
/** Current min and max calendar date controller. */
|
|
2672
|
+
class VegaDatePickerCalendarMinMaxDateController extends VegaSlimmer {
|
|
2673
|
+
/** componentWillLoad */
|
|
2674
|
+
componentWillLoad() {
|
|
2675
|
+
this.setMaxCalendarDate();
|
|
2676
|
+
this.setMinCalendarDate();
|
|
2677
|
+
}
|
|
2678
|
+
/** Listen maxDate changed */
|
|
2679
|
+
watchMaxDate() {
|
|
2680
|
+
this.setMaxCalendarDate();
|
|
2681
|
+
}
|
|
2682
|
+
/** Listen minDate changed */
|
|
2683
|
+
watchMinDate() {
|
|
2684
|
+
this.setMinCalendarDate();
|
|
2685
|
+
}
|
|
2686
|
+
/** Set maxCalendarDate */
|
|
2687
|
+
setMaxCalendarDate() {
|
|
2688
|
+
this.maxCalendarDate = CalendarDate.fromString(this.maxDate, this.format);
|
|
2689
|
+
}
|
|
2690
|
+
/** Set minCalendarDate */
|
|
2691
|
+
setMinCalendarDate() {
|
|
2692
|
+
this.minCalendarDate = CalendarDate.fromString(this.minDate, this.format);
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
__decorate$2([
|
|
2696
|
+
MapToComponentField()
|
|
2697
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "maxDate", void 0);
|
|
2698
|
+
__decorate$2([
|
|
2699
|
+
MapToComponentField()
|
|
2700
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "minDate", void 0);
|
|
2701
|
+
__decorate$2([
|
|
2702
|
+
MapToComponentField()
|
|
2703
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "format", void 0);
|
|
2704
|
+
__decorate$2([
|
|
2705
|
+
MapToComponentField({ writable: true })
|
|
2706
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "maxCalendarDate", void 0);
|
|
2707
|
+
__decorate$2([
|
|
2708
|
+
MapToComponentField({ writable: true })
|
|
2709
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "minCalendarDate", void 0);
|
|
2710
|
+
__decorate$2([
|
|
2711
|
+
MapToComponentMethod('componentWillLoad')
|
|
2712
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "componentWillLoad", null);
|
|
2713
|
+
__decorate$2([
|
|
2714
|
+
MapToComponentMethod('watchMaxDate')
|
|
2715
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "watchMaxDate", null);
|
|
2716
|
+
__decorate$2([
|
|
2717
|
+
MapToComponentMethod('watchMinDate')
|
|
2718
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "watchMinDate", null);
|
|
2719
|
+
|
|
2720
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2721
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2722
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2723
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2724
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2725
|
+
};
|
|
2726
|
+
/** Allow repick controller. */
|
|
2727
|
+
class VegaDatePickerCalendarAllowRepickController extends VegaSlimmer {
|
|
2728
|
+
/**
|
|
2729
|
+
* Trigger repick
|
|
2730
|
+
*
|
|
2731
|
+
* @param {DatePickerCalendarRepickType} type - The type of repick.
|
|
2732
|
+
*/
|
|
2733
|
+
triggerRepick(type) {
|
|
2734
|
+
this.repickType = type;
|
|
2735
|
+
if (type === 'end') {
|
|
2736
|
+
this.setEndDateAsCurrentMonthPeriod();
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
/** while selection completed, we should clear repick type */
|
|
2740
|
+
watchCalendarSelection() {
|
|
2741
|
+
if (this.calendarSelection.isCompleted()) {
|
|
2742
|
+
this.repickType = null;
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Get triggered repick type.
|
|
2747
|
+
*
|
|
2748
|
+
* @returns {DatePickerCalendarRepickType} - Repick type.
|
|
2749
|
+
*/
|
|
2750
|
+
getRepickType() {
|
|
2751
|
+
return this.repickType;
|
|
2752
|
+
}
|
|
2753
|
+
/**
|
|
2754
|
+
* Set end date as current period.
|
|
2755
|
+
* - while start date and end date in same month of year, we set startDate as current period
|
|
2756
|
+
* - while in range mobile device, since we only render on month, so set the end date at current period
|
|
2757
|
+
* - while in range desktop devide, we set previous month as current period to keep end date is in second month.
|
|
2758
|
+
*/
|
|
2759
|
+
setEndDateAsCurrentMonthPeriod() {
|
|
2760
|
+
const startDate = this.calendarSelection.startDate;
|
|
2761
|
+
const endDate = this.calendarSelection.endDate;
|
|
2762
|
+
if (endDate) {
|
|
2763
|
+
const date = isCalendarDateType(startDate) && startDate.compare(endDate).inMonth
|
|
2764
|
+
? startDate
|
|
2765
|
+
: this.isMobileDevice
|
|
2766
|
+
? endDate
|
|
2767
|
+
: endDate.add(0, -1);
|
|
2768
|
+
this.currentPeriodController.updateCalendarPeriod(new MonthPeriod(date));
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
__decorate$1([
|
|
2773
|
+
MapToComponentField()
|
|
2774
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "calendarSelection", void 0);
|
|
2775
|
+
__decorate$1([
|
|
2776
|
+
MapToComponentField()
|
|
2777
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "isMobileDevice", void 0);
|
|
2778
|
+
__decorate$1([
|
|
2779
|
+
MapToComponentField()
|
|
2780
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "currentPeriodController", void 0);
|
|
2781
|
+
__decorate$1([
|
|
2782
|
+
MapToComponentMethod('triggerRepick')
|
|
2783
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "triggerRepick", null);
|
|
2784
|
+
__decorate$1([
|
|
2785
|
+
MapToComponentMethod('watchCalendarSelection')
|
|
2786
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "watchCalendarSelection", null);
|
|
2787
|
+
|
|
2788
|
+
const vegaDatePickerCalendarCss = ":host{--vega-litepicker-container-width:calc(var(--vega-litepicker-day-width) * 7)}.calendar,.calendar .container__main,.calendar .container__months{height:100%}:host(.small.range) .calendar.static-height .container__main,:host(.regular.range) .calendar.static-height .container__main,:host(.large.range) .calendar.static-height .container__main{aspect-ratio:1/1}:host(.small){--vega-litepicker-day-width:28px;--vega-litepicker-day-height:28px;--vega-date-picker-calendar-range-space-size:16px}:host(.small) .calendar .container__main{max-width:360px;max-height:360px}:host(.small) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;margin-bottom:4px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.small) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.small) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.small) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host(.small) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.small) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.small) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.small) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host(.small) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.small) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.small) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.small) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host(.small) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.small) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.small) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.small) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px}}:host(.small) .calendar .container__days .day-item .is-start-date,:host(.small) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.small) .calendar .container__days .day-item .is-start-date,:host(.small) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.small) .calendar .container__days .day-item .is-start-date,:host(.small) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.small) .calendar .container__days .day-item .is-start-date,:host(.small) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host(.small.range) .calendar .container__main{width:100%;max-width:600px;max-height:360px}:host(.regular){--vega-litepicker-day-width:40px;--vega-litepicker-day-height:40px;--vega-date-picker-calendar-range-space-size:24px}:host(.regular) .calendar .container__main{max-width:450px;max-height:450px}:host(.regular) .calendar .container__months .month-item-header{margin-bottom:12px}:host(.regular) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.regular) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.regular) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.regular) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}:host(.regular) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.regular) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.regular) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.regular) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}:host(.regular) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.regular) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.regular) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.regular) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px}}:host(.regular) .calendar .container__days .day-item .is-start-date,:host(.regular) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.regular) .calendar .container__days .day-item .is-start-date,:host(.regular) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.regular) .calendar .container__days .day-item .is-start-date,:host(.regular) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.regular) .calendar .container__days .day-item .is-start-date,:host(.regular) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}:host(.regular.range) .calendar .container__main{width:100%;max-width:900px;max-height:450px}:host(.large){--vega-litepicker-day-width:56px;--vega-litepicker-day-height:56px;--vega-date-picker-calendar-range-space-size:40px}:host(.large) .calendar .container__main{max-width:600px;max-height:600px}:host(.large) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px;margin-bottom:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.large) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.large) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.large) .calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}:host(.large) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.large) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.large) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.large) .calendar .container__months .month-item-weekdays-row{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}:host(.large) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.large) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.large) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.large) .calendar .container__months .month-item-weekdays-row div{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}:host(.large) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.large) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.large) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.large) .calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}:host(.large) .calendar .container__days .day-item .is-start-date,:host(.large) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.large) .calendar .container__days .day-item .is-start-date,:host(.large) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.large) .calendar .container__days .day-item .is-start-date,:host(.large) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.large) .calendar .container__days .day-item .is-start-date,:host(.large) .calendar .container__days .day-item .is-end-date{font-family:\"Inter\", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}}:host(.large.range) .calendar .container__main{width:100%;max-width:1200px;max-height:600px}.calendar .container__main{display:flex;flex-direction:column}.calendar .container__months{display:flex}.calendar .container__months.columns-2{width:100%;flex-direction:row}.calendar .container__months .month-item{box-sizing:content-box;position:relative;width:100%;height:100%;z-index:1;display:flex;flex-direction:column}.calendar .container__months.columns-2 .month-item:first-of-type{padding-right:var(--vega-date-picker-calendar-range-space-size)}.calendar .container__months.columns-2 .month-item:last-of-type{padding-left:var(--vega-date-picker-calendar-range-space-size)}.calendar .container__months .month-item:nth-child(2)::before{background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:32px;margin-bottom:32px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:none;width:1px;content:\"\";display:block}.calendar .container__months .month-item-header{display:flex;justify-content:space-between;align-items:center;text-align:center;font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar .container__months .month-item-header{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px}}.calendar .container__months .month-item-header div>.month-item-name{margin-right:5px}.calendar .container__months .month-item-header .button-previous-month,.calendar .container__months .month-item-header .button-next-month{visibility:hidden;text-decoration:none;cursor:default}.calendar .container__months .month-item-header .button-previous-month *,.calendar .container__months .month-item-header .button-next-month *{pointer-events:none}.calendar .container__months .month-item-header .button-previous-month>svg,.calendar .container__months .month-item-header .button-previous-month>img{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.calendar .container__months .month-item-header .button-next-month>svg,.calendar .container__months .month-item-header .button-next-month>img{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.calendar .container__months .month-item-weekdays-row{color:rgba(var(--v-text-primary, 32, 54, 69, 1));place-items:center}.calendar .container__months .month-item:first-child .button-previous-month{visibility:visible}.calendar .container__months .month-item:last-child .button-next-month{visibility:visible}.calendar .container__months .month-item.no-previous-month .button-previous-month{visibility:hidden}.calendar .container__months .month-item.no-next-month .button-next-month{visibility:hidden}.calendar .container__days{text-align:center;place-items:center;flex:1 1 auto}.calendar.static-height .container__days{align-content:flex-start}.calendar:not(.static-height) .container__days{flex:none}.calendar .container__months .month-item-weekdays-row>div,.calendar .container__days>div,.calendar .container__days>a{padding:4px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--vega-litepicker-day-height);width:100%;min-width:var(--vega-litepicker-day-width)}.calendar .container__days .day-item{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;text-align:center;border-radius:9999px;cursor:default}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar .container__days .day-item{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.calendar .container__days .day-item:not(.is-locked):not(.is-disabled):active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));border-width:0px}.calendar .day-item.is-start-date.is-end-date.is-locked:active{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}.calendar .container__days .day-item:hover:before{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));border-radius:9999px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;content:\" \";z-index:-1}.calendar .container__days .day-item.is-locked:hover:before,html.dark .calendar .container__days .day-item.is-locked:hover:before{border-style:none}.calendar .container__days .day-item.is-disabled:hover:before{border-style:none}.calendar .container__days .day-item.is-locked,.calendar .container__days .day-item.is-disabled{-webkit-tap-highlight-color:transparent}.calendar .container__days .day-item:hover{position:relative}.calendar .container__days .day-item.is-today{color:rgba(var(--v-text-link, 19, 98, 226, 1));font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar .container__days .day-item.is-today{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar .container__days .day-item.is-in-range{border-radius:0px;position:relative;z-index:2;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.calendar .container__days .day-item:not(.is-locked):not(.is-disabled).is-in-range:hover:before{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));border-radius:9999px;position:absolute;top:0px;right:0px;bottom:0px;left:0px;content:\" \";z-index:-1}.calendar .container__days .day-item.is-start-date{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-radius:9999px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));position:relative}.calendar .container__days .day-item.is-start-date:hover:before{z-index:2}.calendar .container__days .day-item.is-start-date:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-top-left-radius:9999px;border-bottom-left-radius:9999px;content:\" \";z-index:-1;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.calendar .container__days .day-item.is-start-date.is-flipped{border-radius:9999px;position:relative}.calendar .container__days .day-item.is-start-date.is-flipped:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;content:\" \";z-index:-1}.calendar .container__days .day-item.is-end-date{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-radius:9999px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));position:relative}.calendar .container__days .day-item.is-end-date:hover:before{z-index:2}.calendar .container__days .day-item.is-end-date:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;content:\" \";z-index:-1;background-color:rgba(var(--v-bg-date-picker-range, 229, 239, 255, 1))}.calendar .container__days .day-item.is-end-date.is-flipped{border-radius:9999px;position:relative}.calendar .container__days .day-item.is-end-date.is-flipped:after{position:absolute;top:0px;right:0px;bottom:0px;left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-top-left-radius:9999px;border-bottom-left-radius:9999px;content:\" \";z-index:-1}.calendar .container__days .day-item.is-start-date.is-end-date{border-radius:9999px}.calendar .container__days .day-item.is-start-date.is-end-date:after,html.dark .calendar .container__days .day-item.is-start-date.is-end-date:after{background:none}.calendar .container__tooltip{display:none}.calendar .container__days .day-item.is-locked{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));cursor:not-allowed}.calendar.mobilefriendly[data-plugins*=mobilefriendly] .container__days>div{height:var(--vega-date-picker-calendar-day-height)}.calendar .clear-button{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar .clear-button{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}.calendar .footer-container{margin-top:16px;height:24px}:host(.vega-force-hidden){display:none !important}.calendar{left:initial !important;top:initial !important;position:initial !important}.button-next-month svg,.button-previous-month svg{width:12px;height:16px}.calendar .container__days .day-item.is-disabled{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));cursor:not-allowed;text-decoration:line-through}.calendar .container__days>div:not(.day-item){-webkit-tap-highlight-color:transparent}.calendar .month-item-header>div.dropdown-section{display:flex;gap:12px}.calendar .month-item-header>div.dropdown-section .dropdown-current-value{position:relative;display:flex;gap:4px;align-items:center;cursor:pointer}.calendar .month-item-header>div.dropdown-section .dropdown-current-value.active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}.calendar .month-item-header>div.dropdown-section .dropdown-current-value.active:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}.calendar .month-item-header>div.dropdown-section .dropdown-current-value.active:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}.calendar .month-item-header>div.dropdown-section .dropdown-current-value.active:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}.locked-month-button{width:32px;height:32px}vega-dropdown .month-item-name,vega-dropdown .month-item-year{display:flex;gap:4px;align-items:center;cursor:pointer}vega-dropdown.active .month-item-name,vega-dropdown.active .month-item-year{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}vega-dropdown.active .month-item-name:active,vega-dropdown.active .month-item-year:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}vega-dropdown.active .month-item-name:hover,vega-dropdown.active .month-item-year:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}vega-dropdown.active .month-item-name:focus-visible,vega-dropdown.active .month-item-year:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}";
|
|
2789
|
+
|
|
2790
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2791
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2792
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2793
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2794
|
+
else
|
|
2795
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2796
|
+
if (d = decorators[i])
|
|
2797
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2798
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2799
|
+
};
|
|
2800
|
+
const VegaDatePickerCalendar = class {
|
|
2801
|
+
constructor(hostRef) {
|
|
2802
|
+
registerInstance(this, hostRef);
|
|
2803
|
+
this.vegaClear = createEvent(this, "vegaClear", 7);
|
|
2804
|
+
this.clear = createEvent(this, "clear", 7);
|
|
2805
|
+
this.vegaMonthYearChange = createEvent(this, "vegaMonthYearChange", 7);
|
|
2806
|
+
this.monthYearChange = createEvent(this, "monthYearChange", 7);
|
|
2807
|
+
this.vegaSelectionChange = createEvent(this, "vegaSelectionChange", 7);
|
|
2808
|
+
this.selectionChange = createEvent(this, "selectionChange", 7);
|
|
2809
|
+
this.globalSlimmers = {};
|
|
2810
|
+
this.renderer = new VegaDatePickerCalendarRenderer();
|
|
2811
|
+
this.monthItemRenderer = new VegaDatePickerMonthItemRenderer();
|
|
2812
|
+
this.translationSlimmer = new TranslationSlimmer();
|
|
2813
|
+
this.todayController = new VegaDatePickerCalendarTodayController();
|
|
2814
|
+
this.selectionController = new VegaDatePickerCalendarSelectionController();
|
|
2815
|
+
this.minMaxDateController = new VegaDatePickerCalendarMinMaxDateController();
|
|
2816
|
+
this.currentPeriodController = new VegaDatePickerCalendarCurrentPeriodController();
|
|
2817
|
+
this.yearMonthSwitcherRender = new VegaDatePickerCalendarYearMonthSwitcherRenderer();
|
|
2818
|
+
this.allowRepickController = new VegaDatePickerCalendarAllowRepickController();
|
|
2819
|
+
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
2820
|
+
this.clearEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaClear);
|
|
2821
|
+
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaMonthYearChange);
|
|
2822
|
+
this.vegaSelectionChangeEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaSelectionChange);
|
|
2823
|
+
this.isMobileDevice = getDeviceType() === DeviceType.MOBILE;
|
|
2824
|
+
/**
|
|
2825
|
+
* Renders the calendar picker in different sizes. Defaults to regular size
|
|
2826
|
+
*
|
|
2827
|
+
* @vegaVersion 2.72.0
|
|
2828
|
+
*/
|
|
2829
|
+
this.size = 'regular';
|
|
2830
|
+
/**
|
|
2831
|
+
* Specifies the selection mode of the date picker calendar.
|
|
2832
|
+
*
|
|
2833
|
+
* - Use `single` to allow selecting a single date.
|
|
2834
|
+
* - Use `range` to allow selecting a date range.
|
|
2835
|
+
*
|
|
2836
|
+
* @vegaVersion 2.72.0
|
|
2837
|
+
*/
|
|
2838
|
+
this.mode = 'single';
|
|
2839
|
+
/**
|
|
2840
|
+
* Specifies the selected date or date range in the date picker calendar.
|
|
2841
|
+
*
|
|
2842
|
+
* @vegaVersion 2.72.0
|
|
2843
|
+
*/
|
|
2844
|
+
/* eslint-disable-next-line @stencil/strict-mutable */
|
|
2845
|
+
this.selection = this.mode === 'range' ? ['', ''] : '';
|
|
2846
|
+
/**
|
|
2847
|
+
* Specifies the desired date format.
|
|
2848
|
+
*
|
|
2849
|
+
* @vegaVersion 2.72.0
|
|
2850
|
+
*/
|
|
2851
|
+
this.format = 'MM/DD/YYYY';
|
|
2852
|
+
/**
|
|
2853
|
+
* Specifies whether to display the clear button when the calendar is shown.
|
|
2854
|
+
*
|
|
2855
|
+
* @vegaVersion 2.72.0
|
|
2856
|
+
*/
|
|
2857
|
+
this.clearButton = false;
|
|
2858
|
+
/**
|
|
2859
|
+
* Specifies the calendar is static height.
|
|
2860
|
+
*
|
|
2861
|
+
* @vegaVersion 2.72.0
|
|
2862
|
+
*/
|
|
2863
|
+
this.staticHeight = false;
|
|
2864
|
+
/**
|
|
2865
|
+
* Determines whether to show months and years dropdown in date picker calendar
|
|
2866
|
+
* If set to true, date picker calendar will have months and years dropdown
|
|
2867
|
+
*
|
|
2868
|
+
* @vegaVersion 2.72.0
|
|
2869
|
+
*/
|
|
2870
|
+
this.showYearMonthDropdowns = false;
|
|
2871
|
+
/**
|
|
2872
|
+
* Determines whether the year or month dropdown position is calculated relative to the screen.
|
|
2873
|
+
*
|
|
2874
|
+
* @vegaVersion 2.72.0
|
|
2875
|
+
*/
|
|
2876
|
+
this.yearMonthDropdownProps = {};
|
|
2877
|
+
/**
|
|
2878
|
+
* Specifies a predicate function that determines whether a given date in the date picker should be disabled (non-interactive).
|
|
2879
|
+
*
|
|
2880
|
+
* The function is called for each date cell before rendering.
|
|
2881
|
+
*
|
|
2882
|
+
* Return `true` to disable the cell, or false to keep it selectable.
|
|
2883
|
+
* Default behavior: always returns `false` (no cells are disabled).
|
|
2884
|
+
*
|
|
2885
|
+
* @param date - The `Date` object for the cell being evaluated.
|
|
2886
|
+
* @returns `true` if the cell should be disabled; otherwise `false`.
|
|
2887
|
+
* @vegaVersion 2.72.0
|
|
2888
|
+
*/
|
|
2889
|
+
this.isDateDisabled = () => false;
|
|
2890
|
+
}
|
|
2891
|
+
watchCurrentPeriod() {
|
|
2892
|
+
}
|
|
2893
|
+
watchCalendarSelection() {
|
|
2894
|
+
}
|
|
2895
|
+
watchMaxCalendarDate() {
|
|
2896
|
+
}
|
|
2897
|
+
watchMinCalendarDate() {
|
|
2898
|
+
}
|
|
2899
|
+
watchSelection() {
|
|
2900
|
+
}
|
|
2901
|
+
watchMinDate() {
|
|
2902
|
+
}
|
|
2903
|
+
watchMaxDate() {
|
|
2904
|
+
}
|
|
2905
|
+
watchTimezone() {
|
|
2906
|
+
}
|
|
2907
|
+
/**
|
|
2908
|
+
* Invoke this method to reset calendar to its initial state,
|
|
2909
|
+
* it include reset to current value and reset the current period.
|
|
2910
|
+
* @vegaVersion 2.72.0
|
|
2911
|
+
*/
|
|
2912
|
+
async reset() {
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* Invoke this method to trigger repick.
|
|
2916
|
+
* The param `type` is distinguishing the start date or end date can be repick.
|
|
2917
|
+
* @vegaVersion 2.72.0
|
|
2918
|
+
*/
|
|
2919
|
+
async triggerRepick(type) {
|
|
2920
|
+
}
|
|
2921
|
+
render() {
|
|
2922
|
+
return sanitizeVegaComponent(h(Host, { class: {
|
|
2923
|
+
[this.size]: true,
|
|
2924
|
+
[this.mode]: true,
|
|
2925
|
+
mobile: this.isMobileDevice,
|
|
2926
|
+
} }, this.renderer.render()), this.host);
|
|
2927
|
+
}
|
|
2928
|
+
get host() { return getElement(this); }
|
|
2929
|
+
static get watchers() { return {
|
|
2930
|
+
"currentPeriod": ["watchCurrentPeriod"],
|
|
2931
|
+
"calendarSelection": ["watchCalendarSelection"],
|
|
2932
|
+
"maxCalendarDate": ["watchMaxCalendarDate"],
|
|
2933
|
+
"minCalendarDate": ["watchMinCalendarDate"],
|
|
2934
|
+
"selection": ["watchSelection"],
|
|
2935
|
+
"minDate": ["watchMinDate"],
|
|
2936
|
+
"maxDate": ["watchMaxDate"],
|
|
2937
|
+
"timezone": ["watchTimezone"]
|
|
2938
|
+
}; }
|
|
2939
|
+
};
|
|
2940
|
+
__decorate([
|
|
2941
|
+
InjectVegaGlobalSlimmer()
|
|
2942
|
+
], VegaDatePickerCalendar.prototype, "globalSlimmers", void 0);
|
|
2943
|
+
__decorate([
|
|
2944
|
+
InjectVegaSlimmer()
|
|
2945
|
+
], VegaDatePickerCalendar.prototype, "renderer", void 0);
|
|
2946
|
+
__decorate([
|
|
2947
|
+
InjectVegaSlimmer()
|
|
2948
|
+
], VegaDatePickerCalendar.prototype, "monthItemRenderer", void 0);
|
|
2949
|
+
__decorate([
|
|
2950
|
+
InjectVegaSlimmer()
|
|
2951
|
+
], VegaDatePickerCalendar.prototype, "translationSlimmer", void 0);
|
|
2952
|
+
__decorate([
|
|
2953
|
+
InjectVegaSlimmer()
|
|
2954
|
+
], VegaDatePickerCalendar.prototype, "todayController", void 0);
|
|
2955
|
+
__decorate([
|
|
2956
|
+
InjectVegaSlimmer()
|
|
2957
|
+
], VegaDatePickerCalendar.prototype, "selectionController", void 0);
|
|
2958
|
+
__decorate([
|
|
2959
|
+
InjectVegaSlimmer()
|
|
2960
|
+
], VegaDatePickerCalendar.prototype, "minMaxDateController", void 0);
|
|
2961
|
+
__decorate([
|
|
2962
|
+
InjectVegaSlimmer()
|
|
2963
|
+
], VegaDatePickerCalendar.prototype, "currentPeriodController", void 0);
|
|
2964
|
+
__decorate([
|
|
2965
|
+
InjectVegaSlimmer()
|
|
2966
|
+
], VegaDatePickerCalendar.prototype, "yearMonthSwitcherRender", void 0);
|
|
2967
|
+
__decorate([
|
|
2968
|
+
InjectVegaSlimmer()
|
|
2969
|
+
], VegaDatePickerCalendar.prototype, "allowRepickController", void 0);
|
|
2970
|
+
__decorate([
|
|
2971
|
+
InjectVegaSlimmer()
|
|
2972
|
+
], VegaDatePickerCalendar.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
2973
|
+
__decorate([
|
|
2974
|
+
InjectVegaSlimmer()
|
|
2975
|
+
], VegaDatePickerCalendar.prototype, "clearEventEmitter", void 0);
|
|
2976
|
+
__decorate([
|
|
2977
|
+
InjectVegaSlimmer()
|
|
2978
|
+
], VegaDatePickerCalendar.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2979
|
+
__decorate([
|
|
2980
|
+
InjectVegaSlimmer()
|
|
2981
|
+
], VegaDatePickerCalendar.prototype, "vegaSelectionChangeEventEmitter", void 0);
|
|
2791
2982
|
VegaDatePickerCalendar.style = vegaDatePickerCalendarCss;
|
|
2792
2983
|
|
|
2793
2984
|
export { VegaDatePicker as vega_date_picker, VegaDatePickerCalendar as vega_date_picker_calendar };
|