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
|
@@ -40,2054 +40,2057 @@ var import_log = require("../../ui/src/log");
|
|
|
40
40
|
var import_scrollbar = __toESM(require("../../scrollbar"));
|
|
41
41
|
const { getConfig, getI18n, createEvent, useFns, renderEmptyElement } = import_core.VxeUI;
|
|
42
42
|
const { errLog } = (0, import_log.createComponentLog)("date-panel");
|
|
43
|
-
var date_panel_default = (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
43
|
+
var date_panel_default = (
|
|
44
|
+
/* define-vxe-component start */
|
|
45
|
+
(0, import_comp.defineVxeComponent)({
|
|
46
|
+
name: "VxeDatePanel",
|
|
47
|
+
props: {
|
|
48
|
+
modelValue: [String, Number, Date, Array],
|
|
49
|
+
type: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "date"
|
|
52
|
+
},
|
|
53
|
+
className: String,
|
|
54
|
+
cellClassName: [String, Function],
|
|
55
|
+
size: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: () => getConfig().datePanel.size || getConfig().size
|
|
58
|
+
},
|
|
59
|
+
multiple: Boolean,
|
|
60
|
+
limitCount: {
|
|
61
|
+
type: [String, Number],
|
|
62
|
+
default: () => getConfig().datePanel.limitCount
|
|
63
|
+
},
|
|
64
|
+
// date、week、month、quarter、year
|
|
65
|
+
startDate: {
|
|
66
|
+
type: [String, Number, Date],
|
|
67
|
+
default: () => getConfig().datePanel.startDate
|
|
68
|
+
},
|
|
69
|
+
endDate: {
|
|
70
|
+
type: [String, Number, Date],
|
|
71
|
+
default: () => getConfig().datePanel.endDate
|
|
72
|
+
},
|
|
73
|
+
defaultMode: String,
|
|
74
|
+
defaultDate: [String, Number, Date],
|
|
75
|
+
defaultTime: [String, Number, Date],
|
|
76
|
+
minDate: [String, Number, Date],
|
|
77
|
+
maxDate: [String, Number, Date],
|
|
78
|
+
startDay: {
|
|
79
|
+
type: [String, Number],
|
|
80
|
+
default: () => getConfig().datePanel.startDay
|
|
81
|
+
},
|
|
82
|
+
labelFormat: String,
|
|
83
|
+
valueFormat: String,
|
|
84
|
+
timeFormat: String,
|
|
85
|
+
valueSort: Boolean,
|
|
86
|
+
festivalMethod: Function,
|
|
87
|
+
disabledMethod: Function,
|
|
88
|
+
timeConfig: Object,
|
|
89
|
+
// week
|
|
90
|
+
selectDay: {
|
|
91
|
+
type: [String, Number],
|
|
92
|
+
default: () => getConfig().datePanel.selectDay
|
|
93
|
+
}
|
|
79
94
|
},
|
|
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
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const { modelValue, valueFormat } = props;
|
|
145
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
146
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
147
|
-
const restList = [];
|
|
148
|
-
if (modelValue && isDatePanelType) {
|
|
149
|
-
;
|
|
150
|
-
(import_xe_utils.default.isArray(modelValue) ? modelValue : import_xe_utils.default.toValueString(modelValue).split(",")).forEach((val) => {
|
|
151
|
-
let strVal = val;
|
|
152
|
-
if (val) {
|
|
153
|
-
if (valueFormat === "timestamp") {
|
|
154
|
-
if (import_xe_utils.default.isString(val) && /^\d+$/.test(val)) {
|
|
155
|
-
strVal = Number(strVal);
|
|
95
|
+
emits: ["update:modelValue", "change", "click", "clear", "date-prev", "date-today", "date-next", "confirm", "revert"],
|
|
96
|
+
setup(props, context) {
|
|
97
|
+
const { emit } = context;
|
|
98
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
99
|
+
const { computeSize } = useFns.useSize(props);
|
|
100
|
+
const reactData = (0, import_vue.reactive)({
|
|
101
|
+
visiblePanel: false,
|
|
102
|
+
isAniVisible: false,
|
|
103
|
+
isActivated: false,
|
|
104
|
+
inputValue: "",
|
|
105
|
+
inputLabel: "",
|
|
106
|
+
datetimePanelValue: null,
|
|
107
|
+
datePanelValue: null,
|
|
108
|
+
datePanelLabel: "",
|
|
109
|
+
datePanelType: "day",
|
|
110
|
+
selectMonth: null,
|
|
111
|
+
currentDate: null
|
|
112
|
+
});
|
|
113
|
+
const internalData = {
|
|
114
|
+
yearSize: 16,
|
|
115
|
+
monthSize: 12,
|
|
116
|
+
quarterSize: 4,
|
|
117
|
+
hpTimeout: void 0
|
|
118
|
+
};
|
|
119
|
+
const defaultFuncProps = {
|
|
120
|
+
festivalMethod: getConfig().datePanel.festivalMethod,
|
|
121
|
+
disabledMethod: getConfig().datePanel.disabledMethod
|
|
122
|
+
};
|
|
123
|
+
const refElem = (0, import_vue.ref)();
|
|
124
|
+
const refPanelWrapper = (0, import_vue.ref)();
|
|
125
|
+
const refInputTimeBody = (0, import_vue.ref)();
|
|
126
|
+
const computeIsTimeType = (0, import_vue.computed)(() => {
|
|
127
|
+
const { type } = props;
|
|
128
|
+
return type === "time";
|
|
129
|
+
});
|
|
130
|
+
const computeIsTimeOrDateTimeType = (0, import_vue.computed)(() => {
|
|
131
|
+
const { type } = props;
|
|
132
|
+
const isTimeType = computeIsTimeType.value;
|
|
133
|
+
return isTimeType || type === "datetime";
|
|
134
|
+
});
|
|
135
|
+
const computeIsDatePanelType = (0, import_vue.computed)(() => {
|
|
136
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
137
|
+
return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
|
|
138
|
+
});
|
|
139
|
+
const computeDateStartDate = (0, import_vue.computed)(() => {
|
|
140
|
+
return props.startDate ? import_xe_utils.default.toStringDate(props.startDate) : null;
|
|
141
|
+
});
|
|
142
|
+
const computeDateEndDate = (0, import_vue.computed)(() => {
|
|
143
|
+
return props.endDate ? import_xe_utils.default.toStringDate(props.endDate) : null;
|
|
144
|
+
});
|
|
145
|
+
const computeDateListValue = (0, import_vue.computed)(() => {
|
|
146
|
+
const { modelValue, valueFormat } = props;
|
|
147
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
148
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
149
|
+
const restList = [];
|
|
150
|
+
if (modelValue && isDatePanelType) {
|
|
151
|
+
;
|
|
152
|
+
(import_xe_utils.default.isArray(modelValue) ? modelValue : import_xe_utils.default.toValueString(modelValue).split(",")).forEach((val) => {
|
|
153
|
+
let strVal = val;
|
|
154
|
+
if (val) {
|
|
155
|
+
if (valueFormat === "timestamp") {
|
|
156
|
+
if (import_xe_utils.default.isString(val) && /^\d+$/.test(val)) {
|
|
157
|
+
strVal = Number(strVal);
|
|
158
|
+
}
|
|
156
159
|
}
|
|
160
|
+
const date = parseDate(strVal, dateValueFormat);
|
|
161
|
+
restList.push(date);
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return restList;
|
|
166
|
+
});
|
|
167
|
+
const computeDateMultipleValue = (0, import_vue.computed)(() => {
|
|
168
|
+
const dateListValue = computeDateListValue.value;
|
|
169
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
170
|
+
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
|
|
171
|
+
});
|
|
172
|
+
const computeDateMultipleLabel = (0, import_vue.computed)(() => {
|
|
173
|
+
const dateListValue = computeDateListValue.value;
|
|
174
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
175
|
+
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateLabelFormat)).join(", ");
|
|
176
|
+
});
|
|
177
|
+
const computeLimitMaxCount = (0, import_vue.computed)(() => {
|
|
178
|
+
return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
|
|
179
|
+
});
|
|
180
|
+
const computeOverCount = (0, import_vue.computed)(() => {
|
|
181
|
+
const { multiple } = props;
|
|
182
|
+
const limitMaxCount = computeLimitMaxCount.value;
|
|
183
|
+
const dateMultipleValue = computeDateMultipleValue.value;
|
|
184
|
+
if (multiple && limitMaxCount) {
|
|
185
|
+
return dateMultipleValue.length >= limitMaxCount;
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
});
|
|
189
|
+
const computeTimeOpts = (0, import_vue.computed)(() => {
|
|
190
|
+
return Object.assign({}, getConfig().datePanel.timeConfig, props.timeConfig);
|
|
191
|
+
});
|
|
192
|
+
const computeDateValueFormat = (0, import_vue.computed)(() => {
|
|
193
|
+
const { type, valueFormat } = props;
|
|
194
|
+
return (0, import_util.handleValueFormat)(type, valueFormat);
|
|
195
|
+
});
|
|
196
|
+
const computeDateValue = (0, import_vue.computed)(() => {
|
|
197
|
+
const { modelValue, defaultMode } = props;
|
|
198
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
199
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
200
|
+
let val = null;
|
|
201
|
+
if (modelValue && isDatePanelType) {
|
|
202
|
+
const vals = import_xe_utils.default.isString(modelValue) ? modelValue.split(",") : modelValue;
|
|
203
|
+
const currVal = defaultMode === "last" ? import_xe_utils.default.last(vals) : import_xe_utils.default.first(vals);
|
|
204
|
+
const date = parseDate(currVal, dateValueFormat);
|
|
205
|
+
if (import_xe_utils.default.isValidDate(date)) {
|
|
206
|
+
val = date;
|
|
160
207
|
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return restList;
|
|
164
|
-
});
|
|
165
|
-
const computeDateMultipleValue = (0, import_vue.computed)(() => {
|
|
166
|
-
const dateListValue = computeDateListValue.value;
|
|
167
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
168
|
-
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
|
|
169
|
-
});
|
|
170
|
-
const computeDateMultipleLabel = (0, import_vue.computed)(() => {
|
|
171
|
-
const dateListValue = computeDateListValue.value;
|
|
172
|
-
const dateLabelFormat = computeDateLabelFormat.value;
|
|
173
|
-
return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateLabelFormat)).join(", ");
|
|
174
|
-
});
|
|
175
|
-
const computeLimitMaxCount = (0, import_vue.computed)(() => {
|
|
176
|
-
return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
|
|
177
|
-
});
|
|
178
|
-
const computeOverCount = (0, import_vue.computed)(() => {
|
|
179
|
-
const { multiple } = props;
|
|
180
|
-
const limitMaxCount = computeLimitMaxCount.value;
|
|
181
|
-
const dateMultipleValue = computeDateMultipleValue.value;
|
|
182
|
-
if (multiple && limitMaxCount) {
|
|
183
|
-
return dateMultipleValue.length >= limitMaxCount;
|
|
184
|
-
}
|
|
185
|
-
return false;
|
|
186
|
-
});
|
|
187
|
-
const computeTimeOpts = (0, import_vue.computed)(() => {
|
|
188
|
-
return Object.assign({}, getConfig().datePanel.timeConfig, props.timeConfig);
|
|
189
|
-
});
|
|
190
|
-
const computeDateValueFormat = (0, import_vue.computed)(() => {
|
|
191
|
-
const { type, valueFormat } = props;
|
|
192
|
-
return (0, import_util.handleValueFormat)(type, valueFormat);
|
|
193
|
-
});
|
|
194
|
-
const computeDateValue = (0, import_vue.computed)(() => {
|
|
195
|
-
const { modelValue, defaultMode } = props;
|
|
196
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
197
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
198
|
-
let val = null;
|
|
199
|
-
if (modelValue && isDatePanelType) {
|
|
200
|
-
const vals = import_xe_utils.default.isString(modelValue) ? modelValue.split(",") : modelValue;
|
|
201
|
-
const currVal = defaultMode === "last" ? import_xe_utils.default.last(vals) : import_xe_utils.default.first(vals);
|
|
202
|
-
const date = parseDate(currVal, dateValueFormat);
|
|
203
|
-
if (import_xe_utils.default.isValidDate(date)) {
|
|
204
|
-
val = date;
|
|
205
208
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return selectMonth <= dateStartTime;
|
|
214
|
-
}
|
|
215
|
-
return false;
|
|
216
|
-
});
|
|
217
|
-
const computeIsDisabledNextDateBtn = (0, import_vue.computed)(() => {
|
|
218
|
-
const dateEndTime = computeDateEndDate.value;
|
|
219
|
-
const { selectMonth } = reactData;
|
|
220
|
-
if (selectMonth && dateEndTime) {
|
|
221
|
-
return import_xe_utils.default.getWhatMonth(selectMonth, 0, "last") >= dateEndTime;
|
|
222
|
-
}
|
|
223
|
-
return false;
|
|
224
|
-
});
|
|
225
|
-
const computeDateTimeLabel = (0, import_vue.computed)(() => {
|
|
226
|
-
const { datetimePanelValue } = reactData;
|
|
227
|
-
const hasTimeSecond = computeHasTimeSecond.value;
|
|
228
|
-
const hasTimeMinute = computeHasTimeMinute.value;
|
|
229
|
-
if (datetimePanelValue) {
|
|
230
|
-
return import_xe_utils.default.toDateString(datetimePanelValue, hasTimeMinute && hasTimeSecond ? "HH:mm:ss" : hasTimeMinute ? "HH:mm" : "HH");
|
|
231
|
-
}
|
|
232
|
-
return "";
|
|
233
|
-
});
|
|
234
|
-
const computeDateHMSTime = (0, import_vue.computed)(() => {
|
|
235
|
-
const dateValue = computeDateValue.value;
|
|
236
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
237
|
-
return dateValue && isTimeOrDateTimeType ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1e3 : 0;
|
|
238
|
-
});
|
|
239
|
-
const computeDateLabelFormat = (0, import_vue.computed)(() => {
|
|
240
|
-
const { labelFormat } = props;
|
|
241
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
242
|
-
if (isDatePanelType) {
|
|
243
|
-
return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
244
|
-
}
|
|
245
|
-
return "";
|
|
246
|
-
});
|
|
247
|
-
const computeYearList = (0, import_vue.computed)(() => {
|
|
248
|
-
const { yearSize } = internalData;
|
|
249
|
-
const { selectMonth, currentDate } = reactData;
|
|
250
|
-
const years = [];
|
|
251
|
-
if (selectMonth && currentDate) {
|
|
252
|
-
const currFullYear = currentDate.getFullYear();
|
|
253
|
-
const selectFullYear = selectMonth.getFullYear();
|
|
254
|
-
const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
|
|
255
|
-
for (let index = 0; index < yearSize; index++) {
|
|
256
|
-
const date = import_xe_utils.default.getWhatYear(startYearDate, index, "first");
|
|
257
|
-
const itemFullYear = date.getFullYear();
|
|
258
|
-
years.push({
|
|
259
|
-
date,
|
|
260
|
-
isCurrent: true,
|
|
261
|
-
isPrev: index < 0,
|
|
262
|
-
isNow: currFullYear === itemFullYear,
|
|
263
|
-
isNext: index >= yearSize,
|
|
264
|
-
year: itemFullYear
|
|
265
|
-
});
|
|
209
|
+
return val;
|
|
210
|
+
});
|
|
211
|
+
const computeIsDisabledPrevDateBtn = (0, import_vue.computed)(() => {
|
|
212
|
+
const dateStartTime = computeDateStartDate.value;
|
|
213
|
+
const { selectMonth } = reactData;
|
|
214
|
+
if (selectMonth && dateStartTime) {
|
|
215
|
+
return selectMonth <= dateStartTime;
|
|
266
216
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (isDatePanelType) {
|
|
275
|
-
const { datePanelType, selectMonth } = reactData;
|
|
276
|
-
const yearList = computeYearList.value;
|
|
277
|
-
let year = "";
|
|
278
|
-
let month;
|
|
279
|
-
if (selectMonth) {
|
|
280
|
-
year = selectMonth.getFullYear();
|
|
281
|
-
month = selectMonth.getMonth() + 1;
|
|
217
|
+
return false;
|
|
218
|
+
});
|
|
219
|
+
const computeIsDisabledNextDateBtn = (0, import_vue.computed)(() => {
|
|
220
|
+
const dateEndTime = computeDateEndDate.value;
|
|
221
|
+
const { selectMonth } = reactData;
|
|
222
|
+
if (selectMonth && dateEndTime) {
|
|
223
|
+
return import_xe_utils.default.getWhatMonth(selectMonth, 0, "last") >= dateEndTime;
|
|
282
224
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
225
|
+
return false;
|
|
226
|
+
});
|
|
227
|
+
const computeDateTimeLabel = (0, import_vue.computed)(() => {
|
|
228
|
+
const { datetimePanelValue } = reactData;
|
|
229
|
+
const hasTimeSecond = computeHasTimeSecond.value;
|
|
230
|
+
const hasTimeMinute = computeHasTimeMinute.value;
|
|
231
|
+
if (datetimePanelValue) {
|
|
232
|
+
return import_xe_utils.default.toDateString(datetimePanelValue, hasTimeMinute && hasTimeSecond ? "HH:mm:ss" : hasTimeMinute ? "HH:mm" : "HH");
|
|
290
233
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
234
|
+
return "";
|
|
235
|
+
});
|
|
236
|
+
const computeDateHMSTime = (0, import_vue.computed)(() => {
|
|
237
|
+
const dateValue = computeDateValue.value;
|
|
238
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
239
|
+
return dateValue && isTimeOrDateTimeType ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1e3 : 0;
|
|
240
|
+
});
|
|
241
|
+
const computeDateLabelFormat = (0, import_vue.computed)(() => {
|
|
242
|
+
const { labelFormat } = props;
|
|
243
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
244
|
+
if (isDatePanelType) {
|
|
245
|
+
return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
246
|
+
}
|
|
247
|
+
return "";
|
|
248
|
+
});
|
|
249
|
+
const computeYearList = (0, import_vue.computed)(() => {
|
|
250
|
+
const { yearSize } = internalData;
|
|
251
|
+
const { selectMonth, currentDate } = reactData;
|
|
252
|
+
const years = [];
|
|
253
|
+
if (selectMonth && currentDate) {
|
|
254
|
+
const currFullYear = currentDate.getFullYear();
|
|
255
|
+
const selectFullYear = selectMonth.getFullYear();
|
|
256
|
+
const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
|
|
257
|
+
for (let index = 0; index < yearSize; index++) {
|
|
258
|
+
const date = import_xe_utils.default.getWhatYear(startYearDate, index, "first");
|
|
259
|
+
const itemFullYear = date.getFullYear();
|
|
260
|
+
years.push({
|
|
261
|
+
date,
|
|
262
|
+
isCurrent: true,
|
|
263
|
+
isPrev: index < 0,
|
|
264
|
+
isNow: currFullYear === itemFullYear,
|
|
265
|
+
isNext: index >= yearSize,
|
|
266
|
+
year: itemFullYear
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return years;
|
|
271
|
+
});
|
|
272
|
+
const computeSelectDatePanelObj = (0, import_vue.computed)(() => {
|
|
273
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
274
|
+
let y = "";
|
|
275
|
+
let m = "";
|
|
276
|
+
if (isDatePanelType) {
|
|
277
|
+
const { datePanelType, selectMonth } = reactData;
|
|
278
|
+
const yearList = computeYearList.value;
|
|
279
|
+
let year = "";
|
|
280
|
+
let month;
|
|
281
|
+
if (selectMonth) {
|
|
282
|
+
year = selectMonth.getFullYear();
|
|
283
|
+
month = selectMonth.getMonth() + 1;
|
|
284
|
+
}
|
|
285
|
+
if (datePanelType === "quarter" || datePanelType === "month") {
|
|
286
|
+
y = getI18n("vxe.datePicker.yearTitle", [year]);
|
|
287
|
+
} else if (datePanelType === "year") {
|
|
288
|
+
y = yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : "";
|
|
310
289
|
} else {
|
|
311
|
-
|
|
290
|
+
y = getI18n("vxe.datePicker.yearTitle", [year]);
|
|
291
|
+
m = month ? getI18n(`vxe.input.date.m${month}`) : "-";
|
|
312
292
|
}
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
y,
|
|
296
|
+
m
|
|
297
|
+
};
|
|
298
|
+
});
|
|
299
|
+
const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
|
|
300
|
+
const { startDay } = props;
|
|
301
|
+
return import_xe_utils.default.toNumber(startDay);
|
|
302
|
+
});
|
|
303
|
+
const computeWeekDatas = (0, import_vue.computed)(() => {
|
|
304
|
+
const weeks = [];
|
|
305
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
306
|
+
if (isDatePanelType) {
|
|
307
|
+
let sWeek = computeFirstDayOfWeek.value;
|
|
313
308
|
weeks.push(sWeek);
|
|
309
|
+
for (let index = 0; index < 6; index++) {
|
|
310
|
+
if (sWeek >= 6) {
|
|
311
|
+
sWeek = 0;
|
|
312
|
+
} else {
|
|
313
|
+
sWeek++;
|
|
314
|
+
}
|
|
315
|
+
weeks.push(sWeek);
|
|
316
|
+
}
|
|
314
317
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
};
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
return [];
|
|
330
|
-
});
|
|
331
|
-
const computeWeekHeaders = (0, import_vue.computed)(() => {
|
|
332
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
333
|
-
if (isDatePanelType) {
|
|
334
|
-
const dateHeaders = computeDateHeaders.value;
|
|
335
|
-
return [{ label: getI18n("vxe.input.date.weeks.w") }].concat(dateHeaders);
|
|
336
|
-
}
|
|
337
|
-
return [];
|
|
338
|
-
});
|
|
339
|
-
const computeYearDatas = (0, import_vue.computed)(() => {
|
|
340
|
-
const yearList = computeYearList.value;
|
|
341
|
-
return import_xe_utils.default.chunk(yearList, 4);
|
|
342
|
-
});
|
|
343
|
-
const computeQuarterList = (0, import_vue.computed)(() => {
|
|
344
|
-
const { quarterSize } = internalData;
|
|
345
|
-
const { selectMonth, currentDate } = reactData;
|
|
346
|
-
const quarters = [];
|
|
347
|
-
if (selectMonth && currentDate) {
|
|
348
|
-
const currFullYear = currentDate.getFullYear();
|
|
349
|
-
const currQuarter = (0, import_util.getDateQuarter)(currentDate);
|
|
350
|
-
const firstYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first");
|
|
351
|
-
const selFullYear = firstYear.getFullYear();
|
|
352
|
-
for (let index = 0; index < quarterSize; index++) {
|
|
353
|
-
const date = import_xe_utils.default.getWhatQuarter(firstYear, index);
|
|
354
|
-
const itemFullYear = date.getFullYear();
|
|
355
|
-
const itemQuarter = (0, import_util.getDateQuarter)(date);
|
|
356
|
-
const isPrev = itemFullYear < selFullYear;
|
|
357
|
-
quarters.push({
|
|
358
|
-
date,
|
|
359
|
-
isPrev,
|
|
360
|
-
isCurrent: itemFullYear === selFullYear,
|
|
361
|
-
isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
|
|
362
|
-
isNext: !isPrev && itemFullYear > selFullYear,
|
|
363
|
-
quarter: itemQuarter
|
|
318
|
+
return weeks;
|
|
319
|
+
});
|
|
320
|
+
const computeDateHeaders = (0, import_vue.computed)(() => {
|
|
321
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
322
|
+
if (isDatePanelType) {
|
|
323
|
+
const weekDatas = computeWeekDatas.value;
|
|
324
|
+
return weekDatas.map((day) => {
|
|
325
|
+
return {
|
|
326
|
+
value: day,
|
|
327
|
+
label: getI18n(`vxe.input.date.weeks.w${day}`)
|
|
328
|
+
};
|
|
364
329
|
});
|
|
365
330
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const computeMonthList = (0, import_vue.computed)(() => {
|
|
374
|
-
const { monthSize } = internalData;
|
|
375
|
-
const { selectMonth, currentDate } = reactData;
|
|
376
|
-
const months = [];
|
|
377
|
-
if (selectMonth && currentDate) {
|
|
378
|
-
const currFullYear = currentDate.getFullYear();
|
|
379
|
-
const currMonth = currentDate.getMonth();
|
|
380
|
-
const selFullYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first").getFullYear();
|
|
381
|
-
for (let index = 0; index < monthSize; index++) {
|
|
382
|
-
const date = import_xe_utils.default.getWhatYear(selectMonth, 0, index);
|
|
383
|
-
const itemFullYear = date.getFullYear();
|
|
384
|
-
const itemMonth = date.getMonth();
|
|
385
|
-
const isPrev = itemFullYear < selFullYear;
|
|
386
|
-
months.push({
|
|
387
|
-
date,
|
|
388
|
-
isPrev,
|
|
389
|
-
isCurrent: itemFullYear === selFullYear,
|
|
390
|
-
isNow: itemFullYear === currFullYear && itemMonth === currMonth,
|
|
391
|
-
isNext: !isPrev && itemFullYear > selFullYear,
|
|
392
|
-
month: itemMonth
|
|
393
|
-
});
|
|
331
|
+
return [];
|
|
332
|
+
});
|
|
333
|
+
const computeWeekHeaders = (0, import_vue.computed)(() => {
|
|
334
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
335
|
+
if (isDatePanelType) {
|
|
336
|
+
const dateHeaders = computeDateHeaders.value;
|
|
337
|
+
return [{ label: getI18n("vxe.input.date.weeks.w") }].concat(dateHeaders);
|
|
394
338
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
isPrev,
|
|
425
|
-
isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
|
|
426
|
-
isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
|
|
427
|
-
isNext: !isPrev && selMonth !== itemMonth,
|
|
428
|
-
label: itemDate
|
|
429
|
-
});
|
|
339
|
+
return [];
|
|
340
|
+
});
|
|
341
|
+
const computeYearDatas = (0, import_vue.computed)(() => {
|
|
342
|
+
const yearList = computeYearList.value;
|
|
343
|
+
return import_xe_utils.default.chunk(yearList, 4);
|
|
344
|
+
});
|
|
345
|
+
const computeQuarterList = (0, import_vue.computed)(() => {
|
|
346
|
+
const { quarterSize } = internalData;
|
|
347
|
+
const { selectMonth, currentDate } = reactData;
|
|
348
|
+
const quarters = [];
|
|
349
|
+
if (selectMonth && currentDate) {
|
|
350
|
+
const currFullYear = currentDate.getFullYear();
|
|
351
|
+
const currQuarter = (0, import_util.getDateQuarter)(currentDate);
|
|
352
|
+
const firstYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first");
|
|
353
|
+
const selFullYear = firstYear.getFullYear();
|
|
354
|
+
for (let index = 0; index < quarterSize; index++) {
|
|
355
|
+
const date = import_xe_utils.default.getWhatQuarter(firstYear, index);
|
|
356
|
+
const itemFullYear = date.getFullYear();
|
|
357
|
+
const itemQuarter = (0, import_util.getDateQuarter)(date);
|
|
358
|
+
const isPrev = itemFullYear < selFullYear;
|
|
359
|
+
quarters.push({
|
|
360
|
+
date,
|
|
361
|
+
isPrev,
|
|
362
|
+
isCurrent: itemFullYear === selFullYear,
|
|
363
|
+
isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
|
|
364
|
+
isNext: !isPrev && itemFullYear > selFullYear,
|
|
365
|
+
quarter: itemQuarter
|
|
366
|
+
});
|
|
367
|
+
}
|
|
430
368
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
369
|
+
return quarters;
|
|
370
|
+
});
|
|
371
|
+
const computeQuarterDatas = (0, import_vue.computed)(() => {
|
|
372
|
+
const quarterList = computeQuarterList.value;
|
|
373
|
+
return import_xe_utils.default.chunk(quarterList, 2);
|
|
374
|
+
});
|
|
375
|
+
const computeMonthList = (0, import_vue.computed)(() => {
|
|
376
|
+
const { monthSize } = internalData;
|
|
377
|
+
const { selectMonth, currentDate } = reactData;
|
|
378
|
+
const months = [];
|
|
379
|
+
if (selectMonth && currentDate) {
|
|
380
|
+
const currFullYear = currentDate.getFullYear();
|
|
381
|
+
const currMonth = currentDate.getMonth();
|
|
382
|
+
const selFullYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first").getFullYear();
|
|
383
|
+
for (let index = 0; index < monthSize; index++) {
|
|
384
|
+
const date = import_xe_utils.default.getWhatYear(selectMonth, 0, index);
|
|
385
|
+
const itemFullYear = date.getFullYear();
|
|
386
|
+
const itemMonth = date.getMonth();
|
|
387
|
+
const isPrev = itemFullYear < selFullYear;
|
|
388
|
+
months.push({
|
|
389
|
+
date,
|
|
390
|
+
isPrev,
|
|
391
|
+
isCurrent: itemFullYear === selFullYear,
|
|
392
|
+
isNow: itemFullYear === currFullYear && itemMonth === currMonth,
|
|
393
|
+
isNext: !isPrev && itemFullYear > selFullYear,
|
|
394
|
+
month: itemMonth
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return months;
|
|
453
399
|
});
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
if (
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
400
|
+
const computeMonthDatas = (0, import_vue.computed)(() => {
|
|
401
|
+
const monthList = computeMonthList.value;
|
|
402
|
+
return import_xe_utils.default.chunk(monthList, 4);
|
|
403
|
+
});
|
|
404
|
+
const computeDayList = (0, import_vue.computed)(() => {
|
|
405
|
+
const { selectMonth, currentDate } = reactData;
|
|
406
|
+
const days = [];
|
|
407
|
+
if (selectMonth && currentDate) {
|
|
408
|
+
const dateHMSTime = computeDateHMSTime.value;
|
|
409
|
+
const weekDatas = computeWeekDatas.value;
|
|
410
|
+
const currFullYear = currentDate.getFullYear();
|
|
411
|
+
const currMonth = currentDate.getMonth();
|
|
412
|
+
const currDate = currentDate.getDate();
|
|
413
|
+
const selFullYear = selectMonth.getFullYear();
|
|
414
|
+
const selMonth = selectMonth.getMonth();
|
|
415
|
+
const selDay = selectMonth.getDay();
|
|
416
|
+
const prevOffsetDate = -weekDatas.indexOf(selDay);
|
|
417
|
+
const startDayDate = new Date(import_xe_utils.default.getWhatDay(selectMonth, prevOffsetDate).getTime() + dateHMSTime);
|
|
418
|
+
for (let index = 0; index < 42; index++) {
|
|
419
|
+
const date = import_xe_utils.default.getWhatDay(startDayDate, index);
|
|
420
|
+
const itemFullYear = date.getFullYear();
|
|
421
|
+
const itemMonth = date.getMonth();
|
|
422
|
+
const itemDate = date.getDate();
|
|
423
|
+
const isPrev = date < selectMonth;
|
|
424
|
+
days.push({
|
|
425
|
+
date,
|
|
426
|
+
isPrev,
|
|
427
|
+
isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
|
|
428
|
+
isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
|
|
429
|
+
isNext: !isPrev && selMonth !== itemMonth,
|
|
430
|
+
label: itemDate
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return days;
|
|
435
|
+
});
|
|
436
|
+
const computeDayDatas = (0, import_vue.computed)(() => {
|
|
437
|
+
const dayList = computeDayList.value;
|
|
438
|
+
return import_xe_utils.default.chunk(dayList, 7);
|
|
439
|
+
});
|
|
440
|
+
const computeWeekDates = (0, import_vue.computed)(() => {
|
|
441
|
+
const dayDatas = computeDayDatas.value;
|
|
442
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
443
|
+
return dayDatas.map((list) => {
|
|
444
|
+
const firstItem = list[0];
|
|
445
|
+
const item = {
|
|
446
|
+
date: firstItem.date,
|
|
447
|
+
isWeekNumber: true,
|
|
448
|
+
isPrev: false,
|
|
449
|
+
isCurrent: false,
|
|
450
|
+
isNow: false,
|
|
451
|
+
isNext: false,
|
|
452
|
+
label: import_xe_utils.default.getYearWeek(firstItem.date, firstDayOfWeek)
|
|
453
|
+
};
|
|
454
|
+
return [item].concat(list);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
const computeHourList = (0, import_vue.computed)(() => {
|
|
458
|
+
const timeOpts = computeTimeOpts.value;
|
|
459
|
+
const { hours: hourOptions, hourDisabledMethod } = timeOpts;
|
|
460
|
+
const list = [];
|
|
461
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
462
|
+
if (isTimeOrDateTimeType) {
|
|
463
|
+
if (hourOptions && hourOptions.length) {
|
|
464
|
+
hourOptions.forEach((item) => {
|
|
465
|
+
if (import_xe_utils.default.isNumber(item) || import_xe_utils.default.isString(item)) {
|
|
466
|
+
const hour = import_xe_utils.default.toNumber(item);
|
|
467
|
+
list.push({
|
|
468
|
+
value: hour,
|
|
469
|
+
label: ("" + hour).padStart(2, "0"),
|
|
470
|
+
disabled: !!(hourDisabledMethod && hourDisabledMethod({ hour }))
|
|
471
|
+
});
|
|
472
|
+
} else if (item) {
|
|
473
|
+
const hour = import_xe_utils.default.toNumber(item.value);
|
|
474
|
+
list.push({
|
|
475
|
+
value: hour,
|
|
476
|
+
label: ("" + (item.label || hour)).padStart(2, "0"),
|
|
477
|
+
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(hourDisabledMethod && hourDisabledMethod({ hour }))
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
} else {
|
|
482
|
+
for (let index = 0; index < 24; index++) {
|
|
483
|
+
const hour = index;
|
|
465
484
|
list.push({
|
|
466
485
|
value: hour,
|
|
467
486
|
label: ("" + hour).padStart(2, "0"),
|
|
468
487
|
disabled: !!(hourDisabledMethod && hourDisabledMethod({ hour }))
|
|
469
488
|
});
|
|
470
|
-
} else if (item) {
|
|
471
|
-
const hour = import_xe_utils.default.toNumber(item.value);
|
|
472
|
-
list.push({
|
|
473
|
-
value: hour,
|
|
474
|
-
label: ("" + (item.label || hour)).padStart(2, "0"),
|
|
475
|
-
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(hourDisabledMethod && hourDisabledMethod({ hour }))
|
|
476
|
-
});
|
|
477
489
|
}
|
|
478
|
-
});
|
|
479
|
-
} else {
|
|
480
|
-
for (let index = 0; index < 24; index++) {
|
|
481
|
-
const hour = index;
|
|
482
|
-
list.push({
|
|
483
|
-
value: hour,
|
|
484
|
-
label: ("" + hour).padStart(2, "0"),
|
|
485
|
-
disabled: !!(hourDisabledMethod && hourDisabledMethod({ hour }))
|
|
486
|
-
});
|
|
487
490
|
}
|
|
488
491
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
492
|
+
return list;
|
|
493
|
+
});
|
|
494
|
+
const computeMinuteList = (0, import_vue.computed)(() => {
|
|
495
|
+
const timeOpts = computeTimeOpts.value;
|
|
496
|
+
const { minutes: minuteOptions, minuteDisabledMethod } = timeOpts;
|
|
497
|
+
const list = [];
|
|
498
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
499
|
+
if (isTimeOrDateTimeType) {
|
|
500
|
+
if (minuteOptions && minuteOptions.length) {
|
|
501
|
+
minuteOptions.forEach((item) => {
|
|
502
|
+
if (import_xe_utils.default.isNumber(item) || import_xe_utils.default.isString(item)) {
|
|
503
|
+
const minute = import_xe_utils.default.toNumber(item);
|
|
504
|
+
list.push({
|
|
505
|
+
value: minute,
|
|
506
|
+
label: ("" + minute).padStart(2, "0"),
|
|
507
|
+
disabled: !!(minuteDisabledMethod && minuteDisabledMethod({ minute }))
|
|
508
|
+
});
|
|
509
|
+
} else if (item) {
|
|
510
|
+
const minute = import_xe_utils.default.toNumber(item.value);
|
|
511
|
+
list.push({
|
|
512
|
+
value: minute,
|
|
513
|
+
label: ("" + (item.label || minute)).padStart(2, "0"),
|
|
514
|
+
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(minuteDisabledMethod && minuteDisabledMethod({ minute }))
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
} else {
|
|
519
|
+
for (let index = 0; index < 60; index++) {
|
|
520
|
+
const minute = index;
|
|
502
521
|
list.push({
|
|
503
522
|
value: minute,
|
|
504
523
|
label: ("" + minute).padStart(2, "0"),
|
|
505
524
|
disabled: !!(minuteDisabledMethod && minuteDisabledMethod({ minute }))
|
|
506
525
|
});
|
|
507
|
-
} else if (item) {
|
|
508
|
-
const minute = import_xe_utils.default.toNumber(item.value);
|
|
509
|
-
list.push({
|
|
510
|
-
value: minute,
|
|
511
|
-
label: ("" + (item.label || minute)).padStart(2, "0"),
|
|
512
|
-
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(minuteDisabledMethod && minuteDisabledMethod({ minute }))
|
|
513
|
-
});
|
|
514
526
|
}
|
|
515
|
-
});
|
|
516
|
-
} else {
|
|
517
|
-
for (let index = 0; index < 60; index++) {
|
|
518
|
-
const minute = index;
|
|
519
|
-
list.push({
|
|
520
|
-
value: minute,
|
|
521
|
-
label: ("" + minute).padStart(2, "0"),
|
|
522
|
-
disabled: !!(minuteDisabledMethod && minuteDisabledMethod({ minute }))
|
|
523
|
-
});
|
|
524
527
|
}
|
|
525
528
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
529
|
+
return list;
|
|
530
|
+
});
|
|
531
|
+
const computeHasTimeMinute = (0, import_vue.computed)(() => {
|
|
532
|
+
const { timeFormat } = props;
|
|
533
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
534
|
+
return !/HH/.test(timeFormat || dateValueFormat) || /mm/.test(timeFormat || dateValueFormat);
|
|
535
|
+
});
|
|
536
|
+
const computeHasTimeSecond = (0, import_vue.computed)(() => {
|
|
537
|
+
const { timeFormat } = props;
|
|
538
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
539
|
+
return !/HH/.test(timeFormat || dateValueFormat) || /ss/.test(timeFormat || dateValueFormat);
|
|
540
|
+
});
|
|
541
|
+
const computeSecondList = (0, import_vue.computed)(() => {
|
|
542
|
+
const timeOpts = computeTimeOpts.value;
|
|
543
|
+
const { seconds: secondOptions, secondDisabledMethod } = timeOpts;
|
|
544
|
+
const list = [];
|
|
545
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
546
|
+
if (isTimeOrDateTimeType) {
|
|
547
|
+
if (secondOptions && secondOptions.length) {
|
|
548
|
+
secondOptions.forEach((item) => {
|
|
549
|
+
if (import_xe_utils.default.isNumber(item) || import_xe_utils.default.isString(item)) {
|
|
550
|
+
const second = import_xe_utils.default.toNumber(item);
|
|
551
|
+
list.push({
|
|
552
|
+
value: second,
|
|
553
|
+
label: ("" + second).padStart(2, "0"),
|
|
554
|
+
disabled: !!(secondDisabledMethod && secondDisabledMethod({ second }))
|
|
555
|
+
});
|
|
556
|
+
} else if (item) {
|
|
557
|
+
const second = import_xe_utils.default.toNumber(item.value);
|
|
558
|
+
list.push({
|
|
559
|
+
value: second,
|
|
560
|
+
label: ("" + (item.label || second)).padStart(2, "0"),
|
|
561
|
+
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(secondDisabledMethod && secondDisabledMethod({ second }))
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
} else {
|
|
566
|
+
for (let index = 0; index < 60; index++) {
|
|
567
|
+
const second = index;
|
|
549
568
|
list.push({
|
|
550
569
|
value: second,
|
|
551
570
|
label: ("" + second).padStart(2, "0"),
|
|
552
571
|
disabled: !!(secondDisabledMethod && secondDisabledMethod({ second }))
|
|
553
572
|
});
|
|
554
|
-
} else if (item) {
|
|
555
|
-
const second = import_xe_utils.default.toNumber(item.value);
|
|
556
|
-
list.push({
|
|
557
|
-
value: second,
|
|
558
|
-
label: ("" + (item.label || second)).padStart(2, "0"),
|
|
559
|
-
disabled: import_xe_utils.default.isBoolean(item.disabled) ? item.disabled : !!(secondDisabledMethod && secondDisabledMethod({ second }))
|
|
560
|
-
});
|
|
561
573
|
}
|
|
562
|
-
});
|
|
563
|
-
} else {
|
|
564
|
-
for (let index = 0; index < 60; index++) {
|
|
565
|
-
const second = index;
|
|
566
|
-
list.push({
|
|
567
|
-
value: second,
|
|
568
|
-
label: ("" + second).padStart(2, "0"),
|
|
569
|
-
disabled: !!(secondDisabledMethod && secondDisabledMethod({ second }))
|
|
570
|
-
});
|
|
571
574
|
}
|
|
572
575
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
handleChange(inpDateVal, { type: "check" });
|
|
631
|
-
}
|
|
632
|
-
reactData.inputLabel = inpDateVal;
|
|
633
|
-
} else {
|
|
634
|
-
if (dateEndDate && inpDateVal > dateEndDate) {
|
|
635
|
-
inpDateVal = dateEndDate;
|
|
636
|
-
}
|
|
637
|
-
if (dateStartDate && inpDateVal < dateStartDate) {
|
|
638
|
-
inpDateVal = dateStartDate;
|
|
639
|
-
}
|
|
640
|
-
let isChange = false;
|
|
641
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
642
|
-
if (type === "datetime") {
|
|
643
|
-
const dateValue = computeDateValue.value;
|
|
644
|
-
if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
|
|
645
|
-
isChange = true;
|
|
646
|
-
if (datetimePanelValue) {
|
|
647
|
-
datetimePanelValue.setHours(inpDateVal.getHours());
|
|
648
|
-
datetimePanelValue.setMinutes(inpDateVal.getMinutes());
|
|
649
|
-
datetimePanelValue.setSeconds(inpDateVal.getSeconds());
|
|
650
|
-
}
|
|
576
|
+
return list;
|
|
577
|
+
});
|
|
578
|
+
const refMaps = {
|
|
579
|
+
refElem
|
|
580
|
+
};
|
|
581
|
+
const computeMaps = {
|
|
582
|
+
computeSize,
|
|
583
|
+
computeYearList
|
|
584
|
+
};
|
|
585
|
+
const $xeDatePanel = {
|
|
586
|
+
xID,
|
|
587
|
+
props,
|
|
588
|
+
context,
|
|
589
|
+
reactData,
|
|
590
|
+
internalData,
|
|
591
|
+
getRefMaps: () => refMaps,
|
|
592
|
+
getComputeMaps: () => computeMaps
|
|
593
|
+
};
|
|
594
|
+
const updateModelValue = (modelValue) => {
|
|
595
|
+
const { type } = props;
|
|
596
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
597
|
+
const inpDate = (0, import_util.parseDateValue)(modelValue, type, { valueFormat: dateValueFormat });
|
|
598
|
+
reactData.inputValue = inpDate;
|
|
599
|
+
reactData.inputLabel = inpDate;
|
|
600
|
+
dateOpenPanel();
|
|
601
|
+
};
|
|
602
|
+
const parseDate = (value, format) => {
|
|
603
|
+
const { type, multiple } = props;
|
|
604
|
+
if (type === "time") {
|
|
605
|
+
return (0, import_util.toStringTimeDate)(import_xe_utils.default.isArray(value) ? import_xe_utils.default.last(value) : value);
|
|
606
|
+
}
|
|
607
|
+
if (import_xe_utils.default.isArray(value)) {
|
|
608
|
+
return import_xe_utils.default.toStringDate(import_xe_utils.default.last(value), format);
|
|
609
|
+
}
|
|
610
|
+
if (import_xe_utils.default.isString(value)) {
|
|
611
|
+
return import_xe_utils.default.toStringDate(multiple ? import_xe_utils.default.last(value.split(",")) : value, format);
|
|
612
|
+
}
|
|
613
|
+
return import_xe_utils.default.toStringDate(value, format);
|
|
614
|
+
};
|
|
615
|
+
const dateRevert = () => {
|
|
616
|
+
const label = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
617
|
+
reactData.inputLabel = label;
|
|
618
|
+
dispatchEvent("revert", { label }, null);
|
|
619
|
+
};
|
|
620
|
+
const afterCheckValue = (inpVal) => {
|
|
621
|
+
const { type } = props;
|
|
622
|
+
const { inputLabel, datetimePanelValue } = reactData;
|
|
623
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
624
|
+
const dateStartDate = computeDateStartDate.value;
|
|
625
|
+
const dateEndDate = computeDateEndDate.value;
|
|
626
|
+
if (inpVal) {
|
|
627
|
+
let inpDateVal = parseDate(inpVal, dateLabelFormat);
|
|
628
|
+
if (import_xe_utils.default.isValidDate(inpDateVal)) {
|
|
629
|
+
if (type === "time") {
|
|
630
|
+
inpDateVal = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat);
|
|
631
|
+
if (inputLabel !== inpDateVal) {
|
|
632
|
+
handleChange(inpDateVal, { type: "check" });
|
|
651
633
|
}
|
|
634
|
+
reactData.inputLabel = inpDateVal;
|
|
652
635
|
} else {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
636
|
+
if (dateEndDate && inpDateVal > dateEndDate) {
|
|
637
|
+
inpDateVal = dateEndDate;
|
|
638
|
+
}
|
|
639
|
+
if (dateStartDate && inpDateVal < dateStartDate) {
|
|
640
|
+
inpDateVal = dateStartDate;
|
|
641
|
+
}
|
|
642
|
+
let isChange = false;
|
|
643
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
644
|
+
if (type === "datetime") {
|
|
645
|
+
const dateValue = computeDateValue.value;
|
|
646
|
+
if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
|
|
647
|
+
isChange = true;
|
|
648
|
+
if (datetimePanelValue) {
|
|
649
|
+
datetimePanelValue.setHours(inpDateVal.getHours());
|
|
650
|
+
datetimePanelValue.setMinutes(inpDateVal.getMinutes());
|
|
651
|
+
datetimePanelValue.setSeconds(inpDateVal.getSeconds());
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
} else {
|
|
655
|
+
isChange = true;
|
|
656
|
+
}
|
|
657
|
+
reactData.inputLabel = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
|
|
658
|
+
if (isChange) {
|
|
659
|
+
dateChange(inpDateVal);
|
|
660
|
+
}
|
|
658
661
|
}
|
|
662
|
+
} else {
|
|
663
|
+
dateRevert();
|
|
659
664
|
}
|
|
660
665
|
} else {
|
|
661
|
-
|
|
666
|
+
handleChange("", { type: "check" });
|
|
662
667
|
}
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if (
|
|
680
|
-
|
|
668
|
+
};
|
|
669
|
+
const emitModel = (value) => {
|
|
670
|
+
reactData.inputValue = value;
|
|
671
|
+
emit("update:modelValue", value);
|
|
672
|
+
};
|
|
673
|
+
const handleChange = (value, evnt, params) => {
|
|
674
|
+
const { type, modelValue, valueFormat } = props;
|
|
675
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
676
|
+
reactData.inputLabel = value;
|
|
677
|
+
if ((0, import_util.hasTimestampValueType)(valueFormat)) {
|
|
678
|
+
const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
|
|
679
|
+
const timeNum = dateVal ? dateVal.getTime() : null;
|
|
680
|
+
emitModel(timeNum);
|
|
681
|
+
if (modelValue !== timeNum) {
|
|
682
|
+
dispatchEvent("change", { value: timeNum, currValue: params ? params.currValue : "" }, evnt);
|
|
683
|
+
}
|
|
684
|
+
} else if ((0, import_util.hasDateValueType)(valueFormat)) {
|
|
685
|
+
const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
|
|
686
|
+
emitModel(dateVal);
|
|
687
|
+
if (modelValue && dateVal ? import_xe_utils.default.toStringDate(modelValue).getTime() !== dateVal.getTime() : modelValue !== dateVal) {
|
|
688
|
+
dispatchEvent("change", { value: dateVal, currValue: params ? params.currValue : "" }, evnt);
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
emitModel(value);
|
|
692
|
+
if (import_xe_utils.default.toValueString(modelValue) !== value) {
|
|
693
|
+
dispatchEvent("change", { value, currValue: params ? params.currValue : "" }, evnt);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
const hidePanel = () => {
|
|
698
|
+
return new Promise((resolve) => {
|
|
699
|
+
reactData.visiblePanel = false;
|
|
700
|
+
internalData.hpTimeout = setTimeout(() => {
|
|
701
|
+
reactData.isAniVisible = false;
|
|
702
|
+
resolve();
|
|
703
|
+
}, 350);
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
const dateParseValue = (val) => {
|
|
707
|
+
const { type } = props;
|
|
708
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
709
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
710
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
711
|
+
const dateObj = (0, import_util.parseDateObj)(val, type, {
|
|
712
|
+
valueFormat: dateValueFormat,
|
|
713
|
+
labelFormat: dateLabelFormat,
|
|
714
|
+
firstDay: firstDayOfWeek
|
|
715
|
+
});
|
|
716
|
+
reactData.datePanelValue = dateObj.value;
|
|
717
|
+
reactData.datePanelLabel = dateObj.label;
|
|
718
|
+
};
|
|
719
|
+
const changeValue = () => {
|
|
720
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
721
|
+
const { inputLabel } = reactData;
|
|
722
|
+
if (isDatePanelType) {
|
|
723
|
+
dateParseValue(inputLabel);
|
|
724
|
+
reactData.inputLabel = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
681
725
|
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
726
|
+
};
|
|
727
|
+
const initValue = () => {
|
|
728
|
+
const { modelValue } = props;
|
|
729
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
730
|
+
updateModelValue(modelValue);
|
|
731
|
+
if (isDatePanelType) {
|
|
732
|
+
changeValue();
|
|
687
733
|
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
734
|
+
};
|
|
735
|
+
const dateCheckMonth = (date) => {
|
|
736
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
737
|
+
const weekNum = import_xe_utils.default.getYearWeek(date, firstDayOfWeek);
|
|
738
|
+
const weekStartDate = import_xe_utils.default.getWhatWeek(date, 0, firstDayOfWeek, firstDayOfWeek);
|
|
739
|
+
const month = import_xe_utils.default.getWhatMonth(weekNum === 1 ? import_xe_utils.default.getWhatDay(weekStartDate, 6) : date, 0, "first");
|
|
740
|
+
if (!import_xe_utils.default.isEqual(month, reactData.selectMonth)) {
|
|
741
|
+
reactData.selectMonth = month;
|
|
692
742
|
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
valueFormat: dateValueFormat,
|
|
711
|
-
labelFormat: dateLabelFormat,
|
|
712
|
-
firstDay: firstDayOfWeek
|
|
713
|
-
});
|
|
714
|
-
reactData.datePanelValue = dateObj.value;
|
|
715
|
-
reactData.datePanelLabel = dateObj.label;
|
|
716
|
-
};
|
|
717
|
-
const changeValue = () => {
|
|
718
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
719
|
-
const { inputLabel } = reactData;
|
|
720
|
-
if (isDatePanelType) {
|
|
721
|
-
dateParseValue(inputLabel);
|
|
722
|
-
reactData.inputLabel = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
const initValue = () => {
|
|
726
|
-
const { modelValue } = props;
|
|
727
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
728
|
-
updateModelValue(modelValue);
|
|
729
|
-
if (isDatePanelType) {
|
|
730
|
-
changeValue();
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
const dateCheckMonth = (date) => {
|
|
734
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
735
|
-
const weekNum = import_xe_utils.default.getYearWeek(date, firstDayOfWeek);
|
|
736
|
-
const weekStartDate = import_xe_utils.default.getWhatWeek(date, 0, firstDayOfWeek, firstDayOfWeek);
|
|
737
|
-
const month = import_xe_utils.default.getWhatMonth(weekNum === 1 ? import_xe_utils.default.getWhatDay(weekStartDate, 6) : date, 0, "first");
|
|
738
|
-
if (!import_xe_utils.default.isEqual(month, reactData.selectMonth)) {
|
|
739
|
-
reactData.selectMonth = month;
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
const dateChange = (date, isReload) => {
|
|
743
|
-
const { modelValue, multiple, valueSort } = props;
|
|
744
|
-
const { datetimePanelValue } = reactData;
|
|
745
|
-
const isTimeType = computeIsTimeType.value;
|
|
746
|
-
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
747
|
-
const dateValueFormat = computeDateValueFormat.value;
|
|
748
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
749
|
-
if (props.type === "week") {
|
|
750
|
-
const sWeek = import_xe_utils.default.toNumber(props.selectDay);
|
|
751
|
-
date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
|
|
752
|
-
} else if (isTimeOrDateTimeType) {
|
|
753
|
-
if (datetimePanelValue) {
|
|
754
|
-
date.setHours(datetimePanelValue.getHours());
|
|
755
|
-
date.setMinutes(datetimePanelValue.getMinutes());
|
|
756
|
-
date.setSeconds(datetimePanelValue.getSeconds());
|
|
743
|
+
};
|
|
744
|
+
const dateChange = (date, isReload) => {
|
|
745
|
+
const { modelValue, multiple, valueSort } = props;
|
|
746
|
+
const { datetimePanelValue } = reactData;
|
|
747
|
+
const isTimeType = computeIsTimeType.value;
|
|
748
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
749
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
750
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
751
|
+
if (props.type === "week") {
|
|
752
|
+
const sWeek = import_xe_utils.default.toNumber(props.selectDay);
|
|
753
|
+
date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
|
|
754
|
+
} else if (isTimeOrDateTimeType) {
|
|
755
|
+
if (datetimePanelValue) {
|
|
756
|
+
date.setHours(datetimePanelValue.getHours());
|
|
757
|
+
date.setMinutes(datetimePanelValue.getMinutes());
|
|
758
|
+
date.setSeconds(datetimePanelValue.getSeconds());
|
|
759
|
+
}
|
|
757
760
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
761
|
+
const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
|
|
762
|
+
dateCheckMonth(date);
|
|
763
|
+
if (!isTimeType && multiple) {
|
|
764
|
+
const overCount = computeOverCount.value;
|
|
765
|
+
if (isTimeOrDateTimeType) {
|
|
766
|
+
const dateListValue = isReload ? [] : [...computeDateListValue.value];
|
|
767
|
+
let datetimeRest = [];
|
|
768
|
+
const eqIndex = import_xe_utils.default.findIndexOf(dateListValue, (val) => import_xe_utils.default.isDateSame(date, val, "yyyyMMdd"));
|
|
769
|
+
if (eqIndex === -1) {
|
|
770
|
+
if (overCount) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
dateListValue.push(date);
|
|
774
|
+
} else {
|
|
775
|
+
dateListValue.splice(eqIndex, 1);
|
|
770
776
|
}
|
|
771
|
-
dateListValue.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
item.setMinutes(datetimePanelValue.getMinutes());
|
|
780
|
-
item.setSeconds(datetimePanelValue.getSeconds());
|
|
777
|
+
dateListValue.forEach((item) => {
|
|
778
|
+
if (item) {
|
|
779
|
+
if (datetimePanelValue) {
|
|
780
|
+
item.setHours(datetimePanelValue.getHours());
|
|
781
|
+
item.setMinutes(datetimePanelValue.getMinutes());
|
|
782
|
+
item.setSeconds(datetimePanelValue.getSeconds());
|
|
783
|
+
}
|
|
784
|
+
datetimeRest.push(item);
|
|
781
785
|
}
|
|
782
|
-
|
|
786
|
+
});
|
|
787
|
+
if (valueSort) {
|
|
788
|
+
datetimeRest = datetimeRest.sort((a, b) => a.getTime() - b.getTime());
|
|
783
789
|
}
|
|
784
|
-
|
|
785
|
-
if (valueSort) {
|
|
786
|
-
datetimeRest = datetimeRest.sort((a, b) => a.getTime() - b.getTime());
|
|
787
|
-
}
|
|
788
|
-
handleChange(datetimeRest.map((date2) => import_xe_utils.default.toDateString(date2, dateValueFormat)).join(","), { type: "update" }, { currValue: inpVal });
|
|
789
|
-
} else {
|
|
790
|
-
const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
|
|
791
|
-
let dateRest = [];
|
|
792
|
-
if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
|
|
793
|
-
dateRest = dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal));
|
|
790
|
+
handleChange(datetimeRest.map((date2) => import_xe_utils.default.toDateString(date2, dateValueFormat)).join(","), { type: "update" }, { currValue: inpVal });
|
|
794
791
|
} else {
|
|
795
|
-
|
|
796
|
-
|
|
792
|
+
const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
|
|
793
|
+
let dateRest = [];
|
|
794
|
+
if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
|
|
795
|
+
dateRest = dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal));
|
|
796
|
+
} else {
|
|
797
|
+
if (overCount) {
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
dateRest = dateMultipleValue.concat([inpVal]);
|
|
801
|
+
}
|
|
802
|
+
if (valueSort) {
|
|
803
|
+
dateRest = dateRest.sort();
|
|
797
804
|
}
|
|
798
|
-
dateRest
|
|
805
|
+
handleChange(dateRest.join(","), { type: "update" }, { currValue: inpVal });
|
|
799
806
|
}
|
|
800
|
-
|
|
801
|
-
|
|
807
|
+
} else {
|
|
808
|
+
if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
|
|
809
|
+
handleChange(inpVal, { type: "update" }, { currValue: inpVal });
|
|
802
810
|
}
|
|
803
|
-
handleChange(dateRest.join(","), { type: "update" }, { currValue: inpVal });
|
|
804
811
|
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
|
|
812
|
+
};
|
|
813
|
+
const dateMonthHandle = (date, offsetMonth) => {
|
|
814
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
815
|
+
const weekNum = import_xe_utils.default.getYearWeek(date, firstDayOfWeek);
|
|
816
|
+
const weekStartDate = import_xe_utils.default.getWhatWeek(date, 0, firstDayOfWeek, firstDayOfWeek);
|
|
817
|
+
const month = import_xe_utils.default.getWhatMonth(weekNum === 1 ? import_xe_utils.default.getWhatDay(weekStartDate, 6) : date, offsetMonth, "first");
|
|
818
|
+
reactData.selectMonth = month;
|
|
819
|
+
};
|
|
820
|
+
const dateNowHandle = () => {
|
|
821
|
+
const { type } = props;
|
|
822
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
823
|
+
let currentDate = /* @__PURE__ */ new Date();
|
|
824
|
+
switch (type) {
|
|
825
|
+
case "week":
|
|
826
|
+
currentDate = import_xe_utils.default.getWhatWeek(currentDate, 0, firstDayOfWeek);
|
|
827
|
+
break;
|
|
828
|
+
case "datetime":
|
|
829
|
+
currentDate = /* @__PURE__ */ new Date();
|
|
830
|
+
reactData.datetimePanelValue = /* @__PURE__ */ new Date();
|
|
831
|
+
break;
|
|
832
|
+
default:
|
|
833
|
+
currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
|
|
834
|
+
break;
|
|
808
835
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
const { type } = props;
|
|
820
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
821
|
-
let currentDate = /* @__PURE__ */ new Date();
|
|
822
|
-
switch (type) {
|
|
823
|
-
case "week":
|
|
824
|
-
currentDate = import_xe_utils.default.getWhatWeek(currentDate, 0, firstDayOfWeek);
|
|
825
|
-
break;
|
|
826
|
-
case "datetime":
|
|
827
|
-
currentDate = /* @__PURE__ */ new Date();
|
|
828
|
-
reactData.datetimePanelValue = /* @__PURE__ */ new Date();
|
|
829
|
-
break;
|
|
830
|
-
default:
|
|
831
|
-
currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
|
|
832
|
-
break;
|
|
833
|
-
}
|
|
834
|
-
reactData.currentDate = currentDate;
|
|
835
|
-
dateMonthHandle(currentDate, 0);
|
|
836
|
-
};
|
|
837
|
-
const dateToggleYearTypeEvent = () => {
|
|
838
|
-
reactData.datePanelType = "year";
|
|
839
|
-
};
|
|
840
|
-
const dateToggleMonthTypeEvent = () => {
|
|
841
|
-
let { datePanelType } = reactData;
|
|
842
|
-
if (datePanelType === "month" || datePanelType === "quarter") {
|
|
843
|
-
datePanelType = "year";
|
|
844
|
-
} else {
|
|
845
|
-
datePanelType = "month";
|
|
846
|
-
}
|
|
847
|
-
reactData.datePanelType = datePanelType;
|
|
848
|
-
};
|
|
849
|
-
const datePrevEvent = (evnt) => {
|
|
850
|
-
const { type } = props;
|
|
851
|
-
const { datePanelType, selectMonth, inputLabel } = reactData;
|
|
852
|
-
const { yearSize } = internalData;
|
|
853
|
-
const value = inputLabel;
|
|
854
|
-
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
855
|
-
if (!isDisabledPrevDateBtn) {
|
|
856
|
-
let viewDate;
|
|
857
|
-
if (type === "year") {
|
|
858
|
-
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
|
|
859
|
-
} else if (type === "month" || type === "quarter") {
|
|
860
|
-
if (datePanelType === "year") {
|
|
861
|
-
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
|
|
862
|
-
} else {
|
|
863
|
-
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
|
|
864
|
-
}
|
|
836
|
+
reactData.currentDate = currentDate;
|
|
837
|
+
dateMonthHandle(currentDate, 0);
|
|
838
|
+
};
|
|
839
|
+
const dateToggleYearTypeEvent = () => {
|
|
840
|
+
reactData.datePanelType = "year";
|
|
841
|
+
};
|
|
842
|
+
const dateToggleMonthTypeEvent = () => {
|
|
843
|
+
let { datePanelType } = reactData;
|
|
844
|
+
if (datePanelType === "month" || datePanelType === "quarter") {
|
|
845
|
+
datePanelType = "year";
|
|
865
846
|
} else {
|
|
866
|
-
|
|
847
|
+
datePanelType = "month";
|
|
848
|
+
}
|
|
849
|
+
reactData.datePanelType = datePanelType;
|
|
850
|
+
};
|
|
851
|
+
const datePrevEvent = (evnt) => {
|
|
852
|
+
const { type } = props;
|
|
853
|
+
const { datePanelType, selectMonth, inputLabel } = reactData;
|
|
854
|
+
const { yearSize } = internalData;
|
|
855
|
+
const value = inputLabel;
|
|
856
|
+
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
857
|
+
if (!isDisabledPrevDateBtn) {
|
|
858
|
+
let viewDate;
|
|
859
|
+
if (type === "year") {
|
|
867
860
|
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
|
|
868
|
-
} else if (
|
|
869
|
-
|
|
861
|
+
} else if (type === "month" || type === "quarter") {
|
|
862
|
+
if (datePanelType === "year") {
|
|
863
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
|
|
864
|
+
} else {
|
|
865
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
|
|
866
|
+
}
|
|
870
867
|
} else {
|
|
871
|
-
|
|
868
|
+
if (datePanelType === "year") {
|
|
869
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
|
|
870
|
+
} else if (datePanelType === "month") {
|
|
871
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
|
|
872
|
+
} else {
|
|
873
|
+
viewDate = import_xe_utils.default.getWhatMonth(selectMonth, -1, "first");
|
|
874
|
+
}
|
|
872
875
|
}
|
|
876
|
+
reactData.selectMonth = viewDate;
|
|
877
|
+
dispatchEvent("date-prev", { viewType: datePanelType, viewDate, value, type }, evnt);
|
|
873
878
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
if (!isDisabledNextDateBtn) {
|
|
893
|
-
let viewDate;
|
|
894
|
-
if (type === "year") {
|
|
895
|
-
viewDate = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
|
|
896
|
-
} else if (type === "month" || type === "quarter") {
|
|
897
|
-
if (datePanelType === "year") {
|
|
879
|
+
};
|
|
880
|
+
const dateTodayMonthEvent = (evnt) => {
|
|
881
|
+
dateNowHandle();
|
|
882
|
+
dateChange(reactData.currentDate, true);
|
|
883
|
+
if (!props.multiple) {
|
|
884
|
+
hidePanel();
|
|
885
|
+
}
|
|
886
|
+
dispatchEvent("date-today", { viewType: reactData.datePanelType, type: props.type, viewDate: reactData.selectMonth }, evnt);
|
|
887
|
+
};
|
|
888
|
+
const dateNextEvent = (evnt) => {
|
|
889
|
+
const { type } = props;
|
|
890
|
+
const { datePanelType, selectMonth, inputLabel } = reactData;
|
|
891
|
+
const { yearSize } = internalData;
|
|
892
|
+
const value = inputLabel;
|
|
893
|
+
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
|
|
894
|
+
if (!isDisabledNextDateBtn) {
|
|
895
|
+
let viewDate;
|
|
896
|
+
if (type === "year") {
|
|
898
897
|
viewDate = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
|
|
898
|
+
} else if (type === "month" || type === "quarter") {
|
|
899
|
+
if (datePanelType === "year") {
|
|
900
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
|
|
901
|
+
} else {
|
|
902
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
|
|
903
|
+
}
|
|
899
904
|
} else {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
} else {
|
|
908
|
-
viewDate = import_xe_utils.default.getWhatMonth(selectMonth, 1, "first");
|
|
905
|
+
if (datePanelType === "year") {
|
|
906
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
|
|
907
|
+
} else if (datePanelType === "month") {
|
|
908
|
+
viewDate = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
|
|
909
|
+
} else {
|
|
910
|
+
viewDate = import_xe_utils.default.getWhatMonth(selectMonth, 1, "first");
|
|
911
|
+
}
|
|
909
912
|
}
|
|
913
|
+
reactData.selectMonth = viewDate;
|
|
914
|
+
dispatchEvent("date-next", { viewType: datePanelType, value, type, viewDate }, evnt);
|
|
910
915
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
const { date } = item;
|
|
919
|
-
if (dateStartTime && dateStartTime.getTime() > date.getTime()) {
|
|
920
|
-
return true;
|
|
921
|
-
}
|
|
922
|
-
if (dateEndTime && dateEndTime.getTime() < date.getTime()) {
|
|
923
|
-
return true;
|
|
924
|
-
}
|
|
925
|
-
return false;
|
|
926
|
-
};
|
|
927
|
-
const isDateDisabled = (item) => {
|
|
928
|
-
const disbMethod = props.disabledMethod || defaultFuncProps.disabledMethod;
|
|
929
|
-
const { datePanelType } = reactData;
|
|
930
|
-
const { date } = item;
|
|
931
|
-
if (disbMethod) {
|
|
932
|
-
return disbMethod({ type: datePanelType, viewType: datePanelType, date, $datePanel: $xeDatePanel });
|
|
933
|
-
}
|
|
934
|
-
return false;
|
|
935
|
-
};
|
|
936
|
-
const hasAllDisabled = (item) => {
|
|
937
|
-
return isRangeDisabled(item) || isDateDisabled(item);
|
|
938
|
-
};
|
|
939
|
-
const dateSelectItem = (date) => {
|
|
940
|
-
const { type, multiple } = props;
|
|
941
|
-
const { datePanelType } = reactData;
|
|
942
|
-
if (type === "month") {
|
|
943
|
-
if (datePanelType === "year") {
|
|
944
|
-
reactData.datePanelType = "month";
|
|
945
|
-
dateCheckMonth(date);
|
|
946
|
-
} else {
|
|
947
|
-
dateChange(date);
|
|
948
|
-
if (!multiple) {
|
|
949
|
-
hidePanel();
|
|
950
|
-
}
|
|
916
|
+
};
|
|
917
|
+
const isRangeDisabled = (item) => {
|
|
918
|
+
const dateStartTime = computeDateStartDate.value;
|
|
919
|
+
const dateEndTime = computeDateEndDate.value;
|
|
920
|
+
const { date } = item;
|
|
921
|
+
if (dateStartTime && dateStartTime.getTime() > date.getTime()) {
|
|
922
|
+
return true;
|
|
951
923
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
if (!multiple) {
|
|
955
|
-
hidePanel();
|
|
924
|
+
if (dateEndTime && dateEndTime.getTime() < date.getTime()) {
|
|
925
|
+
return true;
|
|
956
926
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}
|
|
927
|
+
return false;
|
|
928
|
+
};
|
|
929
|
+
const isDateDisabled = (item) => {
|
|
930
|
+
const disbMethod = props.disabledMethod || defaultFuncProps.disabledMethod;
|
|
931
|
+
const { datePanelType } = reactData;
|
|
932
|
+
const { date } = item;
|
|
933
|
+
if (disbMethod) {
|
|
934
|
+
return disbMethod({ type: datePanelType, viewType: datePanelType, date, $datePanel: $xeDatePanel });
|
|
935
|
+
}
|
|
936
|
+
return false;
|
|
937
|
+
};
|
|
938
|
+
const hasAllDisabled = (item) => {
|
|
939
|
+
return isRangeDisabled(item) || isDateDisabled(item);
|
|
940
|
+
};
|
|
941
|
+
const dateSelectItem = (date) => {
|
|
942
|
+
const { type, multiple } = props;
|
|
943
|
+
const { datePanelType } = reactData;
|
|
944
|
+
if (type === "month") {
|
|
945
|
+
if (datePanelType === "year") {
|
|
946
|
+
reactData.datePanelType = "month";
|
|
947
|
+
dateCheckMonth(date);
|
|
948
|
+
} else {
|
|
949
|
+
dateChange(date);
|
|
950
|
+
if (!multiple) {
|
|
951
|
+
hidePanel();
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
} else if (type === "year") {
|
|
962
955
|
dateChange(date);
|
|
963
956
|
if (!multiple) {
|
|
964
957
|
hidePanel();
|
|
965
958
|
}
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
dateCheckMonth(date);
|
|
971
|
-
} else if (datePanelType === "year") {
|
|
972
|
-
reactData.datePanelType = "month";
|
|
973
|
-
dateCheckMonth(date);
|
|
974
|
-
} else {
|
|
975
|
-
dateChange(date);
|
|
976
|
-
if (type === "datetime") {
|
|
959
|
+
} else if (type === "quarter") {
|
|
960
|
+
if (datePanelType === "year") {
|
|
961
|
+
reactData.datePanelType = "quarter";
|
|
962
|
+
dateCheckMonth(date);
|
|
977
963
|
} else {
|
|
964
|
+
dateChange(date);
|
|
978
965
|
if (!multiple) {
|
|
979
966
|
hidePanel();
|
|
980
967
|
}
|
|
981
968
|
}
|
|
969
|
+
} else {
|
|
970
|
+
if (datePanelType === "month") {
|
|
971
|
+
reactData.datePanelType = type === "week" ? type : "day";
|
|
972
|
+
dateCheckMonth(date);
|
|
973
|
+
} else if (datePanelType === "year") {
|
|
974
|
+
reactData.datePanelType = "month";
|
|
975
|
+
dateCheckMonth(date);
|
|
976
|
+
} else {
|
|
977
|
+
dateChange(date);
|
|
978
|
+
if (type === "datetime") {
|
|
979
|
+
} else {
|
|
980
|
+
if (!multiple) {
|
|
981
|
+
hidePanel();
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}
|
|
982
985
|
}
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
dateSelectItem(item.date);
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
const dateMoveDay = (offsetDay) => {
|
|
991
|
-
if (!hasAllDisabled({ date: offsetDay })) {
|
|
992
|
-
const dayList = computeDayList.value;
|
|
993
|
-
if (!dayList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetDay, "yyyyMMdd"))) {
|
|
994
|
-
dateCheckMonth(offsetDay);
|
|
986
|
+
};
|
|
987
|
+
const dateSelectEvent = (item) => {
|
|
988
|
+
if (!hasAllDisabled(item)) {
|
|
989
|
+
dateSelectItem(item.date);
|
|
995
990
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
991
|
+
};
|
|
992
|
+
const dateMoveDay = (offsetDay) => {
|
|
993
|
+
if (!hasAllDisabled({ date: offsetDay })) {
|
|
994
|
+
const dayList = computeDayList.value;
|
|
995
|
+
if (!dayList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetDay, "yyyyMMdd"))) {
|
|
996
|
+
dateCheckMonth(offsetDay);
|
|
997
|
+
}
|
|
998
|
+
dateParseValue(offsetDay);
|
|
1004
999
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1000
|
+
};
|
|
1001
|
+
const dateMoveYear = (offsetYear) => {
|
|
1002
|
+
if (!hasAllDisabled({ date: offsetYear })) {
|
|
1003
|
+
const yearList = computeYearList.value;
|
|
1004
|
+
if (!yearList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetYear, "yyyy"))) {
|
|
1005
|
+
dateCheckMonth(offsetYear);
|
|
1006
|
+
}
|
|
1007
|
+
dateParseValue(offsetYear);
|
|
1013
1008
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1009
|
+
};
|
|
1010
|
+
const dateMoveQuarter = (offsetQuarter) => {
|
|
1011
|
+
if (!hasAllDisabled({ date: offsetQuarter })) {
|
|
1012
|
+
const quarterList = computeQuarterList.value;
|
|
1013
|
+
if (!quarterList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetQuarter, "yyyyq"))) {
|
|
1014
|
+
dateCheckMonth(offsetQuarter);
|
|
1015
|
+
}
|
|
1016
|
+
dateParseValue(offsetQuarter);
|
|
1022
1017
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
} else if (datePanelType === "quarter") {
|
|
1032
|
-
dateMoveQuarter(item.date);
|
|
1033
|
-
} else if (datePanelType === "year") {
|
|
1034
|
-
dateMoveYear(item.date);
|
|
1035
|
-
} else {
|
|
1036
|
-
dateMoveDay(item.date);
|
|
1018
|
+
};
|
|
1019
|
+
const dateMoveMonth = (offsetMonth) => {
|
|
1020
|
+
if (!hasAllDisabled({ date: offsetMonth })) {
|
|
1021
|
+
const monthList = computeMonthList.value;
|
|
1022
|
+
if (!monthList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetMonth, "yyyyMM"))) {
|
|
1023
|
+
dateCheckMonth(offsetMonth);
|
|
1024
|
+
}
|
|
1025
|
+
dateParseValue(offsetMonth);
|
|
1037
1026
|
}
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
const { datetimePanelValue } = reactData;
|
|
1052
|
-
reactData.datetimePanelValue = datetimePanelValue ? new Date(datetimePanelValue.getTime()) : /* @__PURE__ */ new Date();
|
|
1053
|
-
updateTimePos(evnt.currentTarget);
|
|
1054
|
-
};
|
|
1055
|
-
const dateHourEvent = (evnt, item) => {
|
|
1056
|
-
const { datetimePanelValue } = reactData;
|
|
1057
|
-
if (!item.disabled) {
|
|
1058
|
-
if (datetimePanelValue) {
|
|
1059
|
-
datetimePanelValue.setHours(item.value);
|
|
1027
|
+
};
|
|
1028
|
+
const dateMouseenterEvent = (item) => {
|
|
1029
|
+
if (!hasAllDisabled(item)) {
|
|
1030
|
+
const { datePanelType } = reactData;
|
|
1031
|
+
if (datePanelType === "month") {
|
|
1032
|
+
dateMoveMonth(item.date);
|
|
1033
|
+
} else if (datePanelType === "quarter") {
|
|
1034
|
+
dateMoveQuarter(item.date);
|
|
1035
|
+
} else if (datePanelType === "year") {
|
|
1036
|
+
dateMoveYear(item.date);
|
|
1037
|
+
} else {
|
|
1038
|
+
dateMoveDay(item.date);
|
|
1039
|
+
}
|
|
1060
1040
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1041
|
+
};
|
|
1042
|
+
const dateMouseleaveEvent = () => {
|
|
1043
|
+
reactData.datePanelValue = null;
|
|
1044
|
+
};
|
|
1045
|
+
const updateTimePos = (liElem) => {
|
|
1046
|
+
if (liElem) {
|
|
1047
|
+
const height = liElem.offsetHeight;
|
|
1048
|
+
const ulElem = liElem.parentNode;
|
|
1049
|
+
ulElem.scrollTop = liElem.offsetTop - height * 4;
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
const dateTimeChangeEvent = (evnt) => {
|
|
1053
|
+
const { datetimePanelValue } = reactData;
|
|
1054
|
+
reactData.datetimePanelValue = datetimePanelValue ? new Date(datetimePanelValue.getTime()) : /* @__PURE__ */ new Date();
|
|
1055
|
+
updateTimePos(evnt.currentTarget);
|
|
1056
|
+
};
|
|
1057
|
+
const dateHourEvent = (evnt, item) => {
|
|
1058
|
+
const { datetimePanelValue } = reactData;
|
|
1059
|
+
if (!item.disabled) {
|
|
1060
|
+
if (datetimePanelValue) {
|
|
1061
|
+
datetimePanelValue.setHours(item.value);
|
|
1062
|
+
}
|
|
1063
|
+
dateTimeChangeEvent(evnt);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
const dateConfirmEvent = (evnt) => {
|
|
1067
|
+
const { multiple } = props;
|
|
1068
|
+
const { datetimePanelValue, currentDate } = reactData;
|
|
1069
|
+
const dateValue = computeDateValue.value;
|
|
1070
|
+
const isTimeType = computeIsTimeType.value;
|
|
1071
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1072
|
+
if (isTimeOrDateTimeType) {
|
|
1073
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
1074
|
+
if (!isTimeType && multiple) {
|
|
1075
|
+
const dateMultipleValue = computeDateMultipleValue.value;
|
|
1076
|
+
const dateListValue = computeDateListValue.value;
|
|
1077
|
+
if (isTimeOrDateTimeType) {
|
|
1078
|
+
const listVals = dateListValue.length ? [...dateListValue] : [];
|
|
1079
|
+
const datetimeRest = [];
|
|
1080
|
+
listVals.forEach((item) => {
|
|
1081
|
+
if (item) {
|
|
1082
|
+
if (datetimePanelValue) {
|
|
1083
|
+
item.setHours(datetimePanelValue.getHours());
|
|
1084
|
+
item.setMinutes(datetimePanelValue.getMinutes());
|
|
1085
|
+
item.setSeconds(datetimePanelValue.getSeconds());
|
|
1086
|
+
}
|
|
1087
|
+
datetimeRest.push(item);
|
|
1084
1088
|
}
|
|
1085
|
-
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
+
});
|
|
1090
|
+
handleChange(datetimeRest.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat)).join(","), { type: "update" });
|
|
1091
|
+
} else {
|
|
1092
|
+
handleChange(dateMultipleValue.join(","), { type: "update" });
|
|
1093
|
+
}
|
|
1089
1094
|
} else {
|
|
1090
|
-
|
|
1095
|
+
dateChange(dateValue || currentDate);
|
|
1091
1096
|
}
|
|
1092
|
-
} else {
|
|
1093
|
-
dateChange(dateValue || currentDate);
|
|
1094
1097
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1098
|
+
hidePanel();
|
|
1099
|
+
dispatchEvent("confirm", {}, evnt);
|
|
1100
|
+
};
|
|
1101
|
+
const dateMinuteEvent = (evnt, item) => {
|
|
1102
|
+
const { datetimePanelValue } = reactData;
|
|
1103
|
+
if (!item.disabled) {
|
|
1104
|
+
if (datetimePanelValue) {
|
|
1105
|
+
datetimePanelValue.setMinutes(item.value);
|
|
1106
|
+
}
|
|
1107
|
+
dateTimeChangeEvent(evnt);
|
|
1104
1108
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1109
|
+
};
|
|
1110
|
+
const dateSecondEvent = (evnt, item) => {
|
|
1111
|
+
const { datetimePanelValue } = reactData;
|
|
1112
|
+
if (!item.disabled) {
|
|
1113
|
+
if (datetimePanelValue) {
|
|
1114
|
+
datetimePanelValue.setSeconds(item.value);
|
|
1115
|
+
}
|
|
1116
|
+
dateTimeChangeEvent(evnt);
|
|
1113
1117
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
reactData.
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1118
|
+
};
|
|
1119
|
+
const dateOpenPanel = () => {
|
|
1120
|
+
const { type, defaultDate, defaultTime } = props;
|
|
1121
|
+
const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
|
|
1122
|
+
const dateValue = computeDateValue.value;
|
|
1123
|
+
if (["year", "quarter", "month", "week"].indexOf(type) > -1) {
|
|
1124
|
+
reactData.datePanelType = type;
|
|
1125
|
+
} else {
|
|
1126
|
+
reactData.datePanelType = "day";
|
|
1127
|
+
}
|
|
1128
|
+
reactData.currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
|
|
1129
|
+
if (dateValue) {
|
|
1130
|
+
dateMonthHandle(dateValue, 0);
|
|
1131
|
+
dateParseValue(dateValue);
|
|
1132
|
+
} else {
|
|
1133
|
+
if (defaultDate) {
|
|
1134
|
+
const defDate = parseDate(defaultDate, "yyyy-MM-dd");
|
|
1135
|
+
if (import_xe_utils.default.isValidDate(defDate)) {
|
|
1136
|
+
dateMonthHandle(defDate, 0);
|
|
1137
|
+
} else {
|
|
1138
|
+
dateNowHandle();
|
|
1139
|
+
}
|
|
1135
1140
|
} else {
|
|
1136
1141
|
dateNowHandle();
|
|
1137
1142
|
}
|
|
1138
|
-
} else {
|
|
1139
|
-
dateNowHandle();
|
|
1140
1143
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1144
|
+
if (isTimeOrDateTimeType) {
|
|
1145
|
+
let dtPanelValue = reactData.datePanelValue;
|
|
1146
|
+
if (!dtPanelValue) {
|
|
1147
|
+
dtPanelValue = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
|
|
1148
|
+
if (defaultTime) {
|
|
1149
|
+
const defTime = (0, import_util.toStringTimeDate)(defaultTime);
|
|
1150
|
+
if (import_xe_utils.default.isValidDate(defTime)) {
|
|
1151
|
+
dtPanelValue.setHours(defTime.getHours());
|
|
1152
|
+
dtPanelValue.setMinutes(defTime.getMinutes());
|
|
1153
|
+
dtPanelValue.setSeconds(defTime.getSeconds());
|
|
1154
|
+
}
|
|
1152
1155
|
}
|
|
1153
1156
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1157
|
+
reactData.datetimePanelValue = dtPanelValue;
|
|
1158
|
+
(0, import_vue.nextTick)(() => {
|
|
1159
|
+
const timeBodyElem = refInputTimeBody.value;
|
|
1160
|
+
import_xe_utils.default.arrayEach(timeBodyElem.querySelectorAll("li.is--selected"), (elem) => {
|
|
1161
|
+
updateTimePos(elem);
|
|
1162
|
+
});
|
|
1160
1163
|
});
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
};
|
|
1164
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
1165
|
-
emit(type, createEvent(evnt, { $datePanel: $xeDatePanel }, params));
|
|
1166
|
-
};
|
|
1167
|
-
const datePanelMethods = {
|
|
1168
|
-
dispatchEvent,
|
|
1169
|
-
getModelValue() {
|
|
1170
|
-
return reactData.inputValue;
|
|
1171
|
-
},
|
|
1172
|
-
getViewType() {
|
|
1173
|
-
const { datePanelType } = reactData;
|
|
1174
|
-
return datePanelType;
|
|
1175
|
-
},
|
|
1176
|
-
setPanelDate(date) {
|
|
1177
|
-
if (date) {
|
|
1178
|
-
dateCheckMonth(date);
|
|
1179
1164
|
}
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
`${label}`
|
|
1219
|
-
),
|
|
1220
|
-
(0, import_vue.h)(
|
|
1221
|
-
"div",
|
|
1222
|
-
{
|
|
1223
|
-
class: ["vxe-date-panel--label--extra", extraItem.important ? "is-important" : "", extraItem.className],
|
|
1224
|
-
style: extraItem.style
|
|
1225
|
-
},
|
|
1226
|
-
import_xe_utils.default.toValueString(extraItem.label)
|
|
1227
|
-
)
|
|
1228
|
-
] : `${label}`
|
|
1229
|
-
)
|
|
1230
|
-
);
|
|
1231
|
-
const festivalLabel = festivalItem.label;
|
|
1232
|
-
if (festivalLabel) {
|
|
1233
|
-
const festivalLabels = import_xe_utils.default.toValueString(festivalLabel).split(",");
|
|
1165
|
+
};
|
|
1166
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
1167
|
+
emit(type, createEvent(evnt, { $datePanel: $xeDatePanel }, params));
|
|
1168
|
+
};
|
|
1169
|
+
const datePanelMethods = {
|
|
1170
|
+
dispatchEvent,
|
|
1171
|
+
getModelValue() {
|
|
1172
|
+
return reactData.inputValue;
|
|
1173
|
+
},
|
|
1174
|
+
getViewType() {
|
|
1175
|
+
const { datePanelType } = reactData;
|
|
1176
|
+
return datePanelType;
|
|
1177
|
+
},
|
|
1178
|
+
setPanelDate(date) {
|
|
1179
|
+
if (date) {
|
|
1180
|
+
dateCheckMonth(date);
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
getPanelDate() {
|
|
1184
|
+
const { selectMonth } = reactData;
|
|
1185
|
+
return selectMonth ? new Date(selectMonth.getTime()) : /* @__PURE__ */ new Date();
|
|
1186
|
+
},
|
|
1187
|
+
checkValue(value) {
|
|
1188
|
+
afterCheckValue(value);
|
|
1189
|
+
},
|
|
1190
|
+
confirmByEvent(evnt) {
|
|
1191
|
+
dateConfirmEvent(evnt);
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
Object.assign($xeDatePanel, datePanelMethods);
|
|
1195
|
+
const renderDateLabel = (item, label) => {
|
|
1196
|
+
const flMethod = props.festivalMethod || defaultFuncProps.festivalMethod;
|
|
1197
|
+
const labelVNs = [];
|
|
1198
|
+
if (flMethod) {
|
|
1199
|
+
const { datePanelType } = reactData;
|
|
1200
|
+
const festivalRest = flMethod({ type: datePanelType, viewType: datePanelType, date: item.date, $datePanel: $xeDatePanel });
|
|
1201
|
+
const festivalItem = festivalRest ? import_xe_utils.default.isString(festivalRest) ? { label: festivalRest } : festivalRest : {};
|
|
1202
|
+
const extraItem = festivalItem.extra ? import_xe_utils.default.isString(festivalItem.extra) ? { label: festivalItem.extra } : festivalItem.extra : null;
|
|
1234
1203
|
labelVNs.push(
|
|
1235
1204
|
(0, import_vue.h)(
|
|
1236
1205
|
"div",
|
|
1237
1206
|
{
|
|
1238
|
-
class: [
|
|
1239
|
-
|
|
1207
|
+
class: [
|
|
1208
|
+
"vxe-date-panel--label",
|
|
1209
|
+
{
|
|
1210
|
+
"is-notice": festivalItem.notice
|
|
1211
|
+
}
|
|
1212
|
+
]
|
|
1240
1213
|
},
|
|
1241
|
-
[
|
|
1242
|
-
|
|
1214
|
+
extraItem && extraItem.label ? [
|
|
1215
|
+
(0, import_vue.h)(
|
|
1243
1216
|
"div",
|
|
1244
1217
|
{
|
|
1245
|
-
class:
|
|
1218
|
+
class: "vxe-date-panel--label--number"
|
|
1246
1219
|
},
|
|
1247
|
-
|
|
1248
|
-
)
|
|
1220
|
+
`${label}`
|
|
1221
|
+
),
|
|
1222
|
+
(0, import_vue.h)(
|
|
1249
1223
|
"div",
|
|
1250
1224
|
{
|
|
1251
|
-
class: "vxe-date-panel--
|
|
1225
|
+
class: ["vxe-date-panel--label--extra", extraItem.important ? "is-important" : "", extraItem.className],
|
|
1226
|
+
style: extraItem.style
|
|
1252
1227
|
},
|
|
1253
|
-
|
|
1228
|
+
import_xe_utils.default.toValueString(extraItem.label)
|
|
1254
1229
|
)
|
|
1255
|
-
]
|
|
1230
|
+
] : `${label}`
|
|
1231
|
+
)
|
|
1232
|
+
);
|
|
1233
|
+
const festivalLabel = festivalItem.label;
|
|
1234
|
+
if (festivalLabel) {
|
|
1235
|
+
const festivalLabels = import_xe_utils.default.toValueString(festivalLabel).split(",");
|
|
1236
|
+
labelVNs.push(
|
|
1237
|
+
(0, import_vue.h)(
|
|
1238
|
+
"div",
|
|
1239
|
+
{
|
|
1240
|
+
class: ["vxe-date-panel--festival", festivalItem.important ? "is-important" : "", festivalItem.className],
|
|
1241
|
+
style: festivalItem.style
|
|
1242
|
+
},
|
|
1243
|
+
[
|
|
1244
|
+
festivalLabels.length > 1 ? (0, import_vue.h)(
|
|
1245
|
+
"div",
|
|
1246
|
+
{
|
|
1247
|
+
class: ["vxe-date-panel--festival--overlap", `overlap--${festivalLabels.length}`]
|
|
1248
|
+
},
|
|
1249
|
+
festivalLabels.map((label2) => (0, import_vue.h)("div", label2.substring(0, 3)))
|
|
1250
|
+
) : (0, import_vue.h)(
|
|
1251
|
+
"div",
|
|
1252
|
+
{
|
|
1253
|
+
class: "vxe-date-panel--festival--label"
|
|
1254
|
+
},
|
|
1255
|
+
festivalLabels[0].substring(0, 3)
|
|
1256
|
+
)
|
|
1257
|
+
]
|
|
1258
|
+
)
|
|
1259
|
+
);
|
|
1260
|
+
}
|
|
1261
|
+
} else {
|
|
1262
|
+
labelVNs.push(
|
|
1263
|
+
(0, import_vue.h)(
|
|
1264
|
+
"div",
|
|
1265
|
+
{
|
|
1266
|
+
class: "vxe-date-panel--label"
|
|
1267
|
+
},
|
|
1268
|
+
`${label}`
|
|
1256
1269
|
)
|
|
1257
1270
|
);
|
|
1258
1271
|
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1272
|
+
return labelVNs;
|
|
1273
|
+
};
|
|
1274
|
+
const renderDateDayTable = () => {
|
|
1275
|
+
const { type, multiple, cellClassName } = props;
|
|
1276
|
+
const { datePanelType, datePanelValue } = reactData;
|
|
1277
|
+
const dateValue = computeDateValue.value;
|
|
1278
|
+
const dateHeaders = computeDateHeaders.value;
|
|
1279
|
+
const dayDatas = computeDayDatas.value;
|
|
1280
|
+
const dateListValue = computeDateListValue.value;
|
|
1281
|
+
const overCount = computeOverCount.value;
|
|
1282
|
+
const matchFormat = "yyyyMMdd";
|
|
1283
|
+
return [
|
|
1261
1284
|
(0, import_vue.h)(
|
|
1262
1285
|
"div",
|
|
1263
1286
|
{
|
|
1264
|
-
class: "vxe-date-panel--
|
|
1287
|
+
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1265
1288
|
},
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1286
|
-
},
|
|
1287
|
-
[
|
|
1288
|
-
(0, import_vue.h)(
|
|
1289
|
-
"div",
|
|
1290
|
-
{
|
|
1291
|
-
class: "vxe-date-panel--view-header"
|
|
1292
|
-
},
|
|
1293
|
-
[
|
|
1294
|
-
(0, import_vue.h)(
|
|
1295
|
-
"div",
|
|
1296
|
-
{
|
|
1297
|
-
class: "vxe-date-panel--view-row"
|
|
1298
|
-
},
|
|
1299
|
-
dateHeaders.map((item) => {
|
|
1300
|
-
return (0, import_vue.h)(
|
|
1301
|
-
"div",
|
|
1302
|
-
{
|
|
1303
|
-
class: "vxe-date-panel--view-item",
|
|
1304
|
-
style: {
|
|
1305
|
-
width: `${100 / dateHeaders.length}%`
|
|
1306
|
-
}
|
|
1307
|
-
},
|
|
1308
|
-
[
|
|
1309
|
-
(0, import_vue.h)(
|
|
1310
|
-
"div",
|
|
1311
|
-
{
|
|
1312
|
-
class: "vxe-date-panel--view-item-inner"
|
|
1313
|
-
},
|
|
1314
|
-
[
|
|
1315
|
-
(0, import_vue.h)(
|
|
1316
|
-
"div",
|
|
1317
|
-
{
|
|
1318
|
-
class: "vxe-date-panel--view-item-label"
|
|
1319
|
-
},
|
|
1320
|
-
item.label
|
|
1321
|
-
)
|
|
1322
|
-
]
|
|
1323
|
-
)
|
|
1324
|
-
]
|
|
1325
|
-
);
|
|
1326
|
-
})
|
|
1327
|
-
)
|
|
1328
|
-
]
|
|
1329
|
-
),
|
|
1330
|
-
(0, import_vue.h)(
|
|
1331
|
-
"div",
|
|
1332
|
-
{
|
|
1333
|
-
class: "vxe-date-panel--view-body"
|
|
1334
|
-
},
|
|
1335
|
-
dayDatas.map((rows) => {
|
|
1336
|
-
return (0, import_vue.h)(
|
|
1337
|
-
"div",
|
|
1338
|
-
{
|
|
1339
|
-
class: "vxe-date-panel--view-row",
|
|
1340
|
-
style: {
|
|
1341
|
-
height: `${100 / dayDatas.length}%`
|
|
1342
|
-
}
|
|
1343
|
-
},
|
|
1344
|
-
rows.map((item) => {
|
|
1345
|
-
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1346
|
-
return (0, import_vue.h)(
|
|
1347
|
-
"div",
|
|
1348
|
-
{
|
|
1349
|
-
class: [
|
|
1350
|
-
"vxe-date-panel--view-item",
|
|
1351
|
-
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1352
|
-
{
|
|
1353
|
-
"is--prev": item.isPrev,
|
|
1354
|
-
"is--current": item.isCurrent,
|
|
1355
|
-
"is--now": item.isNow,
|
|
1356
|
-
"is--next": item.isNext,
|
|
1357
|
-
"is--range-disabled": isRangeDisabled(item),
|
|
1358
|
-
"is--disabled": isDateDisabled(item),
|
|
1359
|
-
"is--selected": isSelected,
|
|
1360
|
-
"is--over": overCount && !isSelected,
|
|
1361
|
-
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1289
|
+
[
|
|
1290
|
+
(0, import_vue.h)(
|
|
1291
|
+
"div",
|
|
1292
|
+
{
|
|
1293
|
+
class: "vxe-date-panel--view-header"
|
|
1294
|
+
},
|
|
1295
|
+
[
|
|
1296
|
+
(0, import_vue.h)(
|
|
1297
|
+
"div",
|
|
1298
|
+
{
|
|
1299
|
+
class: "vxe-date-panel--view-row"
|
|
1300
|
+
},
|
|
1301
|
+
dateHeaders.map((item) => {
|
|
1302
|
+
return (0, import_vue.h)(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
class: "vxe-date-panel--view-item",
|
|
1306
|
+
style: {
|
|
1307
|
+
width: `${100 / dateHeaders.length}%`
|
|
1362
1308
|
}
|
|
1363
|
-
],
|
|
1364
|
-
style: {
|
|
1365
|
-
width: `${100 / rows.length}%`
|
|
1366
1309
|
},
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
[
|
|
1426
|
-
(0, import_vue.h)(
|
|
1427
|
-
"div",
|
|
1428
|
-
{
|
|
1429
|
-
class: "vxe-date-panel--view-item-inner"
|
|
1310
|
+
[
|
|
1311
|
+
(0, import_vue.h)(
|
|
1312
|
+
"div",
|
|
1313
|
+
{
|
|
1314
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1315
|
+
},
|
|
1316
|
+
[
|
|
1317
|
+
(0, import_vue.h)(
|
|
1318
|
+
"div",
|
|
1319
|
+
{
|
|
1320
|
+
class: "vxe-date-panel--view-item-label"
|
|
1321
|
+
},
|
|
1322
|
+
item.label
|
|
1323
|
+
)
|
|
1324
|
+
]
|
|
1325
|
+
)
|
|
1326
|
+
]
|
|
1327
|
+
);
|
|
1328
|
+
})
|
|
1329
|
+
)
|
|
1330
|
+
]
|
|
1331
|
+
),
|
|
1332
|
+
(0, import_vue.h)(
|
|
1333
|
+
"div",
|
|
1334
|
+
{
|
|
1335
|
+
class: "vxe-date-panel--view-body"
|
|
1336
|
+
},
|
|
1337
|
+
dayDatas.map((rows) => {
|
|
1338
|
+
return (0, import_vue.h)(
|
|
1339
|
+
"div",
|
|
1340
|
+
{
|
|
1341
|
+
class: "vxe-date-panel--view-row",
|
|
1342
|
+
style: {
|
|
1343
|
+
height: `${100 / dayDatas.length}%`
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
rows.map((item) => {
|
|
1347
|
+
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1348
|
+
return (0, import_vue.h)(
|
|
1349
|
+
"div",
|
|
1350
|
+
{
|
|
1351
|
+
class: [
|
|
1352
|
+
"vxe-date-panel--view-item",
|
|
1353
|
+
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1354
|
+
{
|
|
1355
|
+
"is--prev": item.isPrev,
|
|
1356
|
+
"is--current": item.isCurrent,
|
|
1357
|
+
"is--now": item.isNow,
|
|
1358
|
+
"is--next": item.isNext,
|
|
1359
|
+
"is--range-disabled": isRangeDisabled(item),
|
|
1360
|
+
"is--disabled": isDateDisabled(item),
|
|
1361
|
+
"is--selected": isSelected,
|
|
1362
|
+
"is--over": overCount && !isSelected,
|
|
1363
|
+
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1364
|
+
}
|
|
1365
|
+
],
|
|
1366
|
+
style: {
|
|
1367
|
+
width: `${100 / rows.length}%`
|
|
1430
1368
|
},
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1369
|
+
onClick: () => dateSelectEvent(item),
|
|
1370
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
1371
|
+
onMouseleave: dateMouseleaveEvent
|
|
1372
|
+
},
|
|
1373
|
+
[
|
|
1374
|
+
(0, import_vue.h)(
|
|
1375
|
+
"div",
|
|
1376
|
+
{
|
|
1377
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1378
|
+
},
|
|
1379
|
+
renderDateLabel(item, item.label)
|
|
1380
|
+
)
|
|
1381
|
+
]
|
|
1382
|
+
);
|
|
1383
|
+
})
|
|
1384
|
+
);
|
|
1385
|
+
})
|
|
1386
|
+
)
|
|
1387
|
+
]
|
|
1388
|
+
)
|
|
1389
|
+
];
|
|
1390
|
+
};
|
|
1391
|
+
const renderDateWeekTable = () => {
|
|
1392
|
+
const { type, multiple, cellClassName } = props;
|
|
1393
|
+
const { datePanelType, datePanelValue } = reactData;
|
|
1394
|
+
const dateValue = computeDateValue.value;
|
|
1395
|
+
const weekHeaders = computeWeekHeaders.value;
|
|
1396
|
+
const weekDates = computeWeekDates.value;
|
|
1397
|
+
const dateListValue = computeDateListValue.value;
|
|
1398
|
+
const overCount = computeOverCount.value;
|
|
1399
|
+
const matchFormat = "yyyyMMdd";
|
|
1400
|
+
return [
|
|
1401
|
+
(0, import_vue.h)(
|
|
1402
|
+
"div",
|
|
1403
|
+
{
|
|
1404
|
+
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1405
|
+
},
|
|
1406
|
+
[
|
|
1407
|
+
(0, import_vue.h)(
|
|
1408
|
+
"div",
|
|
1409
|
+
{
|
|
1410
|
+
class: "vxe-date-panel--view-header"
|
|
1411
|
+
},
|
|
1412
|
+
[
|
|
1413
|
+
(0, import_vue.h)(
|
|
1414
|
+
"div",
|
|
1415
|
+
{
|
|
1416
|
+
class: "vxe-date-panel--view-row"
|
|
1417
|
+
},
|
|
1418
|
+
weekHeaders.map((item, rIndex) => {
|
|
1419
|
+
return (0, import_vue.h)(
|
|
1420
|
+
"div",
|
|
1421
|
+
{
|
|
1422
|
+
class: "vxe-date-panel--view-item",
|
|
1423
|
+
style: {
|
|
1424
|
+
width: `${rIndex ? 13 : 9}%`
|
|
1481
1425
|
}
|
|
1482
|
-
],
|
|
1483
|
-
style: {
|
|
1484
|
-
width: `${rIndex ? 13 : 9}%`
|
|
1485
1426
|
},
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
"is--prev": item.isPrev,
|
|
1547
|
-
"is--current": item.isCurrent,
|
|
1548
|
-
"is--now": item.isNow,
|
|
1549
|
-
"is--next": item.isNext,
|
|
1550
|
-
"is--range-disabled": isRangeDisabled(item),
|
|
1551
|
-
"is--disabled": isDateDisabled(item),
|
|
1552
|
-
"is--selected": isSelected,
|
|
1553
|
-
"is--over": overCount && !isSelected,
|
|
1554
|
-
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1555
|
-
}
|
|
1556
|
-
],
|
|
1557
|
-
style: {
|
|
1558
|
-
width: `${100 / rows.length}%`
|
|
1559
|
-
},
|
|
1560
|
-
onClick: () => dateSelectEvent(item),
|
|
1561
|
-
onMouseenter: () => dateMouseenterEvent(item),
|
|
1562
|
-
onMouseleave: dateMouseleaveEvent
|
|
1563
|
-
},
|
|
1564
|
-
[
|
|
1565
|
-
(0, import_vue.h)(
|
|
1566
|
-
"div",
|
|
1567
|
-
{
|
|
1568
|
-
class: "vxe-date-panel--view-item-inner"
|
|
1427
|
+
[
|
|
1428
|
+
(0, import_vue.h)(
|
|
1429
|
+
"div",
|
|
1430
|
+
{
|
|
1431
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1432
|
+
},
|
|
1433
|
+
[
|
|
1434
|
+
(0, import_vue.h)(
|
|
1435
|
+
"div",
|
|
1436
|
+
{
|
|
1437
|
+
class: "vxe-date-panel--view-item-label"
|
|
1438
|
+
},
|
|
1439
|
+
item.label
|
|
1440
|
+
)
|
|
1441
|
+
]
|
|
1442
|
+
)
|
|
1443
|
+
]
|
|
1444
|
+
);
|
|
1445
|
+
})
|
|
1446
|
+
)
|
|
1447
|
+
]
|
|
1448
|
+
),
|
|
1449
|
+
(0, import_vue.h)(
|
|
1450
|
+
"div",
|
|
1451
|
+
{
|
|
1452
|
+
class: "vxe-date-panel--view-body"
|
|
1453
|
+
},
|
|
1454
|
+
weekDates.map((rows) => {
|
|
1455
|
+
const isSelected = multiple ? rows.some((item) => dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat))) : rows.some((item) => import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat));
|
|
1456
|
+
const isHover = rows.some((item) => import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat));
|
|
1457
|
+
const isNowWeek = rows.some((item) => item.isNow);
|
|
1458
|
+
return (0, import_vue.h)(
|
|
1459
|
+
"div",
|
|
1460
|
+
{
|
|
1461
|
+
class: "vxe-date-panel--view-row",
|
|
1462
|
+
style: {
|
|
1463
|
+
height: `${100 / weekDates.length}%`
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
rows.map((item, rIndex) => {
|
|
1467
|
+
return (0, import_vue.h)(
|
|
1468
|
+
"div",
|
|
1469
|
+
{
|
|
1470
|
+
class: [
|
|
1471
|
+
"vxe-date-panel--view-item",
|
|
1472
|
+
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1473
|
+
{
|
|
1474
|
+
"is--prev": item.isPrev,
|
|
1475
|
+
"is--current": item.isCurrent,
|
|
1476
|
+
"is--now": rIndex ? item.isNow : isNowWeek,
|
|
1477
|
+
"is--next": item.isNext,
|
|
1478
|
+
"is--range-disabled": isRangeDisabled(item),
|
|
1479
|
+
"is--disabled": isDateDisabled(item),
|
|
1480
|
+
"is--selected": isSelected,
|
|
1481
|
+
"is--over": overCount && !isSelected,
|
|
1482
|
+
"is--hover": !overCount && isHover
|
|
1483
|
+
}
|
|
1484
|
+
],
|
|
1485
|
+
style: {
|
|
1486
|
+
width: `${rIndex ? 13 : 9}%`
|
|
1569
1487
|
},
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
);
|
|
1574
|
-
})
|
|
1575
|
-
);
|
|
1576
|
-
})
|
|
1577
|
-
)
|
|
1578
|
-
]
|
|
1579
|
-
)
|
|
1580
|
-
];
|
|
1581
|
-
};
|
|
1582
|
-
const renderDateQuarterTable = () => {
|
|
1583
|
-
const { type, multiple, cellClassName } = props;
|
|
1584
|
-
const { datePanelType, datePanelValue } = reactData;
|
|
1585
|
-
const dateValue = computeDateValue.value;
|
|
1586
|
-
const quarterDatas = computeQuarterDatas.value;
|
|
1587
|
-
const dateListValue = computeDateListValue.value;
|
|
1588
|
-
const overCount = computeOverCount.value;
|
|
1589
|
-
const matchFormat = "yyyyq";
|
|
1590
|
-
return [
|
|
1591
|
-
(0, import_vue.h)(
|
|
1592
|
-
"div",
|
|
1593
|
-
{
|
|
1594
|
-
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1595
|
-
},
|
|
1596
|
-
[
|
|
1597
|
-
(0, import_vue.h)(
|
|
1598
|
-
"div",
|
|
1599
|
-
{
|
|
1600
|
-
class: "vxe-date-panel--view-body"
|
|
1601
|
-
},
|
|
1602
|
-
quarterDatas.map((rows) => {
|
|
1603
|
-
return (0, import_vue.h)(
|
|
1604
|
-
"div",
|
|
1605
|
-
{
|
|
1606
|
-
class: "vxe-date-panel--view-row",
|
|
1607
|
-
style: {
|
|
1608
|
-
height: `${100 / quarterDatas.length}%`
|
|
1609
|
-
}
|
|
1610
|
-
},
|
|
1611
|
-
rows.map((item) => {
|
|
1612
|
-
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1613
|
-
return (0, import_vue.h)(
|
|
1614
|
-
"div",
|
|
1615
|
-
{
|
|
1616
|
-
class: [
|
|
1617
|
-
"vxe-date-panel--view-item",
|
|
1618
|
-
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1619
|
-
{
|
|
1620
|
-
"is--prev": item.isPrev,
|
|
1621
|
-
"is--current": item.isCurrent,
|
|
1622
|
-
"is--now": item.isNow,
|
|
1623
|
-
"is--next": item.isNext,
|
|
1624
|
-
"is--range-disabled": isRangeDisabled(item),
|
|
1625
|
-
"is--disabled": isDateDisabled(item),
|
|
1626
|
-
"is--selected": isSelected,
|
|
1627
|
-
"is--over": overCount && !isSelected,
|
|
1628
|
-
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1629
|
-
}
|
|
1630
|
-
],
|
|
1631
|
-
style: {
|
|
1632
|
-
width: `${100 / rows.length}%`
|
|
1488
|
+
onClick: () => dateSelectEvent(item),
|
|
1489
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
1490
|
+
onMouseleave: dateMouseleaveEvent
|
|
1633
1491
|
},
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1492
|
+
[
|
|
1493
|
+
(0, import_vue.h)(
|
|
1494
|
+
"div",
|
|
1495
|
+
{
|
|
1496
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1497
|
+
},
|
|
1498
|
+
renderDateLabel(item, item.label)
|
|
1499
|
+
)
|
|
1500
|
+
]
|
|
1501
|
+
);
|
|
1502
|
+
})
|
|
1503
|
+
);
|
|
1504
|
+
})
|
|
1505
|
+
)
|
|
1506
|
+
]
|
|
1507
|
+
)
|
|
1508
|
+
];
|
|
1509
|
+
};
|
|
1510
|
+
const renderDateMonthTable = () => {
|
|
1511
|
+
const { type, multiple, cellClassName } = props;
|
|
1512
|
+
const { datePanelType, datePanelValue } = reactData;
|
|
1513
|
+
const dateValue = computeDateValue.value;
|
|
1514
|
+
const monthDatas = computeMonthDatas.value;
|
|
1515
|
+
const dateListValue = computeDateListValue.value;
|
|
1516
|
+
const overCount = computeOverCount.value;
|
|
1517
|
+
const matchFormat = "yyyyMM";
|
|
1518
|
+
return [
|
|
1519
|
+
(0, import_vue.h)(
|
|
1520
|
+
"div",
|
|
1521
|
+
{
|
|
1522
|
+
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1523
|
+
},
|
|
1524
|
+
[
|
|
1525
|
+
(0, import_vue.h)(
|
|
1526
|
+
"div",
|
|
1527
|
+
{
|
|
1528
|
+
class: "vxe-date-panel--view-body"
|
|
1529
|
+
},
|
|
1530
|
+
monthDatas.map((rows) => {
|
|
1531
|
+
return (0, import_vue.h)(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
class: "vxe-date-panel--view-row",
|
|
1535
|
+
style: {
|
|
1536
|
+
height: `${100 / monthDatas.length}%`
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
rows.map((item) => {
|
|
1540
|
+
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1541
|
+
return (0, import_vue.h)(
|
|
1542
|
+
"div",
|
|
1543
|
+
{
|
|
1544
|
+
class: [
|
|
1545
|
+
"vxe-date-panel--view-item",
|
|
1546
|
+
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1547
|
+
{
|
|
1548
|
+
"is--prev": item.isPrev,
|
|
1549
|
+
"is--current": item.isCurrent,
|
|
1550
|
+
"is--now": item.isNow,
|
|
1551
|
+
"is--next": item.isNext,
|
|
1552
|
+
"is--range-disabled": isRangeDisabled(item),
|
|
1553
|
+
"is--disabled": isDateDisabled(item),
|
|
1554
|
+
"is--selected": isSelected,
|
|
1555
|
+
"is--over": overCount && !isSelected,
|
|
1556
|
+
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1557
|
+
}
|
|
1558
|
+
],
|
|
1559
|
+
style: {
|
|
1560
|
+
width: `${100 / rows.length}%`
|
|
1643
1561
|
},
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
);
|
|
1648
|
-
})
|
|
1649
|
-
);
|
|
1650
|
-
})
|
|
1651
|
-
)
|
|
1652
|
-
]
|
|
1653
|
-
)
|
|
1654
|
-
];
|
|
1655
|
-
};
|
|
1656
|
-
const renderDateYearTable = () => {
|
|
1657
|
-
const { type, multiple, cellClassName } = props;
|
|
1658
|
-
const { datePanelType, datePanelValue } = reactData;
|
|
1659
|
-
const dateValue = computeDateValue.value;
|
|
1660
|
-
const yearDatas = computeYearDatas.value;
|
|
1661
|
-
const dateListValue = computeDateListValue.value;
|
|
1662
|
-
const overCount = computeOverCount.value;
|
|
1663
|
-
const matchFormat = "yyyy";
|
|
1664
|
-
return [
|
|
1665
|
-
(0, import_vue.h)(
|
|
1666
|
-
"div",
|
|
1667
|
-
{
|
|
1668
|
-
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1669
|
-
},
|
|
1670
|
-
[
|
|
1671
|
-
(0, import_vue.h)(
|
|
1672
|
-
"div",
|
|
1673
|
-
{
|
|
1674
|
-
class: "vxe-date-panel--view-body"
|
|
1675
|
-
},
|
|
1676
|
-
yearDatas.map((rows) => {
|
|
1677
|
-
return (0, import_vue.h)(
|
|
1678
|
-
"div",
|
|
1679
|
-
{
|
|
1680
|
-
class: "vxe-date-panel--view-row",
|
|
1681
|
-
style: {
|
|
1682
|
-
height: `${100 / yearDatas.length}%`
|
|
1683
|
-
}
|
|
1684
|
-
},
|
|
1685
|
-
rows.map((item) => {
|
|
1686
|
-
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1687
|
-
return (0, import_vue.h)(
|
|
1688
|
-
"div",
|
|
1689
|
-
{
|
|
1690
|
-
class: [
|
|
1691
|
-
"vxe-date-panel--view-item",
|
|
1692
|
-
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1693
|
-
{
|
|
1694
|
-
"is--prev": item.isPrev,
|
|
1695
|
-
"is--current": item.isCurrent,
|
|
1696
|
-
"is--now": item.isNow,
|
|
1697
|
-
"is--next": item.isNext,
|
|
1698
|
-
"is--range-disabled": isRangeDisabled(item),
|
|
1699
|
-
"is--disabled": isDateDisabled(item),
|
|
1700
|
-
"is--selected": isSelected,
|
|
1701
|
-
"is--over": overCount && !isSelected,
|
|
1702
|
-
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1703
|
-
}
|
|
1704
|
-
],
|
|
1705
|
-
style: {
|
|
1706
|
-
width: `${100 / rows.length}%`
|
|
1562
|
+
onClick: () => dateSelectEvent(item),
|
|
1563
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
1564
|
+
onMouseleave: dateMouseleaveEvent
|
|
1707
1565
|
},
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
renderDateLabel(item, item.year)
|
|
1719
|
-
)
|
|
1720
|
-
]
|
|
1721
|
-
);
|
|
1722
|
-
})
|
|
1723
|
-
);
|
|
1724
|
-
})
|
|
1725
|
-
)
|
|
1726
|
-
]
|
|
1727
|
-
)
|
|
1728
|
-
];
|
|
1729
|
-
};
|
|
1730
|
-
const renderDateTable = () => {
|
|
1731
|
-
const { datePanelType } = reactData;
|
|
1732
|
-
switch (datePanelType) {
|
|
1733
|
-
case "week":
|
|
1734
|
-
return renderDateWeekTable();
|
|
1735
|
-
case "month":
|
|
1736
|
-
return renderDateMonthTable();
|
|
1737
|
-
case "quarter":
|
|
1738
|
-
return renderDateQuarterTable();
|
|
1739
|
-
case "year":
|
|
1740
|
-
return renderDateYearTable();
|
|
1741
|
-
}
|
|
1742
|
-
return renderDateDayTable();
|
|
1743
|
-
};
|
|
1744
|
-
const renderDatePanel = () => {
|
|
1745
|
-
const { datePanelType } = reactData;
|
|
1746
|
-
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
1747
|
-
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
|
|
1748
|
-
const selectDatePanelObj = computeSelectDatePanelObj.value;
|
|
1749
|
-
return [
|
|
1750
|
-
(0, import_vue.h)(
|
|
1751
|
-
"div",
|
|
1752
|
-
{
|
|
1753
|
-
class: "vxe-date-panel--picker-header"
|
|
1754
|
-
},
|
|
1755
|
-
[
|
|
1756
|
-
(0, import_vue.h)(
|
|
1757
|
-
"div",
|
|
1758
|
-
{
|
|
1759
|
-
class: "vxe-date-panel--picker-type-wrapper"
|
|
1760
|
-
},
|
|
1761
|
-
[
|
|
1762
|
-
datePanelType === "year" ? (0, import_vue.h)(
|
|
1763
|
-
"span",
|
|
1764
|
-
{
|
|
1765
|
-
class: "vxe-date-panel--picker-label"
|
|
1766
|
-
},
|
|
1767
|
-
selectDatePanelObj.y
|
|
1768
|
-
) : (0, import_vue.h)(
|
|
1769
|
-
"span",
|
|
1770
|
-
{
|
|
1771
|
-
class: "vxe-date-panel--picker-btns"
|
|
1772
|
-
},
|
|
1773
|
-
[
|
|
1774
|
-
(0, import_vue.h)(
|
|
1775
|
-
"span",
|
|
1776
|
-
{
|
|
1777
|
-
class: "vxe-date-panel--picker-btn",
|
|
1778
|
-
onClick: dateToggleYearTypeEvent
|
|
1779
|
-
},
|
|
1780
|
-
selectDatePanelObj.y
|
|
1781
|
-
),
|
|
1782
|
-
selectDatePanelObj.m ? (0, import_vue.h)(
|
|
1783
|
-
"span",
|
|
1784
|
-
{
|
|
1785
|
-
class: "vxe-date-panel--picker-btn",
|
|
1786
|
-
onClick: dateToggleMonthTypeEvent
|
|
1787
|
-
},
|
|
1788
|
-
selectDatePanelObj.m
|
|
1789
|
-
) : renderEmptyElement($xeDatePanel)
|
|
1790
|
-
]
|
|
1791
|
-
)
|
|
1792
|
-
]
|
|
1793
|
-
),
|
|
1794
|
-
(0, import_vue.h)(
|
|
1795
|
-
"div",
|
|
1796
|
-
{
|
|
1797
|
-
class: "vxe-date-panel--picker-btn-wrapper"
|
|
1798
|
-
},
|
|
1799
|
-
[
|
|
1800
|
-
(0, import_vue.h)(
|
|
1801
|
-
"span",
|
|
1802
|
-
{
|
|
1803
|
-
class: [
|
|
1804
|
-
"vxe-date-panel--picker-btn vxe-date-panel--picker-prev-btn",
|
|
1805
|
-
{
|
|
1806
|
-
"is--disabled": isDisabledPrevDateBtn
|
|
1807
|
-
}
|
|
1808
|
-
],
|
|
1809
|
-
onClick: datePrevEvent
|
|
1810
|
-
},
|
|
1811
|
-
[
|
|
1812
|
-
(0, import_vue.h)("i", {
|
|
1813
|
-
class: "vxe-icon-caret-left"
|
|
1566
|
+
[
|
|
1567
|
+
(0, import_vue.h)(
|
|
1568
|
+
"div",
|
|
1569
|
+
{
|
|
1570
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1571
|
+
},
|
|
1572
|
+
renderDateLabel(item, getI18n(`vxe.input.date.months.m${item.month}`))
|
|
1573
|
+
)
|
|
1574
|
+
]
|
|
1575
|
+
);
|
|
1814
1576
|
})
|
|
1815
|
-
|
|
1816
|
-
)
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1577
|
+
);
|
|
1578
|
+
})
|
|
1579
|
+
)
|
|
1580
|
+
]
|
|
1581
|
+
)
|
|
1582
|
+
];
|
|
1583
|
+
};
|
|
1584
|
+
const renderDateQuarterTable = () => {
|
|
1585
|
+
const { type, multiple, cellClassName } = props;
|
|
1586
|
+
const { datePanelType, datePanelValue } = reactData;
|
|
1587
|
+
const dateValue = computeDateValue.value;
|
|
1588
|
+
const quarterDatas = computeQuarterDatas.value;
|
|
1589
|
+
const dateListValue = computeDateListValue.value;
|
|
1590
|
+
const overCount = computeOverCount.value;
|
|
1591
|
+
const matchFormat = "yyyyq";
|
|
1592
|
+
return [
|
|
1593
|
+
(0, import_vue.h)(
|
|
1594
|
+
"div",
|
|
1595
|
+
{
|
|
1596
|
+
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1597
|
+
},
|
|
1598
|
+
[
|
|
1599
|
+
(0, import_vue.h)(
|
|
1600
|
+
"div",
|
|
1601
|
+
{
|
|
1602
|
+
class: "vxe-date-panel--view-body"
|
|
1603
|
+
},
|
|
1604
|
+
quarterDatas.map((rows) => {
|
|
1605
|
+
return (0, import_vue.h)(
|
|
1606
|
+
"div",
|
|
1607
|
+
{
|
|
1608
|
+
class: "vxe-date-panel--view-row",
|
|
1609
|
+
style: {
|
|
1610
|
+
height: `${100 / quarterDatas.length}%`
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
rows.map((item) => {
|
|
1614
|
+
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1615
|
+
return (0, import_vue.h)(
|
|
1616
|
+
"div",
|
|
1617
|
+
{
|
|
1618
|
+
class: [
|
|
1619
|
+
"vxe-date-panel--view-item",
|
|
1620
|
+
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1621
|
+
{
|
|
1622
|
+
"is--prev": item.isPrev,
|
|
1623
|
+
"is--current": item.isCurrent,
|
|
1624
|
+
"is--now": item.isNow,
|
|
1625
|
+
"is--next": item.isNext,
|
|
1626
|
+
"is--range-disabled": isRangeDisabled(item),
|
|
1627
|
+
"is--disabled": isDateDisabled(item),
|
|
1628
|
+
"is--selected": isSelected,
|
|
1629
|
+
"is--over": overCount && !isSelected,
|
|
1630
|
+
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1631
|
+
}
|
|
1632
|
+
],
|
|
1633
|
+
style: {
|
|
1634
|
+
width: `${100 / rows.length}%`
|
|
1635
|
+
},
|
|
1636
|
+
onClick: () => dateSelectEvent(item),
|
|
1637
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
1638
|
+
onMouseleave: dateMouseleaveEvent
|
|
1639
|
+
},
|
|
1640
|
+
[
|
|
1641
|
+
(0, import_vue.h)(
|
|
1642
|
+
"div",
|
|
1643
|
+
{
|
|
1644
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1645
|
+
},
|
|
1646
|
+
renderDateLabel(item, getI18n(`vxe.input.date.quarters.q${item.quarter}`))
|
|
1647
|
+
)
|
|
1648
|
+
]
|
|
1649
|
+
);
|
|
1826
1650
|
})
|
|
1827
|
-
|
|
1828
|
-
)
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1651
|
+
);
|
|
1652
|
+
})
|
|
1653
|
+
)
|
|
1654
|
+
]
|
|
1655
|
+
)
|
|
1656
|
+
];
|
|
1657
|
+
};
|
|
1658
|
+
const renderDateYearTable = () => {
|
|
1659
|
+
const { type, multiple, cellClassName } = props;
|
|
1660
|
+
const { datePanelType, datePanelValue } = reactData;
|
|
1661
|
+
const dateValue = computeDateValue.value;
|
|
1662
|
+
const yearDatas = computeYearDatas.value;
|
|
1663
|
+
const dateListValue = computeDateListValue.value;
|
|
1664
|
+
const overCount = computeOverCount.value;
|
|
1665
|
+
const matchFormat = "yyyy";
|
|
1666
|
+
return [
|
|
1667
|
+
(0, import_vue.h)(
|
|
1668
|
+
"div",
|
|
1669
|
+
{
|
|
1670
|
+
class: ["vxe-date-panel--view-wrapper", `type--${datePanelType}`]
|
|
1671
|
+
},
|
|
1672
|
+
[
|
|
1673
|
+
(0, import_vue.h)(
|
|
1674
|
+
"div",
|
|
1675
|
+
{
|
|
1676
|
+
class: "vxe-date-panel--view-body"
|
|
1677
|
+
},
|
|
1678
|
+
yearDatas.map((rows) => {
|
|
1679
|
+
return (0, import_vue.h)(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
class: "vxe-date-panel--view-row",
|
|
1683
|
+
style: {
|
|
1684
|
+
height: `${100 / yearDatas.length}%`
|
|
1836
1685
|
}
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1686
|
+
},
|
|
1687
|
+
rows.map((item) => {
|
|
1688
|
+
const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
|
|
1689
|
+
return (0, import_vue.h)(
|
|
1690
|
+
"div",
|
|
1691
|
+
{
|
|
1692
|
+
class: [
|
|
1693
|
+
"vxe-date-panel--view-item",
|
|
1694
|
+
cellClassName ? import_xe_utils.default.isFunction(cellClassName) ? `${cellClassName({ $datePanel: $xeDatePanel, type, viewType: datePanelType, date: item.date }) || ""}` : `${cellClassName || ""}` : "",
|
|
1695
|
+
{
|
|
1696
|
+
"is--prev": item.isPrev,
|
|
1697
|
+
"is--current": item.isCurrent,
|
|
1698
|
+
"is--now": item.isNow,
|
|
1699
|
+
"is--next": item.isNext,
|
|
1700
|
+
"is--range-disabled": isRangeDisabled(item),
|
|
1701
|
+
"is--disabled": isDateDisabled(item),
|
|
1702
|
+
"is--selected": isSelected,
|
|
1703
|
+
"is--over": overCount && !isSelected,
|
|
1704
|
+
"is--hover": !overCount && import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1705
|
+
}
|
|
1706
|
+
],
|
|
1707
|
+
style: {
|
|
1708
|
+
width: `${100 / rows.length}%`
|
|
1709
|
+
},
|
|
1710
|
+
onClick: () => dateSelectEvent(item),
|
|
1711
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
1712
|
+
onMouseleave: dateMouseleaveEvent
|
|
1713
|
+
},
|
|
1714
|
+
[
|
|
1715
|
+
(0, import_vue.h)(
|
|
1716
|
+
"div",
|
|
1717
|
+
{
|
|
1718
|
+
class: "vxe-date-panel--view-item-inner"
|
|
1719
|
+
},
|
|
1720
|
+
renderDateLabel(item, item.year)
|
|
1721
|
+
)
|
|
1722
|
+
]
|
|
1723
|
+
);
|
|
1843
1724
|
})
|
|
1844
|
-
|
|
1845
|
-
)
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1725
|
+
);
|
|
1726
|
+
})
|
|
1727
|
+
)
|
|
1728
|
+
]
|
|
1729
|
+
)
|
|
1730
|
+
];
|
|
1731
|
+
};
|
|
1732
|
+
const renderDateTable = () => {
|
|
1733
|
+
const { datePanelType } = reactData;
|
|
1734
|
+
switch (datePanelType) {
|
|
1735
|
+
case "week":
|
|
1736
|
+
return renderDateWeekTable();
|
|
1737
|
+
case "month":
|
|
1738
|
+
return renderDateMonthTable();
|
|
1739
|
+
case "quarter":
|
|
1740
|
+
return renderDateQuarterTable();
|
|
1741
|
+
case "year":
|
|
1742
|
+
return renderDateYearTable();
|
|
1743
|
+
}
|
|
1744
|
+
return renderDateDayTable();
|
|
1745
|
+
};
|
|
1746
|
+
const renderDatePanel = () => {
|
|
1747
|
+
const { datePanelType } = reactData;
|
|
1748
|
+
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
1749
|
+
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
|
|
1750
|
+
const selectDatePanelObj = computeSelectDatePanelObj.value;
|
|
1751
|
+
return [
|
|
1752
|
+
(0, import_vue.h)(
|
|
1753
|
+
"div",
|
|
1754
|
+
{
|
|
1755
|
+
class: "vxe-date-panel--picker-header"
|
|
1756
|
+
},
|
|
1757
|
+
[
|
|
1758
|
+
(0, import_vue.h)(
|
|
1759
|
+
"div",
|
|
1760
|
+
{
|
|
1761
|
+
class: "vxe-date-panel--picker-type-wrapper"
|
|
1762
|
+
},
|
|
1763
|
+
[
|
|
1764
|
+
datePanelType === "year" ? (0, import_vue.h)(
|
|
1765
|
+
"span",
|
|
1766
|
+
{
|
|
1767
|
+
class: "vxe-date-panel--picker-label"
|
|
1768
|
+
},
|
|
1769
|
+
selectDatePanelObj.y
|
|
1770
|
+
) : (0, import_vue.h)(
|
|
1771
|
+
"span",
|
|
1772
|
+
{
|
|
1773
|
+
class: "vxe-date-panel--picker-btns"
|
|
1774
|
+
},
|
|
1775
|
+
[
|
|
1776
|
+
(0, import_vue.h)(
|
|
1777
|
+
"span",
|
|
1778
|
+
{
|
|
1779
|
+
class: "vxe-date-panel--picker-btn",
|
|
1780
|
+
onClick: dateToggleYearTypeEvent
|
|
1781
|
+
},
|
|
1782
|
+
selectDatePanelObj.y
|
|
1783
|
+
),
|
|
1784
|
+
selectDatePanelObj.m ? (0, import_vue.h)(
|
|
1785
|
+
"span",
|
|
1786
|
+
{
|
|
1787
|
+
class: "vxe-date-panel--picker-btn",
|
|
1788
|
+
onClick: dateToggleMonthTypeEvent
|
|
1789
|
+
},
|
|
1790
|
+
selectDatePanelObj.m
|
|
1791
|
+
) : renderEmptyElement($xeDatePanel)
|
|
1792
|
+
]
|
|
1793
|
+
)
|
|
1794
|
+
]
|
|
1795
|
+
),
|
|
1796
|
+
(0, import_vue.h)(
|
|
1797
|
+
"div",
|
|
1798
|
+
{
|
|
1799
|
+
class: "vxe-date-panel--picker-btn-wrapper"
|
|
1800
|
+
},
|
|
1801
|
+
[
|
|
1802
|
+
(0, import_vue.h)(
|
|
1803
|
+
"span",
|
|
1804
|
+
{
|
|
1805
|
+
class: [
|
|
1806
|
+
"vxe-date-panel--picker-btn vxe-date-panel--picker-prev-btn",
|
|
1807
|
+
{
|
|
1808
|
+
"is--disabled": isDisabledPrevDateBtn
|
|
1809
|
+
}
|
|
1810
|
+
],
|
|
1811
|
+
onClick: datePrevEvent
|
|
1812
|
+
},
|
|
1813
|
+
[
|
|
1814
|
+
(0, import_vue.h)("i", {
|
|
1815
|
+
class: "vxe-icon-caret-left"
|
|
1816
|
+
})
|
|
1817
|
+
]
|
|
1818
|
+
),
|
|
1819
|
+
(0, import_vue.h)(
|
|
1820
|
+
"span",
|
|
1821
|
+
{
|
|
1822
|
+
class: "vxe-date-panel--picker-btn vxe-date-panel--picker-current-btn",
|
|
1823
|
+
onClick: dateTodayMonthEvent
|
|
1824
|
+
},
|
|
1825
|
+
[
|
|
1826
|
+
(0, import_vue.h)("i", {
|
|
1827
|
+
class: "vxe-icon-dot"
|
|
1828
|
+
})
|
|
1829
|
+
]
|
|
1830
|
+
),
|
|
1831
|
+
(0, import_vue.h)(
|
|
1832
|
+
"span",
|
|
1833
|
+
{
|
|
1834
|
+
class: [
|
|
1835
|
+
"vxe-date-panel--picker-btn vxe-date-panel--picker-next-btn",
|
|
1836
|
+
{
|
|
1837
|
+
"is--disabled": isDisabledNextDateBtn
|
|
1838
|
+
}
|
|
1839
|
+
],
|
|
1840
|
+
onClick: dateNextEvent
|
|
1841
|
+
},
|
|
1842
|
+
[
|
|
1843
|
+
(0, import_vue.h)("i", {
|
|
1844
|
+
class: "vxe-icon-caret-right"
|
|
1845
|
+
})
|
|
1846
|
+
]
|
|
1847
|
+
)
|
|
1848
|
+
]
|
|
1849
|
+
)
|
|
1850
|
+
]
|
|
1851
|
+
),
|
|
1852
|
+
(0, import_vue.h)(
|
|
1853
|
+
"div",
|
|
1854
|
+
{
|
|
1855
|
+
class: "vxe-date-panel--picker-body"
|
|
1856
|
+
},
|
|
1857
|
+
renderDateTable()
|
|
1858
|
+
)
|
|
1859
|
+
];
|
|
1860
|
+
};
|
|
1861
|
+
const renderTimePanel = () => {
|
|
1862
|
+
const { type } = props;
|
|
1863
|
+
const { datetimePanelValue } = reactData;
|
|
1864
|
+
const dateTimeLabel = computeDateTimeLabel.value;
|
|
1865
|
+
const hourList = computeHourList.value;
|
|
1866
|
+
const hasTimeMinute = computeHasTimeMinute.value;
|
|
1867
|
+
const minuteList = computeMinuteList.value;
|
|
1868
|
+
const hasTimeSecond = computeHasTimeSecond.value;
|
|
1869
|
+
const secondList = computeSecondList.value;
|
|
1870
|
+
return [
|
|
1871
|
+
type === "time" ? renderEmptyElement($xeDatePanel) : (0, import_vue.h)(
|
|
1872
|
+
"div",
|
|
1873
|
+
{
|
|
1874
|
+
class: "vxe-date-panel--time-header"
|
|
1875
|
+
},
|
|
1876
|
+
[
|
|
1877
|
+
(0, import_vue.h)(
|
|
1878
|
+
"div",
|
|
1879
|
+
{
|
|
1880
|
+
class: "vxe-date-panel--time-title"
|
|
1881
|
+
},
|
|
1882
|
+
dateTimeLabel
|
|
1883
|
+
)
|
|
1884
|
+
]
|
|
1885
|
+
),
|
|
1886
|
+
(0, import_vue.h)(
|
|
1887
|
+
"div",
|
|
1888
|
+
{
|
|
1889
|
+
ref: refInputTimeBody,
|
|
1890
|
+
class: "vxe-date-panel--time-body"
|
|
1891
|
+
},
|
|
1892
|
+
[
|
|
1893
|
+
(0, import_vue.h)(
|
|
1894
|
+
import_scrollbar.default,
|
|
1895
|
+
{
|
|
1896
|
+
autoHide: true,
|
|
1897
|
+
class: "vxe-date-panel--time-hour-list",
|
|
1898
|
+
viewClassName: "vxe-date-panel--time-list-view",
|
|
1899
|
+
viewInnerClassName: "vxe-date-panel--time-list-inner"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
default: () => {
|
|
1903
|
+
return hourList.map((item, index) => {
|
|
1904
|
+
return (0, import_vue.h)(
|
|
1905
|
+
"div",
|
|
1906
|
+
{
|
|
1907
|
+
key: index,
|
|
1908
|
+
class: [
|
|
1909
|
+
"vxe-date-panel--time-item",
|
|
1910
|
+
{
|
|
1911
|
+
"is--disabled": item.disabled,
|
|
1912
|
+
"is--selected": datetimePanelValue && datetimePanelValue.getHours() === item.value
|
|
1913
|
+
}
|
|
1914
|
+
],
|
|
1915
|
+
onClick: (evnt) => dateHourEvent(evnt, item)
|
|
1916
|
+
},
|
|
1917
|
+
item.label
|
|
1918
|
+
);
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1918
1921
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
);
|
|
1947
|
-
}
|
|
1922
|
+
),
|
|
1923
|
+
hasTimeMinute ? (0, import_vue.h)(
|
|
1924
|
+
import_scrollbar.default,
|
|
1925
|
+
{
|
|
1926
|
+
autoHide: true,
|
|
1927
|
+
class: "vxe-date-panel--time-minute-list",
|
|
1928
|
+
viewClassName: "vxe-date-panel--time-list-view",
|
|
1929
|
+
viewInnerClassName: "vxe-date-panel--time-list-inner"
|
|
1930
|
+
},
|
|
1931
|
+
{
|
|
1932
|
+
default: () => {
|
|
1933
|
+
return minuteList.map((item, index) => {
|
|
1934
|
+
return (0, import_vue.h)(
|
|
1935
|
+
"div",
|
|
1936
|
+
{
|
|
1937
|
+
key: index,
|
|
1938
|
+
class: [
|
|
1939
|
+
"vxe-date-panel--time-item",
|
|
1940
|
+
{
|
|
1941
|
+
"is--disabled": item.disabled,
|
|
1942
|
+
"is--selected": datetimePanelValue && datetimePanelValue.getMinutes() === item.value
|
|
1943
|
+
}
|
|
1944
|
+
],
|
|
1945
|
+
onClick: (evnt) => dateMinuteEvent(evnt, item)
|
|
1946
|
+
},
|
|
1947
|
+
item.label
|
|
1948
|
+
);
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1948
1951
|
}
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
);
|
|
1977
|
-
}
|
|
1952
|
+
) : renderEmptyElement($xeDatePanel),
|
|
1953
|
+
hasTimeMinute && hasTimeSecond ? (0, import_vue.h)(
|
|
1954
|
+
import_scrollbar.default,
|
|
1955
|
+
{
|
|
1956
|
+
autoHide: true,
|
|
1957
|
+
class: "vxe-date-panel--time-second-list",
|
|
1958
|
+
viewClassName: "vxe-date-panel--time-list-view",
|
|
1959
|
+
viewInnerClassName: "vxe-date-panel--time-list-inner"
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
default: () => {
|
|
1963
|
+
return secondList.map((item, index) => {
|
|
1964
|
+
return (0, import_vue.h)(
|
|
1965
|
+
"div",
|
|
1966
|
+
{
|
|
1967
|
+
key: index,
|
|
1968
|
+
class: [
|
|
1969
|
+
"vxe-date-panel--time-item",
|
|
1970
|
+
{
|
|
1971
|
+
"is--disabled": item.disabled,
|
|
1972
|
+
"is--selected": datetimePanelValue && datetimePanelValue.getSeconds() === item.value
|
|
1973
|
+
}
|
|
1974
|
+
],
|
|
1975
|
+
onClick: (evnt) => dateSecondEvent(evnt, item)
|
|
1976
|
+
},
|
|
1977
|
+
item.label
|
|
1978
|
+
);
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1978
1981
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1982
|
+
) : renderEmptyElement($xeDatePanel)
|
|
1983
|
+
]
|
|
1984
|
+
)
|
|
1985
|
+
];
|
|
1986
|
+
};
|
|
1987
|
+
const renderPickerPanel = () => {
|
|
1988
|
+
const { type } = props;
|
|
1989
|
+
if (type === "datetime") {
|
|
1990
|
+
return (0, import_vue.h)(
|
|
1991
|
+
"div",
|
|
1992
|
+
{
|
|
1993
|
+
key: type,
|
|
1994
|
+
ref: refPanelWrapper,
|
|
1995
|
+
class: "vxe-date-panel--time-layout-wrapper"
|
|
1996
|
+
},
|
|
1997
|
+
[
|
|
1998
|
+
(0, import_vue.h)(
|
|
1999
|
+
"div",
|
|
2000
|
+
{
|
|
2001
|
+
class: "vxe-date-panel--time-left-wrapper"
|
|
2002
|
+
},
|
|
2003
|
+
renderDatePanel()
|
|
2004
|
+
),
|
|
2005
|
+
(0, import_vue.h)(
|
|
2006
|
+
"div",
|
|
2007
|
+
{
|
|
2008
|
+
class: "vxe-date-panel--time-right-wrapper"
|
|
2009
|
+
},
|
|
2010
|
+
renderTimePanel()
|
|
2011
|
+
)
|
|
2012
|
+
]
|
|
2013
|
+
);
|
|
2014
|
+
} else if (type === "time") {
|
|
2015
|
+
return (0, import_vue.h)(
|
|
2016
|
+
"div",
|
|
2017
|
+
{
|
|
2018
|
+
key: type,
|
|
2019
|
+
ref: refPanelWrapper,
|
|
2020
|
+
class: "vxe-date-panel--wrapper"
|
|
2021
|
+
},
|
|
2022
|
+
renderTimePanel()
|
|
2023
|
+
);
|
|
2024
|
+
}
|
|
1988
2025
|
return (0, import_vue.h)(
|
|
1989
2026
|
"div",
|
|
1990
2027
|
{
|
|
1991
|
-
key: type,
|
|
2028
|
+
key: type || "default",
|
|
1992
2029
|
ref: refPanelWrapper,
|
|
1993
|
-
class: "vxe-date-panel--
|
|
2030
|
+
class: "vxe-date-panel--wrapper"
|
|
1994
2031
|
},
|
|
1995
|
-
|
|
1996
|
-
(0, import_vue.h)(
|
|
1997
|
-
"div",
|
|
1998
|
-
{
|
|
1999
|
-
class: "vxe-date-panel--time-left-wrapper"
|
|
2000
|
-
},
|
|
2001
|
-
renderDatePanel()
|
|
2002
|
-
),
|
|
2003
|
-
(0, import_vue.h)(
|
|
2004
|
-
"div",
|
|
2005
|
-
{
|
|
2006
|
-
class: "vxe-date-panel--time-right-wrapper"
|
|
2007
|
-
},
|
|
2008
|
-
renderTimePanel()
|
|
2009
|
-
)
|
|
2010
|
-
]
|
|
2032
|
+
renderDatePanel()
|
|
2011
2033
|
);
|
|
2012
|
-
}
|
|
2034
|
+
};
|
|
2035
|
+
const renderVN = () => {
|
|
2036
|
+
const { type } = props;
|
|
2037
|
+
const vSize = computeSize.value;
|
|
2013
2038
|
return (0, import_vue.h)(
|
|
2014
2039
|
"div",
|
|
2015
2040
|
{
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2041
|
+
class: [
|
|
2042
|
+
"vxe-date-panel",
|
|
2043
|
+
`type--${type}`,
|
|
2044
|
+
{
|
|
2045
|
+
[`size--${vSize}`]: vSize
|
|
2046
|
+
}
|
|
2047
|
+
]
|
|
2019
2048
|
},
|
|
2020
|
-
|
|
2049
|
+
[renderPickerPanel()]
|
|
2021
2050
|
);
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
{
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
},
|
|
2030
|
-
renderDatePanel()
|
|
2051
|
+
};
|
|
2052
|
+
(0, import_vue.watch)(
|
|
2053
|
+
() => props.modelValue,
|
|
2054
|
+
(val) => {
|
|
2055
|
+
updateModelValue(val);
|
|
2056
|
+
changeValue();
|
|
2057
|
+
}
|
|
2031
2058
|
);
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
"
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
},
|
|
2047
|
-
[renderPickerPanel()]
|
|
2059
|
+
(0, import_vue.watch)(
|
|
2060
|
+
() => props.type,
|
|
2061
|
+
() => {
|
|
2062
|
+
Object.assign(reactData, {
|
|
2063
|
+
inputLabel: "",
|
|
2064
|
+
datetimePanelValue: null,
|
|
2065
|
+
datePanelValue: null,
|
|
2066
|
+
datePanelLabel: "",
|
|
2067
|
+
datePanelType: "day",
|
|
2068
|
+
selectMonth: null,
|
|
2069
|
+
currentDate: null
|
|
2070
|
+
});
|
|
2071
|
+
initValue();
|
|
2072
|
+
}
|
|
2048
2073
|
);
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
() =>
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
(0, import_vue.watch)(computeDateLabelFormat, () => {
|
|
2073
|
-
const isDatePanelType = computeIsDatePanelType.value;
|
|
2074
|
-
if (isDatePanelType) {
|
|
2075
|
-
dateParseValue(reactData.datePanelValue);
|
|
2076
|
-
reactData.inputLabel = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
2077
|
-
}
|
|
2078
|
-
});
|
|
2079
|
-
initValue();
|
|
2080
|
-
dateOpenPanel();
|
|
2081
|
-
(0, import_vue.onMounted)(() => {
|
|
2082
|
-
const { type, multiple } = props;
|
|
2083
|
-
if (multiple && type === "time") {
|
|
2084
|
-
errLog("vxe.error.notSupportProp", [`type=${type}`, "multiple=true", "multiple=false"]);
|
|
2085
|
-
}
|
|
2086
|
-
});
|
|
2087
|
-
$xeDatePanel.renderVN = renderVN;
|
|
2088
|
-
return $xeDatePanel;
|
|
2089
|
-
},
|
|
2090
|
-
render() {
|
|
2091
|
-
return this.renderVN();
|
|
2092
|
-
}
|
|
2093
|
-
});
|
|
2074
|
+
(0, import_vue.watch)(computeDateLabelFormat, () => {
|
|
2075
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
2076
|
+
if (isDatePanelType) {
|
|
2077
|
+
dateParseValue(reactData.datePanelValue);
|
|
2078
|
+
reactData.inputLabel = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
2079
|
+
}
|
|
2080
|
+
});
|
|
2081
|
+
initValue();
|
|
2082
|
+
dateOpenPanel();
|
|
2083
|
+
(0, import_vue.onMounted)(() => {
|
|
2084
|
+
const { type, multiple } = props;
|
|
2085
|
+
if (multiple && type === "time") {
|
|
2086
|
+
errLog("vxe.error.notSupportProp", [`type=${type}`, "multiple=true", "multiple=false"]);
|
|
2087
|
+
}
|
|
2088
|
+
});
|
|
2089
|
+
$xeDatePanel.renderVN = renderVN;
|
|
2090
|
+
return $xeDatePanel;
|
|
2091
|
+
},
|
|
2092
|
+
render() {
|
|
2093
|
+
return this.renderVN();
|
|
2094
|
+
}
|
|
2095
|
+
})
|
|
2096
|
+
);
|