vxe-pc-ui 4.20.34 → 4.20.35
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/all.esm.js +45718 -45038
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +307 -1
- package/dist/style.mini.css +1 -1
- package/es/alert/src/alert.js +117 -114
- package/es/anchor/src/anchor-link.js +110 -107
- package/es/anchor/src/anchor.js +212 -209
- package/es/avatar/src/avatar.js +132 -129
- package/es/backtop/src/backtop.js +267 -264
- package/es/badge/src/badge.js +102 -99
- package/es/breadcrumb/src/breadcrumb-item.js +104 -101
- package/es/breadcrumb/src/breadcrumb.js +70 -67
- package/es/button/src/button-group.js +88 -85
- package/es/calendar/src/calendar.js +1371 -1368
- package/es/card/src/card.js +235 -232
- package/es/carousel/src/carousel-item.js +78 -75
- package/es/carousel/src/carousel.js +392 -389
- package/es/cascader/src/cascader.js +1667 -1664
- package/es/checkbox/src/button.js +198 -195
- package/es/checkbox/src/checkbox.js +181 -178
- package/es/checkbox/src/group.js +210 -207
- package/es/collapse/src/collapse-pane.js +98 -95
- package/es/collapse/src/collapse.js +340 -337
- package/es/color-picker/src/color-picker.js +1116 -1113
- package/es/components.d.ts +1 -0
- package/es/components.js +3 -0
- package/es/context-menu/src/context-menu.js +601 -598
- package/es/countdown/src/countdown.js +224 -221
- package/es/date-panel/src/date-panel.js +1905 -1902
- package/es/date-picker/src/date-picker.js +1537 -1534
- package/es/date-range-picker/src/date-range-picker.js +1412 -1409
- package/es/divider/src/divider.js +80 -77
- package/es/drawer/src/drawer.js +778 -775
- package/es/empty/src/empty.js +100 -97
- package/es/form/src/form-group.js +74 -71
- package/es/form/src/form-item.js +76 -73
- package/es/form/src/form.js +789 -786
- package/es/icon/src/icon.js +59 -56
- package/es/icon/style.css +1 -1
- package/es/icon/style.mini.css +1 -1
- package/es/icon-picker/src/icon-picker.js +719 -716
- package/es/image/src/group.js +130 -127
- package/es/image/src/image.js +243 -240
- package/es/image/src/preview.js +627 -624
- package/es/index.esm.js +2 -0
- package/es/index.js +2 -0
- package/es/input/src/input.js +2700 -2697
- package/es/layout-aside/src/layout-aside.js +138 -135
- package/es/layout-body/src/layout-body.js +145 -142
- package/es/layout-container/src/layout-container.js +71 -68
- package/es/layout-footer/src/layout-footer.js +60 -57
- package/es/layout-header/src/layout-header.js +58 -55
- package/es/link/src/link.js +131 -128
- package/es/list/src/list.js +2174 -2171
- package/es/loading/src/loading.js +141 -138
- package/es/mention/src/mention.js +49 -46
- package/es/menu/src/menu.js +799 -796
- package/es/modal/src/modal.js +1519 -1527
- package/es/notice-bar/src/notice-bar.js +168 -165
- package/es/number-input/src/number-input.js +1094 -1091
- package/es/pager/src/pager.js +767 -764
- package/es/password-input/src/password-input.js +431 -428
- package/es/print/src/page-break.js +63 -60
- package/es/print/src/print.js +303 -300
- package/es/pulldown/src/pulldown.js +403 -400
- package/es/radio/src/button.js +214 -211
- package/es/radio/src/group.js +195 -192
- package/es/radio/src/radio.js +194 -191
- package/es/rate/src/rate.js +164 -161
- package/es/result/src/result.js +116 -113
- package/es/row/src/col.js +133 -130
- package/es/row/src/row.js +111 -108
- package/es/scrollbar/src/scrollbar.js +518 -515
- package/es/segmented/src/segmented.js +240 -237
- package/es/select/src/optgroup.js +44 -41
- package/es/select/src/option.js +39 -36
- package/es/select/src/select.js +1914 -1896
- package/es/slider/src/slider.js +419 -416
- package/es/space/src/space.js +190 -187
- package/es/splitter/src/splitter-panel.js +146 -143
- package/es/splitter/src/splitter.js +917 -914
- package/es/step-item/index.d.ts +76 -0
- package/es/step-item/index.js +17 -0
- package/es/steps/index.d.ts +288 -34
- package/es/steps/src/step-info.d.ts +6 -0
- package/es/steps/src/step-info.js +20 -0
- package/es/steps/src/step-item.d.ts +14 -0
- package/es/steps/src/step-item.js +39 -0
- package/es/steps/src/steps.d.ts +68 -8
- package/es/steps/src/steps.js +299 -47
- package/es/steps/src/util.d.ts +7 -0
- package/es/steps/src/util.js +44 -0
- package/es/steps/style.css +297 -0
- package/es/steps/style.mini.css +1 -0
- package/es/style.css +307 -1
- package/es/style.mini.css +1 -1
- package/es/switch/src/switch.js +228 -225
- package/es/table-select/src/table-select.js +865 -862
- package/es/table-transfer/src/table-transfer.js +61 -58
- package/es/tabs/src/tab-pane.js +102 -99
- package/es/tabs/src/tabs.js +936 -933
- package/es/tag/src/tag.js +163 -160
- package/es/text/src/text.js +232 -229
- package/es/text-ellipsis/src/text-ellipsis.js +252 -249
- package/es/textarea/src/textarea.js +434 -431
- package/es/timeline/src/timeline.js +74 -36
- package/es/timeline/src/util.js +7 -4
- package/es/tip/src/tip.js +117 -114
- package/es/tooltip/src/tooltip.js +552 -549
- package/es/tour/src/tour.js +49 -46
- package/es/transfer/src/transfer.js +95 -92
- package/es/tree/src/tree.js +3379 -3376
- package/es/tree-select/src/tree-select.js +969 -966
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +1791 -1788
- package/es/vxe-icon/style.css +1 -1
- package/es/vxe-icon/style.mini.css +1 -1
- package/es/vxe-steps/style.css +297 -0
- package/es/vxe-steps/style.mini.css +1 -0
- package/es/watermark/src/watermark.js +158 -155
- package/lib/alert/src/alert.js +117 -114
- package/lib/anchor/src/anchor-link.js +110 -107
- package/lib/anchor/src/anchor.js +212 -209
- package/lib/avatar/src/avatar.js +132 -129
- package/lib/backtop/src/backtop.js +267 -264
- package/lib/badge/src/badge.js +102 -99
- package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
- package/lib/breadcrumb/src/breadcrumb.js +70 -67
- package/lib/button/src/button-group.js +88 -85
- package/lib/calendar/src/calendar.js +1371 -1368
- package/lib/card/src/card.js +235 -232
- package/lib/carousel/src/carousel-item.js +78 -75
- package/lib/carousel/src/carousel.js +392 -389
- package/lib/cascader/src/cascader.js +1665 -1662
- package/lib/checkbox/src/button.js +198 -195
- package/lib/checkbox/src/checkbox.js +181 -178
- package/lib/checkbox/src/group.js +210 -207
- package/lib/collapse/src/collapse-pane.js +98 -95
- package/lib/collapse/src/collapse.js +340 -337
- package/lib/color-picker/src/color-picker.js +1116 -1113
- package/lib/components.js +3 -0
- package/lib/context-menu/src/context-menu.js +601 -598
- package/lib/countdown/src/countdown.js +224 -221
- package/lib/date-panel/src/date-panel.js +1905 -1902
- package/lib/date-picker/src/date-picker.js +1537 -1534
- package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
- package/lib/divider/src/divider.js +80 -77
- package/lib/drawer/src/drawer.js +778 -775
- package/lib/empty/src/empty.js +100 -97
- package/lib/form/src/form-group.js +74 -71
- package/lib/form/src/form-item.js +76 -73
- package/lib/form/src/form.js +789 -786
- package/lib/icon/src/icon.js +59 -56
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.mini.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +719 -716
- package/lib/image/src/group.js +130 -127
- package/lib/image/src/image.js +243 -240
- package/lib/image/src/preview.js +627 -624
- package/lib/index.common.js +2 -0
- package/lib/index.js +2 -0
- package/lib/index.umd.js +47411 -46732
- package/lib/index.umd.min.js +3 -3
- package/lib/input/src/input.js +2700 -2697
- package/lib/layout-aside/src/layout-aside.js +138 -135
- package/lib/layout-body/src/layout-body.js +145 -142
- package/lib/layout-container/src/layout-container.js +71 -68
- package/lib/layout-footer/src/layout-footer.js +60 -57
- package/lib/layout-header/src/layout-header.js +58 -55
- package/lib/link/src/link.js +131 -128
- package/lib/list/src/list.js +2173 -2170
- package/lib/loading/src/loading.js +141 -138
- package/lib/mention/src/mention.js +49 -46
- package/lib/menu/src/menu.js +799 -796
- package/lib/modal/src/modal.js +1519 -1527
- package/lib/notice-bar/src/notice-bar.js +168 -165
- package/lib/number-input/src/number-input.js +1094 -1091
- package/lib/pager/src/pager.js +767 -764
- package/lib/password-input/src/password-input.js +431 -428
- package/lib/print/src/page-break.js +63 -60
- package/lib/print/src/print.js +303 -300
- package/lib/pulldown/src/pulldown.js +403 -400
- package/lib/radio/src/button.js +214 -211
- package/lib/radio/src/group.js +195 -192
- package/lib/radio/src/radio.js +194 -191
- package/lib/rate/src/rate.js +164 -161
- package/lib/result/src/result.js +116 -113
- package/lib/row/src/col.js +133 -130
- package/lib/row/src/row.js +111 -108
- package/lib/scrollbar/src/scrollbar.js +518 -515
- package/lib/segmented/src/segmented.js +240 -237
- package/lib/select/src/optgroup.js +44 -41
- package/lib/select/src/option.js +39 -36
- package/lib/select/src/select.js +1915 -1897
- package/lib/slider/src/slider.js +419 -416
- package/lib/space/src/space.js +190 -187
- package/lib/splitter/src/splitter-panel.js +146 -143
- package/lib/splitter/src/splitter.js +917 -914
- package/lib/step-item/index.js +47 -0
- package/lib/steps/src/step-info.js +49 -0
- package/lib/steps/src/step-item.js +59 -0
- package/lib/steps/src/steps.js +298 -46
- package/lib/steps/src/util.js +74 -0
- package/lib/steps/style/style.css +297 -0
- package/lib/steps/style/style.mini.css +1 -0
- package/lib/style.css +307 -1
- package/lib/style.mini.css +1 -1
- package/lib/switch/src/switch.js +228 -225
- package/lib/table-select/src/table-select.js +865 -862
- package/lib/table-transfer/src/table-transfer.js +61 -58
- package/lib/tabs/src/tab-pane.js +102 -99
- package/lib/tabs/src/tabs.js +936 -933
- package/lib/tag/src/tag.js +163 -160
- package/lib/text/src/text.js +232 -229
- package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
- package/lib/textarea/src/textarea.js +434 -431
- package/lib/timeline/src/timeline.js +74 -36
- package/lib/timeline/src/util.js +7 -4
- package/lib/tip/src/tip.js +117 -114
- package/lib/tooltip/src/tooltip.js +552 -549
- package/lib/tour/src/tour.js +49 -46
- package/lib/transfer/src/transfer.js +95 -92
- package/lib/tree/src/tree.js +3379 -3376
- package/lib/tree-select/src/tree-select.js +969 -966
- package/lib/ui/index.js +8 -2
- package/lib/ui/src/log.js +1 -1
- package/lib/upload/src/upload.js +1788 -1785
- package/lib/vxe-icon/style/style.css +1 -1
- package/lib/vxe-icon/style/style.mini.css +1 -1
- package/lib/vxe-steps/style/style.css +297 -0
- package/lib/vxe-steps/style/style.mini.css +1 -0
- package/lib/watermark/src/watermark.js +158 -155
- package/package.json +1 -1
- package/packages/alert/src/alert.ts +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/avatar/src/avatar.ts +2 -2
- package/packages/backtop/src/backtop.ts +2 -2
- package/packages/badge/src/badge.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +2 -2
- package/packages/calendar/src/calendar.ts +2 -2
- package/packages/card/src/card.ts +2 -2
- package/packages/carousel/src/carousel-item.ts +2 -2
- package/packages/carousel/src/carousel.ts +2 -2
- package/packages/cascader/src/cascader.ts +2 -2
- package/packages/checkbox/src/button.ts +3 -15
- package/packages/checkbox/src/checkbox.ts +2 -2
- package/packages/checkbox/src/group.ts +2 -2
- package/packages/collapse/src/collapse-pane.ts +2 -2
- package/packages/collapse/src/collapse.ts +2 -2
- package/packages/color-picker/src/color-picker.ts +2 -2
- package/packages/components.ts +3 -0
- package/packages/context-menu/src/context-menu.ts +3 -16
- package/packages/countdown/src/countdown.ts +2 -2
- package/packages/date-panel/src/date-panel.ts +2 -2
- package/packages/date-picker/src/date-picker.ts +2 -2
- package/packages/date-range-picker/src/date-range-picker.ts +2 -2
- package/packages/divider/src/divider.ts +2 -2
- package/packages/drawer/src/drawer.ts +2 -2
- package/packages/empty/src/empty.ts +2 -2
- package/packages/form/src/form-group.ts +2 -2
- package/packages/form/src/form-item.ts +2 -2
- package/packages/form/src/form.ts +2 -2
- package/packages/icon/src/icon.ts +2 -2
- package/packages/icon-picker/src/icon-picker.ts +2 -2
- package/packages/image/src/group.ts +2 -2
- package/packages/image/src/image.ts +2 -2
- package/packages/image/src/preview.ts +3 -16
- package/packages/index.ts +2 -2
- package/packages/input/src/input.ts +2 -2
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/layout-body/src/layout-body.ts +2 -2
- package/packages/layout-container/src/layout-container.ts +3 -14
- package/packages/layout-footer/src/layout-footer.ts +2 -2
- package/packages/layout-header/src/layout-header.ts +2 -2
- package/packages/link/src/link.ts +2 -2
- package/packages/list/src/list.ts +2 -2
- package/packages/loading/src/loading.ts +2 -2
- package/packages/mention/src/mention.ts +2 -2
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +5 -20
- package/packages/notice-bar/src/notice-bar.ts +2 -2
- package/packages/number-input/src/number-input.ts +3 -17
- package/packages/pager/src/pager.ts +2 -2
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +2 -2
- package/packages/print/src/print.ts +2 -2
- package/packages/pulldown/src/pulldown.ts +2 -2
- package/packages/radio/src/button.ts +3 -16
- package/packages/radio/src/group.ts +3 -17
- package/packages/radio/src/radio.ts +2 -2
- package/packages/rate/src/rate.ts +2 -2
- package/packages/result/src/result.ts +2 -2
- package/packages/row/src/col.ts +2 -2
- package/packages/row/src/row.ts +2 -2
- package/packages/scrollbar/src/scrollbar.ts +3 -4
- package/packages/segmented/src/segmented.ts +2 -2
- package/packages/select/src/optgroup.ts +2 -2
- package/packages/select/src/option.ts +2 -2
- package/packages/select/src/select.ts +33 -19
- package/packages/slider/src/slider.ts +2 -2
- package/packages/space/src/space.ts +2 -2
- package/packages/splitter/src/splitter-panel.ts +2 -2
- package/packages/splitter/src/splitter.ts +2 -2
- package/packages/step-item/index.ts +16 -0
- package/packages/steps/src/step-info.ts +18 -0
- package/packages/steps/src/step-item.ts +41 -0
- package/packages/steps/src/steps.ts +273 -13
- package/packages/steps/src/util.ts +44 -0
- package/packages/switch/src/switch.ts +2 -2
- package/packages/table-select/src/table-select.ts +2 -2
- package/packages/table-transfer/src/table-transfer.ts +3 -15
- package/packages/tabs/src/tab-pane.ts +2 -2
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tag/src/tag.ts +2 -2
- package/packages/text/src/text.ts +2 -2
- package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
- package/packages/textarea/src/textarea.ts +2 -2
- package/packages/timeline/src/timeline-info.ts +17 -17
- package/packages/timeline/src/timeline.ts +93 -49
- package/packages/timeline/src/util.ts +44 -41
- package/packages/tip/src/tip.ts +2 -2
- package/packages/tooltip/src/tooltip.ts +2 -2
- package/packages/tour/src/tour.ts +2 -2
- package/packages/transfer/src/transfer.ts +2 -2
- package/packages/tree/src/tree.ts +2 -2
- package/packages/tree-select/src/tree-select.ts +2 -2
- package/packages/ui/index.ts +8 -1
- package/packages/upload/src/upload.ts +2 -2
- package/packages/watermark/src/watermark.ts +2 -2
- package/styles/all.scss +1 -0
- package/styles/components/step-item.scss +0 -0
- package/styles/components/steps.scss +354 -0
- package/styles/theme/base.scss +9 -0
- package/types/all.d.ts +3 -0
- package/types/components/gantt.d.ts +1 -3
- package/types/components/select.d.ts +1 -13
- package/types/components/step-item.d.ts +72 -0
- package/types/components/steps.d.ts +67 -8
- package/types/components/table.d.ts +7 -66
- package/types/handles/form-design.d.ts +1 -4
- package/types/ui/global-config.d.ts +2 -0
- package/types/ui/global-icon.d.ts +7 -0
- /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
|
@@ -73,1639 +73,1642 @@ function createInternalData() {
|
|
|
73
73
|
laseFocusMasked: 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
var date_picker_default = (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
76
|
+
var date_picker_default = (
|
|
77
|
+
/* define-vxe-component start */
|
|
78
|
+
(0, import_comp.defineVxeComponent)({
|
|
79
|
+
name: "VxeDatePicker",
|
|
80
|
+
props: {
|
|
81
|
+
modelValue: [String, Number, Date],
|
|
82
|
+
immediate: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true
|
|
85
|
+
},
|
|
86
|
+
name: String,
|
|
87
|
+
type: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: "date"
|
|
90
|
+
},
|
|
91
|
+
width: [Number, String],
|
|
92
|
+
clearable: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: () => getConfig().datePicker.clearable
|
|
95
|
+
},
|
|
96
|
+
readonly: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: null
|
|
99
|
+
},
|
|
100
|
+
disabled: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: null
|
|
103
|
+
},
|
|
104
|
+
placeholder: String,
|
|
105
|
+
autoComplete: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: "off"
|
|
108
|
+
},
|
|
109
|
+
form: String,
|
|
110
|
+
className: String,
|
|
111
|
+
inputClassName: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: () => getConfig().datePicker.inputClassName
|
|
114
|
+
},
|
|
115
|
+
zIndex: Number,
|
|
116
|
+
size: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: () => getConfig().datePicker.size || getConfig().size
|
|
119
|
+
},
|
|
120
|
+
multiple: Boolean,
|
|
121
|
+
limitCount: {
|
|
122
|
+
type: [String, Number],
|
|
123
|
+
default: () => getConfig().datePicker.limitCount
|
|
124
|
+
},
|
|
125
|
+
// date、week、month、quarter、year
|
|
126
|
+
startDate: {
|
|
127
|
+
type: [String, Number, Date],
|
|
128
|
+
default: () => getConfig().datePicker.startDate
|
|
129
|
+
},
|
|
130
|
+
endDate: {
|
|
131
|
+
type: [String, Number, Date],
|
|
132
|
+
default: () => getConfig().datePicker.endDate
|
|
133
|
+
},
|
|
134
|
+
defaultDate: [String, Number, Date],
|
|
135
|
+
defaultTime: [String, Number, Date],
|
|
136
|
+
minDate: [String, Number, Date],
|
|
137
|
+
maxDate: [String, Number, Date],
|
|
138
|
+
startDay: {
|
|
139
|
+
type: [String, Number],
|
|
140
|
+
default: () => getConfig().datePicker.startDay
|
|
141
|
+
},
|
|
142
|
+
labelFormat: String,
|
|
143
|
+
valueFormat: String,
|
|
144
|
+
timeFormat: String,
|
|
145
|
+
parseInputMethod: Function,
|
|
146
|
+
editable: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: true
|
|
149
|
+
},
|
|
150
|
+
festivalMethod: Function,
|
|
151
|
+
disabledMethod: Function,
|
|
152
|
+
// week
|
|
153
|
+
selectDay: {
|
|
154
|
+
type: [String, Number],
|
|
155
|
+
default: () => getConfig().datePicker.selectDay
|
|
156
|
+
},
|
|
157
|
+
showClearButton: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default: () => getConfig().datePicker.showClearButton
|
|
160
|
+
},
|
|
161
|
+
showConfirmButton: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: () => getConfig().datePicker.showConfirmButton
|
|
164
|
+
},
|
|
165
|
+
autoClose: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: () => getConfig().datePicker.autoClose
|
|
168
|
+
},
|
|
169
|
+
maskedConfig: Object,
|
|
170
|
+
prefixIcon: String,
|
|
171
|
+
suffixIcon: String,
|
|
172
|
+
/**
|
|
173
|
+
* 已废弃,请使用 popupConfig.placement
|
|
174
|
+
* @deprecated
|
|
175
|
+
*/
|
|
176
|
+
placement: String,
|
|
177
|
+
/**
|
|
178
|
+
* 已废弃,请使用 popupConfig.transfer
|
|
179
|
+
* @deprecated
|
|
180
|
+
*/
|
|
181
|
+
transfer: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
default: null
|
|
184
|
+
},
|
|
185
|
+
timeConfig: Object,
|
|
186
|
+
popupConfig: Object,
|
|
187
|
+
shortcutConfig: Object,
|
|
188
|
+
/**
|
|
189
|
+
* 已废弃 startWeek,被 startDay 替换
|
|
190
|
+
* @deprecated
|
|
191
|
+
*/
|
|
192
|
+
startWeek: Number
|
|
182
193
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
reactData,
|
|
224
|
-
internalData,
|
|
225
|
-
getRefMaps: () => refMaps
|
|
226
|
-
};
|
|
227
|
-
const computeBtnTransfer = (0, import_vue.computed)(() => {
|
|
228
|
-
const { transfer } = props;
|
|
229
|
-
const popupOpts = computePopupOpts.value;
|
|
230
|
-
if (import_xe_utils.default.isBoolean(popupOpts.transfer)) {
|
|
231
|
-
return popupOpts.transfer;
|
|
232
|
-
}
|
|
233
|
-
if (transfer === null) {
|
|
234
|
-
const globalTransfer = getConfig().datePicker.transfer;
|
|
235
|
-
if (import_xe_utils.default.isBoolean(globalTransfer)) {
|
|
236
|
-
return globalTransfer;
|
|
237
|
-
}
|
|
238
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return transfer;
|
|
243
|
-
});
|
|
244
|
-
const computeFormReadonly = (0, import_vue.computed)(() => {
|
|
245
|
-
const { readonly } = props;
|
|
246
|
-
if (readonly === null) {
|
|
247
|
-
if ($xeForm) {
|
|
248
|
-
return $xeForm.props.readonly;
|
|
249
|
-
}
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
return readonly;
|
|
253
|
-
});
|
|
254
|
-
const computeIsDisabled = (0, import_vue.computed)(() => {
|
|
255
|
-
const { disabled } = props;
|
|
256
|
-
if (disabled === null) {
|
|
257
|
-
if ($xeForm) {
|
|
258
|
-
return $xeForm.props.disabled;
|
|
194
|
+
emits: ["update:modelValue", "input", "change", "keydown", "keyup", "click", "focus", "blur", "clear", "confirm", "prefix-click", "suffix-click", "date-prev", "date-today", "date-next", "shortcut-click"],
|
|
195
|
+
setup(props, context) {
|
|
196
|
+
const { slots, emit } = context;
|
|
197
|
+
const $xeModal = (0, import_vue.inject)("$xeModal", null);
|
|
198
|
+
const $xeDrawer = (0, import_vue.inject)("$xeDrawer", null);
|
|
199
|
+
const $xeTable = (0, import_vue.inject)("$xeTable", null);
|
|
200
|
+
const $xeCard = (0, import_vue.inject)("$xeCard", null);
|
|
201
|
+
const $xeForm = (0, import_vue.inject)("$xeForm", null);
|
|
202
|
+
const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
|
|
203
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
204
|
+
const { computeSize } = useFns.useSize(props);
|
|
205
|
+
const reactData = (0, import_vue.reactive)(createReactData());
|
|
206
|
+
const internalData = createInternalData();
|
|
207
|
+
const defaultFuncProps = {
|
|
208
|
+
parseInputMethod: getConfig().datePicker.parseInputMethod,
|
|
209
|
+
festivalMethod: getConfig().datePicker.festivalMethod,
|
|
210
|
+
disabledMethod: getConfig().datePicker.disabledMethod
|
|
211
|
+
};
|
|
212
|
+
const refElem = (0, import_vue.ref)();
|
|
213
|
+
const refInputTarget = (0, import_vue.ref)();
|
|
214
|
+
const refInputPanel = (0, import_vue.ref)();
|
|
215
|
+
const refPanelWrapper = (0, import_vue.ref)();
|
|
216
|
+
const refDatePanel = (0, import_vue.ref)();
|
|
217
|
+
const refMaps = {
|
|
218
|
+
refElem,
|
|
219
|
+
refInput: refInputTarget
|
|
220
|
+
};
|
|
221
|
+
const $xeDatePicker = {
|
|
222
|
+
xID,
|
|
223
|
+
props,
|
|
224
|
+
context,
|
|
225
|
+
reactData,
|
|
226
|
+
internalData,
|
|
227
|
+
getRefMaps: () => refMaps
|
|
228
|
+
};
|
|
229
|
+
const computeBtnTransfer = (0, import_vue.computed)(() => {
|
|
230
|
+
const { transfer } = props;
|
|
231
|
+
const popupOpts = computePopupOpts.value;
|
|
232
|
+
if (import_xe_utils.default.isBoolean(popupOpts.transfer)) {
|
|
233
|
+
return popupOpts.transfer;
|
|
259
234
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const computeIsTimeType = (0, import_vue.computed)(() => {
|
|
265
|
-
const { type } = props;
|
|
266
|
-
return type === "time";
|
|
267
|
-
});
|
|
268
|
-
const computeIsTimeOrDateTimeType = (0, import_vue.computed)(() => {
|
|
269
|
-
const { type } = props;
|
|
270
|
-
const isTimeType = computeIsTimeType.value;
|
|
271
|
-
return isTimeType || type === "datetime";
|
|
272
|
-
});
|
|
273
|
-
const computeIsDatePickerType = (0, import_vue.computed)(() => {
|
|
274
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
275
|
-
return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
|
|
276
|
-
});
|
|
277
|
-
const computeIsClearable = (0, import_vue.computed)(() => {
|
|
278
|
-
return props.clearable;
|
|
279
|
-
});
|
|
280
|
-
const computeIsDatePanelType = (0, import_vue.computed)(() => {
|
|
281
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
282
|
-
return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
|
|
283
|
-
});
|
|
284
|
-
const computeDateListValue = (0, import_vue.computed)(() => {
|
|
285
|
-
const { modelValue, type, multiple } = props;
|
|
286
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
287
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
288
|
-
if (multiple && modelValue && isDatePanelType) {
|
|
289
|
-
return import_xe_utils.default.toValueString(modelValue).split(",").map((item) => {
|
|
290
|
-
const date = (0, import_util.parseDateValue)(item, type, {
|
|
291
|
-
valueFormat: dateValueFormat
|
|
292
|
-
});
|
|
293
|
-
if (import_xe_utils.default.isValidDate(date)) {
|
|
294
|
-
return date;
|
|
235
|
+
if (transfer === null) {
|
|
236
|
+
const globalTransfer = getConfig().datePicker.transfer;
|
|
237
|
+
if (import_xe_utils.default.isBoolean(globalTransfer)) {
|
|
238
|
+
return globalTransfer;
|
|
295
239
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
return [];
|
|
300
|
-
});
|
|
301
|
-
const computeCurrStyle = (0, import_vue.computed)(() => {
|
|
302
|
-
const { width } = props;
|
|
303
|
-
const stys = {};
|
|
304
|
-
if (width) {
|
|
305
|
-
stys.width = (0, import_dom.toCssUnit)(width);
|
|
306
|
-
}
|
|
307
|
-
return stys;
|
|
308
|
-
});
|
|
309
|
-
const computeDateStartDate = (0, import_vue.computed)(() => {
|
|
310
|
-
return props.startDate ? import_xe_utils.default.toStringDate(props.startDate) : null;
|
|
311
|
-
});
|
|
312
|
-
const computeDateEndDate = (0, import_vue.computed)(() => {
|
|
313
|
-
return props.endDate ? import_xe_utils.default.toStringDate(props.endDate) : null;
|
|
314
|
-
});
|
|
315
|
-
const computeLimitMaxCount = (0, import_vue.computed)(() => {
|
|
316
|
-
return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
|
|
317
|
-
});
|
|
318
|
-
const computeDateMultipleValue = (0, import_vue.computed)(() => {
|
|
319
|
-
const dateListValue = computeDateListValue.value;
|
|
320
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
321
|
-
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
|
|
322
|
-
});
|
|
323
|
-
const computeOverCount = (0, import_vue.computed)(() => {
|
|
324
|
-
const { multiple } = props;
|
|
325
|
-
const limitMaxCount = computeLimitMaxCount.value;
|
|
326
|
-
const dateMultipleValue = computeDateMultipleValue.value;
|
|
327
|
-
if (multiple && limitMaxCount) {
|
|
328
|
-
return dateMultipleValue.length >= limitMaxCount;
|
|
329
|
-
}
|
|
330
|
-
return false;
|
|
331
|
-
});
|
|
332
|
-
const computeInputReadonly = (0, import_vue.computed)(() => {
|
|
333
|
-
const { type, editable, multiple } = props;
|
|
334
|
-
const formReadonly = computeFormReadonly.value;
|
|
335
|
-
return formReadonly || multiple || !editable || type === "week" || type === "quarter";
|
|
336
|
-
});
|
|
337
|
-
const computeInpPlaceholder = (0, import_vue.computed)(() => {
|
|
338
|
-
const { placeholder } = props;
|
|
339
|
-
if (placeholder) {
|
|
340
|
-
return (0, import_utils.getFuncText)(placeholder);
|
|
341
|
-
}
|
|
342
|
-
const globalPlaceholder = getConfig().datePicker.placeholder;
|
|
343
|
-
if (globalPlaceholder) {
|
|
344
|
-
return (0, import_utils.getFuncText)(globalPlaceholder);
|
|
345
|
-
}
|
|
346
|
-
return getI18n("vxe.base.pleaseSelect");
|
|
347
|
-
});
|
|
348
|
-
const computeInpImmediate = (0, import_vue.computed)(() => {
|
|
349
|
-
const { immediate } = props;
|
|
350
|
-
return immediate;
|
|
351
|
-
});
|
|
352
|
-
const computeTimeOpts = (0, import_vue.computed)(() => {
|
|
353
|
-
return Object.assign({}, getConfig().datePicker.timeConfig, props.timeConfig);
|
|
354
|
-
});
|
|
355
|
-
const computePopupOpts = (0, import_vue.computed)(() => {
|
|
356
|
-
return Object.assign({}, getConfig().datePicker.popupConfig, props.popupConfig);
|
|
357
|
-
});
|
|
358
|
-
const computeShortcutOpts = (0, import_vue.computed)(() => {
|
|
359
|
-
return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
|
|
360
|
-
});
|
|
361
|
-
const computeShortcutList = (0, import_vue.computed)(() => {
|
|
362
|
-
const shortcutOpts = computeShortcutOpts.value;
|
|
363
|
-
const { options } = shortcutOpts;
|
|
364
|
-
if (options) {
|
|
365
|
-
return options.map((option, index) => {
|
|
366
|
-
return Object.assign(
|
|
367
|
-
{
|
|
368
|
-
name: `${option.name || option.code || index}`
|
|
369
|
-
},
|
|
370
|
-
option
|
|
371
|
-
);
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
return [];
|
|
375
|
-
});
|
|
376
|
-
const computeDateLabelFormat = (0, import_vue.computed)(() => {
|
|
377
|
-
const { labelFormat } = props;
|
|
378
|
-
return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
379
|
-
});
|
|
380
|
-
const computeDateValueFormat = (0, import_vue.computed)(() => {
|
|
381
|
-
const { type, valueFormat } = props;
|
|
382
|
-
return (0, import_util.handleValueFormat)(type, valueFormat);
|
|
383
|
-
});
|
|
384
|
-
const computeDateMaskedFormat = (0, import_vue.computed)(() => {
|
|
385
|
-
const dateLabelFormat = computeDateLabelFormat.value;
|
|
386
|
-
return dateLabelFormat;
|
|
387
|
-
});
|
|
388
|
-
const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
|
|
389
|
-
const { startDay } = props;
|
|
390
|
-
return import_xe_utils.default.toNumber(startDay);
|
|
391
|
-
});
|
|
392
|
-
const computePanelLabel = (0, import_vue.computed)(() => {
|
|
393
|
-
const { type, multiple } = props;
|
|
394
|
-
const { inputValue } = reactData;
|
|
395
|
-
const dateLabelFormat = computeDateLabelFormat.value;
|
|
396
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
397
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
398
|
-
const vals = inputValue ? multiple ? inputValue.split(",") : [inputValue] : [];
|
|
399
|
-
return vals.map((val) => {
|
|
400
|
-
const dateObj = (0, import_util.parseDateObj)(val, type, {
|
|
401
|
-
valueFormat: dateValueFormat,
|
|
402
|
-
labelFormat: dateLabelFormat,
|
|
403
|
-
firstDay: firstDayOfWeek
|
|
404
|
-
});
|
|
405
|
-
return dateObj.label;
|
|
406
|
-
}).join(", ");
|
|
407
|
-
});
|
|
408
|
-
const computeMaskedOpts = (0, import_vue.computed)(() => {
|
|
409
|
-
return Object.assign({}, getConfig().datePicker.maskedConfig, props.maskedConfig);
|
|
410
|
-
});
|
|
411
|
-
const computeMaskChar = (0, import_vue.computed)(() => {
|
|
412
|
-
const maskedOpts = computeMaskedOpts.value;
|
|
413
|
-
const { maskPlaceholder } = maskedOpts;
|
|
414
|
-
return (maskPlaceholder ? ("" + maskPlaceholder)[0] : "") || defaultMaskPlaceholder;
|
|
415
|
-
});
|
|
416
|
-
const updateModelValue = () => {
|
|
417
|
-
const { modelValue } = props;
|
|
418
|
-
let val = "";
|
|
419
|
-
if (modelValue) {
|
|
420
|
-
if (import_xe_utils.default.isNumber(modelValue) && /^[0-9]{11,15}$/.test(`${modelValue}`)) {
|
|
421
|
-
val = new Date(modelValue);
|
|
422
|
-
} else {
|
|
423
|
-
val = modelValue;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
reactData.inputValue = val;
|
|
427
|
-
};
|
|
428
|
-
const handleInputLabel = (text, isUpdate) => {
|
|
429
|
-
internalData.inputLabel = text;
|
|
430
|
-
if (isUpdate) {
|
|
431
|
-
reactData.labelFlag++;
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
const triggerEvent = (evnt) => {
|
|
435
|
-
const { inputValue } = reactData;
|
|
436
|
-
dispatchEvent(evnt.type, { value: inputValue }, evnt);
|
|
437
|
-
};
|
|
438
|
-
const handleChange = (value, evnt) => {
|
|
439
|
-
const { type, modelValue, valueFormat } = props;
|
|
440
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
441
|
-
reactData.inputValue = value;
|
|
442
|
-
if ((0, import_util.hasTimestampValueType)(valueFormat)) {
|
|
443
|
-
const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
|
|
444
|
-
const timeNum = dateVal ? dateVal.getTime() : null;
|
|
445
|
-
emitModel(timeNum);
|
|
446
|
-
if (modelValue !== timeNum) {
|
|
447
|
-
dispatchEvent("change", { value: timeNum }, evnt);
|
|
448
|
-
if ($xeForm && formItemInfo) {
|
|
449
|
-
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, timeNum);
|
|
240
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
241
|
+
return true;
|
|
450
242
|
}
|
|
451
243
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
if ($xeForm
|
|
458
|
-
$xeForm.
|
|
244
|
+
return transfer;
|
|
245
|
+
});
|
|
246
|
+
const computeFormReadonly = (0, import_vue.computed)(() => {
|
|
247
|
+
const { readonly } = props;
|
|
248
|
+
if (readonly === null) {
|
|
249
|
+
if ($xeForm) {
|
|
250
|
+
return $xeForm.props.readonly;
|
|
459
251
|
}
|
|
252
|
+
return false;
|
|
460
253
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
254
|
+
return readonly;
|
|
255
|
+
});
|
|
256
|
+
const computeIsDisabled = (0, import_vue.computed)(() => {
|
|
257
|
+
const { disabled } = props;
|
|
258
|
+
if (disabled === null) {
|
|
259
|
+
if ($xeForm) {
|
|
260
|
+
return $xeForm.props.disabled;
|
|
467
261
|
}
|
|
262
|
+
return false;
|
|
468
263
|
}
|
|
469
|
-
|
|
470
|
-
};
|
|
471
|
-
const inputEvent = (evnt) => {
|
|
472
|
-
const inputElem = evnt.target;
|
|
473
|
-
const value = inputElem.value;
|
|
474
|
-
handleInputLabel(value, true);
|
|
475
|
-
dispatchEvent("input", { value }, evnt);
|
|
476
|
-
};
|
|
477
|
-
const changeEvent = (evnt) => {
|
|
478
|
-
const inpImmediate = computeInpImmediate.value;
|
|
479
|
-
if (!inpImmediate) {
|
|
480
|
-
triggerEvent(evnt);
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
const clickPrefixEvent = (evnt) => {
|
|
484
|
-
const isDisabled = computeIsDisabled.value;
|
|
485
|
-
if (!isDisabled) {
|
|
486
|
-
const { inputValue } = reactData;
|
|
487
|
-
dispatchEvent("prefix-click", { value: inputValue }, evnt);
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
const hidePanel = () => {
|
|
491
|
-
return new Promise((resolve) => {
|
|
492
|
-
reactData.visiblePanel = false;
|
|
493
|
-
internalData.hpTimeout = setTimeout(() => {
|
|
494
|
-
reactData.isAniVisible = false;
|
|
495
|
-
resolve();
|
|
496
|
-
}, 350);
|
|
264
|
+
return disabled;
|
|
497
265
|
});
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
266
|
+
const computeIsTimeType = (0, import_vue.computed)(() => {
|
|
267
|
+
const { type } = props;
|
|
268
|
+
return type === "time";
|
|
269
|
+
});
|
|
270
|
+
const computeIsTimeOrDateTimeType = (0, import_vue.computed)(() => {
|
|
271
|
+
const { type } = props;
|
|
272
|
+
const isTimeType = computeIsTimeType.value;
|
|
273
|
+
return isTimeType || type === "datetime";
|
|
274
|
+
});
|
|
275
|
+
const computeIsDatePickerType = (0, import_vue.computed)(() => {
|
|
276
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
277
|
+
return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
|
|
278
|
+
});
|
|
279
|
+
const computeIsClearable = (0, import_vue.computed)(() => {
|
|
280
|
+
return props.clearable;
|
|
281
|
+
});
|
|
282
|
+
const computeIsDatePanelType = (0, import_vue.computed)(() => {
|
|
283
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
284
|
+
return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
|
|
285
|
+
});
|
|
286
|
+
const computeDateListValue = (0, import_vue.computed)(() => {
|
|
287
|
+
const { modelValue, type, multiple } = props;
|
|
288
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
289
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
290
|
+
if (multiple && modelValue && isDatePanelType) {
|
|
291
|
+
return import_xe_utils.default.toValueString(modelValue).split(",").map((item) => {
|
|
292
|
+
const date = (0, import_util.parseDateValue)(item, type, {
|
|
293
|
+
valueFormat: dateValueFormat
|
|
294
|
+
});
|
|
295
|
+
if (import_xe_utils.default.isValidDate(date)) {
|
|
296
|
+
return date;
|
|
518
297
|
}
|
|
519
|
-
|
|
298
|
+
return date;
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
return [];
|
|
302
|
+
});
|
|
303
|
+
const computeCurrStyle = (0, import_vue.computed)(() => {
|
|
304
|
+
const { width } = props;
|
|
305
|
+
const stys = {};
|
|
306
|
+
if (width) {
|
|
307
|
+
stys.width = (0, import_dom.toCssUnit)(width);
|
|
308
|
+
}
|
|
309
|
+
return stys;
|
|
310
|
+
});
|
|
311
|
+
const computeDateStartDate = (0, import_vue.computed)(() => {
|
|
312
|
+
return props.startDate ? import_xe_utils.default.toStringDate(props.startDate) : null;
|
|
313
|
+
});
|
|
314
|
+
const computeDateEndDate = (0, import_vue.computed)(() => {
|
|
315
|
+
return props.endDate ? import_xe_utils.default.toStringDate(props.endDate) : null;
|
|
316
|
+
});
|
|
317
|
+
const computeLimitMaxCount = (0, import_vue.computed)(() => {
|
|
318
|
+
return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
|
|
319
|
+
});
|
|
320
|
+
const computeDateMultipleValue = (0, import_vue.computed)(() => {
|
|
321
|
+
const dateListValue = computeDateListValue.value;
|
|
322
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
323
|
+
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
|
|
324
|
+
});
|
|
325
|
+
const computeOverCount = (0, import_vue.computed)(() => {
|
|
326
|
+
const { multiple } = props;
|
|
327
|
+
const limitMaxCount = computeLimitMaxCount.value;
|
|
328
|
+
const dateMultipleValue = computeDateMultipleValue.value;
|
|
329
|
+
if (multiple && limitMaxCount) {
|
|
330
|
+
return dateMultipleValue.length >= limitMaxCount;
|
|
331
|
+
}
|
|
332
|
+
return false;
|
|
333
|
+
});
|
|
334
|
+
const computeInputReadonly = (0, import_vue.computed)(() => {
|
|
335
|
+
const { type, editable, multiple } = props;
|
|
336
|
+
const formReadonly = computeFormReadonly.value;
|
|
337
|
+
return formReadonly || multiple || !editable || type === "week" || type === "quarter";
|
|
338
|
+
});
|
|
339
|
+
const computeInpPlaceholder = (0, import_vue.computed)(() => {
|
|
340
|
+
const { placeholder } = props;
|
|
341
|
+
if (placeholder) {
|
|
342
|
+
return (0, import_utils.getFuncText)(placeholder);
|
|
343
|
+
}
|
|
344
|
+
const globalPlaceholder = getConfig().datePicker.placeholder;
|
|
345
|
+
if (globalPlaceholder) {
|
|
346
|
+
return (0, import_utils.getFuncText)(globalPlaceholder);
|
|
347
|
+
}
|
|
348
|
+
return getI18n("vxe.base.pleaseSelect");
|
|
349
|
+
});
|
|
350
|
+
const computeInpImmediate = (0, import_vue.computed)(() => {
|
|
351
|
+
const { immediate } = props;
|
|
352
|
+
return immediate;
|
|
353
|
+
});
|
|
354
|
+
const computeTimeOpts = (0, import_vue.computed)(() => {
|
|
355
|
+
return Object.assign({}, getConfig().datePicker.timeConfig, props.timeConfig);
|
|
356
|
+
});
|
|
357
|
+
const computePopupOpts = (0, import_vue.computed)(() => {
|
|
358
|
+
return Object.assign({}, getConfig().datePicker.popupConfig, props.popupConfig);
|
|
359
|
+
});
|
|
360
|
+
const computeShortcutOpts = (0, import_vue.computed)(() => {
|
|
361
|
+
return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
|
|
362
|
+
});
|
|
363
|
+
const computeShortcutList = (0, import_vue.computed)(() => {
|
|
364
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
365
|
+
const { options } = shortcutOpts;
|
|
366
|
+
if (options) {
|
|
367
|
+
return options.map((option, index) => {
|
|
368
|
+
return Object.assign(
|
|
369
|
+
{
|
|
370
|
+
name: `${option.name || option.code || index}`
|
|
371
|
+
},
|
|
372
|
+
option
|
|
373
|
+
);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return [];
|
|
377
|
+
});
|
|
378
|
+
const computeDateLabelFormat = (0, import_vue.computed)(() => {
|
|
379
|
+
const { labelFormat } = props;
|
|
380
|
+
return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
381
|
+
});
|
|
382
|
+
const computeDateValueFormat = (0, import_vue.computed)(() => {
|
|
383
|
+
const { type, valueFormat } = props;
|
|
384
|
+
return (0, import_util.handleValueFormat)(type, valueFormat);
|
|
385
|
+
});
|
|
386
|
+
const computeDateMaskedFormat = (0, import_vue.computed)(() => {
|
|
387
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
388
|
+
return dateLabelFormat;
|
|
389
|
+
});
|
|
390
|
+
const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
|
|
391
|
+
const { startDay } = props;
|
|
392
|
+
return import_xe_utils.default.toNumber(startDay);
|
|
393
|
+
});
|
|
394
|
+
const computePanelLabel = (0, import_vue.computed)(() => {
|
|
395
|
+
const { type, multiple } = props;
|
|
396
|
+
const { inputValue } = reactData;
|
|
397
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
398
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
399
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
400
|
+
const vals = inputValue ? multiple ? inputValue.split(",") : [inputValue] : [];
|
|
401
|
+
return vals.map((val) => {
|
|
402
|
+
const dateObj = (0, import_util.parseDateObj)(val, type, {
|
|
403
|
+
valueFormat: dateValueFormat,
|
|
404
|
+
labelFormat: dateLabelFormat,
|
|
405
|
+
firstDay: firstDayOfWeek
|
|
406
|
+
});
|
|
407
|
+
return dateObj.label;
|
|
408
|
+
}).join(", ");
|
|
409
|
+
});
|
|
410
|
+
const computeMaskedOpts = (0, import_vue.computed)(() => {
|
|
411
|
+
return Object.assign({}, getConfig().datePicker.maskedConfig, props.maskedConfig);
|
|
412
|
+
});
|
|
413
|
+
const computeMaskChar = (0, import_vue.computed)(() => {
|
|
414
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
415
|
+
const { maskPlaceholder } = maskedOpts;
|
|
416
|
+
return (maskPlaceholder ? ("" + maskPlaceholder)[0] : "") || defaultMaskPlaceholder;
|
|
417
|
+
});
|
|
418
|
+
const updateModelValue = () => {
|
|
419
|
+
const { modelValue } = props;
|
|
420
|
+
let val = "";
|
|
421
|
+
if (modelValue) {
|
|
422
|
+
if (import_xe_utils.default.isNumber(modelValue) && /^[0-9]{11,15}$/.test(`${modelValue}`)) {
|
|
423
|
+
val = new Date(modelValue);
|
|
520
424
|
} else {
|
|
521
|
-
|
|
425
|
+
val = modelValue;
|
|
522
426
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
427
|
+
}
|
|
428
|
+
reactData.inputValue = val;
|
|
429
|
+
};
|
|
430
|
+
const handleInputLabel = (text, isUpdate) => {
|
|
431
|
+
internalData.inputLabel = text;
|
|
432
|
+
if (isUpdate) {
|
|
433
|
+
reactData.labelFlag++;
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
const triggerEvent = (evnt) => {
|
|
437
|
+
const { inputValue } = reactData;
|
|
438
|
+
dispatchEvent(evnt.type, { value: inputValue }, evnt);
|
|
439
|
+
};
|
|
440
|
+
const handleChange = (value, evnt) => {
|
|
441
|
+
const { type, modelValue, valueFormat } = props;
|
|
442
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
443
|
+
reactData.inputValue = value;
|
|
444
|
+
if ((0, import_util.hasTimestampValueType)(valueFormat)) {
|
|
445
|
+
const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
|
|
446
|
+
const timeNum = dateVal ? dateVal.getTime() : null;
|
|
447
|
+
emitModel(timeNum);
|
|
448
|
+
if (modelValue !== timeNum) {
|
|
449
|
+
dispatchEvent("change", { value: timeNum }, evnt);
|
|
450
|
+
if ($xeForm && formItemInfo) {
|
|
451
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, timeNum);
|
|
526
452
|
}
|
|
527
|
-
}
|
|
528
|
-
|
|
453
|
+
}
|
|
454
|
+
} else if ((0, import_util.hasDateValueType)(valueFormat)) {
|
|
455
|
+
const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
|
|
456
|
+
emitModel(dateVal);
|
|
457
|
+
if (modelValue && dateVal ? import_xe_utils.default.toStringDate(modelValue).getTime() !== dateVal.getTime() : modelValue !== dateVal) {
|
|
458
|
+
dispatchEvent("change", { value: dateVal }, evnt);
|
|
459
|
+
if ($xeForm && formItemInfo) {
|
|
460
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, dateVal);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
529
463
|
} else {
|
|
530
|
-
|
|
531
|
-
if (
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return;
|
|
464
|
+
emitModel(value);
|
|
465
|
+
if (import_xe_utils.default.toValueString(modelValue) !== value) {
|
|
466
|
+
dispatchEvent("change", { value }, evnt);
|
|
467
|
+
if ($xeForm && formItemInfo) {
|
|
468
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
536
469
|
}
|
|
537
|
-
handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
|
|
538
470
|
}
|
|
539
471
|
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
472
|
+
};
|
|
473
|
+
const inputEvent = (evnt) => {
|
|
474
|
+
const inputElem = evnt.target;
|
|
475
|
+
const value = inputElem.value;
|
|
476
|
+
handleInputLabel(value, true);
|
|
477
|
+
dispatchEvent("input", { value }, evnt);
|
|
478
|
+
};
|
|
479
|
+
const changeEvent = (evnt) => {
|
|
480
|
+
const inpImmediate = computeInpImmediate.value;
|
|
481
|
+
if (!inpImmediate) {
|
|
482
|
+
triggerEvent(evnt);
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
const clickPrefixEvent = (evnt) => {
|
|
486
|
+
const isDisabled = computeIsDisabled.value;
|
|
487
|
+
if (!isDisabled) {
|
|
488
|
+
const { inputValue } = reactData;
|
|
489
|
+
dispatchEvent("prefix-click", { value: inputValue }, evnt);
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
const hidePanel = () => {
|
|
493
|
+
return new Promise((resolve) => {
|
|
494
|
+
reactData.visiblePanel = false;
|
|
495
|
+
internalData.hpTimeout = setTimeout(() => {
|
|
496
|
+
reactData.isAniVisible = false;
|
|
497
|
+
resolve();
|
|
498
|
+
}, 350);
|
|
499
|
+
});
|
|
500
|
+
};
|
|
501
|
+
const dateChange = (date, isReload) => {
|
|
502
|
+
const { modelValue, multiple } = props;
|
|
503
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
504
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
505
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
506
|
+
if (props.type === "week") {
|
|
507
|
+
const sWeek = import_xe_utils.default.toNumber(props.selectDay);
|
|
508
|
+
date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
|
|
509
|
+
}
|
|
510
|
+
const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
|
|
511
|
+
if (multiple) {
|
|
512
|
+
const overCount = computeOverCount.value;
|
|
513
|
+
if (isTimeOrDateTimeType) {
|
|
514
|
+
const dateListValue = isReload ? [] : [...computeDateListValue.value];
|
|
515
|
+
const datetimeRest = [];
|
|
516
|
+
const eqIndex = import_xe_utils.default.findIndexOf(dateListValue, (val) => import_xe_utils.default.isDateSame(date, val, "yyyyMMdd"));
|
|
517
|
+
if (eqIndex === -1) {
|
|
518
|
+
if (overCount) {
|
|
570
519
|
return;
|
|
571
520
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
521
|
+
dateListValue.push(date);
|
|
522
|
+
} else {
|
|
523
|
+
dateListValue.splice(eqIndex, 1);
|
|
524
|
+
}
|
|
525
|
+
dateListValue.forEach((item) => {
|
|
526
|
+
if (item) {
|
|
527
|
+
datetimeRest.push(item);
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
handleChange(datetimeRest.map((date2) => import_xe_utils.default.toDateString(date2, dateValueFormat)).join(","), { type: "update" });
|
|
531
|
+
} else {
|
|
532
|
+
const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
|
|
533
|
+
if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
|
|
534
|
+
handleChange(dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal)).join(","), { type: "update" });
|
|
535
|
+
} else {
|
|
536
|
+
if (overCount) {
|
|
537
|
+
return;
|
|
575
538
|
}
|
|
576
|
-
|
|
539
|
+
handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
|
|
577
540
|
}
|
|
541
|
+
}
|
|
542
|
+
} else {
|
|
543
|
+
if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
|
|
544
|
+
handleChange(inpVal, { type: "update" });
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
const dateRevert = () => {
|
|
549
|
+
const panelLabel = computePanelLabel.value;
|
|
550
|
+
handleInputLabel(panelLabel, true);
|
|
551
|
+
};
|
|
552
|
+
const afterCheckValue = (inpVal) => {
|
|
553
|
+
const { type, editable, multiple, maskedConfig } = props;
|
|
554
|
+
const { inputLabel } = internalData;
|
|
555
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
556
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
557
|
+
const dateStartDate = computeDateStartDate.value;
|
|
558
|
+
const dateEndDate = computeDateEndDate.value;
|
|
559
|
+
const parseInpMethod = props.parseInputMethod || defaultFuncProps.parseInputMethod;
|
|
560
|
+
if (!inpVal) {
|
|
561
|
+
handleChange("", { type: "check" });
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
|
|
565
|
+
const allMaskedKeys = dateLabelFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g"));
|
|
566
|
+
if (allMaskedKeys) {
|
|
567
|
+
allMaskedKeys.forEach((formatKey) => {
|
|
568
|
+
const fkIndex = dateLabelFormat.indexOf(formatKey);
|
|
569
|
+
if (fkIndex > -1) {
|
|
570
|
+
const valStr = inpVal.slice(fkIndex, fkIndex + formatKey.length).replace(/\D/g, "");
|
|
571
|
+
if (!valStr) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
let valNum = import_xe_utils.default.toNumber(valStr);
|
|
575
|
+
if (!valNum && ["MM", "dd"].includes(formatKey)) {
|
|
576
|
+
valNum = 1;
|
|
577
|
+
}
|
|
578
|
+
inpVal = inpVal.slice(0, fkIndex) + import_xe_utils.default.padStart((0, import_util.checkDateInputFormat)(valNum, formatKey), formatKey.length, "0") + inpVal.slice(fkIndex + formatKey.length);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
let inpDateVal;
|
|
584
|
+
if (parseInpMethod) {
|
|
585
|
+
inpDateVal = parseInpMethod({
|
|
586
|
+
$datePicker: $xeDatePicker,
|
|
587
|
+
type,
|
|
588
|
+
inputValue: inpVal,
|
|
589
|
+
valueFormat: dateLabelFormat
|
|
590
|
+
}) || null;
|
|
591
|
+
} else {
|
|
592
|
+
const $datePanel = refDatePanel.value;
|
|
593
|
+
if ($datePanel) {
|
|
594
|
+
return $datePanel.checkValue(inpVal);
|
|
595
|
+
}
|
|
596
|
+
inpDateVal = (0, import_util.parseDateValue)(inpVal, type, {
|
|
597
|
+
valueFormat: dateLabelFormat
|
|
578
598
|
});
|
|
579
599
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
inpDateVal = parseInpMethod({
|
|
584
|
-
$datePicker: $xeDatePicker,
|
|
585
|
-
type,
|
|
586
|
-
inputValue: inpVal,
|
|
587
|
-
valueFormat: dateLabelFormat
|
|
588
|
-
}) || null;
|
|
589
|
-
} else {
|
|
590
|
-
const $datePanel = refDatePanel.value;
|
|
591
|
-
if ($datePanel) {
|
|
592
|
-
return $datePanel.checkValue(inpVal);
|
|
600
|
+
if (!import_xe_utils.default.isValidDate(inpDateVal)) {
|
|
601
|
+
dateRevert();
|
|
602
|
+
return;
|
|
593
603
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
let isChange = false;
|
|
617
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
618
|
-
if (type === "datetime") {
|
|
619
|
-
const dateValue = reactData.inputValue;
|
|
620
|
-
if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
|
|
604
|
+
if (type === "time") {
|
|
605
|
+
const timeVal = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat);
|
|
606
|
+
if (inputLabel !== timeVal) {
|
|
607
|
+
handleChange(inpDateVal, { type: "check" });
|
|
608
|
+
}
|
|
609
|
+
handleInputLabel(timeVal, true);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
if (dateEndDate && inpDateVal > dateEndDate) {
|
|
613
|
+
inpDateVal = dateEndDate;
|
|
614
|
+
}
|
|
615
|
+
if (dateStartDate && inpDateVal < dateStartDate) {
|
|
616
|
+
inpDateVal = dateStartDate;
|
|
617
|
+
}
|
|
618
|
+
let isChange = false;
|
|
619
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
620
|
+
if (type === "datetime") {
|
|
621
|
+
const dateValue = reactData.inputValue;
|
|
622
|
+
if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
|
|
623
|
+
isChange = true;
|
|
624
|
+
}
|
|
625
|
+
} else {
|
|
621
626
|
isChange = true;
|
|
622
627
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
628
|
+
const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
|
|
629
|
+
handleInputLabel(label, true);
|
|
630
|
+
if (isChange) {
|
|
631
|
+
dateChange(inpDateVal);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
const clearValueEvent = (evnt, value) => {
|
|
635
|
+
const isDatePickerType = computeIsDatePickerType.value;
|
|
636
|
+
if (isDatePickerType) {
|
|
637
|
+
hidePanel();
|
|
638
|
+
}
|
|
639
|
+
handleChange("", evnt);
|
|
640
|
+
dispatchEvent("clear", { value }, evnt);
|
|
641
|
+
};
|
|
642
|
+
const clickSuffixEvent = (evnt) => {
|
|
643
|
+
const isDisabled = computeIsDisabled.value;
|
|
644
|
+
if (!isDisabled) {
|
|
645
|
+
const { inputValue } = reactData;
|
|
646
|
+
dispatchEvent("suffix-click", { value: inputValue }, evnt);
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
const checkMaskedInputValue = (numStr, chunkFormat, isFull) => {
|
|
650
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
651
|
+
const { align } = maskedOpts;
|
|
652
|
+
const maskChar = computeMaskChar.value;
|
|
653
|
+
const numVal = import_xe_utils.default.toNumber(numStr);
|
|
654
|
+
let restVal = (0, import_util.checkDateInputFormat)(numVal, chunkFormat);
|
|
655
|
+
if (isFull) {
|
|
656
|
+
if (!restVal && ["MM", "dd"].includes(chunkFormat)) {
|
|
657
|
+
restVal = 1;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
let restStr = "" + restVal;
|
|
661
|
+
if (numStr.length > restStr.length) {
|
|
662
|
+
restStr = restStr.padStart(numStr.length, "0");
|
|
663
|
+
}
|
|
664
|
+
if (isFull) {
|
|
665
|
+
return import_xe_utils.default.padStart(restStr, chunkFormat.length, "0");
|
|
666
|
+
}
|
|
667
|
+
return import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](restStr, chunkFormat.length, maskChar);
|
|
668
|
+
};
|
|
669
|
+
const handleArrowInputDate = (evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow) => {
|
|
670
|
+
const { type, multiple } = props;
|
|
671
|
+
if (multiple) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const targetElem = refInputTarget.value;
|
|
675
|
+
if (!targetElem) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
const inpValue = targetElem.value;
|
|
679
|
+
if (!inpValue) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
const dateMaskedFormat = computeDateMaskedFormat.value;
|
|
683
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
684
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
685
|
+
const maskChar = computeMaskChar.value;
|
|
686
|
+
const selectionStart = targetElem.selectionStart || 0;
|
|
687
|
+
let selectKey = dateMaskedFormat[selectionStart];
|
|
688
|
+
if (!parseInputKayMaps[selectKey]) {
|
|
689
|
+
selectKey = dateMaskedFormat[selectionStart - 1];
|
|
690
|
+
}
|
|
691
|
+
const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
|
|
692
|
+
if (!skRest) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
if (isUpArrow || isDwArrow) {
|
|
696
|
+
const chunkFormat = skRest[0] || "";
|
|
697
|
+
const chunkStartIndex = skRest.index || 0;
|
|
698
|
+
const chunkEndIndex = chunkStartIndex + chunkFormat.length;
|
|
699
|
+
const chunkValue = inpValue.slice(chunkStartIndex, chunkEndIndex);
|
|
700
|
+
if (parseInputKayMaps[selectKey]) {
|
|
701
|
+
const chunkNum = ((0, import_util.isAllSameChar)(chunkValue, maskChar) ? (0, import_util.getChunkDefaultNum)(selectKey) : import_xe_utils.default.toNumber(chunkValue)) + (isUpArrow ? 1 : -1);
|
|
702
|
+
const restValue = inpValue.slice(0, chunkStartIndex) + checkMaskedInputValue("" + chunkNum, chunkFormat, true) + inpValue.slice(chunkEndIndex);
|
|
703
|
+
evnt.preventDefault();
|
|
704
|
+
if (restValue.indexOf(maskChar) === -1) {
|
|
705
|
+
const inpDateVal = (0, import_util.parseDateValue)(restValue, type, {
|
|
706
|
+
valueFormat: dateLabelFormat
|
|
707
|
+
});
|
|
708
|
+
if (import_xe_utils.default.isValidDate(inpDateVal)) {
|
|
709
|
+
const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
|
|
710
|
+
targetElem.value = label;
|
|
711
|
+
handleInputLabel(label, false);
|
|
712
|
+
}
|
|
713
|
+
} else {
|
|
714
|
+
targetElem.value = restValue;
|
|
715
|
+
handleInputLabel(restValue, false);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
|
|
719
|
+
} else if (isLtArrow || isRtArrow) {
|
|
720
|
+
const currKeyIndex = inputMaskedKeys.indexOf(selectKey);
|
|
721
|
+
if (currKeyIndex > -1) {
|
|
722
|
+
const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
|
|
723
|
+
const currIndex = import_xe_utils.default.findIndexOf(allMaskedKeys, (key) => selectKey === key[0]);
|
|
724
|
+
const targetFormatKey = isLtArrow ? allMaskedKeys[currIndex - 1] || allMaskedKeys[0] : allMaskedKeys[currIndex + 1] || allMaskedKeys[allMaskedKeys.length - 1];
|
|
725
|
+
const targetKey = targetFormatKey ? targetFormatKey[0] : "";
|
|
726
|
+
const sktRest = dateMaskedFormat.match(new RegExp(targetKey + "+"));
|
|
727
|
+
if (sktRest) {
|
|
728
|
+
evnt.preventDefault();
|
|
729
|
+
const mtStartIndex = sktRest.index || 0;
|
|
730
|
+
const mtEndIndex = mtStartIndex + sktRest[0].length;
|
|
731
|
+
targetElem.setSelectionRange(mtStartIndex, mtEndIndex);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
internalData.isTriggerMasked = true;
|
|
736
|
+
};
|
|
737
|
+
const handleMaskedInputDate = (evnt) => {
|
|
738
|
+
const { multiple } = props;
|
|
739
|
+
if (multiple) {
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
const targetElem = refInputTarget.value;
|
|
743
|
+
if (!targetElem) {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
const isControlKey = (0, import_dom.hasControlKey)(evnt);
|
|
747
|
+
if (isControlKey) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
evnt.preventDefault();
|
|
751
|
+
const eKey = evnt.key;
|
|
752
|
+
const isDeleleKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
|
|
753
|
+
const isBackspaceKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.BACKSPACE);
|
|
754
|
+
const isNumKey = eKey >= "0" && eKey <= "9";
|
|
755
|
+
const numKey = isNumKey ? evnt.key : "";
|
|
756
|
+
if (!(isDeleleKey || isBackspaceKey || isNumKey)) {
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
const { isTriggerMasked } = internalData;
|
|
760
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
761
|
+
const { align } = maskedOpts;
|
|
762
|
+
const dateMaskedFormat = computeDateMaskedFormat.value;
|
|
763
|
+
const maskChar = computeMaskChar.value;
|
|
764
|
+
let inpValue = targetElem.value || dateMaskedFormat;
|
|
765
|
+
const selectionStart = targetElem.selectionStart || 0;
|
|
766
|
+
const selectionEnd = targetElem.selectionEnd || 0;
|
|
767
|
+
let selectKey = dateMaskedFormat[selectionStart];
|
|
768
|
+
if (!parseInputKayMaps[selectKey]) {
|
|
769
|
+
selectKey = dateMaskedFormat[selectionStart - 1];
|
|
770
|
+
}
|
|
771
|
+
const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
|
|
772
|
+
if (!skRest) {
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
|
|
694
776
|
const chunkFormat = skRest[0] || "";
|
|
695
777
|
const chunkStartIndex = skRest.index || 0;
|
|
696
778
|
const chunkEndIndex = chunkStartIndex + chunkFormat.length;
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
779
|
+
const currKeyIndex = allMaskedKeys.indexOf(selectKey);
|
|
780
|
+
const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
|
|
781
|
+
const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
|
|
782
|
+
if (isAllSelected || isNotMasked) {
|
|
783
|
+
inpValue = dateMaskedFormat;
|
|
784
|
+
}
|
|
785
|
+
let chunkValue = isDeleleKey ? "" : inpValue.slice(chunkStartIndex, chunkEndIndex);
|
|
786
|
+
const chunkNums = chunkValue.match(/\d/g) || [];
|
|
787
|
+
const chunkNumList = isTriggerMasked && !isBackspaceKey ? [] : chunkNums.slice(0);
|
|
788
|
+
if (isNumKey) {
|
|
789
|
+
chunkNumList.push(numKey);
|
|
790
|
+
chunkValue = checkMaskedInputValue(chunkNumList.join(""), chunkFormat, false);
|
|
791
|
+
} else if (isBackspaceKey) {
|
|
792
|
+
chunkNumList.pop();
|
|
793
|
+
chunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](chunkNumList.join(""), chunkFormat.length, maskChar);
|
|
794
|
+
}
|
|
795
|
+
let restValue = inpValue.slice(0, chunkStartIndex) + chunkValue + inpValue.slice(chunkEndIndex);
|
|
796
|
+
restValue = restValue.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
797
|
+
targetElem.value = restValue;
|
|
798
|
+
handleInputLabel(restValue, false);
|
|
799
|
+
if (isAllSelected) {
|
|
800
|
+
if (isBackspaceKey || isDeleleKey) {
|
|
801
|
+
const firstMaskedKeys = allMaskedKeys[0];
|
|
802
|
+
const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
|
|
803
|
+
if (firstSkRest) {
|
|
804
|
+
const firstChunkFormat = firstSkRest[0];
|
|
805
|
+
targetElem.setSelectionRange(0, firstChunkFormat.length);
|
|
806
|
+
internalData.isTriggerMasked = true;
|
|
807
|
+
return;
|
|
710
808
|
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
|
|
809
|
+
}
|
|
810
|
+
} else {
|
|
811
|
+
if (isBackspaceKey && !chunkNums.length) {
|
|
812
|
+
for (let i = currKeyIndex - 1; i >= 0; i--) {
|
|
813
|
+
const prveChunkKey = allMaskedKeys[i];
|
|
814
|
+
const prveSkRest = dateMaskedFormat.match(new RegExp(`${prveChunkKey}+`));
|
|
815
|
+
if (prveSkRest) {
|
|
816
|
+
const prveChunkFormat = prveSkRest[0];
|
|
817
|
+
const prveChunkStartIndex = prveSkRest.index || 0;
|
|
818
|
+
const prveChunkEndIndex = prveChunkStartIndex + prveChunkFormat.length;
|
|
819
|
+
let prveChunkValue = restValue.slice(prveChunkStartIndex, prveChunkEndIndex);
|
|
820
|
+
const prveChunkNums = prveChunkValue.match(/\d/g) || [];
|
|
821
|
+
if (prveChunkNums.length) {
|
|
822
|
+
prveChunkNums.pop();
|
|
823
|
+
prveChunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](prveChunkNums.join(""), prveChunkFormat.length, maskChar);
|
|
824
|
+
restValue = restValue.slice(0, prveChunkStartIndex) + prveChunkValue + restValue.slice(prveChunkEndIndex);
|
|
825
|
+
targetElem.value = restValue;
|
|
826
|
+
handleInputLabel(restValue, false);
|
|
827
|
+
targetElem.setSelectionRange(prveChunkStartIndex, prveChunkEndIndex);
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
const firstMaskedKeys = allMaskedKeys[0];
|
|
833
|
+
const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
|
|
834
|
+
if (firstSkRest) {
|
|
835
|
+
const firstChunkFormat = firstSkRest[0];
|
|
836
|
+
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
837
|
+
targetElem.value = restValue;
|
|
838
|
+
handleInputLabel(restValue, false);
|
|
839
|
+
targetElem.setSelectionRange(0, firstChunkFormat.length);
|
|
840
|
+
internalData.isTriggerMasked = true;
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
return;
|
|
714
844
|
}
|
|
715
845
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
targetElem.setSelectionRange(mtStartIndex, mtEndIndex);
|
|
846
|
+
let maskStartIndex = skRest.index || 0;
|
|
847
|
+
let maskEndIndex = maskStartIndex + skRest[0].length;
|
|
848
|
+
if (chunkNumList.length >= chunkValue.length) {
|
|
849
|
+
const nextKeys = allMaskedKeys.slice(currKeyIndex + 1);
|
|
850
|
+
if (currKeyIndex > -1) {
|
|
851
|
+
const nextRest = nextKeys.length ? dateMaskedFormat.match(new RegExp(`(${nextKeys.join("|")})+`)) : null;
|
|
852
|
+
if (nextRest) {
|
|
853
|
+
maskStartIndex = nextRest.index || 0;
|
|
854
|
+
maskEndIndex = maskStartIndex + nextRest[0].length;
|
|
855
|
+
targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
|
|
856
|
+
} else {
|
|
857
|
+
targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
|
|
858
|
+
}
|
|
730
859
|
}
|
|
860
|
+
internalData.isTriggerMasked = true;
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
|
|
864
|
+
internalData.isTriggerMasked = false;
|
|
865
|
+
};
|
|
866
|
+
const handleMaskedSelectedDate = (evnt, isFocus) => {
|
|
867
|
+
internalData.fsTimeout = void 0;
|
|
868
|
+
const { type, multiple, modelValue } = props;
|
|
869
|
+
if (multiple) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
if (!maskedTypes.includes(type)) {
|
|
873
|
+
return;
|
|
731
874
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
const numKey = isNumKey ? evnt.key : "";
|
|
754
|
-
if (!(isDeleleKey || isBackspaceKey || isNumKey)) {
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
const { isTriggerMasked } = internalData;
|
|
758
|
-
const maskedOpts = computeMaskedOpts.value;
|
|
759
|
-
const { align } = maskedOpts;
|
|
760
|
-
const dateMaskedFormat = computeDateMaskedFormat.value;
|
|
761
|
-
const maskChar = computeMaskChar.value;
|
|
762
|
-
let inpValue = targetElem.value || dateMaskedFormat;
|
|
763
|
-
const selectionStart = targetElem.selectionStart || 0;
|
|
764
|
-
const selectionEnd = targetElem.selectionEnd || 0;
|
|
765
|
-
let selectKey = dateMaskedFormat[selectionStart];
|
|
766
|
-
if (!parseInputKayMaps[selectKey]) {
|
|
767
|
-
selectKey = dateMaskedFormat[selectionStart - 1];
|
|
768
|
-
}
|
|
769
|
-
const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
|
|
770
|
-
if (!skRest) {
|
|
771
|
-
return;
|
|
772
|
-
}
|
|
773
|
-
const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
|
|
774
|
-
const chunkFormat = skRest[0] || "";
|
|
775
|
-
const chunkStartIndex = skRest.index || 0;
|
|
776
|
-
const chunkEndIndex = chunkStartIndex + chunkFormat.length;
|
|
777
|
-
const currKeyIndex = allMaskedKeys.indexOf(selectKey);
|
|
778
|
-
const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
|
|
779
|
-
const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
|
|
780
|
-
if (isAllSelected || isNotMasked) {
|
|
781
|
-
inpValue = dateMaskedFormat;
|
|
782
|
-
}
|
|
783
|
-
let chunkValue = isDeleleKey ? "" : inpValue.slice(chunkStartIndex, chunkEndIndex);
|
|
784
|
-
const chunkNums = chunkValue.match(/\d/g) || [];
|
|
785
|
-
const chunkNumList = isTriggerMasked && !isBackspaceKey ? [] : chunkNums.slice(0);
|
|
786
|
-
if (isNumKey) {
|
|
787
|
-
chunkNumList.push(numKey);
|
|
788
|
-
chunkValue = checkMaskedInputValue(chunkNumList.join(""), chunkFormat, false);
|
|
789
|
-
} else if (isBackspaceKey) {
|
|
790
|
-
chunkNumList.pop();
|
|
791
|
-
chunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](chunkNumList.join(""), chunkFormat.length, maskChar);
|
|
792
|
-
}
|
|
793
|
-
let restValue = inpValue.slice(0, chunkStartIndex) + chunkValue + inpValue.slice(chunkEndIndex);
|
|
794
|
-
restValue = restValue.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
795
|
-
targetElem.value = restValue;
|
|
796
|
-
handleInputLabel(restValue, false);
|
|
797
|
-
if (isAllSelected) {
|
|
798
|
-
if (isBackspaceKey || isDeleleKey) {
|
|
875
|
+
const targetElem = refInputTarget.value;
|
|
876
|
+
if (!targetElem) {
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
const { laseFocusMasked } = internalData;
|
|
880
|
+
if (laseFocusMasked && Date.now() - laseFocusMasked < 100) {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
const dateMaskedFormat = computeDateMaskedFormat.value;
|
|
884
|
+
const maskChar = computeMaskChar.value;
|
|
885
|
+
const selectionStart = targetElem.selectionStart || 0;
|
|
886
|
+
const selectionEnd = targetElem.selectionEnd || 0;
|
|
887
|
+
const inpValue = targetElem.value;
|
|
888
|
+
const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
|
|
889
|
+
if (!inpValue) {
|
|
890
|
+
let restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
891
|
+
if (isFocus && modelValue) {
|
|
892
|
+
const chunkNums = ("" + import_xe_utils.default.toNumber(modelValue)).match(/\d/g) || [];
|
|
893
|
+
let useNumIndex = 0;
|
|
894
|
+
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), (txt) => chunkNums[useNumIndex++] || txt);
|
|
895
|
+
}
|
|
799
896
|
const firstMaskedKeys = allMaskedKeys[0];
|
|
800
897
|
const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
|
|
801
898
|
if (firstSkRest) {
|
|
899
|
+
evnt.preventDefault();
|
|
802
900
|
const firstChunkFormat = firstSkRest[0];
|
|
901
|
+
targetElem.value = restValue;
|
|
902
|
+
handleInputLabel(restValue, false);
|
|
803
903
|
targetElem.setSelectionRange(0, firstChunkFormat.length);
|
|
804
|
-
internalData.
|
|
904
|
+
internalData.laseFocusMasked = Date.now();
|
|
805
905
|
return;
|
|
806
906
|
}
|
|
807
907
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
const prveChunkNums = prveChunkValue.match(/\d/g) || [];
|
|
819
|
-
if (prveChunkNums.length) {
|
|
820
|
-
prveChunkNums.pop();
|
|
821
|
-
prveChunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](prveChunkNums.join(""), prveChunkFormat.length, maskChar);
|
|
822
|
-
restValue = restValue.slice(0, prveChunkStartIndex) + prveChunkValue + restValue.slice(prveChunkEndIndex);
|
|
823
|
-
targetElem.value = restValue;
|
|
824
|
-
handleInputLabel(restValue, false);
|
|
825
|
-
targetElem.setSelectionRange(prveChunkStartIndex, prveChunkEndIndex);
|
|
826
|
-
return;
|
|
827
|
-
}
|
|
828
|
-
}
|
|
908
|
+
const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
|
|
909
|
+
const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
|
|
910
|
+
if (isAllSelected || isNotMasked) {
|
|
911
|
+
let restValue = "";
|
|
912
|
+
if (isNotMasked && inpValue) {
|
|
913
|
+
const chunkNums = inpValue.match(/\d/g) || [];
|
|
914
|
+
let useNumIndex = 0;
|
|
915
|
+
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), () => chunkNums[useNumIndex++] || maskChar);
|
|
916
|
+
} else {
|
|
917
|
+
dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
829
918
|
}
|
|
830
919
|
const firstMaskedKeys = allMaskedKeys[0];
|
|
831
920
|
const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
|
|
832
921
|
if (firstSkRest) {
|
|
922
|
+
evnt.preventDefault();
|
|
833
923
|
const firstChunkFormat = firstSkRest[0];
|
|
834
|
-
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
835
924
|
targetElem.value = restValue;
|
|
836
925
|
handleInputLabel(restValue, false);
|
|
837
926
|
targetElem.setSelectionRange(0, firstChunkFormat.length);
|
|
838
|
-
internalData.
|
|
927
|
+
internalData.laseFocusMasked = Date.now();
|
|
839
928
|
return;
|
|
840
929
|
}
|
|
841
|
-
return;
|
|
842
930
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
931
|
+
let selectKey = dateMaskedFormat[selectionStart];
|
|
932
|
+
if (!parseInputKayMaps[selectKey]) {
|
|
933
|
+
selectKey = dateMaskedFormat[selectionStart - 1];
|
|
934
|
+
}
|
|
935
|
+
if (selectKey) {
|
|
936
|
+
evnt.stopPropagation();
|
|
937
|
+
const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
|
|
938
|
+
if (skRest) {
|
|
939
|
+
const chunkFormat = skRest[0] || "";
|
|
940
|
+
const chunkStartIndex = skRest.index || 0;
|
|
941
|
+
const chunkEndIndex = chunkStartIndex + chunkFormat.length;
|
|
942
|
+
targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
|
|
943
|
+
internalData.isTriggerMasked = true;
|
|
944
|
+
internalData.laseFocusMasked = Date.now();
|
|
856
945
|
}
|
|
857
946
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
internalData.fsTimeout = void 0;
|
|
866
|
-
const { type, multiple, modelValue } = props;
|
|
867
|
-
if (multiple) {
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
if (!maskedTypes.includes(type)) {
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
const targetElem = refInputTarget.value;
|
|
874
|
-
if (!targetElem) {
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
const { laseFocusMasked } = internalData;
|
|
878
|
-
if (laseFocusMasked && Date.now() - laseFocusMasked < 100) {
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
const dateMaskedFormat = computeDateMaskedFormat.value;
|
|
882
|
-
const maskChar = computeMaskChar.value;
|
|
883
|
-
const selectionStart = targetElem.selectionStart || 0;
|
|
884
|
-
const selectionEnd = targetElem.selectionEnd || 0;
|
|
885
|
-
const inpValue = targetElem.value;
|
|
886
|
-
const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
|
|
887
|
-
if (!inpValue) {
|
|
888
|
-
let restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
889
|
-
if (isFocus && modelValue) {
|
|
890
|
-
const chunkNums = ("" + import_xe_utils.default.toNumber(modelValue)).match(/\d/g) || [];
|
|
891
|
-
let useNumIndex = 0;
|
|
892
|
-
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), (txt) => chunkNums[useNumIndex++] || txt);
|
|
893
|
-
}
|
|
894
|
-
const firstMaskedKeys = allMaskedKeys[0];
|
|
895
|
-
const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
|
|
896
|
-
if (firstSkRest) {
|
|
897
|
-
evnt.preventDefault();
|
|
898
|
-
const firstChunkFormat = firstSkRest[0];
|
|
899
|
-
targetElem.value = restValue;
|
|
900
|
-
handleInputLabel(restValue, false);
|
|
901
|
-
targetElem.setSelectionRange(0, firstChunkFormat.length);
|
|
902
|
-
internalData.laseFocusMasked = Date.now();
|
|
903
|
-
return;
|
|
947
|
+
};
|
|
948
|
+
const blurEvent = (evnt) => {
|
|
949
|
+
const { inputValue } = reactData;
|
|
950
|
+
const inpImmediate = computeInpImmediate.value;
|
|
951
|
+
const value = inputValue;
|
|
952
|
+
if (!inpImmediate) {
|
|
953
|
+
handleChange(value, evnt);
|
|
904
954
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
let restValue = "";
|
|
910
|
-
if (isNotMasked && inpValue) {
|
|
911
|
-
const chunkNums = inpValue.match(/\d/g) || [];
|
|
912
|
-
let useNumIndex = 0;
|
|
913
|
-
restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), () => chunkNums[useNumIndex++] || maskChar);
|
|
914
|
-
} else {
|
|
915
|
-
dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
|
|
955
|
+
if (!reactData.visiblePanel) {
|
|
956
|
+
const { inputLabel } = internalData;
|
|
957
|
+
reactData.isActivated = false;
|
|
958
|
+
afterCheckValue(inputLabel);
|
|
916
959
|
}
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
960
|
+
dispatchEvent("blur", { value }, evnt);
|
|
961
|
+
if ($xeForm && formItemInfo) {
|
|
962
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
const focusEvent = (evnt) => {
|
|
966
|
+
const { multiple, editable, maskedConfig } = props;
|
|
967
|
+
const { fsTimeout } = internalData;
|
|
968
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
969
|
+
const popupOpts = computePopupOpts.value;
|
|
970
|
+
const { trigger } = popupOpts;
|
|
971
|
+
reactData.isActivated = true;
|
|
972
|
+
if (fsTimeout) {
|
|
973
|
+
clearTimeout(fsTimeout);
|
|
974
|
+
}
|
|
975
|
+
if (!trigger || trigger === "default") {
|
|
976
|
+
datePickerOpenEvent(evnt);
|
|
977
|
+
} else if (trigger === "icon") {
|
|
978
|
+
hidePanel();
|
|
979
|
+
}
|
|
980
|
+
if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
|
|
981
|
+
internalData.fsTimeout = setTimeout(() => {
|
|
982
|
+
handleMaskedSelectedDate(evnt, true);
|
|
983
|
+
}, 20);
|
|
984
|
+
}
|
|
985
|
+
triggerEvent(evnt);
|
|
986
|
+
};
|
|
987
|
+
const clickEvent = (evnt) => {
|
|
988
|
+
const { multiple, editable, maskedConfig } = props;
|
|
989
|
+
const { fsTimeout } = internalData;
|
|
990
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
991
|
+
if (fsTimeout) {
|
|
992
|
+
clearTimeout(fsTimeout);
|
|
993
|
+
}
|
|
994
|
+
if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
|
|
995
|
+
internalData.fsTimeout = setTimeout(() => {
|
|
996
|
+
handleMaskedSelectedDate(evnt);
|
|
997
|
+
}, 10);
|
|
998
|
+
}
|
|
999
|
+
triggerEvent(evnt);
|
|
1000
|
+
};
|
|
1001
|
+
const keydownEvent = (evnt) => {
|
|
1002
|
+
const { type, editable, maskedConfig } = props;
|
|
1003
|
+
const { visiblePanel } = reactData;
|
|
1004
|
+
const maskedOpts = computeMaskedOpts.value;
|
|
1005
|
+
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
1006
|
+
const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
1007
|
+
const isLtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
|
|
1008
|
+
const isRtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
|
|
1009
|
+
const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
|
|
1010
|
+
if (editable) {
|
|
1011
|
+
if (isEnter) {
|
|
1012
|
+
const { inputLabel } = internalData;
|
|
1013
|
+
if (visiblePanel) {
|
|
1014
|
+
hidePanel();
|
|
1015
|
+
}
|
|
1016
|
+
afterCheckValue(inputLabel);
|
|
1017
|
+
} else if (maskedTypes.includes(type)) {
|
|
1018
|
+
if ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled) {
|
|
1019
|
+
if (maskedOpts.isArrow && (isUpArrow || isDwArrow || isLtArrow || isRtArrow)) {
|
|
1020
|
+
handleArrowInputDate(evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow);
|
|
1021
|
+
} else if (maskedOpts.isMasked) {
|
|
1022
|
+
handleMaskedInputDate(evnt);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
triggerEvent(evnt);
|
|
1028
|
+
};
|
|
1029
|
+
const keyupEvent = (evnt) => {
|
|
1030
|
+
triggerEvent(evnt);
|
|
1031
|
+
};
|
|
1032
|
+
const confirmEvent = (evnt) => {
|
|
1033
|
+
const $datePanel = refDatePanel.value;
|
|
1034
|
+
if ($datePanel) {
|
|
1035
|
+
$datePanel.confirmByEvent(evnt);
|
|
927
1036
|
}
|
|
928
|
-
}
|
|
929
|
-
let selectKey = dateMaskedFormat[selectionStart];
|
|
930
|
-
if (!parseInputKayMaps[selectKey]) {
|
|
931
|
-
selectKey = dateMaskedFormat[selectionStart - 1];
|
|
932
|
-
}
|
|
933
|
-
if (selectKey) {
|
|
934
|
-
evnt.stopPropagation();
|
|
935
|
-
const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
|
|
936
|
-
if (skRest) {
|
|
937
|
-
const chunkFormat = skRest[0] || "";
|
|
938
|
-
const chunkStartIndex = skRest.index || 0;
|
|
939
|
-
const chunkEndIndex = chunkStartIndex + chunkFormat.length;
|
|
940
|
-
targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
|
|
941
|
-
internalData.isTriggerMasked = true;
|
|
942
|
-
internalData.laseFocusMasked = Date.now();
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
const blurEvent = (evnt) => {
|
|
947
|
-
const { inputValue } = reactData;
|
|
948
|
-
const inpImmediate = computeInpImmediate.value;
|
|
949
|
-
const value = inputValue;
|
|
950
|
-
if (!inpImmediate) {
|
|
951
|
-
handleChange(value, evnt);
|
|
952
|
-
}
|
|
953
|
-
if (!reactData.visiblePanel) {
|
|
954
|
-
const { inputLabel } = internalData;
|
|
955
|
-
reactData.isActivated = false;
|
|
956
|
-
afterCheckValue(inputLabel);
|
|
957
|
-
}
|
|
958
|
-
dispatchEvent("blur", { value }, evnt);
|
|
959
|
-
if ($xeForm && formItemInfo) {
|
|
960
|
-
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
961
|
-
}
|
|
962
|
-
};
|
|
963
|
-
const focusEvent = (evnt) => {
|
|
964
|
-
const { multiple, editable, maskedConfig } = props;
|
|
965
|
-
const { fsTimeout } = internalData;
|
|
966
|
-
const maskedOpts = computeMaskedOpts.value;
|
|
967
|
-
const popupOpts = computePopupOpts.value;
|
|
968
|
-
const { trigger } = popupOpts;
|
|
969
|
-
reactData.isActivated = true;
|
|
970
|
-
if (fsTimeout) {
|
|
971
|
-
clearTimeout(fsTimeout);
|
|
972
|
-
}
|
|
973
|
-
if (!trigger || trigger === "default") {
|
|
974
|
-
datePickerOpenEvent(evnt);
|
|
975
|
-
} else if (trigger === "icon") {
|
|
976
1037
|
hidePanel();
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
const clickEvent = (evnt) => {
|
|
986
|
-
const { multiple, editable, maskedConfig } = props;
|
|
987
|
-
const { fsTimeout } = internalData;
|
|
988
|
-
const maskedOpts = computeMaskedOpts.value;
|
|
989
|
-
if (fsTimeout) {
|
|
990
|
-
clearTimeout(fsTimeout);
|
|
991
|
-
}
|
|
992
|
-
if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
|
|
993
|
-
internalData.fsTimeout = setTimeout(() => {
|
|
994
|
-
handleMaskedSelectedDate(evnt);
|
|
995
|
-
}, 10);
|
|
996
|
-
}
|
|
997
|
-
triggerEvent(evnt);
|
|
998
|
-
};
|
|
999
|
-
const keydownEvent = (evnt) => {
|
|
1000
|
-
const { type, editable, maskedConfig } = props;
|
|
1001
|
-
const { visiblePanel } = reactData;
|
|
1002
|
-
const maskedOpts = computeMaskedOpts.value;
|
|
1003
|
-
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
1004
|
-
const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
1005
|
-
const isLtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
|
|
1006
|
-
const isRtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
|
|
1007
|
-
const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
|
|
1008
|
-
if (editable) {
|
|
1009
|
-
if (isEnter) {
|
|
1010
|
-
const { inputLabel } = internalData;
|
|
1011
|
-
if (visiblePanel) {
|
|
1038
|
+
};
|
|
1039
|
+
const panelChangeEvent = (params) => {
|
|
1040
|
+
const { multiple, autoClose } = props;
|
|
1041
|
+
const { value, $event } = params;
|
|
1042
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1043
|
+
handleChange(value, $event);
|
|
1044
|
+
if (!multiple && !isTimeOrDateTimeType) {
|
|
1045
|
+
if (autoClose) {
|
|
1012
1046
|
hidePanel();
|
|
1013
1047
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
const panelConfirmEvent = (params) => {
|
|
1051
|
+
dispatchEvent("confirm", params, params.$event);
|
|
1052
|
+
};
|
|
1053
|
+
const panelRevertEvent = (params) => {
|
|
1054
|
+
handleInputLabel(params.label, true);
|
|
1055
|
+
};
|
|
1056
|
+
const handleGlobalMousedownEvent = (evnt) => {
|
|
1057
|
+
const { visiblePanel, isActivated } = reactData;
|
|
1058
|
+
const el = refElem.value;
|
|
1059
|
+
const panelWrapperElem = refPanelWrapper.value;
|
|
1060
|
+
const isDisabled = computeIsDisabled.value;
|
|
1061
|
+
if (!isDisabled && isActivated) {
|
|
1062
|
+
const currActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelWrapperElem).flag;
|
|
1063
|
+
if (currActivated !== isActivated) {
|
|
1064
|
+
reactData.isActivated = currActivated;
|
|
1065
|
+
}
|
|
1066
|
+
if (!currActivated) {
|
|
1067
|
+
if (visiblePanel) {
|
|
1068
|
+
hidePanel();
|
|
1069
|
+
const { inputLabel } = internalData;
|
|
1070
|
+
afterCheckValue(inputLabel);
|
|
1021
1071
|
}
|
|
1022
1072
|
}
|
|
1023
1073
|
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
};
|
|
1037
|
-
const panelChangeEvent = (params) => {
|
|
1038
|
-
const { multiple, autoClose } = props;
|
|
1039
|
-
const { value, $event } = params;
|
|
1040
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1041
|
-
handleChange(value, $event);
|
|
1042
|
-
if (!multiple && !isTimeOrDateTimeType) {
|
|
1043
|
-
if (autoClose) {
|
|
1044
|
-
hidePanel();
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
const panelConfirmEvent = (params) => {
|
|
1049
|
-
dispatchEvent("confirm", params, params.$event);
|
|
1050
|
-
};
|
|
1051
|
-
const panelRevertEvent = (params) => {
|
|
1052
|
-
handleInputLabel(params.label, true);
|
|
1053
|
-
};
|
|
1054
|
-
const handleGlobalMousedownEvent = (evnt) => {
|
|
1055
|
-
const { visiblePanel, isActivated } = reactData;
|
|
1056
|
-
const el = refElem.value;
|
|
1057
|
-
const panelWrapperElem = refPanelWrapper.value;
|
|
1058
|
-
const isDisabled = computeIsDisabled.value;
|
|
1059
|
-
if (!isDisabled && isActivated) {
|
|
1060
|
-
const currActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelWrapperElem).flag;
|
|
1061
|
-
if (currActivated !== isActivated) {
|
|
1062
|
-
reactData.isActivated = currActivated;
|
|
1063
|
-
}
|
|
1064
|
-
if (!currActivated) {
|
|
1074
|
+
};
|
|
1075
|
+
const handleGlobalKeydownEvent = (evnt) => {
|
|
1076
|
+
const { isActivated, visiblePanel } = reactData;
|
|
1077
|
+
const isDisabled = computeIsDisabled.value;
|
|
1078
|
+
if (!isDisabled) {
|
|
1079
|
+
const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
|
|
1080
|
+
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
1081
|
+
if (isTab) {
|
|
1082
|
+
if (isActivated) {
|
|
1083
|
+
reactData.isActivated = false;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1065
1086
|
if (visiblePanel) {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1087
|
+
if (isEsc || isTab) {
|
|
1088
|
+
hidePanel();
|
|
1089
|
+
}
|
|
1069
1090
|
}
|
|
1070
1091
|
}
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1092
|
+
};
|
|
1093
|
+
const handleGlobalBlurEvent = () => {
|
|
1094
|
+
const { isActivated, visiblePanel } = reactData;
|
|
1095
|
+
if (visiblePanel) {
|
|
1096
|
+
hidePanel();
|
|
1097
|
+
}
|
|
1098
|
+
if (isActivated) {
|
|
1099
|
+
reactData.isActivated = false;
|
|
1100
|
+
}
|
|
1101
|
+
if (visiblePanel || isActivated) {
|
|
1102
|
+
afterCheckValue(internalData.inputLabel);
|
|
1103
|
+
const targetElem = refInputTarget.value;
|
|
1104
|
+
if (targetElem) {
|
|
1105
|
+
targetElem.blur();
|
|
1082
1106
|
}
|
|
1083
1107
|
}
|
|
1108
|
+
};
|
|
1109
|
+
const handleGlobalResizeEvent = () => {
|
|
1110
|
+
const { visiblePanel } = reactData;
|
|
1084
1111
|
if (visiblePanel) {
|
|
1085
|
-
|
|
1086
|
-
hidePanel();
|
|
1087
|
-
}
|
|
1112
|
+
updatePlacement();
|
|
1088
1113
|
}
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1114
|
+
};
|
|
1115
|
+
const handleGlobalScrollEvent = () => {
|
|
1116
|
+
const { visiblePanel } = reactData;
|
|
1117
|
+
if (visiblePanel) {
|
|
1118
|
+
updatePlacement();
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
const updateZindex = () => {
|
|
1122
|
+
const popupOpts = computePopupOpts.value;
|
|
1123
|
+
const customZIndex = popupOpts.zIndex || props.zIndex;
|
|
1124
|
+
if (customZIndex) {
|
|
1125
|
+
reactData.panelIndex = import_xe_utils.default.toNumber(customZIndex);
|
|
1126
|
+
} else if (reactData.panelIndex < (0, import_utils.getLastZIndex)()) {
|
|
1127
|
+
reactData.panelIndex = (0, import_utils.nextZIndex)();
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
const updatePlacement = () => {
|
|
1131
|
+
const { placement } = props;
|
|
1132
|
+
const { panelIndex } = reactData;
|
|
1101
1133
|
const targetElem = refInputTarget.value;
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
+
const panelElem = refInputPanel.value;
|
|
1135
|
+
if (!panelElem) {
|
|
1136
|
+
return (0, import_vue.nextTick)();
|
|
1137
|
+
}
|
|
1138
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
1139
|
+
const popupOpts = computePopupOpts.value;
|
|
1140
|
+
const handleStyle = () => {
|
|
1141
|
+
const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
|
|
1142
|
+
placement: popupOpts.placement || placement,
|
|
1143
|
+
defaultPlacement: popupOpts.defaultPlacement,
|
|
1144
|
+
appendTo: popupOpts.appendTo,
|
|
1145
|
+
teleportTo: btnTransfer
|
|
1146
|
+
});
|
|
1147
|
+
const panelStyle = Object.assign(ppObj.style, {
|
|
1148
|
+
zIndex: panelIndex
|
|
1149
|
+
});
|
|
1150
|
+
reactData.panelStyle = panelStyle;
|
|
1151
|
+
reactData.panelPlacement = ppObj.placement;
|
|
1152
|
+
};
|
|
1153
|
+
handleStyle();
|
|
1154
|
+
return (0, import_vue.nextTick)().then(handleStyle);
|
|
1155
|
+
};
|
|
1156
|
+
const showPanel = () => {
|
|
1157
|
+
const { visiblePanel } = reactData;
|
|
1158
|
+
const isDisabled = computeIsDisabled.value;
|
|
1159
|
+
if (!isDisabled && !visiblePanel) {
|
|
1160
|
+
if (!reactData.initialized) {
|
|
1161
|
+
reactData.initialized = true;
|
|
1162
|
+
}
|
|
1163
|
+
if (internalData.hpTimeout) {
|
|
1164
|
+
clearTimeout(internalData.hpTimeout);
|
|
1165
|
+
internalData.hpTimeout = void 0;
|
|
1166
|
+
}
|
|
1167
|
+
reactData.isActivated = true;
|
|
1168
|
+
reactData.isAniVisible = true;
|
|
1169
|
+
setTimeout(() => {
|
|
1170
|
+
reactData.visiblePanel = true;
|
|
1171
|
+
updatePlacement();
|
|
1172
|
+
}, 10);
|
|
1173
|
+
updateZindex();
|
|
1174
|
+
return updatePlacement();
|
|
1175
|
+
}
|
|
1134
1176
|
return (0, import_vue.nextTick)();
|
|
1135
|
-
}
|
|
1136
|
-
const btnTransfer = computeBtnTransfer.value;
|
|
1137
|
-
const popupOpts = computePopupOpts.value;
|
|
1138
|
-
const handleStyle = () => {
|
|
1139
|
-
const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
|
|
1140
|
-
placement: popupOpts.placement || placement,
|
|
1141
|
-
defaultPlacement: popupOpts.defaultPlacement,
|
|
1142
|
-
appendTo: popupOpts.appendTo,
|
|
1143
|
-
teleportTo: btnTransfer
|
|
1144
|
-
});
|
|
1145
|
-
const panelStyle = Object.assign(ppObj.style, {
|
|
1146
|
-
zIndex: panelIndex
|
|
1147
|
-
});
|
|
1148
|
-
reactData.panelStyle = panelStyle;
|
|
1149
|
-
reactData.panelPlacement = ppObj.placement;
|
|
1150
1177
|
};
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
const isDisabled = computeIsDisabled.value;
|
|
1157
|
-
if (!isDisabled && !visiblePanel) {
|
|
1158
|
-
if (!reactData.initialized) {
|
|
1159
|
-
reactData.initialized = true;
|
|
1160
|
-
}
|
|
1161
|
-
if (internalData.hpTimeout) {
|
|
1162
|
-
clearTimeout(internalData.hpTimeout);
|
|
1163
|
-
internalData.hpTimeout = void 0;
|
|
1178
|
+
const datePickerOpenEvent = (evnt) => {
|
|
1179
|
+
const formReadonly = computeFormReadonly.value;
|
|
1180
|
+
if (!formReadonly) {
|
|
1181
|
+
evnt.preventDefault();
|
|
1182
|
+
showPanel();
|
|
1164
1183
|
}
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
const datePickerOpenEvent = (evnt) => {
|
|
1177
|
-
const formReadonly = computeFormReadonly.value;
|
|
1178
|
-
if (!formReadonly) {
|
|
1179
|
-
evnt.preventDefault();
|
|
1180
|
-
showPanel();
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
const clickIconEvent = (evnt) => {
|
|
1184
|
-
const { visiblePanel } = reactData;
|
|
1185
|
-
const popupOpts = computePopupOpts.value;
|
|
1186
|
-
const { trigger } = popupOpts;
|
|
1187
|
-
if (!trigger || trigger === "default" || trigger === "icon") {
|
|
1188
|
-
if (visiblePanel) {
|
|
1189
|
-
hidePanel();
|
|
1190
|
-
} else {
|
|
1191
|
-
datePickerOpenEvent(evnt);
|
|
1184
|
+
};
|
|
1185
|
+
const clickIconEvent = (evnt) => {
|
|
1186
|
+
const { visiblePanel } = reactData;
|
|
1187
|
+
const popupOpts = computePopupOpts.value;
|
|
1188
|
+
const { trigger } = popupOpts;
|
|
1189
|
+
if (!trigger || trigger === "default" || trigger === "icon") {
|
|
1190
|
+
if (visiblePanel) {
|
|
1191
|
+
hidePanel();
|
|
1192
|
+
} else {
|
|
1193
|
+
datePickerOpenEvent(evnt);
|
|
1194
|
+
}
|
|
1192
1195
|
}
|
|
1193
|
-
}
|
|
1194
|
-
};
|
|
1195
|
-
const handleShortcutEvent = ({ option, $event }) => {
|
|
1196
|
-
const { type } = props;
|
|
1197
|
-
const { inputValue } = reactData;
|
|
1198
|
-
const shortcutOpts = computeShortcutOpts.value;
|
|
1199
|
-
const { autoClose } = shortcutOpts;
|
|
1200
|
-
const { code, clickMethod } = option;
|
|
1201
|
-
let value = inputValue;
|
|
1202
|
-
const shortcutParams = {
|
|
1203
|
-
$datePicker: $xeDatePicker,
|
|
1204
|
-
option,
|
|
1205
|
-
value,
|
|
1206
|
-
code
|
|
1207
1196
|
};
|
|
1208
|
-
|
|
1209
|
-
const
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1197
|
+
const handleShortcutEvent = ({ option, $event }) => {
|
|
1198
|
+
const { type } = props;
|
|
1199
|
+
const { inputValue } = reactData;
|
|
1200
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
1201
|
+
const { autoClose } = shortcutOpts;
|
|
1202
|
+
const { code, clickMethod } = option;
|
|
1203
|
+
let value = inputValue;
|
|
1204
|
+
const shortcutParams = {
|
|
1205
|
+
$datePicker: $xeDatePicker,
|
|
1206
|
+
option,
|
|
1207
|
+
value,
|
|
1208
|
+
code
|
|
1209
|
+
};
|
|
1210
|
+
if (!clickMethod && code) {
|
|
1211
|
+
const gCommandOpts = commands.get(code);
|
|
1212
|
+
const dpCommandMethod = gCommandOpts ? gCommandOpts.datePickerCommandMethod : null;
|
|
1213
|
+
if (dpCommandMethod) {
|
|
1214
|
+
dpCommandMethod(shortcutParams);
|
|
1215
|
+
} else {
|
|
1216
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
1217
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
1218
|
+
switch (code) {
|
|
1219
|
+
case "now":
|
|
1220
|
+
case "prev":
|
|
1221
|
+
case "next":
|
|
1222
|
+
case "minus":
|
|
1223
|
+
case "plus": {
|
|
1224
|
+
const restObj = (0, import_util.getDateByCode)(code, value, type, {
|
|
1225
|
+
valueFormat: dateValueFormat,
|
|
1226
|
+
firstDay: firstDayOfWeek
|
|
1227
|
+
});
|
|
1228
|
+
value = restObj.value;
|
|
1229
|
+
shortcutParams.value = value;
|
|
1230
|
+
handleChange(value, $event);
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
default:
|
|
1234
|
+
errLog("vxe.error.notCommands", [code]);
|
|
1235
|
+
break;
|
|
1230
1236
|
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1237
|
+
}
|
|
1238
|
+
} else {
|
|
1239
|
+
const optClickMethod = clickMethod || shortcutOpts.clickMethod;
|
|
1240
|
+
if (optClickMethod) {
|
|
1241
|
+
optClickMethod(shortcutParams);
|
|
1234
1242
|
}
|
|
1235
1243
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
if (optClickMethod) {
|
|
1239
|
-
optClickMethod(shortcutParams);
|
|
1244
|
+
if (autoClose) {
|
|
1245
|
+
hidePanel();
|
|
1240
1246
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
dispatchEvent,
|
|
1255
|
-
setModelValue(value) {
|
|
1256
|
-
reactData.inputValue = value;
|
|
1257
|
-
emitModel(value);
|
|
1258
|
-
},
|
|
1259
|
-
setModelValueByEvent(evnt, value) {
|
|
1260
|
-
handleChange(value || "", evnt);
|
|
1261
|
-
},
|
|
1262
|
-
focus() {
|
|
1263
|
-
const inputElem = refInputTarget.value;
|
|
1264
|
-
reactData.isActivated = true;
|
|
1265
|
-
inputElem.focus();
|
|
1266
|
-
return (0, import_vue.nextTick)();
|
|
1267
|
-
},
|
|
1268
|
-
blur() {
|
|
1269
|
-
const inputElem = refInputTarget.value;
|
|
1270
|
-
inputElem.blur();
|
|
1271
|
-
reactData.isActivated = false;
|
|
1272
|
-
return (0, import_vue.nextTick)();
|
|
1273
|
-
},
|
|
1274
|
-
select() {
|
|
1275
|
-
const inputElem = refInputTarget.value;
|
|
1276
|
-
inputElem.select();
|
|
1277
|
-
reactData.isActivated = false;
|
|
1278
|
-
return (0, import_vue.nextTick)();
|
|
1279
|
-
},
|
|
1280
|
-
showPanel,
|
|
1281
|
-
hidePanel,
|
|
1282
|
-
updatePlacement
|
|
1283
|
-
};
|
|
1284
|
-
Object.assign($xeDatePicker, datePickerMethods);
|
|
1285
|
-
const renderShortcutBtn = (pos, isVertical) => {
|
|
1286
|
-
const shortcutOpts = computeShortcutOpts.value;
|
|
1287
|
-
const { position, align, mode } = shortcutOpts;
|
|
1288
|
-
const shortcutList = computeShortcutList.value;
|
|
1289
|
-
if ((0, import_utils.isEnableConf)(shortcutOpts) && shortcutList.length && (position || "left") === pos) {
|
|
1290
|
-
return (0, import_vue.h)(
|
|
1291
|
-
"div",
|
|
1292
|
-
{
|
|
1293
|
-
class: `vxe-date-picker--layout-${pos}-wrapper`
|
|
1294
|
-
},
|
|
1295
|
-
[
|
|
1296
|
-
(0, import_vue.h)(import_button_group.default, {
|
|
1297
|
-
options: shortcutList,
|
|
1298
|
-
mode,
|
|
1299
|
-
align,
|
|
1300
|
-
vertical: isVertical,
|
|
1301
|
-
onClick: handleShortcutEvent
|
|
1302
|
-
})
|
|
1303
|
-
]
|
|
1304
|
-
);
|
|
1305
|
-
}
|
|
1306
|
-
return renderEmptyElement($xeDatePicker);
|
|
1307
|
-
};
|
|
1308
|
-
const renderPanel = () => {
|
|
1309
|
-
const popupOpts = computePopupOpts.value;
|
|
1310
|
-
if (popupOpts.enabled === false) {
|
|
1311
|
-
return renderEmptyElement($xeDatePicker);
|
|
1312
|
-
}
|
|
1313
|
-
const { type, multiple, showClearButton, showConfirmButton } = props;
|
|
1314
|
-
const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle, inputValue } = reactData;
|
|
1315
|
-
const vSize = computeSize.value;
|
|
1316
|
-
const btnTransfer = computeBtnTransfer.value;
|
|
1317
|
-
const shortcutOpts = computeShortcutOpts.value;
|
|
1318
|
-
const isClearable = computeIsClearable.value;
|
|
1319
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1320
|
-
const shortcutList = computeShortcutList.value;
|
|
1321
|
-
const timeOpts = computeTimeOpts.value;
|
|
1322
|
-
const dateStartDate = computeDateStartDate.value;
|
|
1323
|
-
const dateEndDate = computeDateEndDate.value;
|
|
1324
|
-
const { appendTo } = popupOpts;
|
|
1325
|
-
const { position } = shortcutOpts;
|
|
1326
|
-
const headerSlot = slots.header;
|
|
1327
|
-
const footerSlot = slots.footer;
|
|
1328
|
-
const topSlot = slots.top;
|
|
1329
|
-
const bottomSlot = slots.bottom;
|
|
1330
|
-
const leftSlot = slots.left;
|
|
1331
|
-
const rightSlot = slots.right;
|
|
1332
|
-
const ppClassName = popupOpts.className;
|
|
1333
|
-
const hasShortcutBtn = shortcutList.length > 0;
|
|
1334
|
-
const showConfirmBtn = showConfirmButton === null ? isTimeOrDateTimeType || multiple : showConfirmButton;
|
|
1335
|
-
const showClearBtn = showClearButton === null ? isClearable && showConfirmBtn && type !== "time" : showClearButton;
|
|
1336
|
-
return (0, import_vue.h)(
|
|
1337
|
-
import_vue.Teleport,
|
|
1338
|
-
{
|
|
1339
|
-
to: (0, import_dom.getPopupContainer)(appendTo),
|
|
1340
|
-
disabled: btnTransfer ? !initialized : true
|
|
1247
|
+
dispatchEvent("shortcut-click", shortcutParams, $event);
|
|
1248
|
+
};
|
|
1249
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
1250
|
+
emit(type, createEvent(evnt, { $datePicker: $xeDatePicker }, params));
|
|
1251
|
+
};
|
|
1252
|
+
const emitModel = (value) => {
|
|
1253
|
+
emit("update:modelValue", value);
|
|
1254
|
+
};
|
|
1255
|
+
const datePickerMethods = {
|
|
1256
|
+
dispatchEvent,
|
|
1257
|
+
setModelValue(value) {
|
|
1258
|
+
reactData.inputValue = value;
|
|
1259
|
+
emitModel(value);
|
|
1341
1260
|
},
|
|
1342
|
-
|
|
1343
|
-
(
|
|
1344
|
-
"div",
|
|
1345
|
-
{
|
|
1346
|
-
ref: refInputPanel,
|
|
1347
|
-
class: [
|
|
1348
|
-
"vxe-table--ignore-clear vxe-date-picker--panel",
|
|
1349
|
-
`type--${type}`,
|
|
1350
|
-
ppClassName ? import_xe_utils.default.isFunction(ppClassName) ? ppClassName({ $datePicker: $xeDatePicker }) : ppClassName : "",
|
|
1351
|
-
{
|
|
1352
|
-
[`size--${vSize}`]: vSize,
|
|
1353
|
-
"is--transfer": btnTransfer,
|
|
1354
|
-
"ani--leave": isAniVisible,
|
|
1355
|
-
"ani--enter": visiblePanel,
|
|
1356
|
-
"show--top": !!(topSlot || headerSlot || hasShortcutBtn && (position === "top" || position === "header")),
|
|
1357
|
-
"show--bottom": !!(bottomSlot || footerSlot || hasShortcutBtn && (position === "bottom" || position === "footer")),
|
|
1358
|
-
"show--left": !!(leftSlot || hasShortcutBtn && position === "left"),
|
|
1359
|
-
"show--right": !!(rightSlot || hasShortcutBtn && position === "right")
|
|
1360
|
-
}
|
|
1361
|
-
],
|
|
1362
|
-
placement: panelPlacement,
|
|
1363
|
-
style: panelStyle
|
|
1364
|
-
},
|
|
1365
|
-
initialized && (visiblePanel || isAniVisible) ? [
|
|
1366
|
-
(0, import_vue.h)(
|
|
1367
|
-
"div",
|
|
1368
|
-
{
|
|
1369
|
-
ref: refPanelWrapper,
|
|
1370
|
-
class: [
|
|
1371
|
-
"vxe-date-picker--layout-all-wrapper",
|
|
1372
|
-
`type--${type}`,
|
|
1373
|
-
{
|
|
1374
|
-
[`size--${vSize}`]: vSize
|
|
1375
|
-
}
|
|
1376
|
-
]
|
|
1377
|
-
},
|
|
1378
|
-
[
|
|
1379
|
-
topSlot ? (0, import_vue.h)(
|
|
1380
|
-
"div",
|
|
1381
|
-
{
|
|
1382
|
-
class: "vxe-date-picker--layout-top-wrapper"
|
|
1383
|
-
},
|
|
1384
|
-
topSlot({})
|
|
1385
|
-
) : renderShortcutBtn("top"),
|
|
1386
|
-
(0, import_vue.h)(
|
|
1387
|
-
"div",
|
|
1388
|
-
{
|
|
1389
|
-
class: "vxe-date-picker--layout-body-layout-wrapper"
|
|
1390
|
-
},
|
|
1391
|
-
[
|
|
1392
|
-
leftSlot ? (0, import_vue.h)(
|
|
1393
|
-
"div",
|
|
1394
|
-
{
|
|
1395
|
-
class: "vxe-date-picker--layout-left-wrapper"
|
|
1396
|
-
},
|
|
1397
|
-
leftSlot({})
|
|
1398
|
-
) : renderShortcutBtn("left", true),
|
|
1399
|
-
(0, import_vue.h)(
|
|
1400
|
-
"div",
|
|
1401
|
-
{
|
|
1402
|
-
class: "vxe-date-picker--layout-body-content-wrapper"
|
|
1403
|
-
},
|
|
1404
|
-
[
|
|
1405
|
-
headerSlot ? (0, import_vue.h)(
|
|
1406
|
-
"div",
|
|
1407
|
-
{
|
|
1408
|
-
class: "vxe-date-picker--layout-header-wrapper"
|
|
1409
|
-
},
|
|
1410
|
-
headerSlot({})
|
|
1411
|
-
) : renderShortcutBtn("header"),
|
|
1412
|
-
(0, import_vue.h)(
|
|
1413
|
-
"div",
|
|
1414
|
-
{
|
|
1415
|
-
class: "vxe-date-picker--layout-body-wrapper"
|
|
1416
|
-
},
|
|
1417
|
-
[
|
|
1418
|
-
(0, import_vue.h)(import_date_panel.default, {
|
|
1419
|
-
ref: refDatePanel,
|
|
1420
|
-
modelValue: reactData.inputValue,
|
|
1421
|
-
type: props.type,
|
|
1422
|
-
className: props.className,
|
|
1423
|
-
multiple: props.multiple,
|
|
1424
|
-
limitCount: props.limitCount,
|
|
1425
|
-
startDate: dateStartDate,
|
|
1426
|
-
endDate: dateEndDate,
|
|
1427
|
-
defaultDate: props.defaultDate,
|
|
1428
|
-
defaultTime: props.defaultTime,
|
|
1429
|
-
minDate: props.minDate,
|
|
1430
|
-
maxDate: props.maxDate,
|
|
1431
|
-
startDay: props.startDay,
|
|
1432
|
-
labelFormat: props.labelFormat,
|
|
1433
|
-
valueFormat: props.valueFormat,
|
|
1434
|
-
timeFormat: props.timeFormat,
|
|
1435
|
-
timeConfig: timeOpts,
|
|
1436
|
-
festivalMethod: props.festivalMethod || defaultFuncProps.festivalMethod,
|
|
1437
|
-
disabledMethod: props.disabledMethod || defaultFuncProps.disabledMethod,
|
|
1438
|
-
selectDay: props.selectDay,
|
|
1439
|
-
onChange: panelChangeEvent,
|
|
1440
|
-
onConfirm: panelConfirmEvent,
|
|
1441
|
-
onRevert: panelRevertEvent
|
|
1442
|
-
})
|
|
1443
|
-
]
|
|
1444
|
-
),
|
|
1445
|
-
(0, import_vue.h)(
|
|
1446
|
-
"div",
|
|
1447
|
-
{
|
|
1448
|
-
class: "vxe-date-picker--layout-footer-wrapper"
|
|
1449
|
-
},
|
|
1450
|
-
[
|
|
1451
|
-
(0, import_vue.h)(
|
|
1452
|
-
"div",
|
|
1453
|
-
{
|
|
1454
|
-
class: "vxe-date-picker--layout-footer-custom"
|
|
1455
|
-
},
|
|
1456
|
-
footerSlot ? footerSlot({}) : [renderShortcutBtn("footer")]
|
|
1457
|
-
),
|
|
1458
|
-
showClearBtn || showConfirmBtn ? (0, import_vue.h)(
|
|
1459
|
-
"div",
|
|
1460
|
-
{
|
|
1461
|
-
class: "vxe-date-picker--layout-footer-btns"
|
|
1462
|
-
},
|
|
1463
|
-
[
|
|
1464
|
-
showClearBtn ? (0, import_vue.h)(import_button.default, {
|
|
1465
|
-
size: "mini",
|
|
1466
|
-
disabled: inputValue === "" || import_xe_utils.default.eqNull(inputValue),
|
|
1467
|
-
content: getI18n("vxe.button.clear"),
|
|
1468
|
-
onClick: clearValueEvent
|
|
1469
|
-
}) : renderEmptyElement($xeDatePicker),
|
|
1470
|
-
showConfirmBtn ? (0, import_vue.h)(import_button.default, {
|
|
1471
|
-
size: "mini",
|
|
1472
|
-
status: "primary",
|
|
1473
|
-
content: getI18n("vxe.button.confirm"),
|
|
1474
|
-
onClick: confirmEvent
|
|
1475
|
-
}) : renderEmptyElement($xeDatePicker)
|
|
1476
|
-
]
|
|
1477
|
-
) : renderEmptyElement($xeDatePicker)
|
|
1478
|
-
]
|
|
1479
|
-
)
|
|
1480
|
-
]
|
|
1481
|
-
),
|
|
1482
|
-
rightSlot ? (0, import_vue.h)(
|
|
1483
|
-
"div",
|
|
1484
|
-
{
|
|
1485
|
-
class: "vxe-date-picker--layout-right-wrapper"
|
|
1486
|
-
},
|
|
1487
|
-
rightSlot({})
|
|
1488
|
-
) : renderShortcutBtn("right", true)
|
|
1489
|
-
]
|
|
1490
|
-
),
|
|
1491
|
-
bottomSlot ? (0, import_vue.h)(
|
|
1492
|
-
"div",
|
|
1493
|
-
{
|
|
1494
|
-
class: "vxe-date-picker--layout-bottom-wrapper"
|
|
1495
|
-
},
|
|
1496
|
-
bottomSlot({})
|
|
1497
|
-
) : renderShortcutBtn("bottom")
|
|
1498
|
-
]
|
|
1499
|
-
)
|
|
1500
|
-
] : []
|
|
1501
|
-
)
|
|
1502
|
-
]
|
|
1503
|
-
);
|
|
1504
|
-
};
|
|
1505
|
-
const renderPrefixIcon = () => {
|
|
1506
|
-
const { prefixIcon } = props;
|
|
1507
|
-
const prefixSlot = slots.prefix;
|
|
1508
|
-
return prefixSlot || prefixIcon ? (0, import_vue.h)(
|
|
1509
|
-
"div",
|
|
1510
|
-
{
|
|
1511
|
-
class: "vxe-date-picker--prefix",
|
|
1512
|
-
onClick: clickPrefixEvent
|
|
1261
|
+
setModelValueByEvent(evnt, value) {
|
|
1262
|
+
handleChange(value || "", evnt);
|
|
1513
1263
|
},
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
const { inputValue } = reactData;
|
|
1532
|
-
const suffixSlot = slots.suffix;
|
|
1533
|
-
const isDisabled = computeIsDisabled.value;
|
|
1534
|
-
const isClearable = computeIsClearable.value;
|
|
1535
|
-
return (0, import_vue.h)(
|
|
1536
|
-
"div",
|
|
1537
|
-
{
|
|
1538
|
-
class: [
|
|
1539
|
-
"vxe-date-picker--suffix",
|
|
1540
|
-
{
|
|
1541
|
-
"is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
|
|
1542
|
-
}
|
|
1543
|
-
]
|
|
1264
|
+
focus() {
|
|
1265
|
+
const inputElem = refInputTarget.value;
|
|
1266
|
+
reactData.isActivated = true;
|
|
1267
|
+
inputElem.focus();
|
|
1268
|
+
return (0, import_vue.nextTick)();
|
|
1269
|
+
},
|
|
1270
|
+
blur() {
|
|
1271
|
+
const inputElem = refInputTarget.value;
|
|
1272
|
+
inputElem.blur();
|
|
1273
|
+
reactData.isActivated = false;
|
|
1274
|
+
return (0, import_vue.nextTick)();
|
|
1275
|
+
},
|
|
1276
|
+
select() {
|
|
1277
|
+
const inputElem = refInputTarget.value;
|
|
1278
|
+
inputElem.select();
|
|
1279
|
+
reactData.isActivated = false;
|
|
1280
|
+
return (0, import_vue.nextTick)();
|
|
1544
1281
|
},
|
|
1545
|
-
|
|
1546
|
-
|
|
1282
|
+
showPanel,
|
|
1283
|
+
hidePanel,
|
|
1284
|
+
updatePlacement
|
|
1285
|
+
};
|
|
1286
|
+
Object.assign($xeDatePicker, datePickerMethods);
|
|
1287
|
+
const renderShortcutBtn = (pos, isVertical) => {
|
|
1288
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
1289
|
+
const { position, align, mode } = shortcutOpts;
|
|
1290
|
+
const shortcutList = computeShortcutList.value;
|
|
1291
|
+
if ((0, import_utils.isEnableConf)(shortcutOpts) && shortcutList.length && (position || "left") === pos) {
|
|
1292
|
+
return (0, import_vue.h)(
|
|
1547
1293
|
"div",
|
|
1548
1294
|
{
|
|
1549
|
-
class:
|
|
1550
|
-
onClick: clearValueEvent
|
|
1295
|
+
class: `vxe-date-picker--layout-${pos}-wrapper`
|
|
1551
1296
|
},
|
|
1552
1297
|
[
|
|
1553
|
-
(0, import_vue.h)(
|
|
1554
|
-
|
|
1298
|
+
(0, import_vue.h)(import_button_group.default, {
|
|
1299
|
+
options: shortcutList,
|
|
1300
|
+
mode,
|
|
1301
|
+
align,
|
|
1302
|
+
vertical: isVertical,
|
|
1303
|
+
onClick: handleShortcutEvent
|
|
1555
1304
|
})
|
|
1556
1305
|
]
|
|
1557
|
-
)
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
return renderEmptyElement($xeDatePicker);
|
|
1309
|
+
};
|
|
1310
|
+
const renderPanel = () => {
|
|
1311
|
+
const popupOpts = computePopupOpts.value;
|
|
1312
|
+
if (popupOpts.enabled === false) {
|
|
1313
|
+
return renderEmptyElement($xeDatePicker);
|
|
1314
|
+
}
|
|
1315
|
+
const { type, multiple, showClearButton, showConfirmButton } = props;
|
|
1316
|
+
const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle, inputValue } = reactData;
|
|
1317
|
+
const vSize = computeSize.value;
|
|
1318
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
1319
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
1320
|
+
const isClearable = computeIsClearable.value;
|
|
1321
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1322
|
+
const shortcutList = computeShortcutList.value;
|
|
1323
|
+
const timeOpts = computeTimeOpts.value;
|
|
1324
|
+
const dateStartDate = computeDateStartDate.value;
|
|
1325
|
+
const dateEndDate = computeDateEndDate.value;
|
|
1326
|
+
const { appendTo } = popupOpts;
|
|
1327
|
+
const { position } = shortcutOpts;
|
|
1328
|
+
const headerSlot = slots.header;
|
|
1329
|
+
const footerSlot = slots.footer;
|
|
1330
|
+
const topSlot = slots.top;
|
|
1331
|
+
const bottomSlot = slots.bottom;
|
|
1332
|
+
const leftSlot = slots.left;
|
|
1333
|
+
const rightSlot = slots.right;
|
|
1334
|
+
const ppClassName = popupOpts.className;
|
|
1335
|
+
const hasShortcutBtn = shortcutList.length > 0;
|
|
1336
|
+
const showConfirmBtn = showConfirmButton === null ? isTimeOrDateTimeType || multiple : showConfirmButton;
|
|
1337
|
+
const showClearBtn = showClearButton === null ? isClearable && showConfirmBtn && type !== "time" : showClearButton;
|
|
1338
|
+
return (0, import_vue.h)(
|
|
1339
|
+
import_vue.Teleport,
|
|
1340
|
+
{
|
|
1341
|
+
to: (0, import_dom.getPopupContainer)(appendTo),
|
|
1342
|
+
disabled: btnTransfer ? !initialized : true
|
|
1343
|
+
},
|
|
1344
|
+
[
|
|
1345
|
+
(0, import_vue.h)(
|
|
1346
|
+
"div",
|
|
1347
|
+
{
|
|
1348
|
+
ref: refInputPanel,
|
|
1349
|
+
class: [
|
|
1350
|
+
"vxe-table--ignore-clear vxe-date-picker--panel",
|
|
1351
|
+
`type--${type}`,
|
|
1352
|
+
ppClassName ? import_xe_utils.default.isFunction(ppClassName) ? ppClassName({ $datePicker: $xeDatePicker }) : ppClassName : "",
|
|
1353
|
+
{
|
|
1354
|
+
[`size--${vSize}`]: vSize,
|
|
1355
|
+
"is--transfer": btnTransfer,
|
|
1356
|
+
"ani--leave": isAniVisible,
|
|
1357
|
+
"ani--enter": visiblePanel,
|
|
1358
|
+
"show--top": !!(topSlot || headerSlot || hasShortcutBtn && (position === "top" || position === "header")),
|
|
1359
|
+
"show--bottom": !!(bottomSlot || footerSlot || hasShortcutBtn && (position === "bottom" || position === "footer")),
|
|
1360
|
+
"show--left": !!(leftSlot || hasShortcutBtn && position === "left"),
|
|
1361
|
+
"show--right": !!(rightSlot || hasShortcutBtn && position === "right")
|
|
1362
|
+
}
|
|
1363
|
+
],
|
|
1364
|
+
placement: panelPlacement,
|
|
1365
|
+
style: panelStyle
|
|
1366
|
+
},
|
|
1367
|
+
initialized && (visiblePanel || isAniVisible) ? [
|
|
1368
|
+
(0, import_vue.h)(
|
|
1369
|
+
"div",
|
|
1370
|
+
{
|
|
1371
|
+
ref: refPanelWrapper,
|
|
1372
|
+
class: [
|
|
1373
|
+
"vxe-date-picker--layout-all-wrapper",
|
|
1374
|
+
`type--${type}`,
|
|
1375
|
+
{
|
|
1376
|
+
[`size--${vSize}`]: vSize
|
|
1377
|
+
}
|
|
1378
|
+
]
|
|
1379
|
+
},
|
|
1380
|
+
[
|
|
1381
|
+
topSlot ? (0, import_vue.h)(
|
|
1382
|
+
"div",
|
|
1383
|
+
{
|
|
1384
|
+
class: "vxe-date-picker--layout-top-wrapper"
|
|
1385
|
+
},
|
|
1386
|
+
topSlot({})
|
|
1387
|
+
) : renderShortcutBtn("top"),
|
|
1388
|
+
(0, import_vue.h)(
|
|
1389
|
+
"div",
|
|
1390
|
+
{
|
|
1391
|
+
class: "vxe-date-picker--layout-body-layout-wrapper"
|
|
1392
|
+
},
|
|
1393
|
+
[
|
|
1394
|
+
leftSlot ? (0, import_vue.h)(
|
|
1395
|
+
"div",
|
|
1396
|
+
{
|
|
1397
|
+
class: "vxe-date-picker--layout-left-wrapper"
|
|
1398
|
+
},
|
|
1399
|
+
leftSlot({})
|
|
1400
|
+
) : renderShortcutBtn("left", true),
|
|
1401
|
+
(0, import_vue.h)(
|
|
1402
|
+
"div",
|
|
1403
|
+
{
|
|
1404
|
+
class: "vxe-date-picker--layout-body-content-wrapper"
|
|
1405
|
+
},
|
|
1406
|
+
[
|
|
1407
|
+
headerSlot ? (0, import_vue.h)(
|
|
1408
|
+
"div",
|
|
1409
|
+
{
|
|
1410
|
+
class: "vxe-date-picker--layout-header-wrapper"
|
|
1411
|
+
},
|
|
1412
|
+
headerSlot({})
|
|
1413
|
+
) : renderShortcutBtn("header"),
|
|
1414
|
+
(0, import_vue.h)(
|
|
1415
|
+
"div",
|
|
1416
|
+
{
|
|
1417
|
+
class: "vxe-date-picker--layout-body-wrapper"
|
|
1418
|
+
},
|
|
1419
|
+
[
|
|
1420
|
+
(0, import_vue.h)(import_date_panel.default, {
|
|
1421
|
+
ref: refDatePanel,
|
|
1422
|
+
modelValue: reactData.inputValue,
|
|
1423
|
+
type: props.type,
|
|
1424
|
+
className: props.className,
|
|
1425
|
+
multiple: props.multiple,
|
|
1426
|
+
limitCount: props.limitCount,
|
|
1427
|
+
startDate: dateStartDate,
|
|
1428
|
+
endDate: dateEndDate,
|
|
1429
|
+
defaultDate: props.defaultDate,
|
|
1430
|
+
defaultTime: props.defaultTime,
|
|
1431
|
+
minDate: props.minDate,
|
|
1432
|
+
maxDate: props.maxDate,
|
|
1433
|
+
startDay: props.startDay,
|
|
1434
|
+
labelFormat: props.labelFormat,
|
|
1435
|
+
valueFormat: props.valueFormat,
|
|
1436
|
+
timeFormat: props.timeFormat,
|
|
1437
|
+
timeConfig: timeOpts,
|
|
1438
|
+
festivalMethod: props.festivalMethod || defaultFuncProps.festivalMethod,
|
|
1439
|
+
disabledMethod: props.disabledMethod || defaultFuncProps.disabledMethod,
|
|
1440
|
+
selectDay: props.selectDay,
|
|
1441
|
+
onChange: panelChangeEvent,
|
|
1442
|
+
onConfirm: panelConfirmEvent,
|
|
1443
|
+
onRevert: panelRevertEvent
|
|
1444
|
+
})
|
|
1445
|
+
]
|
|
1446
|
+
),
|
|
1447
|
+
(0, import_vue.h)(
|
|
1448
|
+
"div",
|
|
1449
|
+
{
|
|
1450
|
+
class: "vxe-date-picker--layout-footer-wrapper"
|
|
1451
|
+
},
|
|
1452
|
+
[
|
|
1453
|
+
(0, import_vue.h)(
|
|
1454
|
+
"div",
|
|
1455
|
+
{
|
|
1456
|
+
class: "vxe-date-picker--layout-footer-custom"
|
|
1457
|
+
},
|
|
1458
|
+
footerSlot ? footerSlot({}) : [renderShortcutBtn("footer")]
|
|
1459
|
+
),
|
|
1460
|
+
showClearBtn || showConfirmBtn ? (0, import_vue.h)(
|
|
1461
|
+
"div",
|
|
1462
|
+
{
|
|
1463
|
+
class: "vxe-date-picker--layout-footer-btns"
|
|
1464
|
+
},
|
|
1465
|
+
[
|
|
1466
|
+
showClearBtn ? (0, import_vue.h)(import_button.default, {
|
|
1467
|
+
size: "mini",
|
|
1468
|
+
disabled: inputValue === "" || import_xe_utils.default.eqNull(inputValue),
|
|
1469
|
+
content: getI18n("vxe.button.clear"),
|
|
1470
|
+
onClick: clearValueEvent
|
|
1471
|
+
}) : renderEmptyElement($xeDatePicker),
|
|
1472
|
+
showConfirmBtn ? (0, import_vue.h)(import_button.default, {
|
|
1473
|
+
size: "mini",
|
|
1474
|
+
status: "primary",
|
|
1475
|
+
content: getI18n("vxe.button.confirm"),
|
|
1476
|
+
onClick: confirmEvent
|
|
1477
|
+
}) : renderEmptyElement($xeDatePicker)
|
|
1478
|
+
]
|
|
1479
|
+
) : renderEmptyElement($xeDatePicker)
|
|
1480
|
+
]
|
|
1481
|
+
)
|
|
1482
|
+
]
|
|
1483
|
+
),
|
|
1484
|
+
rightSlot ? (0, import_vue.h)(
|
|
1485
|
+
"div",
|
|
1486
|
+
{
|
|
1487
|
+
class: "vxe-date-picker--layout-right-wrapper"
|
|
1488
|
+
},
|
|
1489
|
+
rightSlot({})
|
|
1490
|
+
) : renderShortcutBtn("right", true)
|
|
1491
|
+
]
|
|
1492
|
+
),
|
|
1493
|
+
bottomSlot ? (0, import_vue.h)(
|
|
1494
|
+
"div",
|
|
1495
|
+
{
|
|
1496
|
+
class: "vxe-date-picker--layout-bottom-wrapper"
|
|
1497
|
+
},
|
|
1498
|
+
bottomSlot({})
|
|
1499
|
+
) : renderShortcutBtn("bottom")
|
|
1500
|
+
]
|
|
1501
|
+
)
|
|
1502
|
+
] : []
|
|
1503
|
+
)
|
|
1504
|
+
]
|
|
1505
|
+
);
|
|
1506
|
+
};
|
|
1507
|
+
const renderPrefixIcon = () => {
|
|
1508
|
+
const { prefixIcon } = props;
|
|
1509
|
+
const prefixSlot = slots.prefix;
|
|
1510
|
+
return prefixSlot || prefixIcon ? (0, import_vue.h)(
|
|
1511
|
+
"div",
|
|
1512
|
+
{
|
|
1513
|
+
class: "vxe-date-picker--prefix",
|
|
1514
|
+
onClick: clickPrefixEvent
|
|
1515
|
+
},
|
|
1516
|
+
[
|
|
1517
|
+
(0, import_vue.h)(
|
|
1518
|
+
"div",
|
|
1519
|
+
{
|
|
1520
|
+
class: "vxe-date-picker--prefix-icon"
|
|
1521
|
+
},
|
|
1522
|
+
prefixSlot ? (0, import_vn.getSlotVNs)(prefixSlot({})) : [
|
|
1523
|
+
(0, import_vue.h)("i", {
|
|
1524
|
+
class: prefixIcon
|
|
1525
|
+
})
|
|
1526
|
+
]
|
|
1527
|
+
)
|
|
1528
|
+
]
|
|
1529
|
+
) : null;
|
|
1530
|
+
};
|
|
1531
|
+
const renderSuffixIcon = () => {
|
|
1532
|
+
const { suffixIcon } = props;
|
|
1533
|
+
const { inputValue } = reactData;
|
|
1534
|
+
const suffixSlot = slots.suffix;
|
|
1535
|
+
const isDisabled = computeIsDisabled.value;
|
|
1536
|
+
const isClearable = computeIsClearable.value;
|
|
1537
|
+
return (0, import_vue.h)(
|
|
1538
|
+
"div",
|
|
1539
|
+
{
|
|
1540
|
+
class: [
|
|
1541
|
+
"vxe-date-picker--suffix",
|
|
1542
|
+
{
|
|
1543
|
+
"is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
|
|
1544
|
+
}
|
|
1569
1545
|
]
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1546
|
+
},
|
|
1547
|
+
[
|
|
1548
|
+
isClearable ? (0, import_vue.h)(
|
|
1549
|
+
"div",
|
|
1550
|
+
{
|
|
1551
|
+
class: "vxe-date-picker--clear-icon",
|
|
1552
|
+
onClick: clearValueEvent
|
|
1553
|
+
},
|
|
1554
|
+
[
|
|
1555
|
+
(0, import_vue.h)("i", {
|
|
1556
|
+
class: getIcon().INPUT_CLEAR
|
|
1557
|
+
})
|
|
1558
|
+
]
|
|
1559
|
+
) : renderEmptyElement($xeDatePicker),
|
|
1560
|
+
renderExtraSuffixIcon(),
|
|
1561
|
+
suffixSlot || suffixIcon ? (0, import_vue.h)(
|
|
1562
|
+
"div",
|
|
1563
|
+
{
|
|
1564
|
+
class: "vxe-date-picker--suffix-icon",
|
|
1565
|
+
onClick: clickSuffixEvent
|
|
1566
|
+
},
|
|
1567
|
+
suffixSlot ? (0, import_vn.getSlotVNs)(suffixSlot({})) : [
|
|
1568
|
+
(0, import_vue.h)("i", {
|
|
1569
|
+
class: suffixIcon
|
|
1570
|
+
})
|
|
1571
|
+
]
|
|
1572
|
+
) : renderEmptyElement($xeDatePicker)
|
|
1573
|
+
]
|
|
1574
|
+
);
|
|
1575
|
+
};
|
|
1576
|
+
const renderExtraSuffixIcon = () => {
|
|
1597
1577
|
return (0, import_vue.h)(
|
|
1598
1578
|
"div",
|
|
1599
1579
|
{
|
|
1600
|
-
|
|
1601
|
-
|
|
1580
|
+
class: "vxe-date-picker--control-icon",
|
|
1581
|
+
onClick: clickIconEvent
|
|
1602
1582
|
},
|
|
1603
|
-
|
|
1583
|
+
[
|
|
1584
|
+
(0, import_vue.h)("i", {
|
|
1585
|
+
class: ["vxe-date-picker--date-picker-icon", getIcon().DATE_PICKER_DATE]
|
|
1586
|
+
})
|
|
1587
|
+
]
|
|
1604
1588
|
);
|
|
1605
|
-
}
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
{
|
|
1615
|
-
|
|
1616
|
-
class: [
|
|
1617
|
-
"vxe-date-picker",
|
|
1618
|
-
`type--${type}`,
|
|
1619
|
-
className,
|
|
1620
|
-
{
|
|
1621
|
-
[`size--${vSize}`]: vSize,
|
|
1622
|
-
"is--prefix": !!prefix,
|
|
1623
|
-
"is--suffix": !!suffix,
|
|
1624
|
-
"is--visible": visiblePanel,
|
|
1625
|
-
"is--disabled": isDisabled,
|
|
1626
|
-
"is--active": isActivated,
|
|
1627
|
-
"show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
|
|
1628
|
-
}
|
|
1629
|
-
],
|
|
1630
|
-
style: currStyle,
|
|
1631
|
-
spellcheck: false
|
|
1632
|
-
},
|
|
1633
|
-
[
|
|
1634
|
-
prefix || renderEmptyElement($xeDatePicker),
|
|
1635
|
-
(0, import_vue.h)(
|
|
1589
|
+
};
|
|
1590
|
+
const renderVN = () => {
|
|
1591
|
+
const { className, inputClassName, type, name, autoComplete } = props;
|
|
1592
|
+
const { inputValue, visiblePanel, isActivated, labelFlag } = reactData;
|
|
1593
|
+
const { inputLabel } = internalData;
|
|
1594
|
+
const vSize = computeSize.value;
|
|
1595
|
+
const isDisabled = computeIsDisabled.value;
|
|
1596
|
+
const formReadonly = computeFormReadonly.value;
|
|
1597
|
+
const panelLabel = computePanelLabel.value;
|
|
1598
|
+
if (formReadonly) {
|
|
1599
|
+
return (0, import_vue.h)(
|
|
1636
1600
|
"div",
|
|
1637
1601
|
{
|
|
1638
|
-
|
|
1602
|
+
ref: refElem,
|
|
1603
|
+
class: ["vxe-date-picker--readonly", `type--${type}`, className]
|
|
1639
1604
|
},
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1605
|
+
panelLabel
|
|
1606
|
+
);
|
|
1607
|
+
}
|
|
1608
|
+
const currStyle = computeCurrStyle.value;
|
|
1609
|
+
const inputReadonly = computeInputReadonly.value;
|
|
1610
|
+
const inpPlaceholder = computeInpPlaceholder.value;
|
|
1611
|
+
const isClearable = computeIsClearable.value;
|
|
1612
|
+
const prefix = renderPrefixIcon();
|
|
1613
|
+
const suffix = renderSuffixIcon();
|
|
1614
|
+
return (0, import_vue.h)(
|
|
1615
|
+
"div",
|
|
1616
|
+
{
|
|
1617
|
+
ref: refElem,
|
|
1618
|
+
class: [
|
|
1619
|
+
"vxe-date-picker",
|
|
1620
|
+
`type--${type}`,
|
|
1621
|
+
className,
|
|
1622
|
+
{
|
|
1623
|
+
[`size--${vSize}`]: vSize,
|
|
1624
|
+
"is--prefix": !!prefix,
|
|
1625
|
+
"is--suffix": !!suffix,
|
|
1626
|
+
"is--visible": visiblePanel,
|
|
1627
|
+
"is--disabled": isDisabled,
|
|
1628
|
+
"is--active": isActivated,
|
|
1629
|
+
"show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
|
|
1630
|
+
}
|
|
1631
|
+
],
|
|
1632
|
+
style: currStyle,
|
|
1633
|
+
spellcheck: false
|
|
1634
|
+
},
|
|
1635
|
+
[
|
|
1636
|
+
prefix || renderEmptyElement($xeDatePicker),
|
|
1637
|
+
(0, import_vue.h)(
|
|
1638
|
+
"div",
|
|
1639
|
+
{
|
|
1640
|
+
class: "vxe-date-picker--wrapper"
|
|
1641
|
+
},
|
|
1642
|
+
[
|
|
1643
|
+
(0, import_vue.h)("input", {
|
|
1644
|
+
ref: refInputTarget,
|
|
1645
|
+
class: "vxe-date-picker--inner" + (inputClassName ? " " + inputClassName : ""),
|
|
1646
|
+
value: labelFlag ? inputLabel : "",
|
|
1647
|
+
name,
|
|
1648
|
+
type: "text",
|
|
1649
|
+
placeholder: inpPlaceholder,
|
|
1650
|
+
readonly: inputReadonly,
|
|
1651
|
+
disabled: isDisabled,
|
|
1652
|
+
autocomplete: autoComplete,
|
|
1653
|
+
onKeydown: keydownEvent,
|
|
1654
|
+
onKeyup: keyupEvent,
|
|
1655
|
+
onClick: clickEvent,
|
|
1656
|
+
onInput: inputEvent,
|
|
1657
|
+
onChange: changeEvent,
|
|
1658
|
+
onFocus: focusEvent,
|
|
1659
|
+
onBlur: blurEvent
|
|
1660
|
+
})
|
|
1661
|
+
]
|
|
1662
|
+
),
|
|
1663
|
+
suffix || renderEmptyElement($xeDatePicker),
|
|
1664
|
+
// 下拉面板
|
|
1665
|
+
renderPanel()
|
|
1666
|
+
]
|
|
1667
|
+
);
|
|
1668
|
+
};
|
|
1669
|
+
(0, import_vue.watch)(computePanelLabel, (val) => {
|
|
1670
|
+
handleInputLabel(val, true);
|
|
1671
|
+
});
|
|
1672
|
+
(0, import_vue.watch)(
|
|
1673
|
+
() => props.modelValue,
|
|
1674
|
+
() => {
|
|
1675
|
+
updateModelValue();
|
|
1676
|
+
}
|
|
1665
1677
|
);
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
});
|
|
1684
|
-
(0, import_vue.onMounted)(() => {
|
|
1685
|
-
const { type, multiple, maskedConfig } = props;
|
|
1686
|
-
if ((0, import_utils.isEnableConf)(maskedConfig)) {
|
|
1687
|
-
if (multiple) {
|
|
1688
|
-
errLog("vxe.error.notSupportProp", ["multiple", "masked-config.enabled=true", "masked-config.enabled=false"]);
|
|
1678
|
+
updateModelValue();
|
|
1679
|
+
(0, import_vue.nextTick)(() => {
|
|
1680
|
+
globalEvents.on($xeDatePicker, "mousedown", handleGlobalMousedownEvent);
|
|
1681
|
+
globalEvents.on($xeDatePicker, "keydown", handleGlobalKeydownEvent);
|
|
1682
|
+
globalEvents.on($xeDatePicker, "blur", handleGlobalBlurEvent);
|
|
1683
|
+
globalEvents.on($xeDatePicker, "resize", handleGlobalResizeEvent);
|
|
1684
|
+
globalEvents.on($xeDatePicker, "scroll", handleGlobalScrollEvent);
|
|
1685
|
+
});
|
|
1686
|
+
(0, import_vue.onMounted)(() => {
|
|
1687
|
+
const { type, multiple, maskedConfig } = props;
|
|
1688
|
+
if ((0, import_utils.isEnableConf)(maskedConfig)) {
|
|
1689
|
+
if (multiple) {
|
|
1690
|
+
errLog("vxe.error.notSupportProp", ["multiple", "masked-config.enabled=true", "masked-config.enabled=false"]);
|
|
1691
|
+
}
|
|
1692
|
+
if (!maskedTypes.includes(type)) {
|
|
1693
|
+
warnLog("vxe.error.notSupportProp", ["masked-config.enabled=true", `type=${type}`, `type=${maskedTypes.join("|")}`]);
|
|
1694
|
+
}
|
|
1689
1695
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
}
|
|
1704
|
-
(
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
return this.renderVN();
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1696
|
+
});
|
|
1697
|
+
(0, import_vue.onUnmounted)(() => {
|
|
1698
|
+
globalEvents.off($xeDatePicker, "mousedown");
|
|
1699
|
+
globalEvents.off($xeDatePicker, "keydown");
|
|
1700
|
+
globalEvents.off($xeDatePicker, "blur");
|
|
1701
|
+
globalEvents.off($xeDatePicker, "resize");
|
|
1702
|
+
globalEvents.off($xeDatePicker, "scroll");
|
|
1703
|
+
import_xe_utils.default.assign(reactData, createReactData());
|
|
1704
|
+
import_xe_utils.default.assign(internalData, createInternalData());
|
|
1705
|
+
});
|
|
1706
|
+
(0, import_vue.provide)("$xeDatePicker", $xeDatePicker);
|
|
1707
|
+
$xeDatePicker.renderVN = renderVN;
|
|
1708
|
+
return $xeDatePicker;
|
|
1709
|
+
},
|
|
1710
|
+
render() {
|
|
1711
|
+
return this.renderVN();
|
|
1712
|
+
}
|
|
1713
|
+
})
|
|
1714
|
+
);
|