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