@globalpayments/vega 2.70.0 → 2.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-837be7a6.js → app-globals-c6be6013.js} +8 -7
- 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-a7c8825f.js} +14 -66
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-cf7b4bda.js → component-value-history-controller-slimmer.abstract-868de3c4.js} +5 -5
- package/dist/cjs/{date-required-rule-4e1f84fd.js → date-required-rule-99cca681.js} +3 -3
- package/dist/cjs/{design-token-00fe8d2f.js → design-token-d9c4dff6.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-f3820a6b.js} +4 -4
- package/dist/cjs/{element-appender-slimmer-f8e89f37.js → element-appender-slimmer-3dc36dfa.js} +49 -11
- 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/{function-extension-28a4d781.js → function-extension-d4fc3b7a.js} +40 -19
- package/dist/cjs/{image-annotation-action-8843adbf.js → image-annotation-action-64414e40.js} +3 -3
- package/dist/cjs/{index-4b896e76.js → index-c7fbf32b.js} +2 -2
- package/dist/cjs/index.cjs.js +17 -19
- 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-d23e5369.js} +2 -2
- package/dist/cjs/loader.cjs.js +13 -13
- package/dist/cjs/month-view-generator-706c5477.js +102 -0
- package/dist/cjs/{public-rules-759c745b.js → public-rules-0847e6fa.js} +15 -15
- package/dist/cjs/{range-0b597850.js → range-14190f6b.js} +1 -1
- package/dist/cjs/{responsive-format-facade-1d9c13a9.js → responsive-format-facade-77d357fb.js} +4 -4
- package/dist/cjs/{rich-text-editor-required-rule-92d0640e.js → rich-text-editor-required-rule-65d85060.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-4fd65f6f.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/{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 +11 -12
- package/dist/cjs/vega-app-header-button.cjs.entry.js +16 -17
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +15 -16
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +15 -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 +15 -15
- package/dist/cjs/vega-calendar_4.cjs.entry.js +87 -909
- package/dist/cjs/vega-card.cjs.entry.js +14 -15
- package/dist/cjs/vega-carousel.cjs.entry.js +14 -14
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-chip.cjs.entry.js +16 -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 +1757 -1568
- package/dist/cjs/vega-dialog_2.cjs.entry.js +17 -18
- package/dist/cjs/vega-divider.cjs.entry.js +10 -11
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +18 -29
- 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 +10 -11
- package/dist/cjs/vega-flex.cjs.entry.js +15 -16
- package/dist/cjs/vega-font.cjs.entry.js +14 -15
- package/dist/cjs/vega-form.cjs.entry.js +9 -9
- package/dist/cjs/vega-grid.cjs.entry.js +14 -15
- package/dist/cjs/vega-icon.cjs.entry.js +14 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +15 -15
- 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 +16 -13
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +13 -13
- package/dist/cjs/vega-input.cjs.entry.js +12 -12
- 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 +14 -15
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +9 -9
- 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 +13 -13
- package/dist/cjs/vega-popover_2.cjs.entry.js +17 -18
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +313 -73
- 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 +19 -19
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +16 -16
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +12 -12
- package/dist/cjs/vega-signature-capture.cjs.entry.js +13 -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 +12 -12
- package/dist/cjs/vega-textarea.cjs.entry.js +7 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +38 -39
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +6 -6
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +14 -14
- package/dist/cjs/vega.cjs.js +13 -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-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +3 -15
- package/dist/collection/components/vega-input/vega-input.js +21 -1
- package/dist/collection/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.js +4 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.js +3 -2
- package/dist/collection/components/vega-modal/vega-modal.js +4 -4
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.js +154 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +101 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +68 -77
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +71 -86
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +11 -63
- 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/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/constants/regex.js +1 -0
- package/dist/collection/constants/ui.js +3 -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/test/date.test.js +2 -0
- package/dist/esm/{app-globals-fd4b7d97.js → app-globals-3d7e8bad.js} +8 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-76331524.js → child-nodes-event-prevent-slimmer-6f7ae2c7.js} +1 -1
- package/dist/esm/{code-block-ecb4491b.js → code-block-8fb548ff.js} +15 -67
- package/dist/esm/{component-value-history-controller-slimmer.abstract-5d618b88.js → component-value-history-controller-slimmer.abstract-05f3ff05.js} +5 -5
- package/dist/esm/{date-required-rule-8944f3bf.js → date-required-rule-a9980386.js} +1 -1
- package/dist/esm/{design-token-2d77e8f5.js → design-token-ee017ea0.js} +4 -5
- package/dist/esm/{dom-node-subject-observer-factory-dca87b70.js → dom-node-subject-observer-factory-479cc5ef.js} +4 -2
- package/dist/esm/{dto-renderer-manager-d862ae78.js → dto-renderer-manager-d185c7ba.js} +4 -4
- package/dist/esm/{element-appender-slimmer-6791c332.js → element-appender-slimmer-00bc1a3c.js} +51 -13
- package/dist/esm/{event-emit-slimmer-4e28e9f8.js → event-emit-slimmer-76fbfe1f.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-bf071b75.js → form-field-controller-slimmer-14379261.js} +4 -4
- package/dist/esm/{function-extension-8d39db56.js → function-extension-3f886d01.js} +41 -20
- package/dist/esm/{image-annotation-action-d0af138c.js → image-annotation-action-3ce95526.js} +3 -3
- package/dist/esm/{index-c943d263.js → index-03a016ed.js} +2 -2
- package/dist/esm/index.js +19 -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-e44672ed.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-36c79ea1.js} +2 -2
- package/dist/esm/loader.js +15 -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/{public-rules-d10e76f4.js → public-rules-0f5a36c2.js} +15 -15
- package/dist/esm/{range-f7b9e2fb.js → range-f10f4c85.js} +1 -1
- package/dist/esm/{responsive-format-facade-267935ae.js → responsive-format-facade-6df7d17a.js} +6 -6
- package/dist/esm/{rich-text-editor-required-rule-774b822b.js → rich-text-editor-required-rule-d0cde24f.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-af085f0a.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-e6879600.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-56380f02.js → sub-state-notify-slimmer-430e150c.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-3504e2f2.js → sub-state-observer-slimmer-17bb0328.js} +2 -2
- 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 +13 -14
- package/dist/esm/vega-app-header-button.entry.js +18 -19
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +17 -18
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +17 -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 +17 -17
- package/dist/esm/vega-calendar_4.entry.js +46 -868
- package/dist/esm/vega-card.entry.js +16 -17
- package/dist/esm/vega-carousel.entry.js +16 -16
- package/dist/esm/vega-checkbox_2.entry.js +9 -9
- package/dist/esm/vega-chip.entry.js +18 -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 +1744 -1555
- package/dist/esm/vega-dialog_2.entry.js +19 -20
- package/dist/esm/vega-divider.entry.js +12 -13
- package/dist/esm/vega-dropdown_5.entry.js +20 -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 +12 -13
- package/dist/esm/vega-flex.entry.js +17 -18
- package/dist/esm/vega-font.entry.js +16 -17
- package/dist/esm/vega-form.entry.js +11 -11
- package/dist/esm/vega-grid.entry.js +16 -17
- package/dist/esm/vega-icon.entry.js +16 -17
- package/dist/esm/vega-image-uploader.entry.js +17 -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 +18 -15
- package/dist/esm/vega-input-phone-number.entry.js +15 -15
- package/dist/esm/vega-input-range.entry.js +9 -9
- package/dist/esm/vega-input-select.entry.js +15 -15
- package/dist/esm/vega-input.entry.js +14 -14
- package/dist/esm/{vega-internal-event-id-5c3e5f7f.js → vega-internal-event-id-71c67c39.js} +4 -3
- package/dist/esm/vega-item-toggle.entry.js +4 -4
- package/dist/esm/vega-left-nav_5.entry.js +16 -17
- package/dist/esm/vega-loader-wrapper_2.entry.js +11 -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 +15 -15
- package/dist/esm/vega-popover_2.entry.js +19 -20
- package/dist/esm/vega-progress-tracker.entry.js +315 -75
- 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 +21 -21
- package/dist/esm/vega-segment-control.entry.js +5 -5
- package/dist/esm/vega-selection-chip_2.entry.js +18 -18
- package/dist/esm/vega-selection-tile_2.entry.js +10 -10
- package/dist/esm/vega-sidenav_3.entry.js +14 -14
- package/dist/esm/vega-signature-capture.entry.js +15 -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 +14 -14
- 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 +19 -20
- package/dist/esm/vega-toggle-switch.entry.js +8 -8
- package/dist/esm/vega-tooltip_2.entry.js +16 -16
- package/dist/esm/vega.js +15 -15
- package/dist/sri/vega-sri-manifest.json +333 -341
- 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-input/vega-input.d.ts +7 -0
- package/dist/types/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.d.ts +1 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +7 -1
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.d.ts +65 -0
- package/dist/types/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.d.ts +19 -0
- package/dist/types/components/vega-progress-tracker/type.d.ts +1 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +14 -10
- 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/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 +6 -1
- package/dist/types/components.d.ts +211 -9
- 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 +4 -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/vega/index.esm.js +1 -1
- package/dist/vega/{p-7c1d08db.entry.js → p-06ab90c4.entry.js} +1 -1
- package/dist/vega/{p-58769a72.entry.js → p-09cd025a.entry.js} +1 -1
- package/dist/vega/p-0b696b0e.entry.js +1 -0
- package/dist/vega/{p-9e59345f.entry.js → p-0f5453a7.entry.js} +1 -1
- package/dist/vega/{p-7d9cd9c8.js → p-10ac8b57.js} +1 -1
- package/dist/vega/p-154f39e4.entry.js +1 -0
- package/dist/vega/p-161b9c5b.js +1 -0
- package/dist/vega/p-169b7252.entry.js +1 -0
- package/dist/vega/{p-1f26de89.js → p-17f3897a.js} +1 -1
- package/dist/vega/p-1832e051.js +1 -0
- package/dist/vega/p-19728819.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-61d9cdf9.entry.js → p-213310e1.entry.js} +1 -1
- package/dist/vega/p-27e641a0.entry.js +1 -0
- package/dist/vega/p-2872565e.js +1 -0
- package/dist/vega/{p-b5ba0c11.js → p-294b0b76.js} +1 -1
- package/dist/vega/p-2c744c20.js +1 -0
- package/dist/vega/{p-ea96635b.entry.js → p-314bf1d5.entry.js} +1 -1
- package/dist/vega/{p-366825fa.entry.js → p-34f624d6.entry.js} +1 -1
- package/dist/vega/p-39b8dda9.entry.js +1 -0
- package/dist/vega/p-3af9421b.entry.js +1 -0
- package/dist/vega/{p-1bb0c934.js → p-3d128c07.js} +1 -1
- package/dist/vega/{p-19522949.js → p-3d85411d.js} +1 -1
- package/dist/vega/{p-69aec6af.entry.js → p-3eb0d55c.entry.js} +1 -1
- package/dist/vega/{p-8c6b6ad7.entry.js → p-3fbfffa1.entry.js} +1 -1
- package/dist/vega/{p-74168615.js → p-40f39194.js} +1 -1
- package/dist/vega/{p-db57dddc.js → p-41026b90.js} +1 -1
- package/dist/vega/{p-0f7dec29.entry.js → p-4cc49d2b.entry.js} +1 -1
- package/dist/vega/{p-54e56f0d.entry.js → p-4ea28b2b.entry.js} +1 -1
- package/dist/vega/{p-c6ae78f2.entry.js → p-4f56da1d.entry.js} +1 -1
- package/dist/vega/{p-91d71ae9.entry.js → p-563b67a0.entry.js} +1 -1
- package/dist/vega/p-59e02528.js +1 -0
- package/dist/vega/p-5ac6bf4e.entry.js +1 -0
- package/dist/vega/p-5c379abd.entry.js +1 -0
- package/dist/vega/{p-b9798158.js → p-5c71a548.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-5fdbff48.js +1 -0
- package/dist/vega/{p-35cd469a.entry.js → p-62e45daf.entry.js} +1 -1
- package/dist/vega/{p-bfb86c3e.entry.js → p-65749591.entry.js} +1 -1
- package/dist/vega/{p-71f9c4d4.js → p-6c1ef2ed.js} +1 -1
- package/dist/vega/p-6ee95368.entry.js +1 -0
- package/dist/vega/{p-fde50319.js → p-707d542e.js} +1 -1
- package/dist/vega/{p-75b5894f.entry.js → p-7089cafe.entry.js} +1 -1
- package/dist/vega/{p-b27fcac4.entry.js → p-74f3516e.entry.js} +1 -1
- package/dist/vega/p-7a5b3ad3.entry.js +1 -0
- package/dist/vega/{p-652626b6.entry.js → p-7c22e766.entry.js} +1 -1
- package/dist/vega/{p-5e708ad5.entry.js → p-8233c5b6.entry.js} +1 -1
- package/dist/vega/p-82bd84f9.js +1 -0
- package/dist/vega/{p-235bf01b.entry.js → p-86b1e8dd.entry.js} +1 -1
- package/dist/vega/p-87960572.entry.js +1 -0
- package/dist/vega/{p-2f09c6aa.js → p-883192ed.js} +1 -1
- package/dist/vega/p-8c5acc0b.entry.js +1 -0
- package/dist/vega/{p-cbabb07a.entry.js → p-94a58223.entry.js} +1 -1
- package/dist/vega/p-95059e57.entry.js +1 -0
- package/dist/vega/p-990b11a7.entry.js +1 -0
- package/dist/vega/p-9a83a6b0.js +1 -0
- package/dist/vega/p-a23f6ed1.entry.js +1 -0
- package/dist/vega/{p-924b4e24.js → p-a4ec6575.js} +1 -1
- package/dist/vega/{p-379f1b40.entry.js → p-a7633138.entry.js} +1 -1
- package/dist/vega/{p-3925c16b.js → p-a8dad05d.js} +1 -1
- package/dist/vega/p-a9268981.entry.js +1 -0
- package/dist/vega/p-afb834d8.js +1 -0
- package/dist/vega/p-b05ec86a.entry.js +1 -0
- package/dist/vega/{p-98fb9eaa.entry.js → p-b1ad3107.entry.js} +1 -1
- package/dist/vega/{p-4a467973.js → p-b2eea369.js} +1 -1
- package/dist/vega/{p-796d840c.entry.js → p-b3d29c1e.entry.js} +1 -1
- package/dist/vega/{p-c2f21426.entry.js → p-b6c92e7a.entry.js} +1 -1
- package/dist/vega/{p-447c7590.js → p-b842f649.js} +1 -1
- package/dist/vega/{p-35252108.js → p-b8a7a54b.js} +1 -1
- package/dist/vega/{p-330c224f.entry.js → p-b96b7f33.entry.js} +1 -1
- package/dist/vega/p-bc1cbd6c.js +1 -0
- package/dist/vega/p-bc7df5e7.entry.js +1 -0
- package/dist/vega/p-bca97027.entry.js +1 -0
- package/dist/vega/p-beed225e.entry.js +1 -0
- package/dist/vega/p-c1db0a81.entry.js +1 -0
- package/dist/vega/{p-c0223a17.entry.js → p-c4b010be.entry.js} +1 -1
- package/dist/vega/{p-18e8c54a.entry.js → p-c4b30117.entry.js} +1 -1
- package/dist/vega/p-c5cf9a89.entry.js +1 -0
- package/dist/vega/{p-a0467b83.js → p-cb7211c3.js} +1 -1
- package/dist/vega/p-cb72ebb5.js +1 -0
- package/dist/vega/{p-3c865f86.entry.js → p-cbefc113.entry.js} +1 -1
- package/dist/vega/{p-8fae8f9e.js → p-d1d0f08a.js} +1 -1
- package/dist/vega/{p-52efaadb.entry.js → p-d4413277.entry.js} +1 -1
- package/dist/vega/p-d991fb11.js +1 -0
- package/dist/vega/{p-9ce249a9.js → p-de70aac1.js} +1 -1
- package/dist/vega/{p-e6351dab.entry.js → p-e1e306c3.entry.js} +1 -1
- package/dist/vega/p-e49c6368.js +1 -0
- package/dist/vega/{p-de97c6d9.js → p-e8d0e71c.js} +1 -1
- package/dist/vega/p-e9838fb4.entry.js +1 -0
- package/dist/vega/p-ea0b6e85.entry.js +1 -0
- package/dist/vega/p-ec412511.entry.js +1 -0
- package/dist/vega/{p-3e040167.entry.js → p-ec4c21d1.entry.js} +1 -1
- package/dist/vega/{p-85f9a980.js → p-eebe9176.js} +1 -1
- package/dist/vega/{p-7b42da4f.entry.js → p-efa4ee14.entry.js} +1 -1
- package/dist/vega/p-f9facf79.entry.js +1 -0
- package/dist/vega/{p-dde03224.entry.js → p-fa63b926.entry.js} +1 -1
- package/dist/vega/p-fc6fca08.entry.js +1 -0
- package/dist/vega/p-fcb3ff5b.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -2
- package/dist/cjs/date-0a6bb035.js +0 -95
- package/dist/cjs/mobilefriendly-aa2e50e9.js +0 -13
- package/dist/cjs/state-background-color-formatter-aa5570f6.js +0 -85
- 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/state-background-color-formatter-0f01d27a.js +0 -82
- 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-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-2e6ce1e9.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-33f3f306.js +0 -1
- package/dist/vega/p-37020002.entry.js +0 -1
- package/dist/vega/p-38cb2b40.js +0 -1
- package/dist/vega/p-4e13a26f.js +0 -1
- package/dist/vega/p-5972c101.entry.js +0 -1
- package/dist/vega/p-5d827fe5.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-71ddccf2.entry.js +0 -1
- package/dist/vega/p-785d9ac3.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-8350506e.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-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-b8b9ed2c.js +0 -1
- package/dist/vega/p-bcc396c2.entry.js +0 -1
- package/dist/vega/p-bccee21e.js +0 -1
- package/dist/vega/p-c224b44c.js +0 -1
- package/dist/vega/p-f21b893b.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,61 @@
|
|
|
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-14379261.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,
|
|
10
|
+
import { D as DomNodeSubjectObserverFactory, a as VegaClick, q as VegaSelectionChange, p as VegaClear, o as VegaMonthYearChange, N as VegaOpen, c as VegaClose, f as VegaChange, d as domNodeSubjectFactory, V as VegaDropdownClick, r as VegaDropdownShow, s as VegaDropdownHide } from './dom-node-subject-observer-factory-479cc5ef.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 './function-extension-3f886d01.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-d185c7ba.js';
|
|
27
20
|
import './vega-nonce-manager-497e5eb5.js';
|
|
28
|
-
import './code-block-
|
|
29
|
-
import {
|
|
21
|
+
import './code-block-8fb548ff.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-af085f0a.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-76fbfe1f.js';
|
|
30
|
+
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-6f7ae2c7.js';
|
|
33
31
|
import { T as TranslationSlimmer } from './translation-slimmer-c936cb1b.js';
|
|
34
|
-
import {
|
|
32
|
+
import { E as ElementAppenderSlimmer } from './element-appender-slimmer-00bc1a3c.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-71c67c39.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-17bb0328.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-e44672ed.js';
|
|
51
|
+
import './object-66c37948.js';
|
|
51
52
|
import './base-renderer-101f6d04.js';
|
|
52
|
-
import './string-format-strategy.abstract-452f4398.js';
|
|
53
|
-
import './index-c943d263.js';
|
|
54
|
-
import './responsive-format-facade-267935ae.js';
|
|
55
|
-
import './pixel-f32c07ce.js';
|
|
56
53
|
import './index-e9da316f.js';
|
|
57
|
-
import './
|
|
58
|
-
import './
|
|
54
|
+
import './string-format-strategy.abstract-75540c16.js';
|
|
55
|
+
import './index-03a016ed.js';
|
|
56
|
+
import './keyboard-manager-89acac79.js';
|
|
57
|
+
import './responsive-format-facade-6df7d17a.js';
|
|
58
|
+
import './pixel-f32c07ce.js';
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* A rule that checks if start date is before than end date
|
|
@@ -265,7 +265,7 @@ const Icons = {
|
|
|
265
265
|
},
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
var __decorate$
|
|
268
|
+
var __decorate$j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
269
269
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
270
270
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
271
271
|
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 +278,10 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
278
278
|
return (h("div", { class: "vega-input-prefix" },
|
|
279
279
|
h("vega-icon", { icon: VegaInternalIconManager.getIconKey('calendar'), color: "text-secondary",
|
|
280
280
|
// eslint-disable-next-line react/jsx-no-bind
|
|
281
|
-
onClick: () => {
|
|
281
|
+
onClick: async () => {
|
|
282
282
|
if (!this.disabled) {
|
|
283
|
-
this.focusInput();
|
|
283
|
+
await this.focusInput();
|
|
284
|
+
await this.vegaDatePickerCalendarRenderer.triggerRepick('start');
|
|
284
285
|
}
|
|
285
286
|
} })));
|
|
286
287
|
};
|
|
@@ -289,13 +290,13 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
289
290
|
* on mobile, the input is ready-only to avoid virtual keyboard
|
|
290
291
|
*/
|
|
291
292
|
this.isInputEnabled = () => {
|
|
292
|
-
return !this.readOnly && !this.
|
|
293
|
+
return !this.readOnly && !this.isMobileDevice;
|
|
293
294
|
};
|
|
294
295
|
this.renderLabel = () => {
|
|
295
296
|
return (this.label && (h("vega-field-label", { ref: (e) => {
|
|
296
297
|
/* istanbul ignore next */
|
|
297
|
-
DomNodeSubjectObserverFactory.addUniqueObserverToNode(e, VegaClick, () => {
|
|
298
|
-
this.focusInput();
|
|
298
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(e, VegaClick, async () => {
|
|
299
|
+
await this.focusInput();
|
|
299
300
|
});
|
|
300
301
|
}, isFieldRequired: this.required, disabled: this.disabled, label: this.label })));
|
|
301
302
|
};
|
|
@@ -304,11 +305,11 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
304
305
|
* @see{module:vega-date-picker-click-label-focus-input-e2e}
|
|
305
306
|
*/
|
|
306
307
|
/* istanbul ignore next */
|
|
307
|
-
this.focusInput = () => {
|
|
308
|
+
this.focusInput = async () => {
|
|
308
309
|
var _a, _b;
|
|
309
310
|
(_a = this.vegaDatePickerSingleInputRenderer.getSingleDateInputRef()) === null || _a === void 0 ? void 0 : _a.focus();
|
|
310
311
|
(_b = this.vegaDatePickerRangeInputRenderer.getStartDateInputRef()) === null || _b === void 0 ? void 0 : _b.focus();
|
|
311
|
-
this.
|
|
312
|
+
await this.calendarOpenStateController.showCalendar();
|
|
312
313
|
};
|
|
313
314
|
}
|
|
314
315
|
getDatePickerContainer() {
|
|
@@ -319,119 +320,62 @@ class VegaDatePickerRenderer extends VegaSlimmer {
|
|
|
319
320
|
'vega-input-container',
|
|
320
321
|
this.size,
|
|
321
322
|
`${this.mode}-mode`,
|
|
322
|
-
this.
|
|
323
|
-
? /* istanbul ignore next */ 'mobile'
|
|
324
|
-
: '',
|
|
323
|
+
this.isMobileDevice ? /* istanbul ignore next */ 'mobile' : '',
|
|
325
324
|
];
|
|
326
325
|
return (h(Host, { class: {
|
|
327
326
|
disabled: this.disabled,
|
|
328
327
|
} },
|
|
329
328
|
this.renderLabel(),
|
|
330
|
-
h("div", { class: arrayToClassString(classNames), ref: (ref) => (this.datePickerContainer = ref) },
|
|
331
|
-
this.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
this.showYearMonthDropdowns && this.monthYearDropdownRenderer.render())));
|
|
329
|
+
h("div", { class: arrayToClassString(classNames), ref: (ref) => (this.datePickerContainer = ref) }, this.mode === 'range'
|
|
330
|
+
? this.vegaDatePickerRangeInputRenderer.render()
|
|
331
|
+
: this.vegaDatePickerSingleInputRenderer.render()),
|
|
332
|
+
this.vegaDatePickerCalendarRenderer.render()));
|
|
335
333
|
}
|
|
336
334
|
}
|
|
337
335
|
(() => {
|
|
338
336
|
VegaInternalIconManager.register({ calendar: Icons.calendar });
|
|
339
337
|
})();
|
|
340
|
-
__decorate$
|
|
338
|
+
__decorate$j([
|
|
341
339
|
MapToComponentField()
|
|
342
340
|
], VegaDatePickerRenderer.prototype, "disabled", void 0);
|
|
343
|
-
__decorate$
|
|
341
|
+
__decorate$j([
|
|
344
342
|
MapToComponentField()
|
|
345
343
|
], VegaDatePickerRenderer.prototype, "size", void 0);
|
|
346
|
-
__decorate$
|
|
344
|
+
__decorate$j([
|
|
347
345
|
MapToComponentField()
|
|
348
346
|
], VegaDatePickerRenderer.prototype, "mode", void 0);
|
|
349
|
-
__decorate$
|
|
347
|
+
__decorate$j([
|
|
350
348
|
MapToComponentField()
|
|
351
349
|
], VegaDatePickerRenderer.prototype, "label", void 0);
|
|
352
|
-
__decorate$
|
|
350
|
+
__decorate$j([
|
|
353
351
|
MapToComponentField()
|
|
354
352
|
], VegaDatePickerRenderer.prototype, "required", void 0);
|
|
355
|
-
__decorate$
|
|
353
|
+
__decorate$j([
|
|
356
354
|
MapToComponentField()
|
|
357
355
|
], VegaDatePickerRenderer.prototype, "readOnly", void 0);
|
|
358
|
-
__decorate$
|
|
356
|
+
__decorate$j([
|
|
359
357
|
MapToComponentField()
|
|
360
358
|
], VegaDatePickerRenderer.prototype, "autoValidation", void 0);
|
|
361
|
-
__decorate$
|
|
359
|
+
__decorate$j([
|
|
362
360
|
MapToComponentField()
|
|
363
361
|
], VegaDatePickerRenderer.prototype, "host", void 0);
|
|
364
|
-
__decorate$
|
|
362
|
+
__decorate$j([
|
|
365
363
|
MapToComponentField()
|
|
366
|
-
], VegaDatePickerRenderer.prototype, "
|
|
367
|
-
__decorate$
|
|
368
|
-
MapToComponentField()
|
|
369
|
-
], VegaDatePickerRenderer.prototype, "vegaDatePickerMobileController", void 0);
|
|
370
|
-
__decorate$f([
|
|
364
|
+
], VegaDatePickerRenderer.prototype, "isMobileDevice", void 0);
|
|
365
|
+
__decorate$j([
|
|
371
366
|
MapToComponentField()
|
|
372
367
|
], VegaDatePickerRenderer.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
373
|
-
__decorate$
|
|
368
|
+
__decorate$j([
|
|
374
369
|
MapToComponentField()
|
|
375
370
|
], VegaDatePickerRenderer.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
376
|
-
__decorate$
|
|
371
|
+
__decorate$j([
|
|
377
372
|
MapToComponentField()
|
|
378
373
|
], 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([
|
|
374
|
+
__decorate$j([
|
|
431
375
|
MapToComponentField()
|
|
432
|
-
],
|
|
376
|
+
], VegaDatePickerRenderer.prototype, "calendarOpenStateController", void 0);
|
|
433
377
|
|
|
434
|
-
var __decorate$
|
|
378
|
+
var __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
435
379
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
436
380
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
437
381
|
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 +387,14 @@ var __decorate$d = (undefined && undefined.__decorate) || function (decorators,
|
|
|
443
387
|
class VegaDatePickerInputRendererBase extends VegaSlimmer {
|
|
444
388
|
constructor() {
|
|
445
389
|
super(...arguments);
|
|
446
|
-
this.onClickClearIcon = () => {
|
|
390
|
+
this.onClickClearIcon = async () => {
|
|
447
391
|
if (this.mode === 'range') {
|
|
448
392
|
this.vegaDatePickerValueController.setValue(['', '']);
|
|
449
393
|
}
|
|
450
394
|
else {
|
|
451
395
|
this.vegaDatePickerValueController.setValue('');
|
|
452
396
|
}
|
|
397
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
453
398
|
};
|
|
454
399
|
this.isClearIconVisible = () => {
|
|
455
400
|
if (this.mode === 'range') {
|
|
@@ -470,20 +415,23 @@ class VegaDatePickerInputRendererBase extends VegaSlimmer {
|
|
|
470
415
|
h("vega-icon", { icon: "close" })))));
|
|
471
416
|
}
|
|
472
417
|
}
|
|
473
|
-
__decorate$
|
|
418
|
+
__decorate$i([
|
|
474
419
|
MapToComponentField()
|
|
475
420
|
], VegaDatePickerInputRendererBase.prototype, "disabled", void 0);
|
|
476
|
-
__decorate$
|
|
421
|
+
__decorate$i([
|
|
477
422
|
MapToComponentField()
|
|
478
423
|
], VegaDatePickerInputRendererBase.prototype, "showClearIcon", void 0);
|
|
479
|
-
__decorate$
|
|
424
|
+
__decorate$i([
|
|
480
425
|
MapToComponentField()
|
|
481
426
|
], VegaDatePickerInputRendererBase.prototype, "mode", void 0);
|
|
482
|
-
__decorate$
|
|
427
|
+
__decorate$i([
|
|
483
428
|
MapToComponentField()
|
|
484
429
|
], VegaDatePickerInputRendererBase.prototype, "vegaDatePickerValueController", void 0);
|
|
430
|
+
__decorate$i([
|
|
431
|
+
MapToComponentField()
|
|
432
|
+
], VegaDatePickerInputRendererBase.prototype, "calendarOpenStateController", void 0);
|
|
485
433
|
|
|
486
|
-
var __decorate$
|
|
434
|
+
var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
487
435
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
488
436
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
489
437
|
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 +444,8 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
496
444
|
return (h("div", { class: "date-picker-input" },
|
|
497
445
|
this.vegaDatePickerRenderer.renderInputPrefix(),
|
|
498
446
|
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
|
-
} }),
|
|
447
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
448
|
+
onClick: () => this.calendarOpenStateController.showCalendar() }),
|
|
503
449
|
this.renderClearIcon()));
|
|
504
450
|
};
|
|
505
451
|
this.getSinglePlaceholder = () => {
|
|
@@ -519,7 +465,7 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
519
465
|
this.onSingleDateChange = (e) => {
|
|
520
466
|
const currentTarget = e.currentTarget;
|
|
521
467
|
const date = currentTarget.value;
|
|
522
|
-
if (
|
|
468
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
523
469
|
this.vegaDatePickerValueController.setValue(this.vegaDatePickerFormatController.formatDate(date));
|
|
524
470
|
}
|
|
525
471
|
else {
|
|
@@ -529,36 +475,27 @@ class VegaDatePickerSingleInputRenderer extends VegaDatePickerInputRendererBase
|
|
|
529
475
|
}
|
|
530
476
|
};
|
|
531
477
|
}
|
|
532
|
-
componentWillRender() {
|
|
533
|
-
this.oldSingleDateInputRef = this.singleDateInputRef;
|
|
534
|
-
}
|
|
535
478
|
getSingleDateInputRef() {
|
|
536
479
|
return this.singleDateInputRef;
|
|
537
480
|
}
|
|
538
|
-
getOldSingleDateInputRef() {
|
|
539
|
-
return this.oldSingleDateInputRef;
|
|
540
|
-
}
|
|
541
481
|
}
|
|
542
|
-
__decorate$
|
|
482
|
+
__decorate$h([
|
|
543
483
|
MapToComponentField()
|
|
544
484
|
], VegaDatePickerSingleInputRenderer.prototype, "placeholder", void 0);
|
|
545
|
-
__decorate$
|
|
485
|
+
__decorate$h([
|
|
546
486
|
MapToComponentField()
|
|
547
487
|
], VegaDatePickerSingleInputRenderer.prototype, "format", void 0);
|
|
548
|
-
__decorate$
|
|
488
|
+
__decorate$h([
|
|
549
489
|
MapToComponentField()
|
|
550
490
|
], VegaDatePickerSingleInputRenderer.prototype, "vegaDatePickerFormatController", void 0);
|
|
551
|
-
__decorate$
|
|
491
|
+
__decorate$h([
|
|
552
492
|
MapToComponentField()
|
|
553
493
|
], VegaDatePickerSingleInputRenderer.prototype, "vegaDatePickerRenderer", void 0);
|
|
554
|
-
__decorate$
|
|
494
|
+
__decorate$h([
|
|
555
495
|
MapToComponentField()
|
|
556
|
-
], VegaDatePickerSingleInputRenderer.prototype, "
|
|
557
|
-
__decorate$c([
|
|
558
|
-
MapToComponentMethod('componentWillRender')
|
|
559
|
-
], VegaDatePickerSingleInputRenderer.prototype, "componentWillRender", null);
|
|
496
|
+
], VegaDatePickerSingleInputRenderer.prototype, "calendarOpenStateController", void 0);
|
|
560
497
|
|
|
561
|
-
var __decorate$
|
|
498
|
+
var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
562
499
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
563
500
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
564
501
|
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 +508,16 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
571
508
|
return (h(Fragment, null,
|
|
572
509
|
h("div", { class: "date-picker-input" },
|
|
573
510
|
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
|
|
511
|
+
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,
|
|
512
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
513
|
+
onClick: async () => await this.onInputClicked('start') })),
|
|
575
514
|
h("span", { class: {
|
|
576
515
|
'range-input-divider': true,
|
|
577
516
|
} }),
|
|
578
517
|
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
|
|
518
|
+
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,
|
|
519
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
520
|
+
onClick: async () => await this.onInputClicked('end') }),
|
|
580
521
|
this.renderClearIcon())));
|
|
581
522
|
};
|
|
582
523
|
this.getRangePlaceholder = () => {
|
|
@@ -596,7 +537,7 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
596
537
|
this.onStartDateChange = (e) => {
|
|
597
538
|
const currentTarget = e.currentTarget;
|
|
598
539
|
const date = currentTarget.value;
|
|
599
|
-
if (
|
|
540
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
600
541
|
this.vegaDatePickerValueController.setValue([
|
|
601
542
|
this.vegaDatePickerFormatController.formatDate(date),
|
|
602
543
|
this.vegaDatePickerValueController.getValue()[1],
|
|
@@ -618,7 +559,7 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
618
559
|
this.onEndDateChange = (e) => {
|
|
619
560
|
const currentTarget = e.currentTarget;
|
|
620
561
|
const date = currentTarget.value;
|
|
621
|
-
if (
|
|
562
|
+
if (CalendarDate.fromString(date, this.format)) {
|
|
622
563
|
this.vegaDatePickerValueController.setValue([
|
|
623
564
|
this.vegaDatePickerValueController.getValue()[0],
|
|
624
565
|
this.vegaDatePickerFormatController.formatDate(date),
|
|
@@ -634,883 +575,206 @@ class VegaDatePickerRangeInputRenderer extends VegaDatePickerInputRendererBase {
|
|
|
634
575
|
}
|
|
635
576
|
};
|
|
636
577
|
}
|
|
637
|
-
componentWillRender() {
|
|
638
|
-
this.oldStartDateInputRef = this.startDateInputRef;
|
|
639
|
-
this.oldEndDateInputRef = this.endDateInputRef;
|
|
640
|
-
}
|
|
641
578
|
getStartDateInputRef() {
|
|
642
579
|
return this.startDateInputRef;
|
|
643
580
|
}
|
|
644
581
|
getEndDateInputRef() {
|
|
645
582
|
return this.endDateInputRef;
|
|
646
583
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
getOldEndDateInputRef() {
|
|
651
|
-
return this.oldEndDateInputRef;
|
|
584
|
+
async onInputClicked(type) {
|
|
585
|
+
await this.calendarOpenStateController.showCalendar();
|
|
586
|
+
await this.vegaDatePickerCalendarRenderer.triggerRepick(type);
|
|
652
587
|
}
|
|
653
588
|
}
|
|
654
|
-
__decorate$
|
|
589
|
+
__decorate$g([
|
|
655
590
|
MapToComponentField()
|
|
656
591
|
], VegaDatePickerRangeInputRenderer.prototype, "placeholder", void 0);
|
|
657
|
-
__decorate$
|
|
592
|
+
__decorate$g([
|
|
658
593
|
MapToComponentField()
|
|
659
594
|
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerFormatController", void 0);
|
|
660
|
-
__decorate$
|
|
595
|
+
__decorate$g([
|
|
661
596
|
MapToComponentField()
|
|
662
597
|
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerRenderer", void 0);
|
|
663
|
-
__decorate$
|
|
598
|
+
__decorate$g([
|
|
599
|
+
MapToComponentField()
|
|
600
|
+
], VegaDatePickerRangeInputRenderer.prototype, "calendarOpenStateController", void 0);
|
|
601
|
+
__decorate$g([
|
|
664
602
|
MapToComponentField()
|
|
665
603
|
], VegaDatePickerRangeInputRenderer.prototype, "translationSlimmer", void 0);
|
|
666
|
-
__decorate$
|
|
667
|
-
|
|
668
|
-
], VegaDatePickerRangeInputRenderer.prototype, "
|
|
604
|
+
__decorate$g([
|
|
605
|
+
MapToComponentField()
|
|
606
|
+
], VegaDatePickerRangeInputRenderer.prototype, "allowRepick", void 0);
|
|
607
|
+
__decorate$g([
|
|
608
|
+
MapToComponentField()
|
|
609
|
+
], VegaDatePickerRangeInputRenderer.prototype, "format", void 0);
|
|
610
|
+
__decorate$g([
|
|
611
|
+
MapToComponentField()
|
|
612
|
+
], VegaDatePickerRangeInputRenderer.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
669
613
|
|
|
670
|
-
var __decorate$
|
|
614
|
+
var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
671
615
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
672
616
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
673
617
|
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
618
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
675
619
|
};
|
|
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
|
-
};
|
|
620
|
+
class VegaDatePickerCalendarRenderer$1 extends VegaSlimmer {
|
|
621
|
+
componentDidLoad() {
|
|
622
|
+
this.appendCalendarToBodyIfMobile();
|
|
791
623
|
}
|
|
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();
|
|
624
|
+
getCalendarContentBoxRef() {
|
|
625
|
+
return this.calendarContentBoxRef;
|
|
808
626
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
this.
|
|
822
|
-
|
|
627
|
+
getCalendarRef() {
|
|
628
|
+
return this.calendarRef;
|
|
629
|
+
}
|
|
630
|
+
getMobileModalRef() {
|
|
631
|
+
return this.mobileModalRef;
|
|
632
|
+
}
|
|
633
|
+
async triggerRepick(type) {
|
|
634
|
+
if (this.allowRepick && this.mode === 'range') {
|
|
635
|
+
await this.calendarRef.triggerRepick(type);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
render() {
|
|
639
|
+
return this.isMobileDevice ? this.mobileRender() : this.renderCalendar();
|
|
640
|
+
}
|
|
641
|
+
mobileRender() {
|
|
642
|
+
return (h("vega-modal", { showCloseButton: false, size: VegaDatePickerCalendarRenderer$1.calendarModalSize, padding: "0", isVerticallyCentered: true, backdropColor: "semi", ref: (ref) => {
|
|
643
|
+
this.mobileModalRef = ref;
|
|
644
|
+
this.addModalObserver(ref);
|
|
645
|
+
} }, h("div", { slot: "modal-content" }, this.renderCalendar())));
|
|
646
|
+
}
|
|
647
|
+
renderCalendar() {
|
|
648
|
+
return (h("vega-box", { padding: {
|
|
649
|
+
default: 'size-12',
|
|
650
|
+
S: 'size-32',
|
|
651
|
+
}, corners: "rounded-12", backgroundColor: "bg-primary", shadow: "shadow-dropdown-menu", border: "border-input-field", ref: (ref) => {
|
|
652
|
+
this.calendarContentBoxRef = ref;
|
|
653
|
+
}, class: "date-picker-content-box" },
|
|
654
|
+
h("vega-box", { width: this.getDefaultCalendarDimension('width'), height: this.getDefaultCalendarDimension('height') },
|
|
655
|
+
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: {
|
|
656
|
+
isScreenPosition: FeatureFlag.isEnabled('VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN'),
|
|
657
|
+
}, ref: (ref) => {
|
|
658
|
+
this.calendarRef = ref;
|
|
659
|
+
this.addCalendarObserver(ref);
|
|
660
|
+
},
|
|
661
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
662
|
+
isDateDisabled: (date) => this.isDateDisabled(date) }))));
|
|
663
|
+
}
|
|
664
|
+
addCalendarObserver(calendarRef) {
|
|
665
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaSelectionChange, async (payload) => {
|
|
666
|
+
await this.onCalendarSelected(payload.detail);
|
|
667
|
+
});
|
|
668
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaClear, async () => {
|
|
669
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
670
|
+
});
|
|
671
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(calendarRef, VegaMonthYearChange, async (payload) => {
|
|
672
|
+
this.monthYearChangeEventEmitter.emit(payload.detail);
|
|
823
673
|
});
|
|
824
|
-
this.goToDate();
|
|
825
674
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
675
|
+
addModalObserver(modalRef) {
|
|
676
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(modalRef, VegaOpen, () => {
|
|
677
|
+
this.calendarOpenStateController.updateIsCalendarShowState(true);
|
|
678
|
+
});
|
|
679
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(modalRef, VegaClose, () => {
|
|
680
|
+
this.calendarOpenStateController.updateIsCalendarShowState(false);
|
|
681
|
+
});
|
|
831
682
|
}
|
|
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);
|
|
683
|
+
async onCalendarSelected(value) {
|
|
684
|
+
if (this.mode === 'single') {
|
|
685
|
+
this.vegaDatePickerValueController.setValue(value);
|
|
848
686
|
}
|
|
849
|
-
else if (this.
|
|
850
|
-
|
|
851
|
-
(this.maxDate && compareIsAfter(today, new Date(this.maxDate))))) {
|
|
852
|
-
datePickerCalendar.gotoDate(this.minDate, 0);
|
|
687
|
+
else if (this.mode === 'range') {
|
|
688
|
+
this.vegaDatePickerValueController.setValue(value);
|
|
853
689
|
}
|
|
854
|
-
|
|
855
|
-
|
|
690
|
+
if (this.isCalendarShow) {
|
|
691
|
+
await this.calendarOpenStateController.hideCalendar();
|
|
856
692
|
}
|
|
857
|
-
|
|
858
|
-
|
|
693
|
+
}
|
|
694
|
+
appendCalendarToBodyIfMobile() {
|
|
695
|
+
const document = tryGetDocument();
|
|
696
|
+
if (this.isMobileDevice && document) {
|
|
697
|
+
document.body.append(this.mobileModalRef);
|
|
859
698
|
}
|
|
860
699
|
}
|
|
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
|
-
}
|
|
700
|
+
getDefaultCalendarDimension(type) {
|
|
701
|
+
const dimensions = this.mode === 'range' && !this.isMobileDevice
|
|
702
|
+
? VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForRange
|
|
703
|
+
: VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForSingle;
|
|
704
|
+
// Height can be dynamic
|
|
705
|
+
if (type === 'height' && this.dropdownConfig.staticHeight === false) {
|
|
706
|
+
return 'auto';
|
|
886
707
|
}
|
|
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
|
-
}
|
|
708
|
+
let value = dimensions[type];
|
|
709
|
+
// Extra space for footer when height is static
|
|
710
|
+
if (type === 'height' && this.clearButton) {
|
|
711
|
+
value += 40; // 24px footer + 16px margin
|
|
899
712
|
}
|
|
713
|
+
return `${value}px`;
|
|
900
714
|
}
|
|
901
715
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
716
|
+
VegaDatePickerCalendarRenderer$1.calendarModalSize = 344;
|
|
717
|
+
VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForSingle = {
|
|
718
|
+
width: 280,
|
|
719
|
+
height: 316,
|
|
720
|
+
};
|
|
721
|
+
VegaDatePickerCalendarRenderer$1.regularDatePickerCalendarDimensionsForRange = {
|
|
722
|
+
width: 608,
|
|
723
|
+
height: 324,
|
|
724
|
+
};
|
|
725
|
+
__decorate$f([
|
|
911
726
|
MapToComponentField()
|
|
912
|
-
],
|
|
913
|
-
__decorate$
|
|
727
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "format", void 0);
|
|
728
|
+
__decorate$f([
|
|
914
729
|
MapToComponentField()
|
|
915
|
-
],
|
|
916
|
-
__decorate$
|
|
730
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "value", void 0);
|
|
731
|
+
__decorate$f([
|
|
917
732
|
MapToComponentField()
|
|
918
|
-
],
|
|
919
|
-
__decorate$
|
|
733
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "mode", void 0);
|
|
734
|
+
__decorate$f([
|
|
920
735
|
MapToComponentField()
|
|
921
|
-
],
|
|
922
|
-
__decorate$
|
|
736
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "minDate", void 0);
|
|
737
|
+
__decorate$f([
|
|
923
738
|
MapToComponentField()
|
|
924
|
-
],
|
|
925
|
-
__decorate$
|
|
739
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "maxDate", void 0);
|
|
740
|
+
__decorate$f([
|
|
926
741
|
MapToComponentField()
|
|
927
|
-
],
|
|
928
|
-
__decorate$
|
|
742
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "clearButton", void 0);
|
|
743
|
+
__decorate$f([
|
|
929
744
|
MapToComponentField()
|
|
930
|
-
],
|
|
931
|
-
__decorate$
|
|
745
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "dropdownConfig", void 0);
|
|
746
|
+
__decorate$f([
|
|
932
747
|
MapToComponentField()
|
|
933
|
-
],
|
|
934
|
-
__decorate$
|
|
748
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "showYearMonthDropdowns", void 0);
|
|
749
|
+
__decorate$f([
|
|
935
750
|
MapToComponentField()
|
|
936
|
-
],
|
|
937
|
-
__decorate$
|
|
751
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "timezone", void 0);
|
|
752
|
+
__decorate$f([
|
|
938
753
|
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
|
-
});
|
|
754
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isMobileDevice", void 0);
|
|
755
|
+
__decorate$f([
|
|
756
|
+
MapToComponentField()
|
|
757
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isCalendarShow", void 0);
|
|
758
|
+
__decorate$f([
|
|
759
|
+
MapToComponentField()
|
|
760
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "isDateDisabled", void 0);
|
|
761
|
+
__decorate$f([
|
|
762
|
+
MapToComponentField()
|
|
763
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "allowRepick", void 0);
|
|
764
|
+
__decorate$f([
|
|
765
|
+
MapToComponentField()
|
|
766
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "monthYearChangeEventEmitter", void 0);
|
|
767
|
+
__decorate$f([
|
|
768
|
+
MapToComponentField()
|
|
769
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "vegaDatePickerValueController", void 0);
|
|
770
|
+
__decorate$f([
|
|
771
|
+
MapToComponentField()
|
|
772
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "calendarOpenStateController", void 0);
|
|
773
|
+
__decorate$f([
|
|
774
|
+
MapToComponentMethod('componentDidLoad')
|
|
775
|
+
], VegaDatePickerCalendarRenderer$1.prototype, "componentDidLoad", null);
|
|
964
776
|
|
|
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) {
|
|
777
|
+
var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1514
778
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1515
779
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1516
780
|
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 +782,6 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1518
782
|
};
|
|
1519
783
|
/** The date picker value controller slimmer */
|
|
1520
784
|
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
785
|
/*
|
|
1540
786
|
* call this method to open the date picker dropdown
|
|
1541
787
|
* The below method is e2e-test covered in
|
|
@@ -1571,10 +817,7 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1571
817
|
isArrayEqual(newValue, oldValue)) {
|
|
1572
818
|
return; // avoid the value changed again by `onDatePickerSelected` in range mode
|
|
1573
819
|
}
|
|
1574
|
-
if (this.valueGuard(newValue)) {
|
|
1575
|
-
this.vegaDatePickerCalendarController.shouldUpdateCalendar(newValue);
|
|
1576
|
-
}
|
|
1577
|
-
else {
|
|
820
|
+
if (!this.valueGuard(newValue)) {
|
|
1578
821
|
this.setDefaultValueByMode();
|
|
1579
822
|
}
|
|
1580
823
|
this.changeEventEmitter.emit(this.value);
|
|
@@ -1636,13 +879,15 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1636
879
|
let isValid;
|
|
1637
880
|
switch (this.mode) {
|
|
1638
881
|
case 'single':
|
|
1639
|
-
isValid =
|
|
882
|
+
isValid =
|
|
883
|
+
(value && typeof value === 'string' && !!CalendarDate.fromString(value, this.format)) ||
|
|
884
|
+
value === '';
|
|
1640
885
|
break;
|
|
1641
886
|
case 'range':
|
|
1642
887
|
isValid =
|
|
1643
888
|
Array.isArray(value) &&
|
|
1644
889
|
value.length === 2 &&
|
|
1645
|
-
value.every((item) =>
|
|
890
|
+
value.every((item) => !!CalendarDate.fromString(item, this.format) || item === '');
|
|
1646
891
|
break;
|
|
1647
892
|
}
|
|
1648
893
|
if (!isValid) {
|
|
@@ -1651,38 +896,41 @@ class VegaDatePickerValueController extends VegaSlimmer {
|
|
|
1651
896
|
return isValid;
|
|
1652
897
|
}
|
|
1653
898
|
}
|
|
1654
|
-
__decorate$
|
|
899
|
+
__decorate$e([
|
|
1655
900
|
MapToComponentField({ writable: true })
|
|
1656
901
|
], VegaDatePickerValueController.prototype, "value", void 0);
|
|
1657
|
-
__decorate$
|
|
902
|
+
__decorate$e([
|
|
1658
903
|
MapToComponentField()
|
|
1659
904
|
], VegaDatePickerValueController.prototype, "mode", void 0);
|
|
1660
|
-
__decorate$
|
|
905
|
+
__decorate$e([
|
|
1661
906
|
MapToComponentField()
|
|
1662
907
|
], VegaDatePickerValueController.prototype, "format", void 0);
|
|
1663
|
-
__decorate$
|
|
908
|
+
__decorate$e([
|
|
1664
909
|
MapToComponentField()
|
|
1665
910
|
], VegaDatePickerValueController.prototype, "changeEventEmitter", void 0);
|
|
1666
|
-
__decorate$
|
|
911
|
+
__decorate$e([
|
|
1667
912
|
MapToComponentField()
|
|
1668
913
|
], VegaDatePickerValueController.prototype, "host", void 0);
|
|
1669
|
-
__decorate$
|
|
914
|
+
__decorate$e([
|
|
1670
915
|
MapToComponentField()
|
|
1671
|
-
], VegaDatePickerValueController.prototype, "
|
|
1672
|
-
__decorate$
|
|
916
|
+
], VegaDatePickerValueController.prototype, "isCalendarShow", void 0);
|
|
917
|
+
__decorate$e([
|
|
1673
918
|
MapToComponentField()
|
|
1674
919
|
], VegaDatePickerValueController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1675
|
-
__decorate$
|
|
920
|
+
__decorate$e([
|
|
921
|
+
MapToComponentField()
|
|
922
|
+
], VegaDatePickerValueController.prototype, "calendarOpenStateController", void 0);
|
|
923
|
+
__decorate$e([
|
|
1676
924
|
MapToComponentMethod('componentWillLoad')
|
|
1677
925
|
], VegaDatePickerValueController.prototype, "componentWillLoad", null);
|
|
1678
|
-
__decorate$
|
|
926
|
+
__decorate$e([
|
|
1679
927
|
MapToComponentMethod('watchValue')
|
|
1680
928
|
], VegaDatePickerValueController.prototype, "watchValue", null);
|
|
1681
|
-
__decorate$
|
|
929
|
+
__decorate$e([
|
|
1682
930
|
MapToComponentMethod('watchMode')
|
|
1683
931
|
], VegaDatePickerValueController.prototype, "watchMode", null);
|
|
1684
932
|
|
|
1685
|
-
var __decorate$
|
|
933
|
+
var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1686
934
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1687
935
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1688
936
|
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 +954,8 @@ class VegaDatePickerFormatController extends StringInputFormatterSlimmer {
|
|
|
1706
954
|
* @returns {string} The formatted date is being returned.
|
|
1707
955
|
*/
|
|
1708
956
|
this.formatDate = (date) => {
|
|
1709
|
-
|
|
957
|
+
const formattedDate = CalendarDate.fromString(date, this.format);
|
|
958
|
+
return formattedDate.toString(this.format);
|
|
1710
959
|
};
|
|
1711
960
|
/**
|
|
1712
961
|
* This function returns a reference to an HTML input element based on the input type specified.
|
|
@@ -1794,62 +1043,29 @@ class VegaDatePickerFormatController extends StringInputFormatterSlimmer {
|
|
|
1794
1043
|
this.setup();
|
|
1795
1044
|
}
|
|
1796
1045
|
}
|
|
1797
|
-
__decorate$
|
|
1046
|
+
__decorate$d([
|
|
1798
1047
|
MapToComponentField()
|
|
1799
1048
|
], VegaDatePickerFormatController.prototype, "format", void 0);
|
|
1800
|
-
__decorate$
|
|
1049
|
+
__decorate$d([
|
|
1801
1050
|
MapToComponentField()
|
|
1802
1051
|
], VegaDatePickerFormatController.prototype, "mode", void 0);
|
|
1803
|
-
__decorate$
|
|
1052
|
+
__decorate$d([
|
|
1804
1053
|
MapToComponentField()
|
|
1805
1054
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1806
|
-
__decorate$
|
|
1055
|
+
__decorate$d([
|
|
1807
1056
|
MapToComponentField()
|
|
1808
1057
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
1809
|
-
__decorate$
|
|
1058
|
+
__decorate$d([
|
|
1810
1059
|
MapToComponentField()
|
|
1811
1060
|
], VegaDatePickerFormatController.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
1812
|
-
__decorate$
|
|
1061
|
+
__decorate$d([
|
|
1813
1062
|
MapToComponentMethod('componentDidLoad')
|
|
1814
1063
|
], VegaDatePickerFormatController.prototype, "componentDidLoad", null);
|
|
1815
|
-
__decorate$
|
|
1064
|
+
__decorate$d([
|
|
1816
1065
|
MapToComponentMethod('watchFormat')
|
|
1817
1066
|
], VegaDatePickerFormatController.prototype, "watchFormat", null);
|
|
1818
1067
|
|
|
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) {
|
|
1068
|
+
var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1853
1069
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1854
1070
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1855
1071
|
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 +1088,7 @@ class VegaDatePickerKeyboardController extends KeyboardManagerSlimmer {
|
|
|
1872
1088
|
target.vegaDatePickerSingleInputRenderer.getSingleDateInputRef(),
|
|
1873
1089
|
target.vegaDatePickerRangeInputRenderer.getStartDateInputRef(),
|
|
1874
1090
|
target.vegaDatePickerRangeInputRenderer.getEndDateInputRef(),
|
|
1875
|
-
target.vegaDatePickerCalendarRenderer.
|
|
1091
|
+
target.vegaDatePickerCalendarRenderer.getCalendarContentBoxRef(),
|
|
1876
1092
|
],
|
|
1877
1093
|
eventName: 'keydown',
|
|
1878
1094
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
@@ -1886,13 +1102,13 @@ class VegaDatePickerKeyboardController extends KeyboardManagerSlimmer {
|
|
|
1886
1102
|
]);
|
|
1887
1103
|
}
|
|
1888
1104
|
}
|
|
1889
|
-
__decorate$
|
|
1105
|
+
__decorate$c([
|
|
1890
1106
|
MapToComponentField()
|
|
1891
1107
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1892
|
-
__decorate$
|
|
1108
|
+
__decorate$c([
|
|
1893
1109
|
MapToComponentField()
|
|
1894
1110
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
1895
|
-
__decorate$
|
|
1111
|
+
__decorate$c([
|
|
1896
1112
|
MapToComponentField()
|
|
1897
1113
|
], VegaDatePickerKeyboardController.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
1898
1114
|
|
|
@@ -1947,475 +1163,155 @@ const VegaDatePickerRuntimeMetricsPayloadDefinition = [
|
|
|
1947
1163
|
},
|
|
1948
1164
|
];
|
|
1949
1165
|
|
|
1950
|
-
var __decorate$
|
|
1166
|
+
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1951
1167
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1952
1168
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1953
1169
|
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
1170
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1955
1171
|
};
|
|
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
|
-
}
|
|
1172
|
+
/** The date picker element appender controller slimmer */
|
|
1173
|
+
class VegaDatePickerCalendarOpenStateController extends ElementAppenderSlimmer {
|
|
2004
1174
|
/**
|
|
2005
|
-
*
|
|
2006
|
-
*
|
|
2007
|
-
* @param {Litepicker} datePicker - Litepicker instance
|
|
1175
|
+
* Sets up the configuration the element appender of date picker.
|
|
2008
1176
|
*/
|
|
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;
|
|
1177
|
+
constructor() {
|
|
1178
|
+
super(() => ({
|
|
1179
|
+
target: this.vegaDatePickerRenderer.getDatePickerContainer(),
|
|
1180
|
+
appendableElement: this.vegaDatePickerCalendarRenderer.getCalendarContentBoxRef(),
|
|
1181
|
+
positionRelativeTo: this.dropdownConfig.positionRelativeTo,
|
|
1182
|
+
translocation: { X: 0, Y: 8 },
|
|
1183
|
+
placement: ['bottom', 'top'],
|
|
1184
|
+
alignment: ['start', 'end'],
|
|
1185
|
+
isScreenPosition: FeatureFlag.isEnabled('VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN'),
|
|
1186
|
+
}), () => 'custom', 'isCalendarShow');
|
|
1187
|
+
this.clearCalendarStateTaskQueue = new SynchronizeTaskQueue();
|
|
2083
1188
|
}
|
|
2084
1189
|
/**
|
|
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
|
|
1190
|
+
* Since connectedCallback will init element appender again, and it will add `vega-force-hidden` class to calendar,
|
|
1191
|
+
* so we should skip this in mobile side.
|
|
2089
1192
|
*/
|
|
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
|
-
}
|
|
1193
|
+
connectedCallback() {
|
|
1194
|
+
if (!this.isMobileDevice) {
|
|
1195
|
+
super.connectedCallback();
|
|
2132
1196
|
}
|
|
2133
1197
|
}
|
|
2134
1198
|
/**
|
|
2135
|
-
*
|
|
2136
|
-
*
|
|
2137
|
-
* @param {HTMLVegaDropdownElement} dropdown - Month or year dropdown
|
|
1199
|
+
* Since it not init the element appender in mobile side, we also not need destroy element appender in disconnectedCallback.
|
|
2138
1200
|
*/
|
|
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
|
-
}
|
|
1201
|
+
disconnectedCallback() {
|
|
1202
|
+
if (!this.isMobileDevice) {
|
|
1203
|
+
super.disconnectedCallback();
|
|
2194
1204
|
}
|
|
2195
1205
|
}
|
|
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
1206
|
/**
|
|
2230
|
-
*
|
|
1207
|
+
* Since componentDidLoad will init element appender, and it will add `vega-force-hidden` class to calendar,
|
|
1208
|
+
* so we should skip this in mobile side.
|
|
2231
1209
|
*/
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
.filter(Boolean)
|
|
2237
|
-
.map((dropdown) => {
|
|
2238
|
-
if (dropdown) {
|
|
2239
|
-
void dropdown.hide();
|
|
2240
|
-
}
|
|
2241
|
-
}));
|
|
1210
|
+
componentDidLoad() {
|
|
1211
|
+
if (!this.isMobileDevice) {
|
|
1212
|
+
super.componentDidLoad();
|
|
1213
|
+
}
|
|
2242
1214
|
}
|
|
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
1215
|
/**
|
|
2293
|
-
*
|
|
1216
|
+
* We need to clear the calendar state when the property or state of the vega-date-picker is completed,
|
|
1217
|
+
* such as when the user inputs a range value. we can refill the selecting state in calendar according the new value.
|
|
2294
1218
|
*/
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
ChangeManager.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalMonthYearChange), this.observer);
|
|
1219
|
+
async componentDidRender() {
|
|
1220
|
+
await this.clearCalendarStateTaskQueue.runTask();
|
|
2298
1221
|
}
|
|
2299
|
-
/**
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
1222
|
+
/** doOpen */
|
|
1223
|
+
async doOpen() {
|
|
1224
|
+
await this.showCalendar();
|
|
1225
|
+
}
|
|
1226
|
+
/** doClose */
|
|
1227
|
+
async doClose() {
|
|
1228
|
+
await this.hideCalendar();
|
|
1229
|
+
}
|
|
1230
|
+
/** watchDisabled */
|
|
1231
|
+
async watchDisabled() {
|
|
1232
|
+
await this.hideCalendar();
|
|
1233
|
+
}
|
|
1234
|
+
/** watch calendar show state */
|
|
1235
|
+
async watchIsCalendarShow() {
|
|
1236
|
+
await this.clearCalendarSelectingState();
|
|
2306
1237
|
}
|
|
2307
1238
|
/**
|
|
2308
|
-
*
|
|
2309
|
-
*
|
|
2310
|
-
* @returns {DatePickerMonthYearTypes} the month and year summary
|
|
1239
|
+
* Watch isCalendarShow state change to clear selecting state in calendar.
|
|
2311
1240
|
*/
|
|
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
|
-
};
|
|
1241
|
+
async showCalendar() {
|
|
1242
|
+
if (this.isMobileDevice) {
|
|
1243
|
+
await this.vegaDatePickerCalendarRenderer.getMobileModalRef().modal('show');
|
|
2320
1244
|
}
|
|
2321
1245
|
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
|
-
];
|
|
1246
|
+
this.show();
|
|
2336
1247
|
}
|
|
2337
1248
|
}
|
|
2338
1249
|
/**
|
|
2339
|
-
*
|
|
2340
|
-
*
|
|
2341
|
-
* @returns {DatePickerMonthYearTypes} the month and year summary
|
|
1250
|
+
* Hide calendar in both mobile and desktop mode.
|
|
2342
1251
|
*/
|
|
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
|
-
};
|
|
1252
|
+
async hideCalendar() {
|
|
1253
|
+
if (this.isMobileDevice) {
|
|
1254
|
+
await this.vegaDatePickerCalendarRenderer.getMobileModalRef().modal('hide');
|
|
2353
1255
|
}
|
|
2354
1256
|
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
|
-
];
|
|
1257
|
+
this.hide();
|
|
2375
1258
|
}
|
|
2376
1259
|
}
|
|
2377
1260
|
/**
|
|
2378
|
-
*
|
|
1261
|
+
* Update isCalendarShow state.
|
|
2379
1262
|
*
|
|
2380
|
-
* @
|
|
1263
|
+
* @param {boolean} isShow - is calendar show
|
|
2381
1264
|
*/
|
|
2382
|
-
|
|
2383
|
-
|
|
1265
|
+
updateIsCalendarShowState(isShow) {
|
|
1266
|
+
this.isCalendarShow = isShow;
|
|
2384
1267
|
}
|
|
2385
1268
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
1269
|
+
* Clear selecting state in calendar.
|
|
1270
|
+
*/
|
|
1271
|
+
async clearCalendarSelectingState() {
|
|
1272
|
+
if (!this.isCalendarShow) {
|
|
1273
|
+
const calendar = this.vegaDatePickerCalendarRenderer.getCalendarRef();
|
|
1274
|
+
await this.clearCalendarStateTaskQueue.enqueue({
|
|
1275
|
+
/** Clear the calendar selecting state */
|
|
1276
|
+
run: async () => await calendar.reset(),
|
|
1277
|
+
}, false);
|
|
1278
|
+
}
|
|
2392
1279
|
}
|
|
2393
1280
|
}
|
|
2394
|
-
__decorate$
|
|
2395
|
-
MapToComponentField()
|
|
2396
|
-
], VegaDatePickerMonthYearChangeEventController.prototype, "host", void 0);
|
|
2397
|
-
__decorate$2([
|
|
1281
|
+
__decorate$b([
|
|
2398
1282
|
MapToComponentField()
|
|
2399
|
-
],
|
|
2400
|
-
__decorate$
|
|
1283
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "dropdownConfig", void 0);
|
|
1284
|
+
__decorate$b([
|
|
2401
1285
|
MapToComponentField()
|
|
2402
|
-
],
|
|
2403
|
-
__decorate$
|
|
1286
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "vegaDatePickerRenderer", void 0);
|
|
1287
|
+
__decorate$b([
|
|
2404
1288
|
MapToComponentField()
|
|
2405
|
-
],
|
|
2406
|
-
__decorate$
|
|
1289
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
1290
|
+
__decorate$b([
|
|
1291
|
+
MapToComponentField({ writable: true })
|
|
1292
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "isCalendarShow", void 0);
|
|
1293
|
+
__decorate$b([
|
|
2407
1294
|
MapToComponentField()
|
|
2408
|
-
],
|
|
2409
|
-
__decorate$
|
|
2410
|
-
MapToComponentMethod('
|
|
2411
|
-
],
|
|
2412
|
-
__decorate$
|
|
2413
|
-
MapToComponentMethod('
|
|
2414
|
-
],
|
|
1295
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "isMobileDevice", void 0);
|
|
1296
|
+
__decorate$b([
|
|
1297
|
+
MapToComponentMethod('componentDidRender')
|
|
1298
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "componentDidRender", null);
|
|
1299
|
+
__decorate$b([
|
|
1300
|
+
MapToComponentMethod('doOpen')
|
|
1301
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "doOpen", null);
|
|
1302
|
+
__decorate$b([
|
|
1303
|
+
MapToComponentMethod('doClose')
|
|
1304
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "doClose", null);
|
|
1305
|
+
__decorate$b([
|
|
1306
|
+
MapToComponentMethod('watchDisabled')
|
|
1307
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "watchDisabled", null);
|
|
1308
|
+
__decorate$b([
|
|
1309
|
+
MapToComponentMethod('watchIsCalendarShow')
|
|
1310
|
+
], VegaDatePickerCalendarOpenStateController.prototype, "watchIsCalendarShow", null);
|
|
2415
1311
|
|
|
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))}
|
|
1312
|
+
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
1313
|
|
|
2418
|
-
var __decorate$
|
|
1314
|
+
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2419
1315
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2420
1316
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2421
1317
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2434,19 +1330,16 @@ const VegaDatePicker = class {
|
|
|
2434
1330
|
this.monthYearChange = createEvent(this, "monthYearChange", 7);
|
|
2435
1331
|
this.globalSlimmers = {};
|
|
2436
1332
|
this.translationSlimmer = new TranslationSlimmer();
|
|
2437
|
-
this.
|
|
2438
|
-
this.vegaDatePickerCalendarController = new VegaDatePickerCalendarController();
|
|
2439
|
-
this.vegaDatePickerZIndexController = new VegaDatePickerZIndexController();
|
|
1333
|
+
this.calendarOpenStateController = new VegaDatePickerCalendarOpenStateController();
|
|
2440
1334
|
this.vegaDatePickerValueController = new VegaDatePickerValueController();
|
|
2441
1335
|
this.vegaDatePickerFormatController = new VegaDatePickerFormatController('single');
|
|
2442
1336
|
this.startInputFormatController = new VegaDatePickerFormatController('rangeStart');
|
|
2443
1337
|
this.endInputFormatController = new VegaDatePickerFormatController('rangeEnd');
|
|
2444
|
-
this.vegaDatePickerElementAppenderController = new VegaDatePickerElementAppenderController();
|
|
2445
1338
|
this.vegaDatePickerKeyboardController = new VegaDatePickerKeyboardController();
|
|
2446
1339
|
this.vegaDatePickerRenderer = new VegaDatePickerRenderer();
|
|
2447
1340
|
this.vegaDatePickerSingleInputRenderer = new VegaDatePickerSingleInputRenderer();
|
|
2448
1341
|
this.vegaDatePickerRangeInputRenderer = new VegaDatePickerRangeInputRenderer();
|
|
2449
|
-
this.vegaDatePickerCalendarRenderer = new VegaDatePickerCalendarRenderer();
|
|
1342
|
+
this.vegaDatePickerCalendarRenderer = new VegaDatePickerCalendarRenderer$1();
|
|
2450
1343
|
this.formFieldController = new FormFieldControllerSlimmer({
|
|
2451
1344
|
propertyRules: [
|
|
2452
1345
|
{
|
|
@@ -2481,12 +1374,12 @@ const VegaDatePicker = class {
|
|
|
2481
1374
|
].filter(Boolean);
|
|
2482
1375
|
},
|
|
2483
1376
|
});
|
|
2484
|
-
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaMonthYearChange);
|
|
2485
1377
|
this.changeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaChange);
|
|
2486
|
-
this.
|
|
1378
|
+
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePicker, VegaMonthYearChange);
|
|
1379
|
+
this.inputEventPrevent = new ChildNodesEventPreventSlimmer([VegaChange, VegaClear, VegaMonthYearChange], () => this.vegaDatePickerCalendarRenderer.getCalendarRef());
|
|
2487
1380
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaDatePickerRuntimeMetricsPayloadDefinition);
|
|
2488
|
-
this.
|
|
2489
|
-
this.
|
|
1381
|
+
this.isMobileDevice = getDeviceType() === DeviceType.MOBILE;
|
|
1382
|
+
this.isCalendarShow = false;
|
|
2490
1383
|
/**
|
|
2491
1384
|
* Specifies the selection mode of the date picker.
|
|
2492
1385
|
*
|
|
@@ -2607,6 +1500,8 @@ const VegaDatePicker = class {
|
|
|
2607
1500
|
*/
|
|
2608
1501
|
this.isDateDisabled = () => false;
|
|
2609
1502
|
}
|
|
1503
|
+
watchIsCalendarShow() {
|
|
1504
|
+
}
|
|
2610
1505
|
/*
|
|
2611
1506
|
* The below method is e2e-test covered in
|
|
2612
1507
|
* @see{module:vega-date-picker-mode-change}
|
|
@@ -2649,8 +1544,6 @@ const VegaDatePicker = class {
|
|
|
2649
1544
|
}
|
|
2650
1545
|
watchDisabled() {
|
|
2651
1546
|
}
|
|
2652
|
-
watchIsDateDisabled() {
|
|
2653
|
-
}
|
|
2654
1547
|
/**
|
|
2655
1548
|
* Invoke this method to close the calendar dropdown
|
|
2656
1549
|
* associated with the date picker.
|
|
@@ -2676,6 +1569,7 @@ const VegaDatePicker = class {
|
|
|
2676
1569
|
}
|
|
2677
1570
|
get host() { return getElement(this); }
|
|
2678
1571
|
static get watchers() { return {
|
|
1572
|
+
"isCalendarShow": ["watchIsCalendarShow"],
|
|
2679
1573
|
"mode": ["watchMode"],
|
|
2680
1574
|
"value": ["watchValue"],
|
|
2681
1575
|
"format": ["watchFormat"],
|
|
@@ -2684,110 +1578,1405 @@ const VegaDatePicker = class {
|
|
|
2684
1578
|
"maxDate": ["watchMaxDate"],
|
|
2685
1579
|
"allowRepick": ["watchAllowRepick"],
|
|
2686
1580
|
"showYearMonthDropdowns": ["watchShowYearMonthDropdowns"],
|
|
2687
|
-
"disabled": ["watchDisabled"]
|
|
2688
|
-
"isDateDisabled": ["watchIsDateDisabled"]
|
|
1581
|
+
"disabled": ["watchDisabled"]
|
|
2689
1582
|
}; }
|
|
2690
1583
|
};
|
|
2691
|
-
__decorate$
|
|
1584
|
+
__decorate$a([
|
|
2692
1585
|
InjectVegaGlobalSlimmer()
|
|
2693
1586
|
], VegaDatePicker.prototype, "globalSlimmers", void 0);
|
|
2694
|
-
__decorate$
|
|
1587
|
+
__decorate$a([
|
|
2695
1588
|
InjectVegaSlimmer()
|
|
2696
1589
|
], 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([
|
|
1590
|
+
__decorate$a([
|
|
2704
1591
|
InjectVegaSlimmer()
|
|
2705
|
-
], VegaDatePicker.prototype, "
|
|
2706
|
-
__decorate$
|
|
1592
|
+
], VegaDatePicker.prototype, "calendarOpenStateController", void 0);
|
|
1593
|
+
__decorate$a([
|
|
2707
1594
|
InjectVegaSlimmer()
|
|
2708
1595
|
], VegaDatePicker.prototype, "vegaDatePickerValueController", void 0);
|
|
2709
|
-
__decorate$
|
|
1596
|
+
__decorate$a([
|
|
2710
1597
|
InjectVegaSlimmer()
|
|
2711
1598
|
], VegaDatePicker.prototype, "vegaDatePickerFormatController", void 0);
|
|
2712
|
-
__decorate$
|
|
1599
|
+
__decorate$a([
|
|
2713
1600
|
InjectVegaSlimmer()
|
|
2714
1601
|
], VegaDatePicker.prototype, "startInputFormatController", void 0);
|
|
2715
|
-
__decorate$
|
|
1602
|
+
__decorate$a([
|
|
2716
1603
|
InjectVegaSlimmer()
|
|
2717
1604
|
], VegaDatePicker.prototype, "endInputFormatController", void 0);
|
|
2718
|
-
__decorate$
|
|
2719
|
-
InjectVegaSlimmer()
|
|
2720
|
-
], VegaDatePicker.prototype, "vegaDatePickerElementAppenderController", void 0);
|
|
2721
|
-
__decorate$1([
|
|
1605
|
+
__decorate$a([
|
|
2722
1606
|
InjectVegaSlimmer()
|
|
2723
1607
|
], VegaDatePicker.prototype, "vegaDatePickerKeyboardController", void 0);
|
|
2724
|
-
__decorate$
|
|
1608
|
+
__decorate$a([
|
|
2725
1609
|
InjectVegaSlimmer()
|
|
2726
1610
|
], VegaDatePicker.prototype, "vegaDatePickerRenderer", void 0);
|
|
2727
|
-
__decorate$
|
|
1611
|
+
__decorate$a([
|
|
2728
1612
|
InjectVegaSlimmer()
|
|
2729
1613
|
], VegaDatePicker.prototype, "vegaDatePickerSingleInputRenderer", void 0);
|
|
2730
|
-
__decorate$
|
|
1614
|
+
__decorate$a([
|
|
2731
1615
|
InjectVegaSlimmer()
|
|
2732
1616
|
], VegaDatePicker.prototype, "vegaDatePickerRangeInputRenderer", void 0);
|
|
2733
|
-
__decorate$
|
|
1617
|
+
__decorate$a([
|
|
2734
1618
|
InjectVegaSlimmer()
|
|
2735
1619
|
], VegaDatePicker.prototype, "vegaDatePickerCalendarRenderer", void 0);
|
|
2736
|
-
__decorate$
|
|
1620
|
+
__decorate$a([
|
|
2737
1621
|
InjectVegaSlimmer()
|
|
2738
1622
|
], VegaDatePicker.prototype, "formFieldController", void 0);
|
|
2739
|
-
__decorate$
|
|
2740
|
-
InjectVegaSlimmer()
|
|
2741
|
-
], VegaDatePicker.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2742
|
-
__decorate$1([
|
|
1623
|
+
__decorate$a([
|
|
2743
1624
|
InjectVegaSlimmer()
|
|
2744
1625
|
], VegaDatePicker.prototype, "changeEventEmitter", void 0);
|
|
2745
|
-
__decorate$
|
|
1626
|
+
__decorate$a([
|
|
1627
|
+
InjectVegaSlimmer()
|
|
1628
|
+
], VegaDatePicker.prototype, "monthYearChangeEventEmitter", void 0);
|
|
1629
|
+
__decorate$a([
|
|
2746
1630
|
InjectVegaSlimmer()
|
|
2747
1631
|
], VegaDatePicker.prototype, "inputEventPrevent", void 0);
|
|
2748
|
-
__decorate$
|
|
1632
|
+
__decorate$a([
|
|
2749
1633
|
InjectVegaSlimmer()
|
|
2750
1634
|
], 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([
|
|
1635
|
+
__decorate$a([
|
|
2758
1636
|
ComponentLoadRequired()
|
|
2759
1637
|
], VegaDatePicker.prototype, "watchValue", null);
|
|
2760
1638
|
VegaDatePicker.style = vegaDatePickerCss;
|
|
2761
1639
|
|
|
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))}";
|
|
1640
|
+
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1641
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1642
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1643
|
+
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;
|
|
1644
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1645
|
+
};
|
|
1646
|
+
class VegaDatePickerCalendarRenderer extends VegaSlimmer {
|
|
1647
|
+
render() {
|
|
1648
|
+
return (h("div", { class: {
|
|
1649
|
+
'calendar': true,
|
|
1650
|
+
'static-height': this.staticHeight,
|
|
1651
|
+
} },
|
|
1652
|
+
h("div", { class: "container__main" },
|
|
1653
|
+
this.renderContainer(),
|
|
1654
|
+
this.renderFooter())));
|
|
1655
|
+
}
|
|
1656
|
+
renderContainer() {
|
|
1657
|
+
const shouldRenderRangeMonth = this.shouldRenderRangeMonth();
|
|
1658
|
+
return (h("div", { class: {
|
|
1659
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1660
|
+
'container__months': true,
|
|
1661
|
+
'columns-2': shouldRenderRangeMonth,
|
|
1662
|
+
} }, shouldRenderRangeMonth ? this.renderRangeMonth() : this.monthItemRenderer.render('start')));
|
|
1663
|
+
}
|
|
1664
|
+
renderRangeMonth() {
|
|
1665
|
+
return (h(Fragment, null,
|
|
1666
|
+
this.monthItemRenderer.render('start'),
|
|
1667
|
+
this.monthItemRenderer.render('end')));
|
|
1668
|
+
}
|
|
1669
|
+
renderFooter() {
|
|
1670
|
+
return (this.clearButton && (h("div", { class: "footer-container" },
|
|
1671
|
+
h("vega-button-link", { ref: (ref) => {
|
|
1672
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
1673
|
+
this.clearCalendar();
|
|
1674
|
+
});
|
|
1675
|
+
}, label: this.translationSlimmer.t('Clear') }))));
|
|
1676
|
+
}
|
|
1677
|
+
shouldRenderRangeMonth() {
|
|
1678
|
+
return this.mode === 'range' && !this.isMobileDevice;
|
|
1679
|
+
}
|
|
1680
|
+
clearCalendar() {
|
|
1681
|
+
this.clearEventEmitter.emit();
|
|
1682
|
+
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), {});
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
__decorate$9([
|
|
1686
|
+
MapToComponentField()
|
|
1687
|
+
], VegaDatePickerCalendarRenderer.prototype, "host", void 0);
|
|
1688
|
+
__decorate$9([
|
|
1689
|
+
MapToComponentField()
|
|
1690
|
+
], VegaDatePickerCalendarRenderer.prototype, "clearButton", void 0);
|
|
1691
|
+
__decorate$9([
|
|
1692
|
+
MapToComponentField()
|
|
1693
|
+
], VegaDatePickerCalendarRenderer.prototype, "monthItemRenderer", void 0);
|
|
1694
|
+
__decorate$9([
|
|
1695
|
+
MapToComponentField()
|
|
1696
|
+
], VegaDatePickerCalendarRenderer.prototype, "staticHeight", void 0);
|
|
1697
|
+
__decorate$9([
|
|
1698
|
+
MapToComponentField()
|
|
1699
|
+
], VegaDatePickerCalendarRenderer.prototype, "translationSlimmer", void 0);
|
|
1700
|
+
__decorate$9([
|
|
1701
|
+
MapToComponentField()
|
|
1702
|
+
], VegaDatePickerCalendarRenderer.prototype, "mode", void 0);
|
|
1703
|
+
__decorate$9([
|
|
1704
|
+
MapToComponentField()
|
|
1705
|
+
], VegaDatePickerCalendarRenderer.prototype, "clearEventEmitter", void 0);
|
|
1706
|
+
__decorate$9([
|
|
1707
|
+
MapToComponentField()
|
|
1708
|
+
], VegaDatePickerCalendarRenderer.prototype, "isMobileDevice", void 0);
|
|
1709
|
+
|
|
1710
|
+
const MonthNames = [
|
|
1711
|
+
'January',
|
|
1712
|
+
'February',
|
|
1713
|
+
'March',
|
|
1714
|
+
'April',
|
|
1715
|
+
'May',
|
|
1716
|
+
'June',
|
|
1717
|
+
'July',
|
|
1718
|
+
'August',
|
|
1719
|
+
'September',
|
|
1720
|
+
'October',
|
|
1721
|
+
'November',
|
|
1722
|
+
'December',
|
|
1723
|
+
];
|
|
2763
1724
|
|
|
2764
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1725
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2765
1726
|
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;
|
|
1727
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1728
|
+
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
1729
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2773
1730
|
};
|
|
2774
|
-
|
|
2775
|
-
constructor(
|
|
2776
|
-
|
|
2777
|
-
this.
|
|
2778
|
-
|
|
1731
|
+
class VegaDatePickerCalendarYearMonthSwitcherRenderer extends VegaSlimmer {
|
|
1732
|
+
constructor() {
|
|
1733
|
+
super(...arguments);
|
|
1734
|
+
this.startDropdownRef = {
|
|
1735
|
+
month: null,
|
|
1736
|
+
year: null,
|
|
1737
|
+
};
|
|
1738
|
+
this.endDropdownRef = {
|
|
1739
|
+
month: null,
|
|
1740
|
+
year: null,
|
|
1741
|
+
};
|
|
2779
1742
|
}
|
|
2780
|
-
render() {
|
|
2781
|
-
return h(
|
|
1743
|
+
render(period, type) {
|
|
1744
|
+
return (h("vega-flex", { gap: 'size-8', justifyContent: 'center' },
|
|
1745
|
+
this.showYearMonthDropdowns
|
|
1746
|
+
? this.renderMonthDropdownSwitcher(period, type)
|
|
1747
|
+
: this.renderCurrentMonth(period),
|
|
1748
|
+
this.showYearMonthDropdowns
|
|
1749
|
+
? this.renderYearDropdownSwitcher(period, type)
|
|
1750
|
+
: this.renderCurrentYear(period)));
|
|
1751
|
+
}
|
|
1752
|
+
getMonthDropdownOptions(type) {
|
|
1753
|
+
let currentYear = this.currentPeriod.current.year;
|
|
1754
|
+
const currentMonth = this.currentPeriod.current.month;
|
|
1755
|
+
if (type === 'end' && currentMonth === 12)
|
|
1756
|
+
currentYear += 1;
|
|
1757
|
+
return MonthNames.map((month, index) => {
|
|
1758
|
+
return {
|
|
1759
|
+
key: `${index}`,
|
|
1760
|
+
label: this.translationSlimmer.t(month),
|
|
1761
|
+
disabled: this.isDisabledMonth(currentYear, index + 1),
|
|
1762
|
+
};
|
|
1763
|
+
});
|
|
2782
1764
|
}
|
|
2783
|
-
|
|
1765
|
+
isDisabledMonth(year, month) {
|
|
1766
|
+
var _a, _b, _c, _d;
|
|
1767
|
+
const startMonth = (_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.month;
|
|
1768
|
+
const startYear = (_b = this.minCalendarDate) === null || _b === void 0 ? void 0 : _b.year;
|
|
1769
|
+
const endMonth = (_c = this.maxCalendarDate) === null || _c === void 0 ? void 0 : _c.month;
|
|
1770
|
+
const endYear = (_d = this.maxCalendarDate) === null || _d === void 0 ? void 0 : _d.year;
|
|
1771
|
+
return (year < startYear ||
|
|
1772
|
+
year > endYear ||
|
|
1773
|
+
(year === startYear && startMonth > month) ||
|
|
1774
|
+
(year === endYear && endMonth < month));
|
|
1775
|
+
}
|
|
1776
|
+
getYearDropdownOptions() {
|
|
1777
|
+
var _a, _b, _c, _d;
|
|
1778
|
+
const currentYear = new Date().getFullYear();
|
|
1779
|
+
const startYear = ((_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.year) ||
|
|
1780
|
+
Math.min(((_b = this.maxCalendarDate) === null || _b === void 0 ? void 0 : _b.year) || currentYear, currentYear) -
|
|
1781
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_BEFORE_CURRENT_YEAR;
|
|
1782
|
+
const endYear = ((_c = this.maxCalendarDate) === null || _c === void 0 ? void 0 : _c.year) ||
|
|
1783
|
+
Math.max(((_d = this.minCalendarDate) === null || _d === void 0 ? void 0 : _d.year) || currentYear, currentYear) +
|
|
1784
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_AFTER_CURRENT_YEAR;
|
|
1785
|
+
const years = [];
|
|
1786
|
+
for (let year = startYear; year <= endYear; year++) {
|
|
1787
|
+
years.push({ key: String(year), label: String(year) });
|
|
1788
|
+
}
|
|
1789
|
+
return years;
|
|
1790
|
+
}
|
|
1791
|
+
renderMonthDropdownSwitcher(period, type) {
|
|
1792
|
+
const { month } = period.current;
|
|
1793
|
+
const monthIndex = month - 1;
|
|
1794
|
+
return (h("vega-dropdown", { trigger: "click", selectType: "single", source: this.getMonthDropdownOptions(type), selectedSourceKey: monthIndex.toString(), "max-height": "300", isScreenPosition: this.yearMonthDropdownProps.isScreenPosition, ref: (node) => {
|
|
1795
|
+
if (type === 'start') {
|
|
1796
|
+
this.startDropdownRef.month = node;
|
|
1797
|
+
}
|
|
1798
|
+
else {
|
|
1799
|
+
this.endDropdownRef.month = node;
|
|
1800
|
+
}
|
|
1801
|
+
this.onDropdownShowOrHide(node);
|
|
1802
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, (payload) => {
|
|
1803
|
+
const selectedMonth = parseInt(payload.detail);
|
|
1804
|
+
this.setDateBasedOnSelectedMonth(period, selectedMonth, type);
|
|
1805
|
+
});
|
|
1806
|
+
} }, this.renderCurrentMonth(period)));
|
|
1807
|
+
}
|
|
1808
|
+
renderYearDropdownSwitcher(period, type) {
|
|
1809
|
+
const { year } = period.current;
|
|
1810
|
+
return (h("vega-dropdown", { trigger: "click", selectType: "single", source: this.getYearDropdownOptions(), selectedSourceKey: year.toString(), "max-height": "300", isScreenPosition: this.yearMonthDropdownProps.isScreenPosition, ref: (node) => {
|
|
1811
|
+
if (type === 'start') {
|
|
1812
|
+
this.startDropdownRef.year = node;
|
|
1813
|
+
}
|
|
1814
|
+
else {
|
|
1815
|
+
this.endDropdownRef.year = node;
|
|
1816
|
+
}
|
|
1817
|
+
this.onDropdownShowOrHide(node);
|
|
1818
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, (payload) => {
|
|
1819
|
+
this.setDateBasedOnSelectedYear(period, parseInt(payload.detail), type);
|
|
1820
|
+
});
|
|
1821
|
+
} }, this.renderCurrentYear(period)));
|
|
1822
|
+
}
|
|
1823
|
+
/**
|
|
1824
|
+
* Control ui when dropdown shows or closes
|
|
1825
|
+
*
|
|
1826
|
+
* @param {HTMLVegaDropdownElement} dropdown - Month or year dropdown
|
|
1827
|
+
*/
|
|
1828
|
+
onDropdownShowOrHide(dropdown) {
|
|
1829
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(dropdown, VegaDropdownShow, async () => {
|
|
1830
|
+
await this.closeOpenDropdowns(dropdown);
|
|
1831
|
+
dropdown.classList.add('active');
|
|
1832
|
+
});
|
|
1833
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(dropdown, VegaDropdownHide, () => {
|
|
1834
|
+
const parentElement = dropdown.closest('.calendar');
|
|
1835
|
+
if (parentElement) {
|
|
1836
|
+
const dropdown = parentElement.querySelector('vega-dropdown.active');
|
|
1837
|
+
dropdown && dropdown.classList.remove('active');
|
|
1838
|
+
}
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
renderCurrentMonth(period) {
|
|
1842
|
+
return (h("div", { class: "month-item-name" },
|
|
1843
|
+
h("span", null, this.translationSlimmer.t(period.current.getMonthName())),
|
|
1844
|
+
this.renderDropdownSwitchIcon()));
|
|
1845
|
+
}
|
|
1846
|
+
renderCurrentYear(period) {
|
|
1847
|
+
return (h("div", { class: "month-item-year" },
|
|
1848
|
+
h("span", null, period.current.year),
|
|
1849
|
+
this.renderDropdownSwitchIcon()));
|
|
1850
|
+
}
|
|
1851
|
+
renderDropdownSwitchIcon() {
|
|
1852
|
+
return (this.showYearMonthDropdowns && (h("vega-icon", { icon: VegaInternalIconManager.getIconKey('caret-down') })));
|
|
1853
|
+
}
|
|
1854
|
+
setDateBasedOnSelectedMonth(period, monthIndex, type) {
|
|
1855
|
+
const { year } = period.current;
|
|
1856
|
+
const date = type === 'start' ? new Date(year, monthIndex, 1) : new Date(year, monthIndex - 1, 1);
|
|
1857
|
+
const newPeriod = new MonthPeriod(CalendarDate.from(date));
|
|
1858
|
+
this.currentPeriodController.updateCalendarPeriod(newPeriod);
|
|
1859
|
+
}
|
|
1860
|
+
setDateBasedOnSelectedYear(period, year, type) {
|
|
1861
|
+
const { month } = period.current;
|
|
1862
|
+
const startMonthIndex = month - 1;
|
|
1863
|
+
const endMonthIndex = startMonthIndex - 1;
|
|
1864
|
+
const date = type === 'start' ? new Date(year, startMonthIndex, 1) : new Date(year, endMonthIndex, 1);
|
|
1865
|
+
const newPeriod = new MonthPeriod(CalendarDate.from(date));
|
|
1866
|
+
this.currentPeriodController.updateCalendarPeriod(newPeriod);
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Close any open vega-dropdown and ignore currently clicked one
|
|
1870
|
+
*
|
|
1871
|
+
* * @param {HTMLVegaDropdownElement} dropdownToIgnore - Dropdown to ignore
|
|
1872
|
+
*/
|
|
1873
|
+
async closeOpenDropdowns(dropdownToIgnore) {
|
|
1874
|
+
const dropdowns = [this.startDropdownRef, this.endDropdownRef];
|
|
1875
|
+
await Promise.all(dropdowns
|
|
1876
|
+
.flatMap((ref) => [ref.month, ref.year])
|
|
1877
|
+
.filter((dropdown) => Boolean(dropdown) && dropdown !== dropdownToIgnore)
|
|
1878
|
+
.map((dropdown) => dropdown.hide()));
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
(() => {
|
|
1882
|
+
VegaInternalIconManager.register({
|
|
1883
|
+
'caret-down': Icons['caret-down'],
|
|
1884
|
+
});
|
|
1885
|
+
})();
|
|
1886
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_BEFORE_CURRENT_YEAR = 10;
|
|
1887
|
+
VegaDatePickerCalendarYearMonthSwitcherRenderer.DEFAULT_MINIMUM_DROPDOWN_YEAR_AFTER_CURRENT_YEAR = 10;
|
|
1888
|
+
__decorate$8([
|
|
1889
|
+
MapToComponentField()
|
|
1890
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "currentPeriodController", void 0);
|
|
1891
|
+
__decorate$8([
|
|
1892
|
+
MapToComponentField()
|
|
1893
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "showYearMonthDropdowns", void 0);
|
|
1894
|
+
__decorate$8([
|
|
1895
|
+
MapToComponentField()
|
|
1896
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "translationSlimmer", void 0);
|
|
1897
|
+
__decorate$8([
|
|
1898
|
+
MapToComponentField()
|
|
1899
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "minCalendarDate", void 0);
|
|
1900
|
+
__decorate$8([
|
|
1901
|
+
MapToComponentField()
|
|
1902
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "maxCalendarDate", void 0);
|
|
1903
|
+
__decorate$8([
|
|
1904
|
+
MapToComponentField()
|
|
1905
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "yearMonthDropdownProps", void 0);
|
|
1906
|
+
__decorate$8([
|
|
1907
|
+
MapToComponentField()
|
|
1908
|
+
], VegaDatePickerCalendarYearMonthSwitcherRenderer.prototype, "currentPeriod", void 0);
|
|
1909
|
+
|
|
1910
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1911
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1912
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1913
|
+
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;
|
|
1914
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2784
1915
|
};
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
1916
|
+
/**
|
|
1917
|
+
* Date picker calendar state base abstract class
|
|
1918
|
+
*/
|
|
1919
|
+
class VegaDatePickerCalendarStateBaseAbstract extends VegaSlimmer {
|
|
1920
|
+
/** connectedCallback */
|
|
1921
|
+
connectedCallback() {
|
|
1922
|
+
this.initCalendarClearObserver();
|
|
1923
|
+
}
|
|
1924
|
+
/** disconnectedCallback */
|
|
1925
|
+
disconnectedCallback() {
|
|
1926
|
+
this.removeCalendarClearObserver();
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Initialize calendar clear observer
|
|
1930
|
+
*/
|
|
1931
|
+
initCalendarClearObserver() {
|
|
1932
|
+
this.calendarClearObserver = new Observer(this.canAcceptClearEvent.bind(this), this.clear.bind(this));
|
|
1933
|
+
ChangeManager.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), this.calendarClearObserver);
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Remove calendar clear observer
|
|
1937
|
+
*/
|
|
1938
|
+
removeCalendarClearObserver() {
|
|
1939
|
+
ChangeManager.unregister(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarClear), this.calendarClearObserver);
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* Check if can accept form reset event
|
|
1943
|
+
*
|
|
1944
|
+
* @returns {boolean} - true if can accept, false otherwise.
|
|
1945
|
+
*/
|
|
1946
|
+
canAcceptClearEvent() {
|
|
1947
|
+
return true;
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
__decorate$7([
|
|
1951
|
+
MapToComponentField()
|
|
1952
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "host", void 0);
|
|
1953
|
+
__decorate$7([
|
|
1954
|
+
MapToComponentMethod('connectedCallback')
|
|
1955
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "connectedCallback", null);
|
|
1956
|
+
__decorate$7([
|
|
1957
|
+
MapToComponentMethod('disconnectedCallback')
|
|
1958
|
+
], VegaDatePickerCalendarStateBaseAbstract.prototype, "disconnectedCallback", null);
|
|
1959
|
+
|
|
1960
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1961
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1962
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1963
|
+
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;
|
|
1964
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1965
|
+
};
|
|
1966
|
+
/** Current period controller. */
|
|
1967
|
+
class VegaDatePickerCalendarCurrentPeriodController extends VegaDatePickerCalendarStateBaseAbstract {
|
|
1968
|
+
/** connectedCallback */
|
|
1969
|
+
connectedCallback() {
|
|
1970
|
+
super.connectedCallback();
|
|
1971
|
+
this.initCalendarPeriodUpdateObserver();
|
|
1972
|
+
}
|
|
1973
|
+
/** disconnectedCallback */
|
|
1974
|
+
disconnectedCallback() {
|
|
1975
|
+
super.disconnectedCallback();
|
|
1976
|
+
this.removeCalendarPeriodUpdateObserver();
|
|
1977
|
+
}
|
|
1978
|
+
/** componentWillLoad */
|
|
1979
|
+
componentWillLoad() {
|
|
1980
|
+
this.setCurrentMonthPeriod();
|
|
1981
|
+
}
|
|
1982
|
+
/** Listen maxDate changed */
|
|
1983
|
+
watchMaxCalendarDate() {
|
|
1984
|
+
this.setCurrentMonthPeriod();
|
|
1985
|
+
}
|
|
1986
|
+
/** Listen minDate changed */
|
|
1987
|
+
watchMinCalendarDate() {
|
|
1988
|
+
this.setCurrentMonthPeriod();
|
|
1989
|
+
}
|
|
1990
|
+
/** Listen currentPeriod changed */
|
|
1991
|
+
watchCurrentPeriod() {
|
|
1992
|
+
this.monthYearChangeEventEmitter.emit(this.getCurrentYearMonthByPeriod());
|
|
1993
|
+
}
|
|
1994
|
+
/** reset current period */
|
|
1995
|
+
resetCurrentPeriod() {
|
|
1996
|
+
this.setCurrentMonthPeriod();
|
|
1997
|
+
}
|
|
1998
|
+
/** Clear current period */
|
|
1999
|
+
clear() {
|
|
2000
|
+
this.setCurrentMonthPeriod();
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Goto next month period while single mode.
|
|
2004
|
+
* Goto next two month period while range mode.
|
|
2005
|
+
*/
|
|
2006
|
+
gotoNextPeriod() {
|
|
2007
|
+
const period = this.isRangeView()
|
|
2008
|
+
? this.currentPeriod.next().next()
|
|
2009
|
+
: this.currentPeriod.next();
|
|
2010
|
+
this.updateCalendarPeriod(period);
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Goto previous month period while single mode.
|
|
2014
|
+
* Goto previous two month period while range mode.
|
|
2015
|
+
*/
|
|
2016
|
+
gotoPreviousPeriod() {
|
|
2017
|
+
const period = this.isRangeView()
|
|
2018
|
+
? this.currentPeriod.previous().previous()
|
|
2019
|
+
: this.currentPeriod.previous();
|
|
2020
|
+
this.updateCalendarPeriod(period);
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* set current period
|
|
2024
|
+
*
|
|
2025
|
+
* @param {MonthPeriod} period current period
|
|
2026
|
+
*/
|
|
2027
|
+
updateCalendarPeriod(period) {
|
|
2028
|
+
if (!this.currentPeriod || !this.currentPeriod.equal(period)) {
|
|
2029
|
+
this.currentPeriod = period;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Current period follow below rules:
|
|
2034
|
+
* - Go to the value date month if the value is set.
|
|
2035
|
+
* - Go to the minDate month if only set the minDate and today is before than minDate.
|
|
2036
|
+
* - Go to the minDate month if minDate and maxDate are both set and today is after than maxDate.
|
|
2037
|
+
* - Go to the maxDate month if only set maxDate and today is after than maxDate.
|
|
2038
|
+
* - Go to today month if the value, minDate and maxDate all are empty.
|
|
2039
|
+
*/
|
|
2040
|
+
setCurrentMonthPeriod() {
|
|
2041
|
+
let currentDate;
|
|
2042
|
+
const startDate = this.calendarSelection.startDate;
|
|
2043
|
+
if (isCalendarDateType(startDate)) {
|
|
2044
|
+
currentDate = startDate;
|
|
2045
|
+
}
|
|
2046
|
+
else if (this.minCalendarDate &&
|
|
2047
|
+
(this.today.isBefore(this.minCalendarDate) ||
|
|
2048
|
+
(this.maxCalendarDate && this.today.isAfter(this.maxCalendarDate)))) {
|
|
2049
|
+
currentDate = this.minCalendarDate;
|
|
2050
|
+
}
|
|
2051
|
+
else if (this.maxCalendarDate && this.today.isAfter(this.maxCalendarDate)) {
|
|
2052
|
+
currentDate = this.maxCalendarDate;
|
|
2053
|
+
}
|
|
2054
|
+
else {
|
|
2055
|
+
currentDate = this.today;
|
|
2056
|
+
}
|
|
2057
|
+
this.updateCalendarPeriod(new MonthPeriod(currentDate, true, this.timezone));
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Check is range view
|
|
2061
|
+
*
|
|
2062
|
+
* @returns {boolean} -
|
|
2063
|
+
*/
|
|
2064
|
+
isRangeView() {
|
|
2065
|
+
return this.mode === 'range' && !this.isMobileDevice;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Get current year month by period
|
|
2069
|
+
*
|
|
2070
|
+
* @returns {DatePickerMonthYearTypes} - month and year info
|
|
2071
|
+
*/
|
|
2072
|
+
getCurrentYearMonthByPeriod() {
|
|
2073
|
+
const startMonthYear = {
|
|
2074
|
+
month: MonthNames[this.currentPeriod.current.month - 1],
|
|
2075
|
+
year: `${this.currentPeriod.current.year}`,
|
|
2076
|
+
};
|
|
2077
|
+
if (this.mode === 'range') {
|
|
2078
|
+
return [
|
|
2079
|
+
startMonthYear,
|
|
2080
|
+
{
|
|
2081
|
+
month: MonthNames[this.currentPeriod.endDate.month - 1],
|
|
2082
|
+
year: `${this.currentPeriod.endDate.year}`,
|
|
2083
|
+
},
|
|
2084
|
+
];
|
|
2085
|
+
}
|
|
2086
|
+
else {
|
|
2087
|
+
return startMonthYear;
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Initialize calendar clear observer
|
|
2092
|
+
*/
|
|
2093
|
+
initCalendarPeriodUpdateObserver() {
|
|
2094
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser, this.setCurrentMonthPeriod.bind(this));
|
|
2095
|
+
}
|
|
2096
|
+
/**
|
|
2097
|
+
* Remove calendar clear observer
|
|
2098
|
+
*/
|
|
2099
|
+
removeCalendarPeriodUpdateObserver() {
|
|
2100
|
+
DomNodeSubjectObserverFactory.removeUniqueObserverFromNode(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser);
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
__decorate$6([
|
|
2104
|
+
MapToComponentField({ writable: true })
|
|
2105
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "currentPeriod", void 0);
|
|
2106
|
+
__decorate$6([
|
|
2107
|
+
MapToComponentField()
|
|
2108
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "host", void 0);
|
|
2109
|
+
__decorate$6([
|
|
2110
|
+
MapToComponentField()
|
|
2111
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "today", void 0);
|
|
2112
|
+
__decorate$6([
|
|
2113
|
+
MapToComponentField()
|
|
2114
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "mode", void 0);
|
|
2115
|
+
__decorate$6([
|
|
2116
|
+
MapToComponentField()
|
|
2117
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "format", void 0);
|
|
2118
|
+
__decorate$6([
|
|
2119
|
+
MapToComponentField()
|
|
2120
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "timezone", void 0);
|
|
2121
|
+
__decorate$6([
|
|
2122
|
+
MapToComponentField()
|
|
2123
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "minCalendarDate", void 0);
|
|
2124
|
+
__decorate$6([
|
|
2125
|
+
MapToComponentField()
|
|
2126
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "maxCalendarDate", void 0);
|
|
2127
|
+
__decorate$6([
|
|
2128
|
+
MapToComponentField()
|
|
2129
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "isMobileDevice", void 0);
|
|
2130
|
+
__decorate$6([
|
|
2131
|
+
MapToComponentField()
|
|
2132
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2133
|
+
__decorate$6([
|
|
2134
|
+
MapToComponentField()
|
|
2135
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "calendarSelection", void 0);
|
|
2136
|
+
__decorate$6([
|
|
2137
|
+
MapToComponentMethod('connectedCallback')
|
|
2138
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "connectedCallback", null);
|
|
2139
|
+
__decorate$6([
|
|
2140
|
+
MapToComponentMethod('disconnectedCallback')
|
|
2141
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "disconnectedCallback", null);
|
|
2142
|
+
__decorate$6([
|
|
2143
|
+
MapToComponentMethod('componentWillLoad')
|
|
2144
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "componentWillLoad", null);
|
|
2145
|
+
__decorate$6([
|
|
2146
|
+
MapToComponentMethod('watchMaxCalendarDate')
|
|
2147
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchMaxCalendarDate", null);
|
|
2148
|
+
__decorate$6([
|
|
2149
|
+
MapToComponentMethod('watchMinCalendarDate')
|
|
2150
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchMinCalendarDate", null);
|
|
2151
|
+
__decorate$6([
|
|
2152
|
+
MapToComponentMethod('watchCurrentPeriod')
|
|
2153
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "watchCurrentPeriod", null);
|
|
2154
|
+
__decorate$6([
|
|
2155
|
+
MapToComponentMethod('reset')
|
|
2156
|
+
], VegaDatePickerCalendarCurrentPeriodController.prototype, "resetCurrentPeriod", null);
|
|
2157
|
+
|
|
2158
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2159
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2160
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2161
|
+
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;
|
|
2162
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2163
|
+
};
|
|
2164
|
+
/** Today controller */
|
|
2165
|
+
class VegaDatePickerCalendarTodayController extends VegaSlimmer {
|
|
2166
|
+
/** connectedCallback */
|
|
2167
|
+
connectedCallback() {
|
|
2168
|
+
this.setToday();
|
|
2169
|
+
}
|
|
2170
|
+
/** Listen time zone changed */
|
|
2171
|
+
watchTimezone() {
|
|
2172
|
+
this.setToday();
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Sets the current date based on the provided timezone or the system timezone if none is provided.
|
|
2176
|
+
*/
|
|
2177
|
+
setToday() {
|
|
2178
|
+
this.today = CalendarDate.from(new Date(), this.timezone);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
__decorate$5([
|
|
2182
|
+
MapToComponentField()
|
|
2183
|
+
], VegaDatePickerCalendarTodayController.prototype, "timezone", void 0);
|
|
2184
|
+
__decorate$5([
|
|
2185
|
+
MapToComponentField({ writable: true })
|
|
2186
|
+
], VegaDatePickerCalendarTodayController.prototype, "today", void 0);
|
|
2187
|
+
__decorate$5([
|
|
2188
|
+
MapToComponentMethod('connectedCallback')
|
|
2189
|
+
], VegaDatePickerCalendarTodayController.prototype, "connectedCallback", null);
|
|
2190
|
+
__decorate$5([
|
|
2191
|
+
MapToComponentMethod('watchTimezone')
|
|
2192
|
+
], VegaDatePickerCalendarTodayController.prototype, "watchTimezone", null);
|
|
2193
|
+
|
|
2194
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2195
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2196
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2197
|
+
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;
|
|
2198
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2199
|
+
};
|
|
2200
|
+
class VegaDatePickerMonthItemRenderer extends VegaSlimmer {
|
|
2201
|
+
constructor() {
|
|
2202
|
+
super(...arguments);
|
|
2203
|
+
this.monthViewGenerator = new MonthViewGenerator();
|
|
2204
|
+
}
|
|
2205
|
+
render(type) {
|
|
2206
|
+
const period = type === 'end' ? this.currentPeriod.next() : this.currentPeriod;
|
|
2207
|
+
const periodView = this.monthViewGenerator.generate(period);
|
|
2208
|
+
return (h("div", { class: "month-item" },
|
|
2209
|
+
this.renderMonthHeader(period, type),
|
|
2210
|
+
this.renderWeek(periodView),
|
|
2211
|
+
this.renderDays(periodView, period)));
|
|
2212
|
+
}
|
|
2213
|
+
renderMonthHeader(period, type) {
|
|
2214
|
+
return (h("vega-grid", { class: "month-item-header", column: '3-auto', row: 1 },
|
|
2215
|
+
this.renderPrevIcon(period, type),
|
|
2216
|
+
this.yearMonthSwitcherRender.render(period, type),
|
|
2217
|
+
this.renderNextIcon(period, type)));
|
|
2218
|
+
}
|
|
2219
|
+
renderPrevIcon(period, type) {
|
|
2220
|
+
var _a;
|
|
2221
|
+
const firstDateOfMonth = period.current.firstDateOfMonth();
|
|
2222
|
+
const lockedPreviousPeriod = this.isBeforeMinDate(firstDateOfMonth) || ((_a = this.minCalendarDate) === null || _a === void 0 ? void 0 : _a.equal(firstDateOfMonth));
|
|
2223
|
+
const needHide = !this.isMobileDevice && this.mode === 'range' && type === 'end';
|
|
2224
|
+
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) => {
|
|
2225
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
2226
|
+
this.currentPeriodController.gotoPreviousPeriod();
|
|
2227
|
+
});
|
|
2228
|
+
}, size: this.getNavigationIconSize() }));
|
|
2229
|
+
}
|
|
2230
|
+
renderNextIcon(period, type) {
|
|
2231
|
+
var _a;
|
|
2232
|
+
const lastDateOfMonth = period.current.lastDateOfMonth();
|
|
2233
|
+
const lockedNextPeriod = this.isAfterMaxDate(lastDateOfMonth) || ((_a = this.maxCalendarDate) === null || _a === void 0 ? void 0 : _a.equal(lastDateOfMonth));
|
|
2234
|
+
const needHide = !this.isMobileDevice && this.mode === 'range' && type === 'start';
|
|
2235
|
+
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) => {
|
|
2236
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
2237
|
+
this.currentPeriodController.gotoNextPeriod();
|
|
2238
|
+
});
|
|
2239
|
+
}, size: this.getNavigationIconSize() }));
|
|
2240
|
+
}
|
|
2241
|
+
renderWeek(periodView) {
|
|
2242
|
+
return (h("vega-grid", { class: "month-item-weekdays-row", column: '7-auto', row: 1 }, periodView.weekdays.map((weekDay) => {
|
|
2243
|
+
return (h("div", { key: weekDay }, this.translationSlimmer.t(`${weekDay}-short`)));
|
|
2244
|
+
})));
|
|
2245
|
+
}
|
|
2246
|
+
renderDays(periodView, period) {
|
|
2247
|
+
return (h("vega-grid", { class: "container__days", column: '7-auto', row: this.staticHeight ? 6 : '6-auto' }, periodView.dateItems
|
|
2248
|
+
.flat()
|
|
2249
|
+
.filter((day) => day.month <= period.current.month || day.year < period.current.year)
|
|
2250
|
+
.map((day) => this.renderDay(day, period))));
|
|
2251
|
+
}
|
|
2252
|
+
renderDay(day, period) {
|
|
2253
|
+
const isCurrentMonth = day.month === period.current.month;
|
|
2254
|
+
const isLockedDate = this.isBeforeMinDate(day) || this.isAfterMaxDate(day);
|
|
2255
|
+
const currentRangeDates = this.getCurrentRangeDates();
|
|
2256
|
+
const isDisabled = this.isDateDisabled(day.toDate());
|
|
2257
|
+
const isInRange = day.isAfter(currentRangeDates[0]) && day.isBefore(currentRangeDates[1]);
|
|
2258
|
+
const canInterActive = isCurrentMonth && !isLockedDate && !isDisabled;
|
|
2259
|
+
return (h("div", { key: `${day.month}-${day.date}`, class: isCurrentMonth && {
|
|
2260
|
+
'day-item': true,
|
|
2261
|
+
'is-today': day.equal(this.today),
|
|
2262
|
+
'is-start-date': day.equal(currentRangeDates[0]),
|
|
2263
|
+
'is-in-range': isInRange,
|
|
2264
|
+
'is-end-date': day.equal(currentRangeDates[1]),
|
|
2265
|
+
'is-locked': isLockedDate,
|
|
2266
|
+
'is-disabled': isDisabled,
|
|
2267
|
+
},
|
|
2268
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2269
|
+
onClick: () => canInterActive && this.selectionController.onDayClick(day),
|
|
2270
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2271
|
+
onMouseEnter: () => canInterActive && this.selectionController.onDayHover(day), onKeyDown: createEnterKeyHandlerToTriggerClick(), role: "menuitem", "aria-label": day.date, tabIndex: canInterActive ? 0 : -1 }, isCurrentMonth ? day.date : ''));
|
|
2272
|
+
}
|
|
2273
|
+
getCurrentRangeDates() {
|
|
2274
|
+
const startDate = this.calendarSelection.startDate;
|
|
2275
|
+
const endDate = this.calendarSelection.endDate;
|
|
2276
|
+
if (isCalendarDateType(startDate) && !endDate && this.hoverDate) {
|
|
2277
|
+
return this.hoverDate.isBefore(startDate)
|
|
2278
|
+
? [this.hoverDate, startDate]
|
|
2279
|
+
: [startDate, this.hoverDate];
|
|
2280
|
+
}
|
|
2281
|
+
else if (!isCalendarDateType(startDate) && endDate && this.hoverDate) {
|
|
2282
|
+
return this.hoverDate.isBefore(endDate) ? [this.hoverDate, endDate] : [endDate, this.hoverDate];
|
|
2283
|
+
}
|
|
2284
|
+
else {
|
|
2285
|
+
return [startDate, endDate];
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
isBeforeMinDate(day) {
|
|
2289
|
+
return this.minCalendarDate && day.isBefore(this.minCalendarDate);
|
|
2290
|
+
}
|
|
2291
|
+
isAfterMaxDate(day) {
|
|
2292
|
+
return this.maxCalendarDate && day.isAfter(this.maxCalendarDate);
|
|
2293
|
+
}
|
|
2294
|
+
getNavigationIconSize() {
|
|
2295
|
+
if (this.size === 'large')
|
|
2296
|
+
return 'default';
|
|
2297
|
+
if (this.size === 'small')
|
|
2298
|
+
return 'extra-small';
|
|
2299
|
+
return 'small';
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
(() => {
|
|
2303
|
+
VegaInternalIconManager.register({
|
|
2304
|
+
'chevron-left': Icons['chevron-left'],
|
|
2305
|
+
'chevron-right': Icons['chevron-right'],
|
|
2306
|
+
});
|
|
2307
|
+
})();
|
|
2308
|
+
__decorate$4([
|
|
2309
|
+
MapToComponentField()
|
|
2310
|
+
], VegaDatePickerMonthItemRenderer.prototype, "currentPeriod", void 0);
|
|
2311
|
+
__decorate$4([
|
|
2312
|
+
MapToComponentField()
|
|
2313
|
+
], VegaDatePickerMonthItemRenderer.prototype, "today", void 0);
|
|
2314
|
+
__decorate$4([
|
|
2315
|
+
MapToComponentField()
|
|
2316
|
+
], VegaDatePickerMonthItemRenderer.prototype, "translationSlimmer", void 0);
|
|
2317
|
+
__decorate$4([
|
|
2318
|
+
MapToComponentField()
|
|
2319
|
+
], VegaDatePickerMonthItemRenderer.prototype, "yearMonthSwitcherRender", void 0);
|
|
2320
|
+
__decorate$4([
|
|
2321
|
+
MapToComponentField()
|
|
2322
|
+
], VegaDatePickerMonthItemRenderer.prototype, "mode", void 0);
|
|
2323
|
+
__decorate$4([
|
|
2324
|
+
MapToComponentField()
|
|
2325
|
+
], VegaDatePickerMonthItemRenderer.prototype, "currentPeriodController", void 0);
|
|
2326
|
+
__decorate$4([
|
|
2327
|
+
MapToComponentField()
|
|
2328
|
+
], VegaDatePickerMonthItemRenderer.prototype, "hoverDate", void 0);
|
|
2329
|
+
__decorate$4([
|
|
2330
|
+
MapToComponentField()
|
|
2331
|
+
], VegaDatePickerMonthItemRenderer.prototype, "maxCalendarDate", void 0);
|
|
2332
|
+
__decorate$4([
|
|
2333
|
+
MapToComponentField()
|
|
2334
|
+
], VegaDatePickerMonthItemRenderer.prototype, "minCalendarDate", void 0);
|
|
2335
|
+
__decorate$4([
|
|
2336
|
+
MapToComponentField()
|
|
2337
|
+
], VegaDatePickerMonthItemRenderer.prototype, "selectionController", void 0);
|
|
2338
|
+
__decorate$4([
|
|
2339
|
+
MapToComponentField()
|
|
2340
|
+
], VegaDatePickerMonthItemRenderer.prototype, "calendarSelection", void 0);
|
|
2341
|
+
__decorate$4([
|
|
2342
|
+
MapToComponentField()
|
|
2343
|
+
], VegaDatePickerMonthItemRenderer.prototype, "size", void 0);
|
|
2344
|
+
__decorate$4([
|
|
2345
|
+
MapToComponentField()
|
|
2346
|
+
], VegaDatePickerMonthItemRenderer.prototype, "staticHeight", void 0);
|
|
2347
|
+
__decorate$4([
|
|
2348
|
+
MapToComponentField()
|
|
2349
|
+
], VegaDatePickerMonthItemRenderer.prototype, "isDateDisabled", void 0);
|
|
2350
|
+
__decorate$4([
|
|
2351
|
+
MapToComponentField()
|
|
2352
|
+
], VegaDatePickerMonthItemRenderer.prototype, "isMobileDevice", void 0);
|
|
2353
|
+
|
|
2354
|
+
/** Calendar selection object. */
|
|
2355
|
+
class CalendarSelection {
|
|
2356
|
+
constructor(startDate, endDate, mode) {
|
|
2357
|
+
this.startDate = startDate;
|
|
2358
|
+
this.endDate = endDate;
|
|
2359
|
+
this.mode = mode;
|
|
2360
|
+
if (this.mode === 'range' && this.startDate && this.endDate && this.startDate.isAfter(this.endDate)) {
|
|
2361
|
+
const startDate = this.startDate;
|
|
2362
|
+
this.startDate = this.endDate;
|
|
2363
|
+
this.endDate = startDate;
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* Creates a CalendarSelection from a selection value.
|
|
2368
|
+
*
|
|
2369
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - The selection value.
|
|
2370
|
+
* @param {DatePickerModeType} mode - The mode of the date picker.
|
|
2371
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2372
|
+
* @returns {CalendarSelection} - The created CalendarSelection instance.
|
|
2373
|
+
*/
|
|
2374
|
+
static fromSelection(selection, mode, format) {
|
|
2375
|
+
let startDate = null;
|
|
2376
|
+
let endDate = null;
|
|
2377
|
+
if (this.isValidSelection(selection, mode, format)) {
|
|
2378
|
+
if (mode === 'single' && typeof selection === 'string') {
|
|
2379
|
+
const date = CalendarDate.fromString(selection, format);
|
|
2380
|
+
startDate = date;
|
|
2381
|
+
endDate = date;
|
|
2382
|
+
}
|
|
2383
|
+
else if (mode === 'range' && Array.isArray(selection)) {
|
|
2384
|
+
startDate = CalendarDate.fromString(selection[0], format);
|
|
2385
|
+
endDate = CalendarDate.fromString(selection[1], format);
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
return new CalendarSelection(startDate, endDate, mode);
|
|
2389
|
+
}
|
|
2390
|
+
/**
|
|
2391
|
+
* Check if the selection is valid.
|
|
2392
|
+
*
|
|
2393
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - The selection value.
|
|
2394
|
+
* @param {DatePickerModeType} mode - The mode of the date picker.
|
|
2395
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2396
|
+
* @returns {boolean} - True if the selection is valid, false otherwise.
|
|
2397
|
+
*/
|
|
2398
|
+
static isValidSelection(selection, mode, format) {
|
|
2399
|
+
let isValid;
|
|
2400
|
+
switch (mode) {
|
|
2401
|
+
case 'single':
|
|
2402
|
+
isValid = this.isValidDateString(selection, format);
|
|
2403
|
+
break;
|
|
2404
|
+
case 'range':
|
|
2405
|
+
isValid =
|
|
2406
|
+
Array.isArray(selection) &&
|
|
2407
|
+
selection.length === 2 &&
|
|
2408
|
+
selection.every((item) => this.isValidDateString(item, format));
|
|
2409
|
+
break;
|
|
2410
|
+
}
|
|
2411
|
+
if (!isValid) {
|
|
2412
|
+
LogUtility.warn(`Invalid date picker calendar selection ${selection} for ${mode} mode`);
|
|
2413
|
+
}
|
|
2414
|
+
return isValid;
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Check if a date string is valid.
|
|
2418
|
+
*
|
|
2419
|
+
* @param {Nullable<string>} dateString - The date string to check.
|
|
2420
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2421
|
+
* @returns {boolean} - True if the date string is valid, false otherwise.
|
|
2422
|
+
*/
|
|
2423
|
+
static isValidDateString(dateString, format) {
|
|
2424
|
+
return ((dateString && typeof dateString === 'string' && !!CalendarDate.fromString(dateString, format)) ||
|
|
2425
|
+
dateString === '');
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Gets the selection value based on the current calendar selection.
|
|
2429
|
+
*
|
|
2430
|
+
* @param {string} format - The date format to use for string conversion.
|
|
2431
|
+
* @returns {DatePickerValueType<DatePickerModeType>} - The selection value.
|
|
2432
|
+
*/
|
|
2433
|
+
toSelection(format) {
|
|
2434
|
+
var _a, _b, _c;
|
|
2435
|
+
if (this.mode === 'range') {
|
|
2436
|
+
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)) || ''];
|
|
2437
|
+
}
|
|
2438
|
+
else {
|
|
2439
|
+
return ((_c = this.startDate) === null || _c === void 0 ? void 0 : _c.toString(format)) || '';
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
/**
|
|
2443
|
+
* Checks if this calendar selection is equal to another.
|
|
2444
|
+
*
|
|
2445
|
+
* @param {CalendarSelection} other - The other calendar selection to compare with.
|
|
2446
|
+
* @returns {boolean} - True if both selections are equal, false otherwise.
|
|
2447
|
+
*/
|
|
2448
|
+
equals(other) {
|
|
2449
|
+
if (!other)
|
|
2450
|
+
return false;
|
|
2451
|
+
const isStartDateEqual = this.startDate && other.startDate
|
|
2452
|
+
? this.startDate.equal(other.startDate)
|
|
2453
|
+
: this.startDate === this.endDate;
|
|
2454
|
+
const isEndDateEqual = this.endDate && other.endDate
|
|
2455
|
+
? this.endDate.equal(other.endDate)
|
|
2456
|
+
: this.endDate === other.endDate;
|
|
2457
|
+
return isStartDateEqual && isEndDateEqual;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* Checks if the calendar selection is completed.
|
|
2461
|
+
*
|
|
2462
|
+
* @returns {boolean} - True if the selection is completed, false otherwise.
|
|
2463
|
+
*/
|
|
2464
|
+
isCompleted() {
|
|
2465
|
+
return (isCalendarDateType(this.startDate) &&
|
|
2466
|
+
(this.mode === 'range' ? isCalendarDateType(this.endDate) : true));
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* Checks if the calendar selection is empty.
|
|
2470
|
+
*
|
|
2471
|
+
* @returns {boolean} - True if the selection is empty, false otherwise.
|
|
2472
|
+
*/
|
|
2473
|
+
isEmpty() {
|
|
2474
|
+
return !isCalendarDateType(this.startDate) && !isCalendarDateType(this.endDate);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2479
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2480
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2481
|
+
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;
|
|
2482
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2483
|
+
};
|
|
2484
|
+
/** Selection controller */
|
|
2485
|
+
class VegaDatePickerCalendarSelectionController extends VegaDatePickerCalendarStateBaseAbstract {
|
|
2486
|
+
/** componentWillLoad */
|
|
2487
|
+
componentWillLoad() {
|
|
2488
|
+
this.setCalendarSelectionBySelection(this.selection);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Listen selection changed
|
|
2492
|
+
*
|
|
2493
|
+
* @param {DatePickerValueType<DatePickerModeType>} newSelection - newSelection.
|
|
2494
|
+
*/
|
|
2495
|
+
watchSelection(newSelection) {
|
|
2496
|
+
const isChangeByUser = !this.isSameSelection(newSelection, this.calendarSelection.toSelection(this.format));
|
|
2497
|
+
// If the user changes the selection via property, we need to update the current period and set the calendar selection.
|
|
2498
|
+
// otherwise, we don't need to update.
|
|
2499
|
+
if (isChangeByUser) {
|
|
2500
|
+
this.setCalendarSelectionBySelection(newSelection);
|
|
2501
|
+
this.notifyPeriodChange();
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
/** Reset selecting range date */
|
|
2505
|
+
resetRange() {
|
|
2506
|
+
const usePrevious = !this.calendarSelection.isCompleted() &&
|
|
2507
|
+
!this.calendarSelection.isEmpty() &&
|
|
2508
|
+
!!this.previousCalendarSelection;
|
|
2509
|
+
this.setCalendarSelectionBySelection(usePrevious ? this.previousCalendarSelection.toSelection(this.format) : this.selection);
|
|
2510
|
+
this.hoverDate = null;
|
|
2511
|
+
}
|
|
2512
|
+
/** Listen calendarSelection changed */
|
|
2513
|
+
watchCalendarSelection() {
|
|
2514
|
+
if (this.calendarSelection.isCompleted() || this.calendarSelection.isEmpty()) {
|
|
2515
|
+
this.setSelection(this.calendarSelection.toSelection(this.format));
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
/** Clear the current selection */
|
|
2519
|
+
clear() {
|
|
2520
|
+
this.setCalendarSelectionByRange(null, null);
|
|
2521
|
+
this.hoverDate = null;
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* Listen the day be clicked.
|
|
2525
|
+
*
|
|
2526
|
+
* @param {CalendarDate} day - clicked day.
|
|
2527
|
+
*/
|
|
2528
|
+
onDayClick(day) {
|
|
2529
|
+
if (this.mode === 'single') {
|
|
2530
|
+
this.setCalendarSelectionByRange(day, day);
|
|
2531
|
+
}
|
|
2532
|
+
else if (this.mode === 'range') {
|
|
2533
|
+
if (this.calendarSelection.startDate && !this.calendarSelection.endDate) {
|
|
2534
|
+
// It second click of range mode, we should set min date as start and max date as end.
|
|
2535
|
+
// As also, the select action have completed, we should set the value same time.
|
|
2536
|
+
this.setCalendarSelectionByRange(this.calendarSelection.startDate, day);
|
|
2537
|
+
}
|
|
2538
|
+
else if (!this.calendarSelection.startDate && this.calendarSelection.endDate) {
|
|
2539
|
+
this.setCalendarSelectionByRange(this.calendarSelection.endDate, day);
|
|
2540
|
+
}
|
|
2541
|
+
else {
|
|
2542
|
+
// It first click of range mode, we only set start date.
|
|
2543
|
+
this.setCalendarSelectionByRange(day, null);
|
|
2544
|
+
}
|
|
2545
|
+
this.hoverDate = null;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Listen the day be hovered.
|
|
2550
|
+
* Need set the hoverDate after the first click in range mode.
|
|
2551
|
+
* For repick, we should clear start or end date according the input which have been clicked.
|
|
2552
|
+
* Note: repick is working at hover any day in range.
|
|
2553
|
+
*
|
|
2554
|
+
* @param {CalendarDate} day - hovered day.
|
|
2555
|
+
*/
|
|
2556
|
+
onDayHover(day) {
|
|
2557
|
+
const clickedInputType = this.allowRepickController.getRepickType();
|
|
2558
|
+
if (clickedInputType && this.mode === 'range' && this.calendarSelection.isCompleted()) {
|
|
2559
|
+
clickedInputType === 'start'
|
|
2560
|
+
? this.setCalendarSelectionByRange(null, this.calendarSelection.endDate)
|
|
2561
|
+
: this.setCalendarSelectionByRange(this.calendarSelection.startDate, null);
|
|
2562
|
+
}
|
|
2563
|
+
if (!this.calendarSelection.isEmpty() && !this.calendarSelection.isCompleted()) {
|
|
2564
|
+
this.hoverDate = day;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Sets calendar selection for date picker calendar based on selection value.
|
|
2569
|
+
*
|
|
2570
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - selection.
|
|
2571
|
+
*/
|
|
2572
|
+
setCalendarSelectionBySelection(selection) {
|
|
2573
|
+
const calendarSelection = CalendarSelection.fromSelection(selection, this.mode, this.format);
|
|
2574
|
+
if (this.calendarSelection &&
|
|
2575
|
+
(this.calendarSelection.isCompleted() || this.calendarSelection.isEmpty())) {
|
|
2576
|
+
this.previousCalendarSelection = this.calendarSelection;
|
|
2577
|
+
}
|
|
2578
|
+
if (!calendarSelection.equals(this.calendarSelection)) {
|
|
2579
|
+
this.calendarSelection = calendarSelection;
|
|
2580
|
+
}
|
|
2581
|
+
// we should reset the selection while calendarSelection changed from inner,
|
|
2582
|
+
// such as reversed range correction.
|
|
2583
|
+
this.setSelection(calendarSelection.toSelection(this.format));
|
|
2584
|
+
}
|
|
2585
|
+
/**
|
|
2586
|
+
* Sets calendar selection for date picker calendar based on range dates.
|
|
2587
|
+
*
|
|
2588
|
+
* @param {Nullable<CalendarDate>} startDate - startDate.
|
|
2589
|
+
* @param {Nullable<CalendarDate>} endDate - endDate.
|
|
2590
|
+
*/
|
|
2591
|
+
setCalendarSelectionByRange(startDate, endDate) {
|
|
2592
|
+
this.calendarSelection = new CalendarSelection(startDate, endDate, this.mode);
|
|
2593
|
+
}
|
|
2594
|
+
/**
|
|
2595
|
+
* Sets selection for date picker calendar and emits a change event with the new value.
|
|
2596
|
+
*
|
|
2597
|
+
* @param {DatePickerValueType<DatePickerModeType>} selection - selection.
|
|
2598
|
+
*/
|
|
2599
|
+
setSelection(selection) {
|
|
2600
|
+
if (!this.isSameSelection(selection, this.selection)) {
|
|
2601
|
+
this.selection = selection;
|
|
2602
|
+
this.vegaSelectionChangeEventEmitter.emit(this.selection);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
/**
|
|
2606
|
+
* Check the previous selection and current selection is same.
|
|
2607
|
+
*
|
|
2608
|
+
* @param {DatePickerValueType<DatePickerModeType>} previous - New selection.
|
|
2609
|
+
* @param {DatePickerValueType<DatePickerModeType>} current - Old selection.
|
|
2610
|
+
* @returns {boolean} -
|
|
2611
|
+
*/
|
|
2612
|
+
isSameSelection(previous, current) {
|
|
2613
|
+
if (this.mode === 'range' && Array.isArray(previous) && Array.isArray(current)) {
|
|
2614
|
+
return isArrayEqual(previous, current);
|
|
2615
|
+
}
|
|
2616
|
+
return previous === current;
|
|
2617
|
+
}
|
|
2618
|
+
/** Notify to update current period */
|
|
2619
|
+
notifyPeriodChange() {
|
|
2620
|
+
ChangeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalDatePickerCalendarUpdatePeriodByUser), {});
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
__decorate$3([
|
|
2624
|
+
MapToComponentField()
|
|
2625
|
+
], VegaDatePickerCalendarSelectionController.prototype, "host", void 0);
|
|
2626
|
+
__decorate$3([
|
|
2627
|
+
MapToComponentField()
|
|
2628
|
+
], VegaDatePickerCalendarSelectionController.prototype, "mode", void 0);
|
|
2629
|
+
__decorate$3([
|
|
2630
|
+
MapToComponentField()
|
|
2631
|
+
], VegaDatePickerCalendarSelectionController.prototype, "format", void 0);
|
|
2632
|
+
__decorate$3([
|
|
2633
|
+
MapToComponentField({ writable: true })
|
|
2634
|
+
], VegaDatePickerCalendarSelectionController.prototype, "selection", void 0);
|
|
2635
|
+
__decorate$3([
|
|
2636
|
+
MapToComponentField({ writable: true })
|
|
2637
|
+
], VegaDatePickerCalendarSelectionController.prototype, "calendarSelection", void 0);
|
|
2638
|
+
__decorate$3([
|
|
2639
|
+
MapToComponentField({ writable: true })
|
|
2640
|
+
], VegaDatePickerCalendarSelectionController.prototype, "hoverDate", void 0);
|
|
2641
|
+
__decorate$3([
|
|
2642
|
+
MapToComponentField()
|
|
2643
|
+
], VegaDatePickerCalendarSelectionController.prototype, "clearEventEmitter", void 0);
|
|
2644
|
+
__decorate$3([
|
|
2645
|
+
MapToComponentField()
|
|
2646
|
+
], VegaDatePickerCalendarSelectionController.prototype, "vegaSelectionChangeEventEmitter", void 0);
|
|
2647
|
+
__decorate$3([
|
|
2648
|
+
MapToComponentField()
|
|
2649
|
+
], VegaDatePickerCalendarSelectionController.prototype, "allowRepickController", void 0);
|
|
2650
|
+
__decorate$3([
|
|
2651
|
+
MapToComponentMethod('componentWillLoad')
|
|
2652
|
+
], VegaDatePickerCalendarSelectionController.prototype, "componentWillLoad", null);
|
|
2653
|
+
__decorate$3([
|
|
2654
|
+
MapToComponentMethod('watchSelection')
|
|
2655
|
+
], VegaDatePickerCalendarSelectionController.prototype, "watchSelection", null);
|
|
2656
|
+
__decorate$3([
|
|
2657
|
+
MapToComponentMethod('reset')
|
|
2658
|
+
], VegaDatePickerCalendarSelectionController.prototype, "resetRange", null);
|
|
2659
|
+
__decorate$3([
|
|
2660
|
+
MapToComponentMethod('watchCalendarSelection')
|
|
2661
|
+
], VegaDatePickerCalendarSelectionController.prototype, "watchCalendarSelection", null);
|
|
2662
|
+
|
|
2663
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2664
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2665
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2666
|
+
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;
|
|
2667
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2668
|
+
};
|
|
2669
|
+
/** Current min and max calendar date controller. */
|
|
2670
|
+
class VegaDatePickerCalendarMinMaxDateController extends VegaSlimmer {
|
|
2671
|
+
/** componentWillLoad */
|
|
2672
|
+
componentWillLoad() {
|
|
2673
|
+
this.setMaxCalendarDate();
|
|
2674
|
+
this.setMinCalendarDate();
|
|
2675
|
+
}
|
|
2676
|
+
/** Listen maxDate changed */
|
|
2677
|
+
watchMaxDate() {
|
|
2678
|
+
this.setMaxCalendarDate();
|
|
2679
|
+
}
|
|
2680
|
+
/** Listen minDate changed */
|
|
2681
|
+
watchMinDate() {
|
|
2682
|
+
this.setMinCalendarDate();
|
|
2683
|
+
}
|
|
2684
|
+
/** Set maxCalendarDate */
|
|
2685
|
+
setMaxCalendarDate() {
|
|
2686
|
+
this.maxCalendarDate = CalendarDate.fromString(this.maxDate, this.format);
|
|
2687
|
+
}
|
|
2688
|
+
/** Set minCalendarDate */
|
|
2689
|
+
setMinCalendarDate() {
|
|
2690
|
+
this.minCalendarDate = CalendarDate.fromString(this.minDate, this.format);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
__decorate$2([
|
|
2694
|
+
MapToComponentField()
|
|
2695
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "maxDate", void 0);
|
|
2696
|
+
__decorate$2([
|
|
2697
|
+
MapToComponentField()
|
|
2698
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "minDate", void 0);
|
|
2699
|
+
__decorate$2([
|
|
2700
|
+
MapToComponentField()
|
|
2701
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "format", void 0);
|
|
2702
|
+
__decorate$2([
|
|
2703
|
+
MapToComponentField({ writable: true })
|
|
2704
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "maxCalendarDate", void 0);
|
|
2705
|
+
__decorate$2([
|
|
2706
|
+
MapToComponentField({ writable: true })
|
|
2707
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "minCalendarDate", void 0);
|
|
2708
|
+
__decorate$2([
|
|
2709
|
+
MapToComponentMethod('componentWillLoad')
|
|
2710
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "componentWillLoad", null);
|
|
2711
|
+
__decorate$2([
|
|
2712
|
+
MapToComponentMethod('watchMaxDate')
|
|
2713
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "watchMaxDate", null);
|
|
2714
|
+
__decorate$2([
|
|
2715
|
+
MapToComponentMethod('watchMinDate')
|
|
2716
|
+
], VegaDatePickerCalendarMinMaxDateController.prototype, "watchMinDate", null);
|
|
2717
|
+
|
|
2718
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2719
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2720
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2721
|
+
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;
|
|
2722
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2723
|
+
};
|
|
2724
|
+
/** Allow repick controller. */
|
|
2725
|
+
class VegaDatePickerCalendarAllowRepickController extends VegaSlimmer {
|
|
2726
|
+
/**
|
|
2727
|
+
* Trigger repick
|
|
2728
|
+
*
|
|
2729
|
+
* @param {DatePickerCalendarRepickType} type - The type of repick.
|
|
2730
|
+
*/
|
|
2731
|
+
triggerRepick(type) {
|
|
2732
|
+
this.repickType = type;
|
|
2733
|
+
if (type === 'end') {
|
|
2734
|
+
this.setEndDateAsCurrentMonthPeriod();
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
/** while selection completed, we should clear repick type */
|
|
2738
|
+
watchCalendarSelection() {
|
|
2739
|
+
if (this.calendarSelection.isCompleted()) {
|
|
2740
|
+
this.repickType = null;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* Get triggered repick type.
|
|
2745
|
+
*
|
|
2746
|
+
* @returns {DatePickerCalendarRepickType} - Repick type.
|
|
2747
|
+
*/
|
|
2748
|
+
getRepickType() {
|
|
2749
|
+
return this.repickType;
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Set end date as current period.
|
|
2753
|
+
* - while start date and end date in same month of year, we set startDate as current period
|
|
2754
|
+
* - while in range mobile device, since we only render on month, so set the end date at current period
|
|
2755
|
+
* - while in range desktop devide, we set previous month as current period to keep end date is in second month.
|
|
2756
|
+
*/
|
|
2757
|
+
setEndDateAsCurrentMonthPeriod() {
|
|
2758
|
+
const startDate = this.calendarSelection.startDate;
|
|
2759
|
+
const endDate = this.calendarSelection.endDate;
|
|
2760
|
+
if (endDate) {
|
|
2761
|
+
const date = isCalendarDateType(startDate) && startDate.compare(endDate).inMonth
|
|
2762
|
+
? startDate
|
|
2763
|
+
: this.isMobileDevice
|
|
2764
|
+
? endDate
|
|
2765
|
+
: endDate.add(0, -1);
|
|
2766
|
+
this.currentPeriodController.updateCalendarPeriod(new MonthPeriod(date));
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
__decorate$1([
|
|
2771
|
+
MapToComponentField()
|
|
2772
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "calendarSelection", void 0);
|
|
2773
|
+
__decorate$1([
|
|
2774
|
+
MapToComponentField()
|
|
2775
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "isMobileDevice", void 0);
|
|
2776
|
+
__decorate$1([
|
|
2777
|
+
MapToComponentField()
|
|
2778
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "currentPeriodController", void 0);
|
|
2779
|
+
__decorate$1([
|
|
2780
|
+
MapToComponentMethod('triggerRepick')
|
|
2781
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "triggerRepick", null);
|
|
2782
|
+
__decorate$1([
|
|
2783
|
+
MapToComponentMethod('watchCalendarSelection')
|
|
2784
|
+
], VegaDatePickerCalendarAllowRepickController.prototype, "watchCalendarSelection", null);
|
|
2785
|
+
|
|
2786
|
+
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))}";
|
|
2787
|
+
|
|
2788
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2789
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2790
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2791
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2792
|
+
else
|
|
2793
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2794
|
+
if (d = decorators[i])
|
|
2795
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2796
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2797
|
+
};
|
|
2798
|
+
const VegaDatePickerCalendar = class {
|
|
2799
|
+
constructor(hostRef) {
|
|
2800
|
+
registerInstance(this, hostRef);
|
|
2801
|
+
this.vegaClear = createEvent(this, "vegaClear", 7);
|
|
2802
|
+
this.clear = createEvent(this, "clear", 7);
|
|
2803
|
+
this.vegaMonthYearChange = createEvent(this, "vegaMonthYearChange", 7);
|
|
2804
|
+
this.monthYearChange = createEvent(this, "monthYearChange", 7);
|
|
2805
|
+
this.vegaSelectionChange = createEvent(this, "vegaSelectionChange", 7);
|
|
2806
|
+
this.selectionChange = createEvent(this, "selectionChange", 7);
|
|
2807
|
+
this.globalSlimmers = {};
|
|
2808
|
+
this.renderer = new VegaDatePickerCalendarRenderer();
|
|
2809
|
+
this.monthItemRenderer = new VegaDatePickerMonthItemRenderer();
|
|
2810
|
+
this.translationSlimmer = new TranslationSlimmer();
|
|
2811
|
+
this.todayController = new VegaDatePickerCalendarTodayController();
|
|
2812
|
+
this.selectionController = new VegaDatePickerCalendarSelectionController();
|
|
2813
|
+
this.minMaxDateController = new VegaDatePickerCalendarMinMaxDateController();
|
|
2814
|
+
this.currentPeriodController = new VegaDatePickerCalendarCurrentPeriodController();
|
|
2815
|
+
this.yearMonthSwitcherRender = new VegaDatePickerCalendarYearMonthSwitcherRenderer();
|
|
2816
|
+
this.allowRepickController = new VegaDatePickerCalendarAllowRepickController();
|
|
2817
|
+
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
2818
|
+
this.clearEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaClear);
|
|
2819
|
+
this.monthYearChangeEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaMonthYearChange);
|
|
2820
|
+
this.vegaSelectionChangeEventEmitter = createEventEmitSlimmer(VegaDatePickerCalendar, VegaSelectionChange);
|
|
2821
|
+
this.isMobileDevice = getDeviceType() === DeviceType.MOBILE;
|
|
2822
|
+
/**
|
|
2823
|
+
* Renders the calendar picker in different sizes. Defaults to regular size
|
|
2824
|
+
*
|
|
2825
|
+
* @vegaVersion 2.72.0
|
|
2826
|
+
*/
|
|
2827
|
+
this.size = 'regular';
|
|
2828
|
+
/**
|
|
2829
|
+
* Specifies the selection mode of the date picker calendar.
|
|
2830
|
+
*
|
|
2831
|
+
* - Use `single` to allow selecting a single date.
|
|
2832
|
+
* - Use `range` to allow selecting a date range.
|
|
2833
|
+
*
|
|
2834
|
+
* @vegaVersion 2.72.0
|
|
2835
|
+
*/
|
|
2836
|
+
this.mode = 'single';
|
|
2837
|
+
/**
|
|
2838
|
+
* Specifies the selected date or date range in the date picker calendar.
|
|
2839
|
+
*
|
|
2840
|
+
* @vegaVersion 2.72.0
|
|
2841
|
+
*/
|
|
2842
|
+
/* eslint-disable-next-line @stencil/strict-mutable */
|
|
2843
|
+
this.selection = this.mode === 'range' ? ['', ''] : '';
|
|
2844
|
+
/**
|
|
2845
|
+
* Specifies the desired date format.
|
|
2846
|
+
*
|
|
2847
|
+
* @vegaVersion 2.72.0
|
|
2848
|
+
*/
|
|
2849
|
+
this.format = 'MM/DD/YYYY';
|
|
2850
|
+
/**
|
|
2851
|
+
* Specifies whether to display the clear button when the calendar is shown.
|
|
2852
|
+
*
|
|
2853
|
+
* @vegaVersion 2.72.0
|
|
2854
|
+
*/
|
|
2855
|
+
this.clearButton = false;
|
|
2856
|
+
/**
|
|
2857
|
+
* Specifies the calendar is static height.
|
|
2858
|
+
*
|
|
2859
|
+
* @vegaVersion 2.72.0
|
|
2860
|
+
*/
|
|
2861
|
+
this.staticHeight = false;
|
|
2862
|
+
/**
|
|
2863
|
+
* Determines whether to show months and years dropdown in date picker calendar
|
|
2864
|
+
* If set to true, date picker calendar will have months and years dropdown
|
|
2865
|
+
*
|
|
2866
|
+
* @vegaVersion 2.72.0
|
|
2867
|
+
*/
|
|
2868
|
+
this.showYearMonthDropdowns = false;
|
|
2869
|
+
/**
|
|
2870
|
+
* Determines whether the year or month dropdown position is calculated relative to the screen.
|
|
2871
|
+
*
|
|
2872
|
+
* @vegaVersion 2.72.0
|
|
2873
|
+
*/
|
|
2874
|
+
this.yearMonthDropdownProps = {};
|
|
2875
|
+
/**
|
|
2876
|
+
* Specifies a predicate function that determines whether a given date in the date picker should be disabled (non-interactive).
|
|
2877
|
+
*
|
|
2878
|
+
* The function is called for each date cell before rendering.
|
|
2879
|
+
*
|
|
2880
|
+
* Return `true` to disable the cell, or false to keep it selectable.
|
|
2881
|
+
* Default behavior: always returns `false` (no cells are disabled).
|
|
2882
|
+
*
|
|
2883
|
+
* @param date - The `Date` object for the cell being evaluated.
|
|
2884
|
+
* @returns `true` if the cell should be disabled; otherwise `false`.
|
|
2885
|
+
* @vegaVersion 2.72.0
|
|
2886
|
+
*/
|
|
2887
|
+
this.isDateDisabled = () => false;
|
|
2888
|
+
}
|
|
2889
|
+
watchCurrentPeriod() {
|
|
2890
|
+
}
|
|
2891
|
+
watchCalendarSelection() {
|
|
2892
|
+
}
|
|
2893
|
+
watchMaxCalendarDate() {
|
|
2894
|
+
}
|
|
2895
|
+
watchMinCalendarDate() {
|
|
2896
|
+
}
|
|
2897
|
+
watchSelection() {
|
|
2898
|
+
}
|
|
2899
|
+
watchMinDate() {
|
|
2900
|
+
}
|
|
2901
|
+
watchMaxDate() {
|
|
2902
|
+
}
|
|
2903
|
+
watchTimezone() {
|
|
2904
|
+
}
|
|
2905
|
+
/**
|
|
2906
|
+
* Invoke this method to reset calendar to its initial state,
|
|
2907
|
+
* it include reset to current value and reset the current period.
|
|
2908
|
+
* @vegaVersion 2.72.0
|
|
2909
|
+
*/
|
|
2910
|
+
async reset() {
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* Invoke this method to trigger repick.
|
|
2914
|
+
* The param `type` is distinguishing the start date or end date can be repick.
|
|
2915
|
+
* @vegaVersion 2.72.0
|
|
2916
|
+
*/
|
|
2917
|
+
async triggerRepick(type) {
|
|
2918
|
+
}
|
|
2919
|
+
render() {
|
|
2920
|
+
return sanitizeVegaComponent(h(Host, { class: {
|
|
2921
|
+
[this.size]: true,
|
|
2922
|
+
[this.mode]: true,
|
|
2923
|
+
mobile: this.isMobileDevice,
|
|
2924
|
+
} }, this.renderer.render()), this.host);
|
|
2925
|
+
}
|
|
2926
|
+
get host() { return getElement(this); }
|
|
2927
|
+
static get watchers() { return {
|
|
2928
|
+
"currentPeriod": ["watchCurrentPeriod"],
|
|
2929
|
+
"calendarSelection": ["watchCalendarSelection"],
|
|
2930
|
+
"maxCalendarDate": ["watchMaxCalendarDate"],
|
|
2931
|
+
"minCalendarDate": ["watchMinCalendarDate"],
|
|
2932
|
+
"selection": ["watchSelection"],
|
|
2933
|
+
"minDate": ["watchMinDate"],
|
|
2934
|
+
"maxDate": ["watchMaxDate"],
|
|
2935
|
+
"timezone": ["watchTimezone"]
|
|
2936
|
+
}; }
|
|
2937
|
+
};
|
|
2938
|
+
__decorate([
|
|
2939
|
+
InjectVegaGlobalSlimmer()
|
|
2940
|
+
], VegaDatePickerCalendar.prototype, "globalSlimmers", void 0);
|
|
2941
|
+
__decorate([
|
|
2942
|
+
InjectVegaSlimmer()
|
|
2943
|
+
], VegaDatePickerCalendar.prototype, "renderer", void 0);
|
|
2944
|
+
__decorate([
|
|
2945
|
+
InjectVegaSlimmer()
|
|
2946
|
+
], VegaDatePickerCalendar.prototype, "monthItemRenderer", void 0);
|
|
2947
|
+
__decorate([
|
|
2948
|
+
InjectVegaSlimmer()
|
|
2949
|
+
], VegaDatePickerCalendar.prototype, "translationSlimmer", void 0);
|
|
2950
|
+
__decorate([
|
|
2951
|
+
InjectVegaSlimmer()
|
|
2952
|
+
], VegaDatePickerCalendar.prototype, "todayController", void 0);
|
|
2953
|
+
__decorate([
|
|
2954
|
+
InjectVegaSlimmer()
|
|
2955
|
+
], VegaDatePickerCalendar.prototype, "selectionController", void 0);
|
|
2956
|
+
__decorate([
|
|
2957
|
+
InjectVegaSlimmer()
|
|
2958
|
+
], VegaDatePickerCalendar.prototype, "minMaxDateController", void 0);
|
|
2959
|
+
__decorate([
|
|
2960
|
+
InjectVegaSlimmer()
|
|
2961
|
+
], VegaDatePickerCalendar.prototype, "currentPeriodController", void 0);
|
|
2962
|
+
__decorate([
|
|
2963
|
+
InjectVegaSlimmer()
|
|
2964
|
+
], VegaDatePickerCalendar.prototype, "yearMonthSwitcherRender", void 0);
|
|
2965
|
+
__decorate([
|
|
2966
|
+
InjectVegaSlimmer()
|
|
2967
|
+
], VegaDatePickerCalendar.prototype, "allowRepickController", void 0);
|
|
2968
|
+
__decorate([
|
|
2969
|
+
InjectVegaSlimmer()
|
|
2970
|
+
], VegaDatePickerCalendar.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
2971
|
+
__decorate([
|
|
2972
|
+
InjectVegaSlimmer()
|
|
2973
|
+
], VegaDatePickerCalendar.prototype, "clearEventEmitter", void 0);
|
|
2974
|
+
__decorate([
|
|
2975
|
+
InjectVegaSlimmer()
|
|
2976
|
+
], VegaDatePickerCalendar.prototype, "monthYearChangeEventEmitter", void 0);
|
|
2977
|
+
__decorate([
|
|
2978
|
+
InjectVegaSlimmer()
|
|
2979
|
+
], VegaDatePickerCalendar.prototype, "vegaSelectionChangeEventEmitter", void 0);
|
|
2791
2980
|
VegaDatePickerCalendar.style = vegaDatePickerCalendarCss;
|
|
2792
2981
|
|
|
2793
2982
|
export { VegaDatePicker as vega_date_picker, VegaDatePickerCalendar as vega_date_picker_calendar };
|