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