vft 0.0.249 → 0.0.252
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/index.css +1 -1
- package/es/components/alert/alert.vue.d.ts +1 -11
- package/es/components/alert/alert.vue2.js +13 -65
- package/es/components/alert/index.d.ts +28 -76
- package/es/components/autocomplete/autocomplete.vue.d.ts +14 -14
- package/es/components/autocomplete/autocomplete.vue2.js +194 -199
- package/es/components/autocomplete/index.d.ts +42 -42
- package/es/components/backtop/backtop.vue.d.ts +1 -15
- package/es/components/backtop/backtop.vue2.js +17 -106
- package/es/components/backtop/index.d.ts +3 -9
- package/es/components/backtop/types.d.ts +14 -0
- package/es/components/backtop/types.js +1 -0
- package/es/components/button/button-custom.d.ts +1 -1
- package/es/components/button/button.vue.d.ts +3 -50
- package/es/components/button/button.vue2.js +1 -1
- package/es/components/button/index.d.ts +39 -40
- package/es/components/button/types.d.ts +47 -1
- package/es/components/button/use-button.d.ts +5 -5
- package/es/components/card/index.d.ts +3 -3
- package/es/components/carousel/carousel.vue.d.ts +1 -1
- package/es/components/carousel/index.d.ts +18 -18
- package/es/components/carousel/use-carousel.js +2 -3
- package/es/components/checkbox/checkbox-group.vue.d.ts +1 -1
- package/es/components/checkbox/index.d.ts +42 -42
- package/es/components/color-picker/components/hue-slider.vue.d.ts +3 -3
- package/es/components/color-picker/components/predefine.vue.d.ts +3 -3
- package/es/components/color-picker/components/sv-panel.vue.d.ts +3 -3
- package/es/components/config-provider/hooks/use-global-config.d.ts +3 -3
- package/es/components/context-menu/context-menu.vue2.js +36 -124
- package/es/components/context-menu/index.js +5 -101
- package/es/components/context-menu/types.d.ts +1 -1
- package/es/components/context-menu/types.js +1 -98
- package/es/components/date-picker/composables/use-basic-date-table.d.ts +188 -0
- package/es/components/date-picker/composables/use-basic-date-table.js +183 -0
- package/es/components/date-picker/composables/use-month-range-header.d.ts +1 -1
- package/es/components/date-picker/composables/use-panel-date-range.d.ts +29 -0
- package/es/components/date-picker/composables/use-panel-date-range.js +72 -0
- package/es/components/date-picker/composables/use-range-picker.d.ts +46 -42
- package/es/components/date-picker/composables/use-range-picker.js +65 -52
- package/es/components/date-picker/composables/use-shortcut.js +4 -4
- package/es/components/date-picker/composables/use-year-range-header.d.ts +16 -0
- package/es/components/date-picker/composables/use-year-range-header.js +35 -0
- package/es/components/date-picker/constants.d.ts +2 -15
- package/es/components/date-picker/constants.js +3 -16
- package/es/components/date-picker/date-picker-com/basic-cell-render.d.ts +3 -1
- package/es/components/date-picker/date-picker-com/basic-cell-render.js +16 -19
- package/es/components/date-picker/date-picker-com/basic-date-table.vue.d.ts +14 -23
- package/es/components/date-picker/date-picker-com/basic-date-table.vue2.js +73 -176
- package/es/components/date-picker/date-picker-com/basic-month-table.vue.d.ts +2 -2
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +93 -71
- package/es/components/date-picker/date-picker-com/basic-year-table.vue.d.ts +50 -9
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +108 -57
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +13 -3
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +329 -277
- package/es/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +16 -3
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +422 -281
- package/es/components/date-picker/date-picker-com/panel-month-range.vue.d.ts +6 -3
- package/es/components/date-picker/date-picker-com/panel-month-range.vue2.js +137 -113
- package/es/components/date-picker/date-picker-com/panel-year-range.vue.d.ts +35 -0
- package/es/components/date-picker/date-picker-com/panel-year-range.vue.js +4 -0
- package/es/components/date-picker/date-picker-com/panel-year-range.vue2.js +210 -0
- package/es/components/date-picker/date-picker.d.ts +70 -40
- package/es/components/date-picker/date-picker.js +59 -50
- package/es/components/date-picker/date-picker.type.d.ts +2 -1
- package/es/components/date-picker/index.d.ts +126 -68
- package/es/components/date-picker/index.js +7 -7
- package/es/components/date-picker/instance.d.ts +9 -0
- package/es/components/date-picker/instance.js +1 -0
- package/es/components/date-picker/panel-utils.d.ts +48 -0
- package/es/components/date-picker/panel-utils.js +9 -6
- package/es/components/date-picker/props/basic-cell.d.ts +2 -1
- package/es/components/date-picker/props/basic-date-table.d.ts +7 -2
- package/es/components/date-picker/props/basic-date-table.js +6 -5
- package/es/components/date-picker/props/basic-month-table.d.ts +3 -2
- package/es/components/date-picker/props/basic-year-table.d.ts +23 -5
- package/es/components/date-picker/props/basic-year-table.js +5 -6
- package/es/components/date-picker/props/date-picker.d.ts +26 -12
- package/es/components/date-picker/props/date-picker.js +3 -0
- package/es/components/date-picker/props/panel-date-pick.d.ts +6 -1
- package/es/components/date-picker/props/panel-date-range.d.ts +7 -1
- package/es/components/date-picker/props/panel-month-range.d.ts +3 -1
- package/es/components/date-picker/props/panel-month-range.js +7 -3
- package/es/components/date-picker/props/panel-year-range.d.ts +14 -0
- package/es/components/date-picker/props/panel-year-range.js +17 -0
- package/es/components/date-picker/props/shared.d.ts +9 -2
- package/es/components/date-picker/props/shared.js +29 -12
- package/es/components/date-picker/style/css.d.ts +4 -0
- package/es/components/date-picker/style/css.js +5 -0
- package/es/components/date-picker/utils.d.ts +9 -2
- package/es/components/date-picker/utils.js +66 -33
- package/es/components/date-time-select/date-time-select.vue2.js +1 -1
- package/es/components/date-time-select/index.d.ts +1 -0
- package/es/components/date-time-select/types.d.ts +4 -0
- package/es/components/dialog/dialog-content.vue2.js +2 -3
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +4 -4
- package/es/components/dropdown/dropdown-item-impl.vue.js +12 -12
- package/es/components/dropdown/dropdown-item-impl.vue2.js +6 -6
- package/es/components/dropdown/dropdown.vue.d.ts +6 -29
- package/es/components/dropdown/dropdown.vue2.js +146 -149
- package/es/components/footer-layout/footer-layout.vue2.js +19 -108
- package/es/components/form/form-item.vue.d.ts +2 -3
- package/es/components/form/form-item.vue2.js +140 -135
- package/es/components/form/form-label-wrap.js +27 -27
- package/es/components/form/form.vue2.js +71 -65
- package/es/components/form/hooks/use-form-common-props.js +3 -4
- package/es/components/form/hooks/use-form-item.js +12 -13
- package/es/components/form/index.d.ts +75 -48
- package/es/components/form/types.d.ts +7 -1
- package/es/components/form/utils.d.ts +1 -1
- package/es/components/form/utils.js +33 -28
- package/es/components/header-layout/header-layout.vue2.js +26 -114
- package/es/components/icon/icon.vue2.js +20 -19
- package/es/components/icon/index.d.ts +0 -1
- package/es/components/icon/index.js +3 -4
- package/es/components/index.js +323 -319
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/link/index.d.ts +3 -3
- package/es/components/md-code-demo/md-code-demo.js +12 -13
- package/es/components/md-container/md-container.vue2.js +52 -138
- package/es/components/md-vue-playground/md-vue-playground.vue2.js +17 -17
- package/es/components/menu/index.js +1 -1
- package/es/components/menu/menu-item.vue.d.ts +1 -1
- package/es/components/menu/menu-item.vue2.js +45 -132
- package/es/components/menu/sub-menu.vue.d.ts +2 -1
- package/es/components/menu/sub-menu.vue2.js +76 -163
- package/es/components/modal/index.d.ts +33 -45
- package/es/components/modal/modal-footer-action.vue2.js +26 -112
- package/es/components/modal/modal.vue.d.ts +2 -2
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +57 -144
- package/es/components/multiple-tabs/tab-content.vue2.js +19 -113
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +37 -132
- package/es/components/popconfirm/index.d.ts +24 -24
- package/es/components/popconfirm/popconfirm.vue.d.ts +2 -2
- package/es/components/popover/index.d.ts +5 -5
- package/es/components/popover/popover.vue.d.ts +2 -2
- package/es/components/popper/composables/use-content.js +2 -3
- package/es/components/popper/trigger.vue2.js +7 -8
- package/es/components/progress/index.d.ts +3 -3
- package/es/components/result/result.vue.d.ts +1 -1
- package/es/components/result/result.vue2.js +20 -109
- package/es/components/roving-focus-group/index.js +11 -11
- package/es/components/roving-focus-group/roving-focus-group.vue.js +5 -5
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +2 -3
- package/es/components/scrollbar/index.js +9 -10
- package/es/components/select/defaults.d.ts +99 -15
- package/es/components/select/defaults.js +90 -12
- package/es/components/select/group-item.vue.d.ts +10 -5
- package/es/components/select/group-item.vue.js +9 -19
- package/es/components/select/group-item.vue2.js +4 -2
- package/es/components/select/index.d.ts +2782 -0
- package/es/components/select/index.js +2 -2
- package/es/components/select/option-item.vue.d.ts +40 -26
- package/es/components/select/option-item.vue.js +12 -12
- package/es/components/select/option-item.vue2.js +15 -12
- package/es/components/select/select-dropdown.d.ts +29 -3
- package/es/components/select/select-dropdown.js +120 -129
- package/es/components/select/select.types.d.ts +19 -11
- package/es/components/select/select.vue.d.ts +2778 -0
- package/es/components/select/select.vue.js +261 -251
- package/es/components/select/select.vue2.js +49 -45
- package/es/components/select/token.d.ts +10 -12
- package/es/components/select/token.js +4 -2
- package/es/components/select/useAllowCreate.d.ts +3 -3
- package/es/components/select/useAllowCreate.js +32 -29
- package/es/components/select/useOption.d.ts +3 -3
- package/es/components/select/useProps.d.ts +21 -0
- package/es/components/select/useProps.js +22 -0
- package/es/components/select/useSelect.d.ts +940 -121
- package/es/components/select/useSelect.js +396 -302
- package/es/components/side-menu/side-menu.vue2.js +77 -165
- package/es/components/steps/index.d.ts +12 -12
- package/es/components/super-form/component-map.js +52 -141
- package/es/components/super-form/style/css.js +4 -4
- package/es/components/super-form/super-form-action.vue2.js +39 -126
- package/es/components/super-form/super-form-item.vue2.js +161 -248
- package/es/components/super-form/super-form.vue.d.ts +1 -1
- package/es/components/super-form/super-form.vue2.js +116 -202
- package/es/components/super-form/types.d.ts +3 -1
- package/es/components/switch/index.d.ts +6 -6
- package/es/components/table/field.js +82 -176
- package/es/components/table/index.d.ts +24 -24
- package/es/components/table/table.vue.d.ts +1 -1
- package/es/components/tabs/tab-nav.vue.d.ts +2 -2
- package/es/components/tabs/tab-nav.vue2.js +98 -187
- package/es/components/tabs/tabs.vue.d.ts +2 -1
- package/es/components/time-picker/common/picker-range-trigger.vue.d.ts +84 -0
- package/es/components/time-picker/common/picker-range-trigger.vue.js +4 -0
- package/es/components/time-picker/common/picker-range-trigger.vue2.js +100 -0
- package/es/components/time-picker/common/picker.vue.d.ts +71 -41
- package/es/components/time-picker/common/picker.vue2.js +285 -289
- package/es/components/time-picker/common/props.d.ts +76 -12
- package/es/components/time-picker/common/props.js +78 -35
- package/es/components/time-picker/composables/use-time-panel.d.ts +4 -4
- package/es/components/time-picker/composables/use-time-picker.d.ts +28 -29
- package/es/components/time-picker/constants.d.ts +5 -0
- package/es/components/time-picker/constants.js +15 -10
- package/es/components/time-picker/index.d.ts +120 -74
- package/es/components/time-picker/index.js +28 -23
- package/es/components/time-picker/props/basic-time-spinner.d.ts +5 -4
- package/es/components/time-picker/props/panel-time-picker.d.ts +2 -1
- package/es/components/time-picker/props/panel-time-range.d.ts +2 -1
- package/es/components/time-picker/props/shared.d.ts +4 -5
- package/es/components/time-picker/style/css.d.ts +3 -0
- package/es/components/time-picker/style/css.js +3 -0
- package/es/components/time-picker/style/index.d.ts +3 -0
- package/es/components/time-picker/style/index.js +3 -0
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue.d.ts +6 -6
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue2.js +135 -128
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue.d.ts +4 -4
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +36 -35
- package/es/components/time-picker/time-picker-com/panel-time-range.vue.d.ts +4 -4
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +109 -108
- package/es/components/time-picker/time-picker.d.ts +60 -37
- package/es/components/time-picker/time-picker.js +28 -30
- package/es/components/time-picker/utils.d.ts +5 -2
- package/es/components/time-picker/utils.js +17 -16
- package/es/components/time-select/time-select.vue.d.ts +1 -1
- package/es/components/timeline/index.d.ts +6 -6
- package/es/components/tooltip/content.vue2.js +47 -48
- package/es/components/tooltip/index.d.ts +3 -3
- package/es/components/tooltip/tooltip.vue.d.ts +1 -1
- package/es/components/tooltip/tooltip.vue2.js +77 -78
- package/es/components/tooltip/utils.js +4 -5
- package/es/components/tree/tree-node.vue.d.ts +33 -33
- package/es/components/tree/tree-node.vue.js +11 -11
- package/es/components/tree/tree-node.vue2.js +15 -15
- package/es/components/upload/index.d.ts +15 -15
- package/es/components/upload/upload-content.vue.d.ts +1 -1
- package/es/components/upload/upload.vue.d.ts +1 -1
- package/es/components/virtual-list/builders/build-grid.d.ts +9 -9
- package/es/components/virtual-list/builders/build-grid.js +222 -214
- package/es/components/virtual-list/builders/build-list.d.ts +13 -13
- package/es/components/virtual-list/builders/build-list.js +206 -198
- package/es/components/virtual-list/components/dynamic-size-grid.d.ts +6 -6
- package/es/components/virtual-list/components/dynamic-size-grid.js +12 -12
- package/es/components/virtual-list/components/dynamic-size-list.d.ts +13 -12
- package/es/components/virtual-list/components/dynamic-size-list.js +7 -7
- package/es/components/virtual-list/components/fixed-size-grid.d.ts +6 -6
- package/es/components/virtual-list/components/fixed-size-list.d.ts +13 -12
- package/es/components/virtual-list/components/fixed-size-list.js +8 -8
- package/es/components/virtual-list/components/scrollbar.js +59 -66
- package/es/components/virtual-list/defaults.d.ts +0 -4
- package/es/components/virtual-list/defaults.js +11 -15
- package/es/components/virtual-list/hooks/use-cache.d.ts +1 -1
- package/es/components/virtual-list/hooks/use-cache.js +6 -6
- package/es/components/virtual-list/hooks/use-wheel.js +1 -1
- package/es/components/virtual-list/index.d.ts +6 -4
- package/es/components/virtual-list/index.js +4 -4
- package/es/components/virtual-list/props.d.ts +11 -7
- package/es/components/virtual-list/props.js +24 -30
- package/es/components/virtual-list/types.d.ts +1 -1
- package/es/components/virtual-list/utils.d.ts +1 -2
- package/es/components/virtual-list/utils.js +16 -18
- package/es/hooks/index.d.ts +3 -1
- package/es/hooks/index.js +49 -46
- package/es/hooks/use-calc-input-width/index.d.ts +7 -0
- package/es/hooks/use-calc-input-width/index.js +17 -0
- package/es/hooks/use-composition/index.d.ts +12 -0
- package/es/hooks/use-composition/index.js +28 -0
- package/es/hooks/use-delayed-toggle/index.d.ts +8 -4
- package/es/hooks/use-delayed-toggle/index.js +52 -17
- package/es/hooks/use-empty-values/index.d.ts +16 -0
- package/es/hooks/use-empty-values/index.js +37 -0
- package/es/hooks/use-focus-controller/index.d.ts +27 -0
- package/es/hooks/use-focus-controller/index.js +38 -0
- package/es/hooks/use-id/index.d.ts +1 -1
- package/es/hooks/use-id/index.js +11 -11
- package/es/hooks/use-namespace/index.d.ts +5 -6
- package/es/hooks/use-namespace/index.js +13 -15
- package/es/index.js +459 -451
- package/es/package.json.d.ts +2 -2
- package/es/package.json.js +1 -1
- package/es/utils/helper.d.ts +1 -0
- package/es/utils/helper.js +3 -2
- package/es/utils/index.js +49 -48
- package/lib/components/alert/alert.vue.d.ts +1 -11
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/alert/index.d.ts +28 -76
- package/lib/components/autocomplete/autocomplete.vue.d.ts +14 -14
- package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
- package/lib/components/autocomplete/index.d.ts +42 -42
- package/lib/components/backtop/backtop.vue.d.ts +1 -15
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/backtop/index.d.ts +3 -9
- package/lib/components/backtop/types.cjs +1 -0
- package/lib/components/backtop/types.d.ts +14 -0
- package/lib/components/button/button-custom.d.ts +1 -1
- package/lib/components/button/button.vue.d.ts +3 -50
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/button/index.d.ts +39 -40
- package/lib/components/button/types.d.ts +47 -1
- package/lib/components/button/use-button.d.ts +5 -5
- package/lib/components/card/index.d.ts +3 -3
- package/lib/components/carousel/carousel.vue.d.ts +1 -1
- package/lib/components/carousel/index.d.ts +18 -18
- package/lib/components/carousel/use-carousel.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue.d.ts +1 -1
- package/lib/components/checkbox/index.d.ts +42 -42
- package/lib/components/color-picker/components/hue-slider.vue.d.ts +3 -3
- package/lib/components/color-picker/components/predefine.vue.d.ts +3 -3
- package/lib/components/color-picker/components/sv-panel.vue.d.ts +3 -3
- package/lib/components/config-provider/hooks/use-global-config.d.ts +3 -3
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/context-menu/index.cjs +1 -1
- package/lib/components/context-menu/types.cjs +1 -1
- package/lib/components/context-menu/types.d.ts +1 -1
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -0
- package/lib/components/date-picker/composables/use-basic-date-table.d.ts +188 -0
- package/lib/components/date-picker/composables/use-month-range-header.d.ts +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -0
- package/lib/components/date-picker/composables/use-panel-date-range.d.ts +29 -0
- package/lib/components/date-picker/composables/use-range-picker.cjs +1 -1
- package/lib/components/date-picker/composables/use-range-picker.d.ts +46 -42
- package/lib/components/date-picker/composables/use-shortcut.cjs +1 -1
- package/lib/components/date-picker/composables/use-year-range-header.cjs +1 -0
- package/lib/components/date-picker/composables/use-year-range-header.d.ts +16 -0
- package/lib/components/date-picker/constants.cjs +1 -1
- package/lib/components/date-picker/constants.d.ts +2 -15
- package/lib/components/date-picker/date-picker-com/basic-cell-render.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-cell-render.d.ts +3 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue.d.ts +14 -23
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue.d.ts +2 -2
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue.d.ts +50 -9
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +13 -3
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +16 -3
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue.d.ts +6 -3
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-year-range.vue.cjs +1 -0
- package/lib/components/date-picker/date-picker-com/panel-year-range.vue.d.ts +35 -0
- package/lib/components/date-picker/date-picker-com/panel-year-range.vue2.cjs +1 -0
- package/lib/components/date-picker/date-picker.cjs +1 -1
- package/lib/components/date-picker/date-picker.d.ts +70 -40
- package/lib/components/date-picker/date-picker.type.d.ts +2 -1
- package/lib/components/date-picker/index.cjs +1 -1
- package/lib/components/date-picker/index.d.ts +126 -68
- package/lib/components/date-picker/instance.cjs +1 -0
- package/lib/components/date-picker/instance.d.ts +9 -0
- package/lib/components/date-picker/panel-utils.cjs +1 -1
- package/lib/components/date-picker/panel-utils.d.ts +48 -0
- package/lib/components/date-picker/props/basic-cell.d.ts +2 -1
- package/lib/components/date-picker/props/basic-date-table.cjs +1 -1
- package/lib/components/date-picker/props/basic-date-table.d.ts +7 -2
- package/lib/components/date-picker/props/basic-month-table.d.ts +3 -2
- package/lib/components/date-picker/props/basic-year-table.cjs +1 -1
- package/lib/components/date-picker/props/basic-year-table.d.ts +23 -5
- package/lib/components/date-picker/props/date-picker.d.ts +26 -12
- package/lib/components/date-picker/props/panel-date-pick.d.ts +6 -1
- package/lib/components/date-picker/props/panel-date-range.d.ts +7 -1
- package/lib/components/date-picker/props/panel-month-range.cjs +1 -1
- package/lib/components/date-picker/props/panel-month-range.d.ts +3 -1
- package/lib/components/date-picker/props/panel-year-range.cjs +1 -0
- package/lib/components/date-picker/props/panel-year-range.d.ts +14 -0
- package/lib/components/date-picker/props/shared.cjs +1 -1
- package/lib/components/date-picker/props/shared.d.ts +9 -2
- package/lib/components/date-picker/style/css.cjs +1 -1
- package/lib/components/date-picker/style/css.d.ts +4 -0
- package/lib/components/date-picker/utils.cjs +1 -1
- package/lib/components/date-picker/utils.d.ts +9 -2
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/date-time-select/index.d.ts +1 -0
- package/lib/components/date-time-select/types.d.ts +4 -0
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +4 -4
- package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +6 -29
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue.d.ts +2 -3
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/form-label-wrap.cjs +1 -1
- package/lib/components/form/form.vue2.cjs +1 -1
- package/lib/components/form/hooks/use-form-common-props.cjs +1 -1
- package/lib/components/form/hooks/use-form-item.cjs +1 -1
- package/lib/components/form/index.d.ts +75 -48
- package/lib/components/form/types.d.ts +7 -1
- package/lib/components/form/utils.cjs +1 -1
- package/lib/components/form/utils.d.ts +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon/index.cjs +1 -1
- package/lib/components/icon/index.d.ts +0 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/link/index.d.ts +3 -3
- package/lib/components/md-code-demo/md-code-demo.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue.d.ts +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue.d.ts +2 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/modal/index.d.ts +33 -45
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue.d.ts +2 -2
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +24 -24
- package/lib/components/popconfirm/popconfirm.vue.d.ts +2 -2
- package/lib/components/popover/index.d.ts +5 -5
- package/lib/components/popover/popover.vue.d.ts +2 -2
- package/lib/components/popper/composables/use-content.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/progress/index.d.ts +3 -3
- package/lib/components/result/result.vue.d.ts +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
- package/lib/components/scrollbar/index.cjs +1 -1
- package/lib/components/select/defaults.cjs +1 -1
- package/lib/components/select/defaults.d.ts +99 -15
- package/lib/components/select/group-item.vue.cjs +1 -1
- package/lib/components/select/group-item.vue.d.ts +10 -5
- package/lib/components/select/group-item.vue2.cjs +1 -1
- package/lib/components/select/index.cjs +1 -1
- package/lib/components/select/index.d.ts +2782 -0
- package/lib/components/select/option-item.vue.cjs +1 -1
- package/lib/components/select/option-item.vue.d.ts +40 -26
- package/lib/components/select/option-item.vue2.cjs +1 -1
- package/lib/components/select/select-dropdown.cjs +1 -1
- package/lib/components/select/select-dropdown.d.ts +29 -3
- package/lib/components/select/select.types.d.ts +19 -11
- package/lib/components/select/select.vue.cjs +1 -1
- package/lib/components/select/select.vue.d.ts +2778 -0
- package/lib/components/select/select.vue2.cjs +1 -1
- package/lib/components/select/token.cjs +1 -1
- package/lib/components/select/token.d.ts +10 -12
- package/lib/components/select/useAllowCreate.cjs +1 -1
- package/lib/components/select/useAllowCreate.d.ts +3 -3
- package/lib/components/select/useOption.d.ts +3 -3
- package/lib/components/select/useProps.cjs +1 -0
- package/lib/components/select/useProps.d.ts +21 -0
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +940 -121
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/steps/index.d.ts +12 -12
- package/lib/components/super-form/component-map.cjs +1 -1
- package/lib/components/super-form/style/css.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue.d.ts +1 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +3 -1
- package/lib/components/switch/index.d.ts +6 -6
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/index.d.ts +24 -24
- package/lib/components/table/table.vue.d.ts +1 -1
- package/lib/components/tabs/tab-nav.vue.d.ts +2 -2
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue.d.ts +2 -1
- package/lib/components/time-picker/common/picker-range-trigger.vue.cjs +1 -0
- package/lib/components/time-picker/common/picker-range-trigger.vue.d.ts +84 -0
- package/lib/components/time-picker/common/picker-range-trigger.vue2.cjs +1 -0
- package/lib/components/time-picker/common/picker.vue.d.ts +71 -41
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-picker/common/props.cjs +1 -1
- package/lib/components/time-picker/common/props.d.ts +76 -12
- package/lib/components/time-picker/composables/use-time-panel.d.ts +4 -4
- package/lib/components/time-picker/composables/use-time-picker.d.ts +28 -29
- package/lib/components/time-picker/constants.cjs +1 -1
- package/lib/components/time-picker/constants.d.ts +5 -0
- package/lib/components/time-picker/index.cjs +1 -1
- package/lib/components/time-picker/index.d.ts +120 -74
- package/lib/components/time-picker/props/basic-time-spinner.d.ts +5 -4
- package/lib/components/time-picker/props/panel-time-picker.d.ts +2 -1
- package/lib/components/time-picker/props/panel-time-range.d.ts +2 -1
- package/lib/components/time-picker/props/shared.d.ts +4 -5
- package/lib/components/time-picker/style/css.cjs +1 -1
- package/lib/components/time-picker/style/css.d.ts +3 -0
- package/lib/components/time-picker/style/index.cjs +1 -1
- package/lib/components/time-picker/style/index.d.ts +3 -0
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.vue.d.ts +6 -6
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue.d.ts +4 -4
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue.d.ts +4 -4
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker.cjs +1 -1
- package/lib/components/time-picker/time-picker.d.ts +60 -37
- package/lib/components/time-picker/utils.cjs +1 -1
- package/lib/components/time-picker/utils.d.ts +5 -2
- package/lib/components/time-select/time-select.vue.d.ts +1 -1
- package/lib/components/timeline/index.d.ts +6 -6
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/index.d.ts +3 -3
- package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/utils.cjs +1 -1
- package/lib/components/tree/tree-node.vue.cjs +1 -1
- package/lib/components/tree/tree-node.vue.d.ts +33 -33
- package/lib/components/tree/tree-node.vue2.cjs +1 -1
- package/lib/components/upload/index.d.ts +15 -15
- package/lib/components/upload/upload-content.vue.d.ts +1 -1
- package/lib/components/upload/upload.vue.d.ts +1 -1
- package/lib/components/virtual-list/builders/build-grid.cjs +1 -1
- package/lib/components/virtual-list/builders/build-grid.d.ts +9 -9
- package/lib/components/virtual-list/builders/build-list.cjs +1 -1
- package/lib/components/virtual-list/builders/build-list.d.ts +13 -13
- package/lib/components/virtual-list/components/dynamic-size-grid.cjs +1 -1
- package/lib/components/virtual-list/components/dynamic-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/components/dynamic-size-list.cjs +1 -1
- package/lib/components/virtual-list/components/dynamic-size-list.d.ts +13 -12
- package/lib/components/virtual-list/components/fixed-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/components/fixed-size-list.cjs +1 -1
- package/lib/components/virtual-list/components/fixed-size-list.d.ts +13 -12
- package/lib/components/virtual-list/components/scrollbar.cjs +1 -1
- package/lib/components/virtual-list/defaults.cjs +1 -1
- package/lib/components/virtual-list/defaults.d.ts +0 -4
- package/lib/components/virtual-list/hooks/use-cache.cjs +1 -1
- package/lib/components/virtual-list/hooks/use-cache.d.ts +1 -1
- package/lib/components/virtual-list/hooks/use-wheel.cjs +1 -1
- package/lib/components/virtual-list/index.cjs +1 -1
- package/lib/components/virtual-list/index.d.ts +6 -4
- package/lib/components/virtual-list/props.cjs +1 -1
- package/lib/components/virtual-list/props.d.ts +11 -7
- package/lib/components/virtual-list/types.d.ts +1 -1
- package/lib/components/virtual-list/utils.cjs +1 -1
- package/lib/components/virtual-list/utils.d.ts +1 -2
- package/lib/hooks/index.cjs +1 -1
- package/lib/hooks/index.d.ts +3 -1
- package/lib/hooks/use-calc-input-width/index.cjs +1 -0
- package/lib/hooks/use-calc-input-width/index.d.ts +7 -0
- package/lib/hooks/use-composition/index.cjs +1 -0
- package/lib/hooks/use-composition/index.d.ts +12 -0
- package/lib/hooks/use-delayed-toggle/index.cjs +1 -1
- package/lib/hooks/use-delayed-toggle/index.d.ts +8 -4
- package/lib/hooks/use-empty-values/index.cjs +1 -0
- package/lib/hooks/use-empty-values/index.d.ts +16 -0
- package/lib/hooks/use-focus-controller/index.cjs +1 -0
- package/lib/hooks/use-focus-controller/index.d.ts +27 -0
- package/lib/hooks/use-id/index.cjs +2 -2
- package/lib/hooks/use-id/index.d.ts +1 -1
- package/lib/hooks/use-namespace/index.cjs +1 -1
- package/lib/hooks/use-namespace/index.d.ts +5 -6
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +2 -2
- package/lib/utils/helper.cjs +1 -1
- package/lib/utils/helper.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/common/var.scss +41 -0
- package/theme-style/src/date-picker/date-picker.scss +31 -31
- package/theme-style/src/date-picker/date-range-picker.scss +60 -37
- package/theme-style/src/date-picker/date-table.scss +20 -20
- package/theme-style/src/date-picker/month-table.scss +40 -25
- package/theme-style/src/date-picker/picker-panel.scss +27 -28
- package/theme-style/src/date-picker/picker.scss +60 -56
- package/theme-style/src/date-picker/time-picker.scss +21 -21
- package/theme-style/src/date-picker/time-range-picker.scss +6 -6
- package/theme-style/src/date-picker/time-spinner.scss +24 -22
- package/theme-style/src/date-picker/year-table.scss +61 -14
- package/theme-style/src/option-group.scss +7 -28
- package/theme-style/src/option.scss +46 -12
- package/theme-style/src/select-dropdown-v2.scss +31 -37
- package/theme-style/src/select.scss +136 -220
- package/theme-style/src/tabs.scss +6 -66
- package/theme-style/src/tabss.scss +4 -4
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-option-group.css +1 -1
- package/theme-style/vft-option.css +1 -1
- package/theme-style/vft-select-dropdown-v2.css +1 -1
- package/theme-style/vft-select.css +1 -1
- package/theme-style/vft-tabs.css +1 -1
- package/theme-style/vft-tabss.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/web-types.json +1 -1
- package/es/components/select/useInput.d.ts +0 -5
- package/es/components/select/useInput.js +0 -20
- package/es/components/select/util.d.ts +0 -2
- package/es/components/select/util.js +0 -18
- package/lib/components/select/useInput.cjs +0 -1
- package/lib/components/select/useInput.d.ts +0 -5
- package/lib/components/select/util.cjs +0 -1
- package/lib/components/select/util.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("dayjs");require("@vueuse/core");const S=require("@vft/utils"),m=require("../../../utils/helper.cjs");require("../../../utils/ns-cover.cjs");require("lodash-es");const Y=require("../../../hooks/use-namespace/index.cjs");require("../../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../../hooks/use-z-index/index.cjs");require("../../time-picker/index.cjs");const T=require("../props/basic-year-table.cjs"),V=require("../utils.cjs"),I=require("./basic-cell-render.cjs"),N=require("../../time-picker/utils.cjs"),K=["aria-selected","aria-label","tabindex","onKeydown"],$=e.defineComponent({__name:"basic-year-table",props:T.basicYearTableProps,emits:["changerange","pick","select"],setup(h,{expose:q,emit:C}){const O=(l,a)=>{const r=f(String(l)).locale(a).startOf("year"),n=r.endOf("year").dayOfYear();return N.rangeArr(n).map(s=>r.add(s,"day").toDate())},t=h,d=C,_=Y.useNamespace("year-table"),y=e.ref("zh-cn"),v=e.ref(),p=e.ref(),D=e.computed(()=>Math.floor(t.date.year()/10)*10),B=e.ref([[],[],[]]),k=e.ref(),x=e.ref(),w=e.computed(()=>{const l=B.value,a=f().locale(y.value).startOf("year");for(let r=0;r<3;r++){const o=l[r];for(let n=0;n<4&&!(r*4+n>=10);n++){let s=o[n];s||(s={row:r,column:n,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1}),s.type="normal";const u=r*4+n+D.value,i=f().year(u),c=t.rangeState.endDate||t.maxDate||t.rangeState.selecting&&t.minDate||null;s.inRange=!!(t.minDate&&i.isSameOrAfter(t.minDate,"year")&&c&&i.isSameOrBefore(c,"year"))||!!(t.minDate&&i.isSameOrBefore(t.minDate,"year")&&c&&i.isSameOrAfter(c,"year")),t.minDate?.isSameOrAfter(c)?(s.start=!!(c&&i.isSame(c,"year")),s.end=!!(t.minDate&&i.isSame(t.minDate,"year"))):(s.start=!!(t.minDate&&i.isSame(t.minDate,"year")),s.end=!!(c&&i.isSame(c,"year"))),a.isSame(i)&&(s.type="today"),s.text=u;const R=i.toDate();s.disabled=t.disabledDate&&t.disabledDate(R)||!1,o[n]=s}}return l}),M=()=>{p.value?.focus()},A=l=>{const a={},r=f().locale(y.value),o=l.text;return a.disabled=t.disabledDate?O(o,y.value).every(t.disabledDate):!1,a.today=r.year()===o,a.current=m.castArray(t.parsedValue).findIndex(n=>n.year()===o)>=0,l.inRange&&(a["in-range"]=!0,l.start&&(a["start-date"]=!0),l.end&&(a["end-date"]=!0)),a},b=l=>{const a=l.text;return m.castArray(t.date).findIndex(r=>r.year()===a)>=0},g=l=>{const a=l.target?.closest("td");if(!a||!a.textContent||S.hasClass(a,"disabled"))return;const r=a.cellIndex,n=a.parentNode.rowIndex*4+r+D.value,s=f().year(n);if(t.selectionMode==="range")t.rangeState.selecting?(t.minDate&&s>=t.minDate?d("pick",{minDate:t.minDate,maxDate:s}):d("pick",{minDate:s,maxDate:t.minDate}),d("select",!1)):(d("pick",{minDate:s,maxDate:null}),d("select",!0));else if(t.selectionMode==="years"){if(l.type==="keydown"){d("pick",m.castArray(t.parsedValue),!1);return}const u=V.getValidDateOfYear(s.startOf("year"),y.value,t.disabledDate),i=S.hasClass(a,"current")?m.castArray(t.parsedValue).filter(c=>c?.year()!==n):m.castArray(t.parsedValue).concat([u]);d("pick",i)}else d("pick",n)},E=l=>{if(!t.rangeState.selecting)return;const a=l.target?.closest("td");if(!a)return;const r=a.parentNode.rowIndex,o=a.cellIndex;w.value[r][o].disabled||(r!==k.value||o!==x.value)&&(k.value=r,x.value=o,d("changerange",{selecting:!0,endDate:f().year(D.value).add(r*4+o,"year")}))};return e.watch(()=>t.date,async()=>{v.value?.contains(document.activeElement)&&(await e.nextTick(),p.value?.focus())}),q({focus:M}),(l,a)=>(e.openBlock(),e.createElementBlock("table",{role:"grid","aria-label":"使用方向键与 Enter 键以选择年份",class:e.normalizeClass(e.unref(_).b()),onClick:g,onMousemove:E},[e.createElementVNode("tbody",{ref_key:"tbodyRef",ref:v},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(r,o)=>(e.openBlock(),e.createElementBlock("tr",{key:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(n,s)=>(e.openBlock(),e.createElementBlock("td",{key:`${o}_${s}`,ref_for:!0,ref:u=>b(n)&&(p.value=u),class:e.normalizeClass(["available",A(n)]),"aria-selected":b(n),"aria-label":String(n.text),tabindex:b(n)?0:-1,onKeydown:[e.withKeys(e.withModifiers(g,["prevent","stop"]),["space"]),e.withKeys(e.withModifiers(g,["prevent","stop"]),["enter"])]},[e.createVNode(e.unref(I.default),{cell:n},null,8,["cell"])],42,K))),128))]))),128))],512)],34))}});exports.default=$;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
sidebar?(_: {
|
|
4
4
|
class: string;
|
|
@@ -6,7 +6,7 @@ declare function __VLS_template(): {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
8
|
readonly parsedValue: {
|
|
9
|
-
readonly type: import("vue").PropType<import("vft/es/utils").EpPropMergeType<(new (...args: any[]) => Dayjs | Dayjs[]) | (() => Dayjs | Dayjs[]) | (((new (...args: any[]) => Dayjs | Dayjs[]) | (() => Dayjs | Dayjs[])) | null)[], unknown, unknown>>;
|
|
9
|
+
readonly type: import("vue").PropType<import("vft/es/utils").EpPropMergeType<(new (...args: any[]) => dayjs.Dayjs | dayjs.Dayjs[]) | (() => dayjs.Dayjs | dayjs.Dayjs[]) | (((new (...args: any[]) => dayjs.Dayjs | dayjs.Dayjs[]) | (() => dayjs.Dayjs | dayjs.Dayjs[])) | null)[], unknown, unknown>>;
|
|
10
10
|
readonly required: false;
|
|
11
11
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
12
12
|
__epPropKey: true;
|
|
@@ -24,13 +24,17 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
24
24
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
25
|
__epPropKey: true;
|
|
26
26
|
};
|
|
27
|
+
readonly dateFormat: StringConstructor;
|
|
28
|
+
readonly timeFormat: StringConstructor;
|
|
29
|
+
readonly showNow: import("vft/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
30
|
+
readonly showWeekNumber: BooleanConstructor;
|
|
27
31
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
32
|
"panel-change": (...args: any[]) => void;
|
|
29
33
|
pick: (...args: any[]) => void;
|
|
30
34
|
"set-picker-option": (...args: any[]) => void;
|
|
31
35
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
36
|
readonly parsedValue: {
|
|
33
|
-
readonly type: import("vue").PropType<import("vft/es/utils").EpPropMergeType<(new (...args: any[]) => Dayjs | Dayjs[]) | (() => Dayjs | Dayjs[]) | (((new (...args: any[]) => Dayjs | Dayjs[]) | (() => Dayjs | Dayjs[])) | null)[], unknown, unknown>>;
|
|
37
|
+
readonly type: import("vue").PropType<import("vft/es/utils").EpPropMergeType<(new (...args: any[]) => dayjs.Dayjs | dayjs.Dayjs[]) | (() => dayjs.Dayjs | dayjs.Dayjs[]) | (((new (...args: any[]) => dayjs.Dayjs | dayjs.Dayjs[]) | (() => dayjs.Dayjs | dayjs.Dayjs[])) | null)[], unknown, unknown>>;
|
|
34
38
|
readonly required: false;
|
|
35
39
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
36
40
|
__epPropKey: true;
|
|
@@ -48,12 +52,18 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
48
52
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
49
53
|
__epPropKey: true;
|
|
50
54
|
};
|
|
55
|
+
readonly dateFormat: StringConstructor;
|
|
56
|
+
readonly timeFormat: StringConstructor;
|
|
57
|
+
readonly showNow: import("vft/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
58
|
+
readonly showWeekNumber: BooleanConstructor;
|
|
51
59
|
}>> & Readonly<{
|
|
52
60
|
"onPanel-change"?: ((...args: any[]) => any) | undefined;
|
|
53
61
|
onPick?: ((...args: any[]) => any) | undefined;
|
|
54
62
|
"onSet-picker-option"?: ((...args: any[]) => any) | undefined;
|
|
55
63
|
}>, {
|
|
56
64
|
readonly format: string;
|
|
65
|
+
readonly showNow: import("vft/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
66
|
+
readonly showWeekNumber: boolean;
|
|
57
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
58
68
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
59
69
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$e=require("@vft/directives"),M=require("@vft/utils"),X=require("../../button/index.cjs"),P=require("../../icon/index.cjs"),Z=require("../../input/index.cjs");require("../../time-picker/index.cjs");require("../../tooltip/index.cjs");const d=require("../../../constants/aria.cjs");require("@vueuse/core");require("../../../utils/ns-cover.cjs");require("lodash-es");const ee=require("../../../hooks/use-namespace/index.cjs");require("../../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../../hooks/use-z-index/index.cjs");const v=require("dayjs"),Oe=require("../constants.cjs"),Se=require("../props/panel-date-pick.cjs"),Ie=require("./basic-date-table.vue2.cjs"),xe=require("./basic-month-table.vue2.cjs"),Fe=require("./basic-year-table.vue2.cjs"),Me=require("../../tooltip/constants.cjs"),te=require("../../time-picker/utils.cjs"),Ke=require("../../time-picker/time-picker-com/panel-time-pick.vue2.cjs"),Re=["onClick"],Ye=e.defineComponent({__name:"panel-date-pick",props:Se.panelDatePickProps,emits:["pick","set-picker-option","panel-change"],setup(ae,{emit:ne}){const le=(t,a,l)=>!0,u=ae,k=ne,c=ee.useNamespace("picker-panel"),V=ee.useNamespace("date-picker"),re=e.useAttrs(),oe=e.useSlots(),m=e.ref("zh-cn"),K=e.inject("EP_PICKER_BASE"),ue=e.inject(Me.TOOLTIP_INJECTION_KEY),{shortcuts:R,disabledDate:p,cellClassName:se,defaultTime:q,arrowControl:ie}=K.props,E=e.toRef(K.props,"defaultValue"),N=e.ref(),n=e.ref(v().locale(m.value)),B=e.ref(!1),Y=e.computed(()=>v(q).locale(m.value)),ce=e.computed(()=>n.value.month()),A=e.computed(()=>n.value.year()),U=e.ref([]),w=e.ref(null),C=e.ref(null),$=t=>U.value.length>0?le(t,U.value,u.format||"HH:mm:ss"):!0,L=t=>q&&!G.value&&!B.value?Y.value.year(t.year()).month(t.month()).date(t.date()):b.value?t.millisecond(0):t.startOf("day"),i=(t,...a)=>{if(!t)k("pick",t,...a);else if(M.isArray(t)){const l=t.map(L);k("pick",l,...a)}else k("pick",L(t),...a);w.value=null,C.value=null,B.value=!1},de=(t,a)=>{if(s.value==="date"){t=t;let l=u.parsedValue?u.parsedValue.year(t.year()).month(t.month()).date(t.date()):t;$(l),n.value=l,i(l,b.value||a)}else s.value==="week"?i(t.date):s.value==="dates"&&i(t,!0)},H=t=>{const a=t?"add":"subtract";n.value=n.value[a](1,"month"),z("month")},W=t=>{const a=n.value,l=t?"add":"subtract";n.value=o.value==="year"?a[l](10,"year"):a[l](1,"year"),z("year")},o=e.ref("date"),ve=e.computed(()=>{const t="年";if(o.value==="year"){const a=Math.floor(A.value/10)*10;return`${a} ${t} - ${a+9} ${t}`}return`${A.value} ${t}`}),me=t=>{const a=M.isFunction(t.value)?t.value():t.value;if(a){i(v(a).locale(m.value));return}t.onClick&&t.onClick({attrs:re,slots:oe,emit:k})},s=e.computed(()=>{const{type:t}=u;return["week","month","year","dates"].includes(t)?t:"date"}),fe=e.computed(()=>s.value==="date"?o.value:s.value),j=e.computed(()=>!!R.length),pe=async t=>{n.value=n.value.startOf("month").month(t),s.value==="month"?i(n.value,!1):(o.value="date",["month","year","date","week"].includes(s.value)&&(i(n.value,!0),await e.nextTick(),_())),z("month")},he=async t=>{s.value==="year"?(n.value=n.value.startOf("year").year(t),i(n.value,!1)):(n.value=n.value.year(t),o.value="month",["month","year","date","week"].includes(s.value)&&(i(n.value,!0),await e.nextTick(),_())),z("year")},T=async t=>{o.value=t,await e.nextTick(),_()},b=e.computed(()=>u.type==="datetime"||u.type==="datetimerange"),ke=e.computed(()=>b.value||s.value==="dates"),Ve=()=>{if(s.value==="dates")i(u.parsedValue);else{let t=u.parsedValue;if(!t){const a=v(q).locale(m.value),l=I();t=a.year(l.year()).month(l.month()).date(l.date())}n.value=t,i(t)}},ye=()=>{const a=v().locale(m.value).toDate();B.value=!0,(!p||!p(a))&&$(a)&&(n.value=v().locale(m.value),i(n.value))},O=e.computed(()=>te.extractTimeFormat(u.format)),J=e.computed(()=>te.extractDateFormat(u.format)),G=e.computed(()=>{if(C.value)return C.value;if(!(!u.parsedValue&&!E.value))return(u.parsedValue||n.value).format(O.value)}),we=e.computed(()=>{if(w.value)return w.value;if(!(!u.parsedValue&&!E.value))return(u.parsedValue||n.value).format(J.value)}),D=e.ref(!1),Ce=()=>{D.value=!0},Ee=()=>{D.value=!1},S=t=>({hour:t.hour(),minute:t.minute(),second:t.second(),year:t.year(),month:t.month(),date:t.date()}),be=(t,a,l)=>{const{hour:f,minute:h,second:x}=S(t),F=u.parsedValue?u.parsedValue.hour(f).minute(h).second(x):t;n.value=F,i(n.value,!0),l||(D.value=a)},De=t=>{const a=v(t,O.value).locale(m.value);if(a.isValid()&&$(a)){const{year:l,month:f,date:h}=S(n.value);n.value=a.year(l).month(f).date(h),C.value=null,D.value=!1,i(n.value,!0)}},ge=t=>{const a=v(t,J.value).locale(m.value);if(a.isValid()){if(p&&p(a.toDate()))return;const{hour:l,minute:f,second:h}=S(n.value);n.value=a.hour(l).minute(f).second(h),w.value=null,i(n.value,!0)}},Ne=t=>v.isDayjs(t)&&t.isValid()&&(p?!p(t.toDate()):!0),Te=t=>s.value==="dates"?t.map(a=>a.format(u.format)):t.format(u.format),_e=t=>v(t,u.format).locale(m.value),I=()=>{const t=v(E.value).locale(m.value);if(!E.value){const a=Y.value;return v().hour(a.hour()).minute(a.minute()).second(a.second()).locale(m.value)}return t},_=async()=>{["week","month","year","date"].includes(s.value)&&(N.value?.focus(),s.value==="week"&&Q(d.EVENT_CODE.down))},ze=t=>{const{code:a}=t;[d.EVENT_CODE.up,d.EVENT_CODE.down,d.EVENT_CODE.left,d.EVENT_CODE.right,d.EVENT_CODE.home,d.EVENT_CODE.end,d.EVENT_CODE.pageUp,d.EVENT_CODE.pageDown].includes(a)&&(Q(a),t.stopPropagation(),t.preventDefault()),[d.EVENT_CODE.enter,d.EVENT_CODE.space,d.EVENT_CODE.numpadEnter].includes(a)&&w.value===null&&C.value===null&&(t.preventDefault(),i(n.value,!1))},Q=t=>{const{up:a,down:l,left:f,right:h,home:x,end:F,pageUp:Pe,pageDown:qe}=d.EVENT_CODE,Be={year:{[a]:-4,[l]:4,[f]:-1,[h]:1,offset:(r,y)=>r.setFullYear(r.getFullYear()+y)},month:{[a]:-4,[l]:4,[f]:-1,[h]:1,offset:(r,y)=>r.setMonth(r.getMonth()+y)},week:{[a]:-1,[l]:1,[f]:-1,[h]:1,offset:(r,y)=>r.setDate(r.getDate()+y*7)},date:{[a]:-7,[l]:7,[f]:-1,[h]:1,[x]:r=>-r.getDay(),[F]:r=>-r.getDay()+6,[Pe]:r=>-new Date(r.getFullYear(),r.getMonth(),0).getDate(),[qe]:r=>new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),offset:(r,y)=>r.setDate(r.getDate()+y)}},g=n.value.toDate();for(;Math.abs(n.value.diff(g,"year",!0))<1;){const r=Be[fe.value];if(!r)return;if(r.offset(g,M.isFunction(r[t])?r[t](g):r[t]??0),p&&p(g))break;const y=v(g).locale(m.value);n.value=y,k("pick",y,!0);break}},z=t=>{k("panel-change",n.value.toDate(),t,o.value)};return e.watch(()=>s.value,t=>{if(["month","year"].includes(t)){o.value=t;return}o.value="date"},{immediate:!0}),e.watch(()=>o.value,()=>{ue?.updatePopper()}),e.watch(()=>E.value,t=>{t&&(n.value=I())},{immediate:!0}),e.watch(()=>u.parsedValue,t=>{if(t){if(s.value==="dates"||Array.isArray(t))return;n.value=t}else n.value=I()},{immediate:!0}),k("set-picker-option",["isValidValue",Ne]),k("set-picker-option",["formatToString",Te]),k("set-picker-option",["parseUserInput",_e]),k("set-picker-option",["handleFocusPicker",_]),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(c).b(),e.unref(V).b(),{"has-sidebar":t.$slots.sidebar||j.value,"has-time":b.value}])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("body-wrapper"))},[e.renderSlot(t.$slots,"sidebar",{class:e.normalizeClass(e.unref(c).e("sidebar"))}),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(c).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(R),(l,f)=>(e.openBlock(),e.createElementBlock("button",{key:f,type:"button",class:e.normalizeClass(e.unref(c).e("shortcut")),onClick:h=>me(l)},e.toDisplayString(l.text),11,Re))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("body"))},[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(V).e("time-header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(V).e("editor-wrap"))},[e.createVNode(e.unref(Z.VftInput),{placeholder:"选择日期","model-value":we.value,size:"small","validate-event":!1,onInput:a[0]||(a[0]=l=>w.value=l),onChange:ge},null,8,["model-value"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(V).e("editor-wrap"))},[e.createVNode(e.unref(Z.VftInput),{placeholder:"选择时间","model-value":G.value,size:"small","validate-event":!1,onFocus:Ce,onInput:a[1]||(a[1]=l=>C.value=l),onChange:De},null,8,["model-value"]),e.createVNode(e.unref(Ke.default),{visible:D.value,format:O.value,"time-arrow-control":e.unref(ie),"parsed-value":n.value,onPick:be},null,8,["visible","format","time-arrow-control","parsed-value"])],2)),[[e.unref($e.ClickOutside),Ee]])],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(V).e("header"),(o.value==="year"||o.value==="month")&&e.unref(V).e("header--bordered")])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(V).e("prev-btn"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["d-arrow-left",e.unref(c).e("icon-btn")]),onClick:a[2]||(a[2]=l=>W(!1))},[e.createVNode(e.unref(P.VftIcon),{icon:"icon-d-arrow-left"})],2),e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(c).e("icon-btn"),"arrow-left"]),onClick:a[3]||(a[3]=l=>H(!1))},[e.createVNode(e.unref(P.VftIcon),{icon:"icon-arrow-left"})],2),[[e.vShow,o.value==="date"]])],2),e.createElementVNode("span",{role:"button",class:e.normalizeClass(e.unref(V).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:a[4]||(a[4]=e.withKeys(l=>T("year"),["enter"])),onClick:a[5]||(a[5]=l=>T("year"))},e.toDisplayString(ve.value),35),e.withDirectives(e.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:e.normalizeClass([e.unref(V).e("header-label"),{active:o.value==="month"}]),onKeydown:a[6]||(a[6]=e.withKeys(l=>T("month"),["enter"])),onClick:a[7]||(a[7]=l=>T("month"))},e.toDisplayString(e.unref(Oe.datePickerConfig)["month"+(ce.value+1)]),35),[[e.vShow,o.value==="date"]]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(V).e("next-btn"))},[e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(c).e("icon-btn"),"arrow-right"]),onClick:a[8]||(a[8]=l=>H(!0))},[e.createVNode(e.unref(P.VftIcon),{icon:"icon-arrow-right"})],2),[[e.vShow,o.value==="date"]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(c).e("icon-btn"),"d-arrow-right"]),onClick:a[9]||(a[9]=l=>W(!0))},[e.createVNode(e.unref(P.VftIcon),{icon:"icon-d-arrow-right"})],2)],2)],2),[[e.vShow,o.value!=="time"]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("content")),onKeydown:ze},[o.value==="date"?(e.openBlock(),e.createBlock(Ie.default,{key:0,ref_key:"currentViewRef",ref:N,"selection-mode":s.value,date:n.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(p),"cell-class-name":e.unref(se),onPick:de},null,8,["selection-mode","date","parsed-value","disabled-date","cell-class-name"])):e.createCommentVNode("",!0),o.value==="year"?(e.openBlock(),e.createBlock(Fe.default,{key:1,ref_key:"currentViewRef",ref:N,date:n.value,"disabled-date":e.unref(p),"parsed-value":t.parsedValue,onPick:he},null,8,["date","disabled-date","parsed-value"])):e.createCommentVNode("",!0),o.value==="month"?(e.openBlock(),e.createBlock(xe.default,{key:2,ref_key:"currentViewRef",ref:N,date:n.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(p),onPick:pe},null,8,["date","parsed-value","disabled-date"])):e.createCommentVNode("",!0)],34)],2)],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("footer"))},[e.withDirectives(e.createVNode(e.unref(X.VftButton),{text:"",size:"small",class:e.normalizeClass(e.unref(c).e("link-btn")),onClick:ye},{default:e.withCtx(()=>a[10]||(a[10]=[e.createTextVNode(" 现在 ")])),_:1,__:[10]},8,["class"]),[[e.vShow,s.value!=="dates"]]),e.createVNode(e.unref(X.VftButton),{plain:"",size:"small",class:e.normalizeClass(e.unref(c).e("link-btn")),onClick:Ve},{default:e.withCtx(()=>a[11]||(a[11]=[e.createTextVNode(" 确认 ")])),_:1,__:[11]},8,["class"])],2),[[e.vShow,ke.value&&o.value==="date"]])],2))}});exports.default=Ye;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("dayjs"),ae=require("../../button/index.cjs"),Ye=require("@vft/directives");require("@vueuse/core");const C=require("@vft/utils"),p=require("../../../constants/aria.cjs");require("../../../utils/ns-cover.cjs");require("lodash-es");const ne=require("../../../hooks/use-namespace/index.cjs");require("../../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../../hooks/use-z-index/index.cjs");const le=require("../../input/index.cjs");require("../../time-picker/index.cjs");const I=require("../../icon/index.cjs");require("../../tooltip/index.cjs");const xe=require("../props/panel-date-pick.cjs"),D=require("../utils.cjs"),Ke=require("../constants.cjs"),Re=require("./basic-date-table.vue2.cjs"),Ae=require("./basic-month-table.vue2.cjs"),Ue=require("./basic-year-table.vue2.cjs"),Le=require("../../time-picker/constants.cjs"),Je=require("../../tooltip/constants.cjs"),re=require("../../time-picker/utils.cjs"),We=require("../../time-picker/time-picker-com/panel-time-pick.vue2.cjs"),je=["onClick"],He=e.defineComponent({__name:"panel-date-pick",props:xe.panelDatePickProps,emits:["pick","set-picker-option","panel-change"],setup(oe,{emit:ue}){const se=(t,a,l)=>!0,r=oe,V=ue,v=ne.useNamespace("picker-panel"),k=ne.useNamespace("date-picker"),ie=e.useAttrs(),ce=e.useSlots(),c=e.ref("zh-cn"),A=e.inject(Le.PICKER_BASE_INJECTION_KEY),U=e.inject(Ke.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY),de=e.inject(Je.TOOLTIP_INJECTION_KEY),{shortcuts:L,disabledDate:i,cellClassName:ve,defaultTime:B}=A.props,E=e.toRef(A.props,"defaultValue"),P=e.ref(),n=e.ref(h().locale(c.value)),F=e.ref(!1);let $=!1;const J=e.computed(()=>h(B).locale(c.value)),me=e.computed(()=>n.value.month()),W=e.computed(()=>n.value.year()),j=e.ref([]),w=e.ref(null),b=e.ref(null),S=t=>j.value.length>0?se(t,j.value,r.format||"HH:mm:ss"):!0,H=t=>B&&!ee.value&&!F.value&&!$?J.value.year(t.year()).month(t.month()).date(t.date()):N.value?t.millisecond(0):t.startOf("day"),d=(t,...a)=>{if(!t)V("pick",t,...a);else if(C.isArray(t)){const l=t.map(H);V("pick",l,...a)}else V("pick",H(t),...a);w.value=null,b.value=null,F.value=!1,$=!1},fe=async(t,a)=>{if(s.value==="date"){t=t;let l=r.parsedValue?r.parsedValue.year(t.year()).month(t.month()).date(t.date()):t;S(l),n.value=l,d(l,N.value||a),r.type==="datetime"&&(await e.nextTick(),T())}else s.value==="week"?d(t.date):s.value==="dates"&&d(t,!0)},G=t=>{const a=t?"add":"subtract";n.value=n.value[a](1,"month"),z("month")},Q=t=>{const a=n.value,l=t?"add":"subtract";n.value=u.value==="year"?a[l](10,"year"):a[l](1,"year"),z("year")},u=e.ref("date"),pe=e.computed(()=>{const t="年";if(u.value==="year"){const a=Math.floor(W.value/10)*10;return`${a} ${t} - ${a+9} ${t}`}return`${W.value} ${t}`}),he=t=>{const a=C.isFunction(t.value)?t.value():t.value;if(a){$=!0,d(h(a).locale(c.value));return}t.onClick&&t.onClick({attrs:ie,slots:ce,emit:V})},s=e.computed(()=>{const{type:t}=r;return["week","month","months","year","years","dates"].includes(t)?t:"date"}),M=e.computed(()=>s.value==="dates"||s.value==="months"||s.value==="years"),Ve=e.computed(()=>s.value==="date"?u.value:s.value),X=e.computed(()=>!!L.length),ke=async(t,a)=>{s.value==="month"?(n.value=D.getValidDateOfMonth(n.value,n.value.year(),t,c.value,i),d(n.value,!1)):s.value==="months"?d(t,a??!0):(n.value=D.getValidDateOfMonth(n.value,n.value.year(),t,c.value,i),u.value="date",["month","year","date","week"].includes(s.value)&&(d(n.value,!0),await e.nextTick(),T())),z("month")},ye=async(t,a)=>{if(s.value==="year"){const l=n.value.startOf("year").year(t);n.value=D.getValidDateOfYear(l,c.value,i),d(n.value,!1)}else if(s.value==="years")d(t,a??!0);else{const l=n.value.year(t);n.value=D.getValidDateOfYear(l,c.value,i),u.value="month",["month","year","date","week"].includes(s.value)&&(d(n.value,!0),await e.nextTick(),T())}z("year")},q=async t=>{u.value=t,await e.nextTick(),T()},N=e.computed(()=>r.type==="datetime"||r.type==="datetimerange"),we=e.computed(()=>{const t=N.value||s.value==="dates",a=s.value==="years",l=s.value==="months",m=u.value==="date",f=u.value==="year",_=u.value==="month";return t&&m||a&&f||l&&_}),be=e.computed(()=>i?r.parsedValue?C.isArray(r.parsedValue)?i(r.parsedValue[0].toDate()):i(r.parsedValue.toDate()):!0:!1),Ce=()=>{if(M.value)d(r.parsedValue);else{let t=r.parsedValue;if(!t){const a=h(B).locale(c.value),l=K();t=a.year(l.year()).month(l.month()).date(l.date())}n.value=t,d(t)}},De=e.computed(()=>i?i(h().locale(c.value).toDate()):!1),Ee=()=>{const a=h().locale(c.value).toDate();F.value=!0,(!i||!i(a))&&S(a)&&(n.value=h().locale(c.value),d(n.value))},Y=e.computed(()=>r.timeFormat||re.extractTimeFormat(r.format)),Z=e.computed(()=>r.dateFormat||re.extractDateFormat(r.format)),ee=e.computed(()=>{if(b.value)return b.value;if(!(!r.parsedValue&&!E.value))return(r.parsedValue||n.value).format(Y.value)}),Ne=e.computed(()=>{if(w.value)return w.value;if(!(!r.parsedValue&&!E.value))return(r.parsedValue||n.value).format(Z.value)}),g=e.ref(!1),ge=()=>{g.value=!0},Te=()=>{g.value=!1},x=t=>({hour:t.hour(),minute:t.minute(),second:t.second(),year:t.year(),month:t.month(),date:t.date()}),_e=(t,a,l)=>{const{hour:m,minute:f,second:_}=x(t),R=r.parsedValue?r.parsedValue.hour(m).minute(f).second(_):t;n.value=R,d(n.value,!0),l||(g.value=a)},Oe=t=>{const a=h(t,Y.value).locale(c.value);if(a.isValid()&&S(a)){const{year:l,month:m,date:f}=x(n.value);n.value=a.year(l).month(m).date(f),b.value=null,g.value=!1,d(n.value,!0)}},Pe=t=>{const a=D.correctlyParseUserInput(t,Z.value,c.value,U);if(a.isValid()){if(i&&i(a.toDate()))return;const{hour:l,minute:m,second:f}=x(n.value);n.value=a.hour(l).minute(m).second(f),w.value=null,d(n.value,!0)}},qe=t=>h.isDayjs(t)&&t.isValid()&&(i?!i(t.toDate()):!0),ze=t=>C.isArray(t)?t.map(a=>a.format(r.format)):t.format(r.format),Ie=t=>D.correctlyParseUserInput(t,r.format,c.value,U),K=()=>{const t=h(E.value).locale(c.value);if(!E.value){const a=J.value;return h().hour(a.hour()).minute(a.minute()).second(a.second()).locale(c.value)}return t},T=()=>{["week","month","year","date"].includes(s.value)&&P.value?.focus()},Be=()=>{T(),s.value==="week"&&te(p.EVENT_CODE.down)},Fe=t=>{const{code:a}=t;[p.EVENT_CODE.up,p.EVENT_CODE.down,p.EVENT_CODE.left,p.EVENT_CODE.right,p.EVENT_CODE.home,p.EVENT_CODE.end,p.EVENT_CODE.pageUp,p.EVENT_CODE.pageDown].includes(a)&&(te(a),t.stopPropagation(),t.preventDefault()),[p.EVENT_CODE.enter,p.EVENT_CODE.space,p.EVENT_CODE.numpadEnter].includes(a)&&w.value===null&&b.value===null&&(t.preventDefault(),d(n.value,!1))},te=t=>{const{up:a,down:l,left:m,right:f,home:_,end:R,pageUp:$e,pageDown:Se}=p.EVENT_CODE,Me={year:{[a]:-4,[l]:4,[m]:-1,[f]:1,offset:(o,y)=>o.setFullYear(o.getFullYear()+y)},month:{[a]:-4,[l]:4,[m]:-1,[f]:1,offset:(o,y)=>o.setMonth(o.getMonth()+y)},week:{[a]:-1,[l]:1,[m]:-1,[f]:1,offset:(o,y)=>o.setDate(o.getDate()+y*7)},date:{[a]:-7,[l]:7,[m]:-1,[f]:1,[_]:o=>-o.getDay(),[R]:o=>-o.getDay()+6,[$e]:o=>-new Date(o.getFullYear(),o.getMonth(),0).getDate(),[Se]:o=>new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),offset:(o,y)=>o.setDate(o.getDate()+y)}},O=n.value.toDate();for(;Math.abs(n.value.diff(O,"year",!0))<1;){const o=Me[Ve.value];if(!o)return;if(o.offset(O,C.isFunction(o[t])?o[t](O):o[t]??0),i&&i(O))break;const y=h(O).locale(c.value);n.value=y,V("pick",y,!0);break}},z=t=>{V("panel-change",n.value.toDate(),t,u.value)};return e.watch(()=>s.value,t=>{if(["month","year"].includes(t)){u.value=t;return}else if(t==="years"){u.value="year";return}else if(t==="months"){u.value="month";return}u.value="date"},{immediate:!0}),e.watch(()=>u.value,()=>{de?.updatePopper()}),e.watch(()=>E.value,t=>{t&&(n.value=K())},{immediate:!0}),e.watch(()=>r.parsedValue,t=>{if(t){if(M.value||C.isArray(t))return;n.value=t}else n.value=K()},{immediate:!0}),V("set-picker-option",["isValidValue",qe]),V("set-picker-option",["formatToString",ze]),V("set-picker-option",["parseUserInput",Ie]),V("set-picker-option",["handleFocusPicker",Be]),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(v).b(),e.unref(k).b(),{"has-sidebar":t.$slots.sidebar||X.value,"has-time":N.value}])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(v).e("body-wrapper"))},[e.renderSlot(t.$slots,"sidebar",{class:e.normalizeClass(e.unref(v).e("sidebar"))}),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(v).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(l,m)=>(e.openBlock(),e.createElementBlock("button",{key:m,type:"button",class:e.normalizeClass(e.unref(v).e("shortcut")),onClick:f=>he(l)},e.toDisplayString(l.text),11,je))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(v).e("body"))},[N.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(k).e("time-header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(k).e("editor-wrap"))},[e.createVNode(e.unref(le.VftInput),{placeholder:"选择日期","model-value":Ne.value,size:"small","validate-event":!1,onInput:a[0]||(a[0]=l=>w.value=l),onChange:Pe},null,8,["model-value"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(k).e("editor-wrap"))},[e.createVNode(e.unref(le.VftInput),{placeholder:"选择时间","model-value":ee.value,size:"small","validate-event":!1,onFocus:ge,onInput:a[1]||(a[1]=l=>b.value=l),onChange:Oe},null,8,["model-value"]),e.createVNode(e.unref(We.default),{visible:g.value,format:Y.value,"parsed-value":n.value,onPick:_e},null,8,["visible","format","parsed-value"])],2)),[[e.unref(Ye.ClickOutside),Te]])],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(k).e("header"),(u.value==="year"||u.value==="month")&&e.unref(k).e("header--bordered")])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(k).e("prev-btn"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["d-arrow-left",e.unref(v).e("icon-btn")]),onClick:a[2]||(a[2]=l=>Q(!1))},[e.createVNode(e.unref(I.VftIcon),{icon:"icon-d-arrow-left"})],2),e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(v).e("icon-btn"),"arrow-left"]),onClick:a[3]||(a[3]=l=>G(!1))},[e.createVNode(e.unref(I.VftIcon),{icon:"icon-arrow-left"})],2),[[e.vShow,u.value==="date"]])],2),e.createElementVNode("span",{role:"button",class:e.normalizeClass(e.unref(k).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:a[4]||(a[4]=e.withKeys(l=>q("year"),["enter"])),onClick:a[5]||(a[5]=l=>q("year"))},e.toDisplayString(pe.value),35),e.withDirectives(e.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:e.normalizeClass([e.unref(k).e("header-label"),{active:u.value==="month"}]),onKeydown:a[6]||(a[6]=e.withKeys(l=>q("month"),["enter"])),onClick:a[7]||(a[7]=l=>q("month"))},e.toDisplayString(me.value+1),35),[[e.vShow,u.value==="date"]]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(k).e("next-btn"))},[e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(v).e("icon-btn"),"arrow-right"]),onClick:a[8]||(a[8]=l=>G(!0))},[e.createVNode(e.unref(I.VftIcon),{icon:"icon-arrow-right"})],2),[[e.vShow,u.value==="date"]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(v).e("icon-btn"),"d-arrow-right"]),onClick:a[9]||(a[9]=l=>Q(!0))},[e.createVNode(e.unref(I.VftIcon),{icon:"icon-d-arrow-right"})],2)],2)],2),[[e.vShow,u.value!=="time"]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(v).e("content")),onKeydown:Fe},[u.value==="date"?(e.openBlock(),e.createBlock(Re.default,{key:0,ref_key:"currentViewRef",ref:P,"selection-mode":s.value,date:n.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(i),"cell-class-name":e.unref(ve),"show-week-number":t.showWeekNumber,onPick:fe},null,8,["selection-mode","date","parsed-value","disabled-date","cell-class-name","show-week-number"])):e.createCommentVNode("",!0),u.value==="year"?(e.openBlock(),e.createBlock(Ue.default,{key:1,ref_key:"currentViewRef",ref:P,"selection-mode":s.value,date:n.value,"disabled-date":e.unref(i),"parsed-value":t.parsedValue,onPick:ye},null,8,["selection-mode","date","disabled-date","parsed-value"])):e.createCommentVNode("",!0),u.value==="month"?(e.openBlock(),e.createBlock(Ae.default,{key:2,ref_key:"currentViewRef",ref:P,"selection-mode":s.value,date:n.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(i),onPick:ke},null,8,["selection-mode","date","parsed-value","disabled-date"])):e.createCommentVNode("",!0)],34)],2)],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(v).e("footer"))},[e.withDirectives(e.createVNode(e.unref(ae.VftButton),{text:"",size:"small",class:e.normalizeClass(e.unref(v).e("link-btn")),disabled:De.value,onClick:Ee},{default:e.withCtx(()=>a[10]||(a[10]=[e.createTextVNode(" 现在 ")])),_:1,__:[10]},8,["class","disabled"]),[[e.vShow,!M.value&&t.showNow]]),e.createVNode(e.unref(ae.VftButton),{plain:"",size:"small",class:e.normalizeClass(e.unref(v).e("link-btn")),disabled:be.value,onClick:Ce},{default:e.withCtx(()=>a[11]||(a[11]=[e.createTextVNode(" 确认 ")])),_:1,__:[11]},8,["class","disabled"])],2),[[e.vShow,we.value]])],2))}});exports.default=He;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
sidebar?(_: {
|
|
4
4
|
class: string;
|
|
@@ -6,8 +6,9 @@ declare function __VLS_template(): {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
8
|
readonly unlinkPanels: BooleanConstructor;
|
|
9
|
+
readonly visible: BooleanConstructor;
|
|
9
10
|
readonly parsedValue: {
|
|
10
|
-
readonly type: import("vue").PropType<Dayjs[]>;
|
|
11
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
11
12
|
readonly required: false;
|
|
12
13
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
14
|
__epPropKey: true;
|
|
@@ -18,6 +19,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
18
19
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
20
|
__epPropKey: true;
|
|
20
21
|
};
|
|
22
|
+
readonly dateFormat: StringConstructor;
|
|
23
|
+
readonly timeFormat: StringConstructor;
|
|
24
|
+
readonly showNow: import("vft/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
25
|
+
readonly showWeekNumber: BooleanConstructor;
|
|
21
26
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
27
|
"calendar-change": (...args: any[]) => void;
|
|
23
28
|
"panel-change": (...args: any[]) => void;
|
|
@@ -25,8 +30,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
25
30
|
"set-picker-option": (...args: any[]) => void;
|
|
26
31
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
32
|
readonly unlinkPanels: BooleanConstructor;
|
|
33
|
+
readonly visible: BooleanConstructor;
|
|
28
34
|
readonly parsedValue: {
|
|
29
|
-
readonly type: import("vue").PropType<Dayjs[]>;
|
|
35
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
30
36
|
readonly required: false;
|
|
31
37
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
32
38
|
__epPropKey: true;
|
|
@@ -37,13 +43,20 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
37
43
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
38
44
|
__epPropKey: true;
|
|
39
45
|
};
|
|
46
|
+
readonly dateFormat: StringConstructor;
|
|
47
|
+
readonly timeFormat: StringConstructor;
|
|
48
|
+
readonly showNow: import("vft/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
49
|
+
readonly showWeekNumber: BooleanConstructor;
|
|
40
50
|
}>> & Readonly<{
|
|
41
51
|
"onCalendar-change"?: ((...args: any[]) => any) | undefined;
|
|
42
52
|
"onPanel-change"?: ((...args: any[]) => any) | undefined;
|
|
43
53
|
onPick?: ((...args: any[]) => any) | undefined;
|
|
44
54
|
"onSet-picker-option"?: ((...args: any[]) => any) | undefined;
|
|
45
55
|
}>, {
|
|
56
|
+
readonly visible: boolean;
|
|
57
|
+
readonly showNow: import("vft/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
46
58
|
readonly unlinkPanels: boolean;
|
|
59
|
+
readonly showWeekNumber: boolean;
|
|
47
60
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
48
61
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
49
62
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ae=require("@vft/directives"),ne=require("@vft/utils"),le=require("../../button/index.cjs"),d=require("../../icon/index.cjs"),D=require("../../input/index.cjs");require("../../time-picker/index.cjs");const k=require("dayjs"),Se=require("../composables/use-range-picker.cjs"),Me=require("../props/panel-date-range.cjs"),$=require("../utils.cjs"),te=require("./basic-date-table.vue2.cjs"),re=require("../../time-picker/time-picker-com/panel-time-pick.vue2.cjs"),oe=require("../../time-picker/utils.cjs"),qe=["onClick"],$e=["disabled"],_e=["disabled"],Re=["disabled"],Ye=["disabled"],I="month",Fe=e.defineComponent({__name:"panel-date-range",props:Me.panelDateRangeProps,emits:["pick","set-picker-option","calendar-change","panel-change"],setup(ue,{emit:se}){const c=ue,p=se,T=e.inject("EP_PICKER_BASE"),{disabledDate:w,cellClassName:_,format:C,defaultTime:S,arrowControl:R,clearable:ie}=T.props,Y=e.toRef(T.props,"shortcuts"),F=e.toRef(T.props,"defaultValue"),m=e.ref("zh-cn"),t=e.ref(k().locale(m.value)),r=e.ref(k().locale(m.value).add(1,I)),{minDate:o,maxDate:u,rangeState:h,ppNs:s,drpNs:i,handleChangeRange:A,handleRangeConfirm:O,handleShortcutClick:ce,onSelect:U}=Se.useRangePicker(c,{defaultValue:F,leftDate:t,rightDate:r,unit:I,onParsedValueChanged:Te}),V=e.ref({min:null,max:null}),v=e.ref({min:null,max:null}),de=e.computed(()=>`${t.value.year()} 年 ${t.value.month()+1}月`),me=e.computed(()=>`${r.value.year()} 年 ${r.value.month()+1}月`),L=e.computed(()=>t.value.year()),M=e.computed(()=>t.value.month()),K=e.computed(()=>r.value.year()),G=e.computed(()=>r.value.month()),H=e.computed(()=>!!Y.value.length),ve=e.computed(()=>V.value.min!==null?V.value.min:o.value?o.value.format(q.value):""),fe=e.computed(()=>V.value.max!==null?V.value.max:u.value||o.value?(u.value||o.value).format(q.value):""),pe=e.computed(()=>v.value.min!==null?v.value.min:o.value?o.value.format(y.value):""),he=e.computed(()=>v.value.max!==null?v.value.max:u.value||o.value?(u.value||o.value).format(y.value):""),y=e.computed(()=>oe.extractTimeFormat(C)),q=e.computed(()=>oe.extractDateFormat(C)),be=()=>{t.value=t.value.subtract(1,"year"),c.unlinkPanels||(r.value=t.value.add(1,"month")),f("year")},ke=()=>{t.value=t.value.subtract(1,"month"),c.unlinkPanels||(r.value=t.value.add(1,"month")),f("month")},Ce=()=>{c.unlinkPanels?r.value=r.value.add(1,"year"):(t.value=t.value.add(1,"year"),r.value=t.value.add(1,"month")),f("year")},Ve=()=>{c.unlinkPanels?r.value=r.value.add(1,"month"):(t.value=t.value.add(1,"month"),r.value=t.value.add(1,"month")),f("month")},ge=()=>{t.value=t.value.add(1,"year"),f("year")},Ne=()=>{t.value=t.value.add(1,"month"),f("month")},ye=()=>{r.value=r.value.subtract(1,"year"),f("year")},ze=()=>{r.value=r.value.subtract(1,"month"),f("month")},f=l=>{p("panel-change",[t.value.toDate(),r.value.toDate()],l)},P=e.computed(()=>{const l=(M.value+1)%12,a=M.value+1>=12?1:0;return c.unlinkPanels&&new Date(L.value+a,l)<new Date(K.value,G.value)}),B=e.computed(()=>c.unlinkPanels&&K.value*12+G.value-(L.value*12+M.value+1)>=12),we=e.computed(()=>!(o.value&&u.value&&!h.value.selecting&&$.isValidRange([o.value,u.value]))),E=e.computed(()=>c.type==="datetime"||c.type==="datetimerange"),J=(l,a)=>{if(l)return S?k(S[a]||S).locale(m.value).year(l.year()).month(l.month()).date(l.date()):l},Q=(l,a=!0)=>{const n=l.minDate,b=l.maxDate,z=J(n,0),x=J(b,1);u.value===x&&o.value===z||(p("calendar-change",[n.toDate(),b&&b.toDate()]),u.value=x,o.value=z,!(!a||E.value)&&O())},g=e.ref(!1),N=e.ref(!1),Pe=()=>{g.value=!1},Be=()=>{N.value=!1},W=(l,a)=>{V.value[a]=l;const n=k(l,q.value).locale(m.value);if(n.isValid()){if(w&&w(n.toDate()))return;a==="min"?(t.value=n,o.value=(o.value||t.value).year(n.year()).month(n.month()).date(n.date()),c.unlinkPanels||(r.value=n.add(1,"month"),u.value=o.value.add(1,"month"))):(r.value=n,u.value=(u.value||r.value).year(n.year()).month(n.month()).date(n.date()),c.unlinkPanels||(t.value=n.subtract(1,"month"),o.value=u.value.subtract(1,"month")))}},X=(l,a)=>{V.value[a]=null},Z=(l,a)=>{v.value[a]=l;const n=k(l,y.value).locale(m.value);n.isValid()&&(a==="min"?(g.value=!0,o.value=(o.value||t.value).hour(n.hour()).minute(n.minute()).second(n.second()),(!u.value||u.value.isBefore(o.value))&&(u.value=o.value)):(N.value=!0,u.value=(u.value||r.value).hour(n.hour()).minute(n.minute()).second(n.second()),r.value=u.value,u.value&&u.value.isBefore(o.value)&&(o.value=u.value)))},j=(l,a)=>{v.value[a]=null,a==="min"?(t.value=o.value,g.value=!1):(r.value=u.value,N.value=!1)},Ee=(l,a,n)=>{v.value.min||(l&&(t.value=l,o.value=(o.value||t.value).hour(l.hour()).minute(l.minute()).second(l.second())),n||(g.value=a),(!u.value||u.value.isBefore(o.value))&&(u.value=o.value,r.value=l))},xe=(l,a,n)=>{v.value.max||(l&&(r.value=l,u.value=(u.value||r.value).hour(l.hour()).minute(l.minute()).second(l.second())),n||(N.value=a),u.value&&u.value.isBefore(o.value)&&(o.value=u.value))},ee=()=>{t.value=$.getDefaultValue(e.unref(F),{lang:e.unref(m),unit:"month",unlinkPanels:c.unlinkPanels})[0],r.value=t.value.add(1,"month"),p("pick",null)},De=l=>ne.isArray(l)?l.map(a=>a.format(C)):l.format(C),Ie=l=>ne.isArray(l)?l.map(a=>k(a,C).locale(m.value)):k(l,C).locale(m.value);function Te(l,a){if(c.unlinkPanels&&a){const n=l?.year()||0,b=l?.month()||0,z=a.year(),x=a.month();r.value=n===z&&b===x?a.add(1,I):a}else r.value=t.value.add(1,I),a&&(r.value=r.value.hour(a.hour()).minute(a.minute()).second(a.second()))}return p("set-picker-option",["isValidValue",$.isValidRange]),p("set-picker-option",["parseUserInput",Ie]),p("set-picker-option",["formatToString",De]),p("set-picker-option",["handleClear",ee]),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(s).b(),e.unref(i).b(),{"has-sidebar":l.$slots.sidebar||H.value,"has-time":E.value}])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("body-wrapper"))},[e.renderSlot(l.$slots,"sidebar",{class:e.normalizeClass(e.unref(s).e("sidebar"))}),H.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(n,b)=>(e.openBlock(),e.createElementBlock("button",{key:b,type:"button",class:e.normalizeClass(e.unref(s).e("shortcut")),onClick:z=>e.unref(ce)(n)},e.toDisplayString(n.text),11,qe))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("body"))},[E.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i).e("time-header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(i).e("editors-wrap"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(i).e("time-picker-wrap"))},[e.createVNode(e.unref(D.VftInput),{size:"small",disabled:e.unref(h).selecting,placeholder:"开始日期",class:e.normalizeClass(e.unref(i).e("editor")),"model-value":ve.value,"validate-event":!1,onInput:a[0]||(a[0]=n=>W(n,"min")),onChange:a[1]||(a[1]=n=>X(n,"min"))},null,8,["disabled","class","model-value"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(i).e("time-picker-wrap"))},[e.createVNode(e.unref(D.VftInput),{size:"small",class:e.normalizeClass(e.unref(i).e("editor")),disabled:e.unref(h).selecting,placeholder:"开始时间","model-value":pe.value,"validate-event":!1,onFocus:a[2]||(a[2]=n=>g.value=!0),onInput:a[3]||(a[3]=n=>Z(n,"min")),onChange:a[4]||(a[4]=n=>j(n,"min"))},null,8,["class","disabled","model-value"]),e.createVNode(e.unref(re.default),{visible:g.value,format:y.value,"datetime-role":"start","time-arrow-control":e.unref(R),"parsed-value":t.value,onPick:Ee},null,8,["visible","format","time-arrow-control","parsed-value"])],2)),[[e.unref(ae.ClickOutside),Pe]])],2),e.createElementVNode("span",null,[e.createVNode(e.unref(d.VftIcon),{icon:"icon-arrow-right"})]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(i).e("editors-wrap"),"is-right"])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(i).e("time-picker-wrap"))},[e.createVNode(e.unref(D.VftInput),{size:"small",class:e.normalizeClass(e.unref(i).e("editor")),disabled:e.unref(h).selecting,placeholder:"结束日期","model-value":fe.value,readonly:!e.unref(o),"validate-event":!1,onInput:a[5]||(a[5]=n=>W(n,"max")),onChange:a[6]||(a[6]=n=>X(n,"max"))},null,8,["class","disabled","model-value","readonly"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(i).e("time-picker-wrap"))},[e.createVNode(e.unref(D.VftInput),{size:"small",class:e.normalizeClass(e.unref(i).e("editor")),disabled:e.unref(h).selecting,placeholder:"结束时间","model-value":he.value,readonly:!e.unref(o),"validate-event":!1,onFocus:a[7]||(a[7]=n=>e.unref(o)&&(N.value=!0)),onInput:a[8]||(a[8]=n=>Z(n,"max")),onChange:a[9]||(a[9]=n=>j(n,"max"))},null,8,["class","disabled","model-value","readonly"]),e.createVNode(e.unref(re.default),{"datetime-role":"end",visible:N.value,format:y.value,"time-arrow-control":e.unref(R),"parsed-value":r.value,onPick:xe},null,8,["visible","format","time-arrow-control","parsed-value"])],2)),[[e.unref(ae.ClickOutside),Be]])],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([[e.unref(s).e("content"),e.unref(i).e("content")],"is-left"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("header"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(s).e("icon-btn"),"d-arrow-left"]),onClick:be},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-d-arrow-left"})],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(s).e("icon-btn"),"arrow-left"]),onClick:ke},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-arrow-left"})],2),l.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!B.value,class:e.normalizeClass([[e.unref(s).e("icon-btn"),{"is-disabled":!B.value}],"d-arrow-right"]),onClick:ge},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-d-arrow-right"})],10,$e)):e.createCommentVNode("",!0),l.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:!P.value,class:e.normalizeClass([[e.unref(s).e("icon-btn"),{"is-disabled":!P.value}],"arrow-right"]),onClick:Ne},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-arrow-right"})],10,_e)):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(de.value),1)],2),e.createVNode(te.default,{"selection-mode":"range",date:t.value,"min-date":e.unref(o),"max-date":e.unref(u),"range-state":e.unref(h),"disabled-date":e.unref(w),"cell-class-name":e.unref(_),onChangerange:e.unref(A),onPick:Q,onSelect:e.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2),e.createElementVNode("div",{class:e.normalizeClass([[e.unref(s).e("content"),e.unref(i).e("content")],"is-right"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("header"))},[l.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!B.value,class:e.normalizeClass([[e.unref(s).e("icon-btn"),{"is-disabled":!B.value}],"d-arrow-left"]),onClick:ye},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-d-arrow-left"})],10,Re)):e.createCommentVNode("",!0),l.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:!P.value,class:e.normalizeClass([[e.unref(s).e("icon-btn"),{"is-disabled":!P.value}],"arrow-left"]),onClick:ze},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-arrow-left"})],10,Ye)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(s).e("icon-btn"),"d-arrow-right"]),onClick:Ce},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-d-arrow-right"})],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(s).e("icon-btn"),"arrow-right"]),onClick:Ve},[e.createVNode(e.unref(d.VftIcon),{icon:"icon-arrow-right"})],2),e.createElementVNode("div",null,e.toDisplayString(me.value),1)],2),e.createVNode(te.default,{"selection-mode":"range",date:r.value,"min-date":e.unref(o),"max-date":e.unref(u),"range-state":e.unref(h),"disabled-date":e.unref(w),"cell-class-name":e.unref(_),onChangerange:e.unref(A),onPick:Q,onSelect:e.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2)],2)],2),E.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("footer"))},[e.unref(ie)?(e.openBlock(),e.createBlock(e.unref(le.VftButton),{key:0,text:"",size:"small",class:e.normalizeClass(e.unref(s).e("link-btn")),onClick:ee},{default:e.withCtx(()=>a[11]||(a[11]=[e.createTextVNode(" 清除 ")])),_:1,__:[11]},8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(le.VftButton),{plain:"",size:"small",class:e.normalizeClass(e.unref(s).e("link-btn")),disabled:we.value,onClick:a[10]||(a[10]=n=>e.unref(O)(!1))},{default:e.withCtx(()=>a[12]||(a[12]=[e.createTextVNode(" 确认 ")])),_:1,__:[12]},8,["class","disabled"])],2)):e.createCommentVNode("",!0)],2))}});exports.default=Fe;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("dayjs"),ue=require("@vft/directives"),We=require("@vft/utils"),se=require("../../button/index.cjs"),_=require("../../input/index.cjs");require("../../time-picker/index.cjs");const f=require("../../icon/index.cjs"),je=require("../props/panel-date-range.cjs"),Ge=require("../composables/use-range-picker.cjs"),$=require("../utils.cjs"),He=require("../composables/use-panel-date-range.cjs"),Qe=require("../constants.cjs"),ie=require("./basic-year-table.vue2.cjs"),de=require("./basic-month-table.vue2.cjs"),ce=require("./basic-date-table.vue2.cjs"),me=require("../../time-picker/time-picker-com/panel-time-pick.vue2.cjs"),Xe=require("../../time-picker/constants.cjs"),ve=require("../../time-picker/utils.cjs"),Ze=["onClick"],ea=["disabled"],aa=["disabled"],na=["disabled"],ta=["disabled"],Y="month",la=e.defineComponent({__name:"panel-date-range",props:je.panelDateRangeProps,emits:["pick","set-picker-option","calendar-change","panel-change"],setup(fe,{emit:pe}){const d=fe,b=pe,D=e.inject(Xe.PICKER_BASE_INJECTION_KEY),ke=e.inject(Qe.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY),{disabledDate:c,cellClassName:U,defaultTime:I,clearable:he}=D.props,N=e.toRef(D.props,"format"),J=e.toRef(D.props,"shortcuts"),W=e.toRef(D.props,"defaultValue"),C=e.ref("zh-cn"),o=e.ref(E().locale(C.value)),u=e.ref(E().locale(C.value).add(1,Y)),{minDate:l,maxDate:r,rangeState:p,ppNs:i,drpNs:s,handleChangeRange:j,handleRangeConfirm:G,handleShortcutClick:be,onSelect:F,onReset:Ce}=Ge.useRangePicker(d,{defaultValue:W,defaultTime:I,leftDate:o,rightDate:u,unit:Y,onParsedValueChanged:Je});e.watch(()=>d.visible,t=>{!t&&p.value.selecting&&(Ce(d.parsedValue),F(!1))});const g=e.ref({min:null,max:null}),k=e.ref({min:null,max:null}),{leftCurrentView:v,rightCurrentView:m,leftCurrentViewRef:K,rightCurrentViewRef:O,leftYear:H,rightYear:Q,leftMonth:A,rightMonth:X,leftYearLabel:Ve,rightYearLabel:ge,showLeftPicker:R,showRightPicker:T,handleLeftYearPick:we,handleRightYearPick:ye,handleLeftMonthPick:Ne,handleRightMonthPick:Pe,handlePanelChange:h,adjustDateByView:P}=He.usePanelDateRange(d,b,o,u),Z=e.computed(()=>!!J.value.length),Be=e.computed(()=>g.value.min!==null?g.value.min:l.value?l.value.format(L.value):""),ze=e.computed(()=>g.value.max!==null?g.value.max:r.value||l.value?(r.value||l.value).format(L.value):""),Ee=e.computed(()=>k.value.min!==null?k.value.min:l.value?l.value.format(B.value):""),De=e.computed(()=>k.value.max!==null?k.value.max:r.value||l.value?(r.value||l.value).format(B.value):""),B=e.computed(()=>d.timeFormat||ve.extractTimeFormat(N.value)),L=e.computed(()=>d.dateFormat||ve.extractDateFormat(N.value)),Ie=t=>$.isValidRange(t)&&(c?!c(t[0].toDate())&&!c(t[1].toDate()):!0),Re=()=>{o.value=P(v.value,o.value,!1),d.unlinkPanels||(u.value=o.value.add(1,"month")),h("year")},Te=()=>{o.value=o.value.subtract(1,"month"),d.unlinkPanels||(u.value=o.value.add(1,"month")),h("month")},xe=()=>{d.unlinkPanels?u.value=P(m.value,u.value,!0):(o.value=P(m.value,o.value,!0),u.value=o.value.add(1,"month")),h("year")},Se=()=>{d.unlinkPanels?u.value=u.value.add(1,"month"):(o.value=o.value.add(1,"month"),u.value=o.value.add(1,"month")),h("month")},Me=()=>{o.value=P(v.value,o.value,!0),h("year")},qe=()=>{o.value=o.value.add(1,"month"),h("month")},_e=()=>{u.value=P(m.value,u.value,!1),h("year")},$e=()=>{u.value=u.value.subtract(1,"month"),h("month")},x=e.computed(()=>{const t=(A.value+1)%12,a=A.value+1>=12?1:0;return d.unlinkPanels&&new Date(H.value+a,t)<new Date(Q.value,X.value)}),S=e.computed(()=>d.unlinkPanels&&Q.value*12+X.value-(H.value*12+A.value+1)>=12),Ye=e.computed(()=>!(l.value&&r.value&&!p.value.selecting&&$.isValidRange([l.value,r.value]))),M=e.computed(()=>d.type==="datetime"||d.type==="datetimerange"),ee=(t,a)=>{if(t)return I?E(I[a]||I).locale(C.value).year(t.year()).month(t.month()).date(t.date()):t},ae=(t,a=!0)=>{const n=t.minDate,V=t.maxDate,z=ee(n,0),q=ee(V,1);r.value===q&&l.value===z||(b("calendar-change",[n.toDate(),V&&V.toDate()]),r.value=q,l.value=z,!(!a||M.value)&&G())},w=e.ref(!1),y=e.ref(!1),Fe=()=>{w.value=!1},Ke=()=>{y.value=!1},ne=(t,a)=>{g.value[a]=t;const n=E(t,L.value).locale(C.value);if(n.isValid()){if(c&&c(n.toDate()))return;a==="min"?(o.value=n,l.value=(l.value||o.value).year(n.year()).month(n.month()).date(n.date()),!d.unlinkPanels&&(!r.value||r.value.isBefore(l.value))&&(u.value=n.add(1,"month"),r.value=l.value.add(1,"month"))):(u.value=n,r.value=(r.value||u.value).year(n.year()).month(n.month()).date(n.date()),!d.unlinkPanels&&(!l.value||l.value.isAfter(r.value))&&(o.value=n.subtract(1,"month"),l.value=r.value.subtract(1,"month")))}},te=(t,a)=>{g.value[a]=null},le=(t,a)=>{k.value[a]=t;const n=E(t,B.value).locale(C.value);n.isValid()&&(a==="min"?(w.value=!0,l.value=(l.value||o.value).hour(n.hour()).minute(n.minute()).second(n.second())):(y.value=!0,r.value=(r.value||u.value).hour(n.hour()).minute(n.minute()).second(n.second()),u.value=r.value))},re=(t,a)=>{k.value[a]=null,a==="min"?(o.value=l.value,w.value=!1,(!r.value||r.value.isBefore(l.value))&&(r.value=l.value)):(u.value=r.value,y.value=!1,r.value&&r.value.isBefore(l.value)&&(l.value=r.value))},Oe=(t,a,n)=>{k.value.min||(t&&(o.value=t,l.value=(l.value||o.value).hour(t.hour()).minute(t.minute()).second(t.second())),n||(w.value=a),(!r.value||r.value.isBefore(l.value))&&(r.value=l.value,u.value=t))},Ae=(t,a,n)=>{k.value.max||(t&&(u.value=t,r.value=(r.value||u.value).hour(t.hour()).minute(t.minute()).second(t.second())),n||(y.value=a),r.value&&r.value.isBefore(l.value)&&(l.value=r.value))},oe=()=>{o.value=$.getDefaultValue(e.unref(W),{lang:e.unref(C),unit:"month",unlinkPanels:d.unlinkPanels})[0],u.value=o.value.add(1,"month"),r.value=void 0,l.value=void 0,b("pick",null)},Le=t=>We.isArray(t)?t.map(a=>a.format(N.value)):t.format(N.value),Ue=t=>$.correctlyParseUserInput(t,N.value,C.value,ke);function Je(t,a){if(d.unlinkPanels&&a){const n=t?.year()||0,V=t?.month()||0,z=a.year(),q=a.month();u.value=n===z&&V===q?a.add(1,Y):a}else u.value=o.value.add(1,Y),a&&(u.value=u.value.hour(a.hour()).minute(a.minute()).second(a.second()))}return b("set-picker-option",["isValidValue",Ie]),b("set-picker-option",["parseUserInput",Ue]),b("set-picker-option",["formatToString",Le]),b("set-picker-option",["handleClear",oe]),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(i).b(),e.unref(s).b(),{"has-sidebar":t.$slots.sidebar||Z.value,"has-time":M.value}])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("body-wrapper"))},[e.renderSlot(t.$slots,"sidebar",{class:e.normalizeClass(e.unref(i).e("sidebar"))}),Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,V)=>(e.openBlock(),e.createElementBlock("button",{key:V,type:"button",class:e.normalizeClass(e.unref(i).e("shortcut")),onClick:z=>e.unref(be)(n)},e.toDisplayString(n.text),11,Ze))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("body"))},[M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("time-header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("editors-wrap"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("time-picker-wrap"))},[e.createVNode(e.unref(_.VftInput),{size:"small",disabled:e.unref(p).selecting,placeholder:"开始日期",class:e.normalizeClass(e.unref(s).e("editor")),"model-value":Be.value,"validate-event":!1,onInput:a[0]||(a[0]=n=>ne(n,"min")),onChange:a[1]||(a[1]=n=>te(n,"min"))},null,8,["disabled","class","model-value"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(s).e("time-picker-wrap"))},[e.createVNode(e.unref(_.VftInput),{size:"small",class:e.normalizeClass(e.unref(s).e("editor")),disabled:e.unref(p).selecting,placeholder:"开始时间","model-value":Ee.value,"validate-event":!1,onFocus:a[2]||(a[2]=n=>w.value=!0),onInput:a[3]||(a[3]=n=>le(n,"min")),onChange:a[4]||(a[4]=n=>re(n,"min"))},null,8,["class","disabled","model-value"]),e.createVNode(e.unref(me.default),{visible:w.value,format:B.value,"datetime-role":"start","parsed-value":o.value,onPick:Oe},null,8,["visible","format","parsed-value"])],2)),[[e.unref(ue.ClickOutside),Fe]])],2),e.createElementVNode("span",null,[e.createVNode(e.unref(f.VftIcon),{icon:"icon-arrow-right"})]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("editors-wrap"),"is-right"])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("time-picker-wrap"))},[e.createVNode(e.unref(_.VftInput),{size:"small",class:e.normalizeClass(e.unref(s).e("editor")),disabled:e.unref(p).selecting,placeholder:"结束日期","model-value":ze.value,readonly:!e.unref(l),"validate-event":!1,onInput:a[5]||(a[5]=n=>ne(n,"max")),onChange:a[6]||(a[6]=n=>te(n,"max"))},null,8,["class","disabled","model-value","readonly"])],2),e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(s).e("time-picker-wrap"))},[e.createVNode(e.unref(_.VftInput),{size:"small",class:e.normalizeClass(e.unref(s).e("editor")),disabled:e.unref(p).selecting,placeholder:"结束时间","model-value":De.value,readonly:!e.unref(l),"validate-event":!1,onFocus:a[7]||(a[7]=n=>e.unref(l)&&(y.value=!0)),onInput:a[8]||(a[8]=n=>le(n,"max")),onChange:a[9]||(a[9]=n=>re(n,"max"))},null,8,["class","disabled","model-value","readonly"]),e.createVNode(e.unref(me.default),{"datetime-role":"end",visible:y.value,format:B.value,"parsed-value":u.value,onPick:Ae},null,8,["visible","format","parsed-value"])],2)),[[e.unref(ue.ClickOutside),Ke]])],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([[e.unref(i).e("content"),e.unref(s).e("content")],"is-left"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("header"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(i).e("icon-btn"),"d-arrow-left"]),onClick:Re},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-d-arrow-left"})],2),e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(i).e("icon-btn"),"arrow-left"]),onClick:Te},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-arrow-left"})],2),[[e.vShow,e.unref(v)==="date"]]),t.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!S.value,class:e.normalizeClass([[e.unref(i).e("icon-btn"),{"is-disabled":!S.value}],"d-arrow-right"]),onClick:Me},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-d-arrow-right"})],10,ea)):e.createCommentVNode("",!0),t.unlinkPanels&&e.unref(v)==="date"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:!x.value,class:e.normalizeClass([[e.unref(i).e("icon-btn"),{"is-disabled":!x.value}],"arrow-right"]),onClick:qe},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-arrow-right"})],10,aa)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("span",{role:"button",class:e.normalizeClass(e.unref(s).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:a[10]||(a[10]=e.withKeys(n=>e.unref(R)("year"),["enter"])),onClick:a[11]||(a[11]=n=>e.unref(R)("year"))},e.toDisplayString(e.unref(Ve)),35),e.withDirectives(e.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:e.normalizeClass([e.unref(s).e("header-label"),{active:e.unref(v)==="month"}]),onKeydown:a[12]||(a[12]=e.withKeys(n=>e.unref(R)("month"),["enter"])),onClick:a[13]||(a[13]=n=>e.unref(R)("month"))},e.toDisplayString(o.value.month()+1),35),[[e.vShow,e.unref(v)==="date"]])])],2),e.unref(v)==="date"?(e.openBlock(),e.createBlock(ce.default,{key:0,ref_key:"leftCurrentViewRef",ref:K,"selection-mode":"range",date:o.value,"min-date":e.unref(l),"max-date":e.unref(r),"range-state":e.unref(p),"disabled-date":e.unref(c),"cell-class-name":e.unref(U),"show-week-number":t.showWeekNumber,onChangerange:e.unref(j),onPick:ae,onSelect:e.unref(F)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","show-week-number","onChangerange","onSelect"])):e.createCommentVNode("",!0),e.unref(v)==="year"?(e.openBlock(),e.createBlock(ie.default,{key:1,ref_key:"leftCurrentViewRef",ref:K,"selection-mode":"year",date:o.value,"disabled-date":e.unref(c),"parsed-value":t.parsedValue,onPick:e.unref(we)},null,8,["date","disabled-date","parsed-value","onPick"])):e.createCommentVNode("",!0),e.unref(v)==="month"?(e.openBlock(),e.createBlock(de.default,{key:2,ref_key:"leftCurrentViewRef",ref:K,"selection-mode":"month",date:o.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(c),onPick:e.unref(Ne)},null,8,["date","parsed-value","disabled-date","onPick"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass([[e.unref(i).e("content"),e.unref(s).e("content")],"is-right"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("header"))},[t.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!S.value,class:e.normalizeClass([[e.unref(i).e("icon-btn"),{"is-disabled":!S.value}],"d-arrow-left"]),onClick:_e},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-d-arrow-left"})],10,na)):e.createCommentVNode("",!0),t.unlinkPanels&&e.unref(m)==="date"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:!x.value,class:e.normalizeClass([[e.unref(i).e("icon-btn"),{"is-disabled":!x.value}],"arrow-left"]),onClick:$e},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-arrow-left"})],10,ta)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(i).e("icon-btn"),"d-arrow-right"]),onClick:xe},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-d-arrow-right"})],2),e.withDirectives(e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(i).e("icon-btn"),"arrow-right"]),onClick:Se},[e.createVNode(e.unref(f.VftIcon),{icon:"icon-arrow-right"})],2),[[e.vShow,e.unref(m)==="date"]]),e.createElementVNode("div",null,[e.createElementVNode("span",{role:"button",class:e.normalizeClass(e.unref(s).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:a[14]||(a[14]=e.withKeys(n=>e.unref(T)("year"),["enter"])),onClick:a[15]||(a[15]=n=>e.unref(T)("year"))},e.toDisplayString(e.unref(ge)),35),e.withDirectives(e.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:e.normalizeClass([e.unref(s).e("header-label"),{active:e.unref(m)==="month"}]),onKeydown:a[16]||(a[16]=e.withKeys(n=>e.unref(T)("month"),["enter"])),onClick:a[17]||(a[17]=n=>e.unref(T)("month"))},e.toDisplayString(u.value.month()+1),35),[[e.vShow,e.unref(m)==="date"]])])],2),e.unref(m)==="date"?(e.openBlock(),e.createBlock(ce.default,{key:0,ref_key:"rightCurrentViewRef",ref:O,"selection-mode":"range",date:u.value,"min-date":e.unref(l),"max-date":e.unref(r),"range-state":e.unref(p),"disabled-date":e.unref(c),"cell-class-name":e.unref(U),"show-week-number":t.showWeekNumber,onChangerange:e.unref(j),onPick:ae,onSelect:e.unref(F)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","show-week-number","onChangerange","onSelect"])):e.createCommentVNode("",!0),e.unref(m)==="year"?(e.openBlock(),e.createBlock(ie.default,{key:1,ref_key:"rightCurrentViewRef",ref:O,"selection-mode":"year",date:u.value,"disabled-date":e.unref(c),"parsed-value":t.parsedValue,onPick:e.unref(ye)},null,8,["date","disabled-date","parsed-value","onPick"])):e.createCommentVNode("",!0),e.unref(m)==="month"?(e.openBlock(),e.createBlock(de.default,{key:2,ref_key:"rightCurrentViewRef",ref:O,"selection-mode":"month",date:u.value,"parsed-value":t.parsedValue,"disabled-date":e.unref(c),onPick:e.unref(Pe)},null,8,["date","parsed-value","disabled-date","onPick"])):e.createCommentVNode("",!0)],2)],2)],2),M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i).e("footer"))},[e.unref(he)?(e.openBlock(),e.createBlock(e.unref(se.VftButton),{key:0,text:"",size:"small",class:e.normalizeClass(e.unref(i).e("link-btn")),onClick:oe},{default:e.withCtx(()=>a[19]||(a[19]=[e.createTextVNode(" 清除 ")])),_:1,__:[19]},8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(se.VftButton),{plain:"",size:"small",class:e.normalizeClass(e.unref(i).e("link-btn")),disabled:Ye.value,onClick:a[18]||(a[18]=n=>e.unref(G)(!1))},{default:e.withCtx(()=>a[20]||(a[20]=[e.createTextVNode(" 确认 ")])),_:1,__:[20]},8,["class","disabled"])],2)):e.createCommentVNode("",!0)],2))}});exports.default=la;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
sidebar?(_: {
|
|
4
4
|
class: string;
|
|
@@ -6,21 +6,24 @@ declare function __VLS_template(): {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
8
|
readonly unlinkPanels: BooleanConstructor;
|
|
9
|
+
readonly visible: BooleanConstructor;
|
|
9
10
|
readonly parsedValue: {
|
|
10
|
-
readonly type: import("vue").PropType<Dayjs[]>;
|
|
11
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
11
12
|
readonly required: false;
|
|
12
13
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
14
|
__epPropKey: true;
|
|
14
15
|
};
|
|
15
16
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
17
|
readonly unlinkPanels: BooleanConstructor;
|
|
18
|
+
readonly visible: BooleanConstructor;
|
|
17
19
|
readonly parsedValue: {
|
|
18
|
-
readonly type: import("vue").PropType<Dayjs[]>;
|
|
20
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
19
21
|
readonly required: false;
|
|
20
22
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
21
23
|
__epPropKey: true;
|
|
22
24
|
};
|
|
23
25
|
}>> & Readonly<{}>, {
|
|
26
|
+
readonly visible: boolean;
|
|
24
27
|
readonly unlinkPanels: boolean;
|
|
25
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("dayjs"),g=require("../../icon/index.cjs"),G=require("@vft/utils");require("../../time-picker/index.cjs");const V=require("../utils.cjs"),q=require("../props/panel-month-range.cjs"),Q=require("../composables/use-month-range-header.cjs"),W=require("../composables/use-range-picker.cjs"),X=require("../constants.cjs"),w=require("./basic-month-table.vue2.cjs"),Z=require("../../time-picker/constants.cjs"),ee=["onClick"],ne=["disabled"],te=["disabled"],v="year",ae=e.defineComponent({name:"DatePickerMonthRange"}),re=e.defineComponent({...ae,props:q.panelMonthRangeProps,emits:q.panelMonthRangeEmits,setup(Y,{emit:M}){const l=Y,s=M,d=e.ref("zh-cn"),b=e.inject(Z.PICKER_BASE_INJECTION_KEY),T=e.inject(X.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY),{shortcuts:N,disabledDate:E}=b.props,k=e.toRef(b.props,"format"),y=e.toRef(b.props,"defaultValue"),i=e.ref(I().locale(d.value)),u=e.ref(I().locale(d.value).add(1,v)),{minDate:f,maxDate:m,rangeState:C,ppNs:r,drpNs:c,handleChangeRange:P,handleRangeConfirm:x,handleShortcutClick:O,onSelect:h,onReset:A}=W.useRangePicker(l,{defaultValue:y,leftDate:i,rightDate:u,unit:v,onParsedValueChanged:J}),_=e.computed(()=>!!N.length),{leftPrevYear:R,rightNextYear:S,leftNextYear:D,rightPrevYear:z,leftLabel:$,rightLabel:j,leftYear:F,rightYear:K}=Q.useMonthRangeHeader({unlinkPanels:e.toRef(l,"unlinkPanels"),leftDate:i,rightDate:u}),p=e.computed(()=>l.unlinkPanels&&K.value>F.value+1),B=(n,t=!0)=>{const a=n.minDate,o=n.maxDate;m.value===o&&f.value===a||(s("calendar-change",[a.toDate(),o&&o.toDate()]),m.value=o,f.value=a,t&&x())},L=()=>{i.value=V.getDefaultValue(e.unref(y),{lang:e.unref(d),unit:"year",unlinkPanels:l.unlinkPanels})[0],u.value=i.value.add(1,"year"),s("pick",null)},U=n=>G.isArray(n)?n.map(t=>t.format(k.value)):n.format(k.value),H=n=>V.correctlyParseUserInput(n,k.value,d.value,T);function J(n,t){if(l.unlinkPanels&&t){const a=n?.year()||0,o=t.year();u.value=a===o?t.add(1,v):t}else u.value=i.value.add(1,v)}return e.watch(()=>l.visible,n=>{!n&&C.value.selecting&&(A(l.parsedValue),h(!1))}),s("set-picker-option",["isValidValue",V.isValidRange]),s("set-picker-option",["formatToString",U]),s("set-picker-option",["parseUserInput",H]),s("set-picker-option",["handleClear",L]),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(r).b(),e.unref(c).b(),{"has-sidebar":!!n.$slots.sidebar||_.value}])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).e("body-wrapper"))},[e.renderSlot(n.$slots,"sidebar",{class:e.normalizeClass(e.unref(r).e("sidebar"))}),_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(a,o)=>(e.openBlock(),e.createElementBlock("button",{key:o,type:"button",class:e.normalizeClass(e.unref(r).e("shortcut")),onClick:oe=>e.unref(O)(a)},e.toDisplayString(a.text),11,ee))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).e("body"))},[e.createElementVNode("div",{class:e.normalizeClass([[e.unref(r).e("content"),e.unref(c).e("content")],"is-left"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("header"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(r).e("icon-btn"),"d-arrow-left"]),onClick:t[0]||(t[0]=(...a)=>e.unref(R)&&e.unref(R)(...a))},[e.createVNode(e.unref(g.VftIcon),{icon:"icon-d-arrow-left"})],2),n.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!p.value,class:e.normalizeClass([[e.unref(r).e("icon-btn"),{[e.unref(r).is("disabled")]:!p.value}],"d-arrow-right"]),onClick:t[1]||(t[1]=(...a)=>e.unref(D)&&e.unref(D)(...a))},[e.createVNode(e.unref(g.VftIcon),{icon:"icon-d-arrow-right"})],10,ne)):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(e.unref($)),1)],2),e.createVNode(w.default,{"selection-mode":"range",date:i.value,"min-date":e.unref(f),"max-date":e.unref(m),"range-state":e.unref(C),"disabled-date":e.unref(E),onChangerange:e.unref(P),onPick:B,onSelect:e.unref(h)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2),e.createElementVNode("div",{class:e.normalizeClass([[e.unref(r).e("content"),e.unref(c).e("content")],"is-right"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).e("header"))},[n.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!p.value,class:e.normalizeClass([[e.unref(r).e("icon-btn"),{"is-disabled":!p.value}],"d-arrow-left"]),onClick:t[2]||(t[2]=(...a)=>e.unref(z)&&e.unref(z)(...a))},[e.createVNode(e.unref(g.VftIcon),{icon:"icon-d-arrow-left"})],10,te)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:e.normalizeClass([e.unref(r).e("icon-btn"),"d-arrow-right"]),onClick:t[3]||(t[3]=(...a)=>e.unref(S)&&e.unref(S)(...a))},[e.createVNode(e.unref(g.VftIcon),{icon:"icon-d-arrow-right"})],2),e.createElementVNode("div",null,e.toDisplayString(e.unref(j)),1)],2),e.createVNode(w.default,{"selection-mode":"range",date:u.value,"min-date":e.unref(f),"max-date":e.unref(m),"range-state":e.unref(C),"disabled-date":e.unref(E),onChangerange:e.unref(P),onPick:B,onSelect:e.unref(h)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2)],2)],2)],2))}});exports.default=re;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./panel-year-range.vue2.cjs");exports.default=e.default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
sidebar?(_: {
|
|
4
|
+
class: string;
|
|
5
|
+
}): any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
readonly unlinkPanels: BooleanConstructor;
|
|
9
|
+
readonly visible: BooleanConstructor;
|
|
10
|
+
readonly parsedValue: {
|
|
11
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
|
+
__epPropKey: true;
|
|
15
|
+
};
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
readonly unlinkPanels: BooleanConstructor;
|
|
18
|
+
readonly visible: BooleanConstructor;
|
|
19
|
+
readonly parsedValue: {
|
|
20
|
+
readonly type: import("vue").PropType<dayjs.Dayjs[]>;
|
|
21
|
+
readonly required: false;
|
|
22
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
23
|
+
__epPropKey: true;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{}>, {
|
|
26
|
+
readonly visible: boolean;
|
|
27
|
+
readonly unlinkPanels: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("dayjs"),ee=require("@vft/utils"),k=require("../../icon/index.cjs");require("../../time-picker/index.cjs");const T=require("../props/panel-year-range.cjs"),te=require("../composables/use-year-range-header.cjs"),ne=require("../composables/use-range-picker.cjs"),R=require("../utils.cjs"),ae=require("../constants.cjs"),L=require("./basic-year-table.vue2.cjs"),re=require("../../time-picker/constants.cjs"),oe=["onClick"],le=["disabled"],se=["disabled"],u=10,m="year",ie=e.defineComponent({name:"DatePickerYearRange"}),ue=e.defineComponent({...ie,props:T.panelYearRangeProps,emits:T.panelYearRangeEmits,setup(x,{emit:K}){const l=x,s=K,p=e.ref("zh-cn"),c=e.ref(q().locale(p.value)),i=e.ref(q().locale(p.value).add(u,m)),A=e.inject(ae.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY),C=e.inject(re.PICKER_BASE_INJECTION_KEY),{shortcuts:B,disabledDate:d}=C.props,h=e.toRef(C.props,"format"),_=e.toRef(C.props,"defaultValue"),{minDate:g,maxDate:v,rangeState:V,ppNs:r,drpNs:f,handleChangeRange:y,handleRangeConfirm:O,handleShortcutClick:j,onSelect:N,onReset:F}=ne.useRangePicker(l,{defaultValue:_,leftDate:c,rightDate:i,step:u,unit:m,onParsedValueChanged:Z}),{leftPrevYear:w,rightNextYear:D,leftNextYear:S,rightPrevYear:Y,leftLabel:U,rightLabel:$,leftYear:M,rightYear:H}=te.useYearRangeHeader({unlinkPanels:e.toRef(l,"unlinkPanels"),leftDate:c,rightDate:i}),z=e.computed(()=>!!B.length),J=e.computed(()=>[r.b(),f.b(),{"has-sidebar":!!e.useSlots().sidebar||z.value}]),E=e.computed(()=>({content:[r.e("content"),f.e("content"),"is-left"],arrowLeftBtn:[r.e("icon-btn"),"d-arrow-left"],arrowRightBtn:[r.e("icon-btn"),{[r.is("disabled")]:!b.value},"d-arrow-right"]})),P=e.computed(()=>({content:[r.e("content"),f.e("content"),"is-right"],arrowLeftBtn:[r.e("icon-btn"),{"is-disabled":!b.value},"d-arrow-left"],arrowRightBtn:[r.e("icon-btn"),"d-arrow-right"]})),b=e.computed(()=>l.unlinkPanels&&H.value>M.value+1),I=(t,n=!0)=>{const a=t.minDate,o=t.maxDate;v.value===o&&g.value===a||(s("calendar-change",[a.toDate(),o&&o.toDate()]),v.value=o,g.value=a,n&&O())},G=t=>R.correctlyParseUserInput(t,h.value,p.value,A),Q=t=>ee.isArray(t)?t.map(n=>n.format(h.value)):t.format(h.value),W=t=>R.isValidRange(t)&&(d?!d(t[0].toDate())&&!d(t[1].toDate()):!0),X=()=>{const t=R.getDefaultValue(e.unref(_),{lang:e.unref(p),step:u,unit:m,unlinkPanels:l.unlinkPanels});c.value=t[0],i.value=t[1],s("pick",null)};function Z(t,n){if(l.unlinkPanels&&n){const a=t?.year()||0,o=n.year();i.value=a+u>o?n.add(u,m):n}else i.value=c.value.add(u,m)}return e.watch(()=>l.visible,t=>{!t&&V.value.selecting&&(F(l.parsedValue),N(!1))}),s("set-picker-option",["isValidValue",W]),s("set-picker-option",["parseUserInput",G]),s("set-picker-option",["formatToString",Q]),s("set-picker-option",["handleClear",X]),(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(J.value)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).e("body-wrapper"))},[e.renderSlot(t.$slots,"sidebar",{class:e.normalizeClass(e.unref(r).e("sidebar"))}),z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).e("sidebar"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),(a,o)=>(e.openBlock(),e.createElementBlock("button",{key:o,type:"button",class:e.normalizeClass(e.unref(r).e("shortcut")),onClick:ce=>e.unref(j)(a)},e.toDisplayString(a.text),11,oe))),128))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).e("body"))},[e.createElementVNode("div",{class:e.normalizeClass(E.value.content)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(f).e("header"))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(E.value.arrowLeftBtn),onClick:n[0]||(n[0]=(...a)=>e.unref(w)&&e.unref(w)(...a))},[e.createVNode(e.unref(k.VftIcon),{icon:"icon-d-arrow-left"})],2),t.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!b.value,class:e.normalizeClass(E.value.arrowRightBtn),onClick:n[1]||(n[1]=(...a)=>e.unref(S)&&e.unref(S)(...a))},[e.createVNode(e.unref(k.VftIcon),{icon:"icon-d-arrow-right"})],10,le)):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(e.unref(U)),1)],2),e.createVNode(L.default,{"selection-mode":"range",date:c.value,"min-date":e.unref(g),"max-date":e.unref(v),"range-state":e.unref(V),"disabled-date":e.unref(d),onChangerange:e.unref(y),onPick:I,onSelect:e.unref(N)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2),e.createElementVNode("div",{class:e.normalizeClass(P.value.content)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(f).e("header"))},[t.unlinkPanels?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:!b.value,class:e.normalizeClass(P.value.arrowLeftBtn),onClick:n[2]||(n[2]=(...a)=>e.unref(Y)&&e.unref(Y)(...a))},[e.createVNode(e.unref(k.VftIcon),{icon:"icon-d-arrow-left"})],10,se)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:e.normalizeClass(P.value.arrowRightBtn),onClick:n[3]||(n[3]=(...a)=>e.unref(D)&&e.unref(D)(...a))},[e.createVNode(e.unref(k.VftIcon),{icon:"icon-d-arrow-right"})],2),e.createElementVNode("div",null,e.toDisplayString(e.unref($)),1)],2),e.createVNode(L.default,{"selection-mode":"range",date:i.value,"min-date":e.unref(g),"max-date":e.unref(v),"range-state":e.unref(V),"disabled-date":e.unref(d),onChangerange:e.unref(y),onPick:I,onSelect:e.unref(N)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2)],2)],2)],2))}});exports.default=ue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),E=require("dayjs/plugin/customParseFormat.js"),O=require("dayjs/plugin/advancedFormat.js"),P=require("dayjs/plugin/localeData.js"),f=require("dayjs/plugin/weekOfYear.js"),v=require("dayjs/plugin/weekYear.js"),T=require("dayjs/plugin/dayOfYear.js"),x=require("dayjs/plugin/isSameOrAfter.js"),D=require("dayjs/plugin/isSameOrBefore.js");require("@vueuse/core");require("@vft/utils");const i=require("../../constants/event.cjs");require("../../utils/ns-cover.cjs");require("lodash-es");const N=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");require("../time-picker/index.cjs");const c=require("./constants.cjs"),y=require("./props/date-picker.cjs"),I=require("./panel-utils.cjs"),u=require("../time-picker/constants.cjs"),A=require("../time-picker/common/picker.vue2.cjs");r.extend(P);r.extend(O);r.extend(E);r.extend(f);r.extend(v);r.extend(T);r.extend(x);r.extend(D);const C=e.defineComponent({name:"ElDatePicker",install:null,props:y.datePickerProps,emits:[i.UPDATE_MODEL_EVENT],setup(t,{expose:s,emit:d,slots:n}){const l=N.useNamespace("picker-panel"),_=e.computed(()=>!t.format);e.provide(c.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,_),e.provide(u.PICKER_POPPER_OPTIONS_INJECTION_KEY,e.reactive(e.toRef(t,"popperOptions"))),e.provide(c.ROOT_PICKER_INJECTION_KEY,{slots:n,pickerNs:l});const a=e.ref();s({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()},handleOpen:()=>{a.value?.handleOpen()},handleClose:()=>{a.value?.handleClose()}});const p=o=>{d(i.UPDATE_MODEL_EVENT,o)};return()=>{const o=t.format??(u.DEFAULT_FORMATS_DATEPICKER[t.type]||u.DEFAULT_FORMATS_DATE),m=I.getPanel(t.type);return e.createVNode(A.default,e.mergeProps(t,{format:o,type:t.type,ref:a,"onUpdate:modelValue":p}),{default:q=>e.createVNode(m,q,{"prev-month":n["prev-month"],"next-month":n["next-month"],"prev-year":n["prev-year"],"next-year":n["next-year"]}),"range-separator":n["range-separator"]})}}});exports.default=C;
|