vxe-pc-ui 4.20.25 → 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 +15059 -10308
- 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.esm.js +9 -8
- package/es/index.js +9 -8
- 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 +40 -23
- 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 +85 -57
- 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 +9 -8
- package/lib/index.js +9 -8
- package/lib/index.umd.js +15131 -10364
- 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 +54 -37
- 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 +87 -59
- 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 -21
- 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 -271
- 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.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/dist/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/dist/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/es/icon/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/es/icon/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/es/icon/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/es/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/es/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/es/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/lib/icon/style/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/lib/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/lib/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/lib/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1792992046297.ttf → iconfont.1793007755017.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1792992046297.woff → iconfont.1793007755017.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1792992046297.woff2 → iconfont.1793007755017.woff2} +0 -0
|
@@ -1,1094 +1,1217 @@
|
|
|
1
|
-
import { ref, computed, h, PropType, nextTick, inject, provide, reactive, Teleport, onMounted, onBeforeUnmount, watch, VNode } from 'vue'
|
|
2
|
-
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
-
import {
|
|
4
|
-
import { getEventTargetNode, updatePanelPlacement, toCssUnit, getPopupContainer } from '../../ui/src/dom'
|
|
5
|
-
import { getLastZIndex, nextZIndex, deModelValue } from '../../ui/src/utils'
|
|
6
|
-
import { createComponentLog } from '../../ui/src/log'
|
|
7
|
-
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
|
-
import XEUtils from 'xe-utils'
|
|
9
|
-
import VxeInputComponent from '../../input'
|
|
10
|
-
import VxeButtonComponent from '../../button'
|
|
11
|
-
import VxeTreeComponent from '../../tree'
|
|
12
|
-
|
|
13
|
-
import type {
|
|
14
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
type:
|
|
126
|
-
default: () => getConfig().treeSelect.
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
type: Boolean as PropType<VxeTreeSelectPropTypes.
|
|
150
|
-
default: () => getConfig().treeSelect.
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
type: Boolean as PropType<VxeTreeSelectPropTypes.
|
|
154
|
-
default:
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
return
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
const
|
|
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
|
-
}, treeOpts.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
return Object.assign(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
return
|
|
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
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
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
|
-
if (
|
|
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
|
-
|
|
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
|
-
const
|
|
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
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const
|
|
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
|
-
const
|
|
663
|
-
const { visiblePanel } = reactData
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
if (
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
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
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
const
|
|
805
|
-
const
|
|
806
|
-
const
|
|
807
|
-
const
|
|
808
|
-
const
|
|
809
|
-
const
|
|
810
|
-
const
|
|
811
|
-
const
|
|
812
|
-
const
|
|
813
|
-
const
|
|
814
|
-
const
|
|
815
|
-
const
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
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
|
-
|
|
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
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1
|
+
import { ref, computed, h, PropType, nextTick, inject, provide, reactive, Teleport, onMounted, onBeforeUnmount, watch, VNode } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
+
import { getEventTargetNode, updatePanelPlacement, toCssUnit, getPopupContainer } from '../../ui/src/dom'
|
|
5
|
+
import { getLastZIndex, nextZIndex, deModelValue } from '../../ui/src/utils'
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log'
|
|
7
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
|
+
import XEUtils from 'xe-utils'
|
|
9
|
+
import VxeInputComponent from '../../input'
|
|
10
|
+
import VxeButtonComponent from '../../button'
|
|
11
|
+
import VxeTreeComponent from '../../tree'
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
TreeSelectReactData,
|
|
15
|
+
VxeTreeSelectEmits,
|
|
16
|
+
TreeSelectInternalData,
|
|
17
|
+
VxeButtonEvents,
|
|
18
|
+
VxeInputEvents,
|
|
19
|
+
ValueOf,
|
|
20
|
+
VxeComponentStyleType,
|
|
21
|
+
TreeSelectPrivateRef,
|
|
22
|
+
TreeSelectPrivateMethods,
|
|
23
|
+
TreeSelectMethods,
|
|
24
|
+
VxeTreeSelectPrivateComputed,
|
|
25
|
+
VxeTreeSelectPropTypes,
|
|
26
|
+
VxeTreeSelectConstructor,
|
|
27
|
+
VxeFormDefines,
|
|
28
|
+
VxeDrawerConstructor,
|
|
29
|
+
VxeDrawerMethods,
|
|
30
|
+
VxeTreeSelectPrivateMethods,
|
|
31
|
+
VxeFormConstructor,
|
|
32
|
+
VxeFormPrivateMethods,
|
|
33
|
+
VxeInputConstructor,
|
|
34
|
+
VxeModalConstructor,
|
|
35
|
+
VxeModalMethods,
|
|
36
|
+
VxeTreeConstructor,
|
|
37
|
+
VxeTreeEvents,
|
|
38
|
+
VxeTreeSelectDefines
|
|
39
|
+
} from '../../../types'
|
|
40
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
41
|
+
|
|
42
|
+
const { getConfig, getI18n, getIcon, globalEvents, createEvent, useFns, renderEmptyElement } = VxeUI
|
|
43
|
+
|
|
44
|
+
const { warnLog, errLog } = createComponentLog('tree-select')
|
|
45
|
+
|
|
46
|
+
function getOptUniqueId() {
|
|
47
|
+
return XEUtils.uniqueId('node_')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function createReactData(): TreeSelectReactData {
|
|
51
|
+
return {
|
|
52
|
+
initialized: false,
|
|
53
|
+
searchValue: '',
|
|
54
|
+
searchLoading: false,
|
|
55
|
+
panelIndex: 0,
|
|
56
|
+
panelStyle: {},
|
|
57
|
+
panelPlacement: null,
|
|
58
|
+
triggerFocusPanel: false,
|
|
59
|
+
visiblePanel: false,
|
|
60
|
+
isAniVisible: false,
|
|
61
|
+
isActivated: false,
|
|
62
|
+
fullOptFlag: 1,
|
|
63
|
+
lazyOptFlag: 1
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function createInternalData(): TreeSelectInternalData {
|
|
68
|
+
return {
|
|
69
|
+
// hpTimeout: undefined,
|
|
70
|
+
fullOptionList: [],
|
|
71
|
+
fullNodeMaps: {},
|
|
72
|
+
lazyNodeMaps: {}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default defineVxeComponent({
|
|
77
|
+
name: 'VxeTreeSelect',
|
|
78
|
+
props: {
|
|
79
|
+
modelValue: [String, Number, Array] as PropType<VxeTreeSelectPropTypes.ModelValue>,
|
|
80
|
+
clearable: {
|
|
81
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.Clearable>,
|
|
82
|
+
default: () => getConfig().treeSelect.clearable
|
|
83
|
+
},
|
|
84
|
+
placeholder: {
|
|
85
|
+
type: String as PropType<VxeTreeSelectPropTypes.Placeholder>,
|
|
86
|
+
default: () => (XEUtils.eqNull(getConfig().treeSelect.placeholder) ? getI18n('vxe.base.pleaseSelect') : getConfig().treeSelect.placeholder)
|
|
87
|
+
},
|
|
88
|
+
readonly: {
|
|
89
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.Readonly>,
|
|
90
|
+
default: null
|
|
91
|
+
},
|
|
92
|
+
loading: Boolean as PropType<VxeTreeSelectPropTypes.Loading>,
|
|
93
|
+
disabled: {
|
|
94
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.Disabled>,
|
|
95
|
+
default: null
|
|
96
|
+
},
|
|
97
|
+
showFullLabel: {
|
|
98
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowFullLabel>,
|
|
99
|
+
default: () => getConfig().treeSelect.showFullLabel
|
|
100
|
+
},
|
|
101
|
+
separator: {
|
|
102
|
+
type: String as PropType<VxeTreeSelectPropTypes.Separator>,
|
|
103
|
+
default: () => getConfig().treeSelect.separator
|
|
104
|
+
},
|
|
105
|
+
filterable: Boolean as PropType<VxeTreeSelectPropTypes.Filterable>,
|
|
106
|
+
filterConfig: Object as PropType<VxeTreeSelectPropTypes.FilterConfig>,
|
|
107
|
+
multiple: Boolean as PropType<VxeTreeSelectPropTypes.Multiple>,
|
|
108
|
+
className: [String, Function] as PropType<VxeTreeSelectPropTypes.ClassName>,
|
|
109
|
+
/**
|
|
110
|
+
* 已废弃,请使用 popupConfig.className
|
|
111
|
+
* @deprecated
|
|
112
|
+
*/
|
|
113
|
+
popupClassName: [String, Function] as PropType<VxeTreeSelectPropTypes.PopupClassName>,
|
|
114
|
+
prefixIcon: String as PropType<VxeTreeSelectPropTypes.PrefixIcon>,
|
|
115
|
+
placement: String as PropType<VxeTreeSelectPropTypes.Placement>,
|
|
116
|
+
lazyOptions: Array as PropType<VxeTreeSelectPropTypes.LazyOptions>,
|
|
117
|
+
options: Array as PropType<VxeTreeSelectPropTypes.Options>,
|
|
118
|
+
optionProps: Object as PropType<VxeTreeSelectPropTypes.OptionProps>,
|
|
119
|
+
/**
|
|
120
|
+
* 已废弃,请使用 popupConfig.zIndex
|
|
121
|
+
* @deprecated
|
|
122
|
+
*/
|
|
123
|
+
zIndex: Number as PropType<VxeTreeSelectPropTypes.ZIndex>,
|
|
124
|
+
size: {
|
|
125
|
+
type: String as PropType<VxeTreeSelectPropTypes.Size>,
|
|
126
|
+
default: () => getConfig().treeSelect.size || getConfig().size
|
|
127
|
+
},
|
|
128
|
+
remote: Boolean as PropType<VxeTreeSelectPropTypes.Remote>,
|
|
129
|
+
remoteConfig: Object as PropType<VxeTreeSelectPropTypes.RemoteConfig>,
|
|
130
|
+
showRadio: {
|
|
131
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowRadio>,
|
|
132
|
+
default: () => getConfig().treeSelect.showRadio
|
|
133
|
+
},
|
|
134
|
+
radioConfig: Object as PropType<VxeTreeSelectPropTypes.RadioConfig>,
|
|
135
|
+
showCheckbox: {
|
|
136
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowCheckbox>,
|
|
137
|
+
default: () => getConfig().treeSelect.showCheckbox
|
|
138
|
+
},
|
|
139
|
+
checkboxConfig: Object as PropType<VxeTreeSelectPropTypes.CheckboxConfig>,
|
|
140
|
+
popupConfig: Object as PropType<VxeTreeSelectPropTypes.PopupConfig>,
|
|
141
|
+
treeConfig: Object as PropType<VxeTreeSelectPropTypes.TreeConfig>,
|
|
142
|
+
menuConfig: Object as PropType<VxeTreeSelectPropTypes.MenuConfig>,
|
|
143
|
+
virtualYConfig: Object as PropType<VxeTreeSelectPropTypes.VirtualYConfig>,
|
|
144
|
+
/**
|
|
145
|
+
* 已废弃,被 checked-closable, clear-closable 替换
|
|
146
|
+
* @deprecated
|
|
147
|
+
*/
|
|
148
|
+
autoClose: {
|
|
149
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.AutoClose>,
|
|
150
|
+
default: () => getConfig().treeSelect.autoClose
|
|
151
|
+
},
|
|
152
|
+
checkedClosable: {
|
|
153
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.CheckedClosable>,
|
|
154
|
+
default: () => getConfig().treeSelect.checkedClosable
|
|
155
|
+
},
|
|
156
|
+
clearClosable: {
|
|
157
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ClearClosable>,
|
|
158
|
+
default: () => getConfig().treeSelect.clearClosable
|
|
159
|
+
},
|
|
160
|
+
showCloseButton: {
|
|
161
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowCloseButton>,
|
|
162
|
+
default: () => getConfig().treeSelect.showCloseButton
|
|
163
|
+
},
|
|
164
|
+
showTotalButton: {
|
|
165
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowTotalButton>,
|
|
166
|
+
default: () => getConfig().treeSelect.showTotalButton
|
|
167
|
+
},
|
|
168
|
+
showCheckedButton: {
|
|
169
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowCheckedButton>,
|
|
170
|
+
default: () => getConfig().treeSelect.showCheckedButton
|
|
171
|
+
},
|
|
172
|
+
showClearButton: {
|
|
173
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowClearButton>,
|
|
174
|
+
default: () => getConfig().treeSelect.showClearButton
|
|
175
|
+
},
|
|
176
|
+
showExpandButton: {
|
|
177
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.ShowExpandButton>,
|
|
178
|
+
default: () => getConfig().treeSelect.showExpandButton
|
|
179
|
+
},
|
|
180
|
+
transfer: {
|
|
181
|
+
type: Boolean as PropType<VxeTreeSelectPropTypes.Transfer>,
|
|
182
|
+
default: null
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 已废弃,被 remote-config.queryMethod 替换
|
|
187
|
+
* @deprecated
|
|
188
|
+
*/
|
|
189
|
+
remoteMethod: Function as PropType<VxeTreeSelectPropTypes.RemoteMethod>
|
|
190
|
+
},
|
|
191
|
+
emits: ['update:modelValue', 'change', 'all-change', 'clear', 'blur', 'focus', 'click', 'node-click', 'visible-change'] as VxeTreeSelectEmits,
|
|
192
|
+
setup(props, context) {
|
|
193
|
+
const { emit, slots } = context
|
|
194
|
+
|
|
195
|
+
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods) | null>('$xeModal', null)
|
|
196
|
+
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
197
|
+
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
198
|
+
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods) | null>('$xeForm', null)
|
|
199
|
+
const formItemInfo = inject<VxeFormDefines.ProvideItemInfo | null>('xeFormItemInfo', null)
|
|
200
|
+
|
|
201
|
+
const xID = XEUtils.uniqueId()
|
|
202
|
+
|
|
203
|
+
const { computeSize } = useFns.useSize(props)
|
|
204
|
+
|
|
205
|
+
const refElem = ref<HTMLDivElement>()
|
|
206
|
+
const refInput = ref<VxeInputConstructor>()
|
|
207
|
+
const refInpSearch = ref<VxeInputConstructor>()
|
|
208
|
+
const refTreeWrapper = ref<HTMLDivElement>()
|
|
209
|
+
const refOptionPanel = ref<HTMLDivElement>()
|
|
210
|
+
const refTree = ref<VxeTreeConstructor>()
|
|
211
|
+
|
|
212
|
+
const reactData = reactive(createReactData())
|
|
213
|
+
|
|
214
|
+
const internalData = createInternalData()
|
|
215
|
+
|
|
216
|
+
const refMaps: TreeSelectPrivateRef = {
|
|
217
|
+
refElem
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const computeFormReadonly = computed(() => {
|
|
221
|
+
const { readonly } = props
|
|
222
|
+
if (readonly === null) {
|
|
223
|
+
if ($xeForm) {
|
|
224
|
+
return $xeForm.props.readonly
|
|
225
|
+
}
|
|
226
|
+
return false
|
|
227
|
+
}
|
|
228
|
+
return readonly
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
const computeIsDisabled = computed(() => {
|
|
232
|
+
const { disabled } = props
|
|
233
|
+
if (disabled === null) {
|
|
234
|
+
if ($xeForm) {
|
|
235
|
+
return $xeForm.props.disabled
|
|
236
|
+
}
|
|
237
|
+
return false
|
|
238
|
+
}
|
|
239
|
+
return disabled
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
const computeBtnTransfer = computed(() => {
|
|
243
|
+
const popupOpts = computePopupOpts.value
|
|
244
|
+
const { transfer } = popupOpts
|
|
245
|
+
if (XEUtils.isBoolean(transfer)) {
|
|
246
|
+
return transfer
|
|
247
|
+
}
|
|
248
|
+
if (props.transfer === null) {
|
|
249
|
+
const globalTransfer = getConfig().treeSelect.transfer
|
|
250
|
+
if (XEUtils.isBoolean(globalTransfer)) {
|
|
251
|
+
return globalTransfer
|
|
252
|
+
}
|
|
253
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
254
|
+
return true
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return props.transfer
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
const computePopupOpts = computed(() => {
|
|
261
|
+
return Object.assign({}, getConfig().treeSelect.popupConfig, props.popupConfig)
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
const computeTreeOpts = computed(() => {
|
|
265
|
+
return Object.assign({}, getConfig().treeSelect.treeConfig, props.treeConfig, { data: undefined })
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
const computeMenuOpts = computed(() => {
|
|
269
|
+
return Object.assign({}, getConfig().treeSelect.menuConfig, props.menuConfig)
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
const computeTreeNodeOpts = computed(() => {
|
|
273
|
+
const treeOpts = computeTreeOpts.value
|
|
274
|
+
return Object.assign({ isHover: true }, treeOpts.nodeConfig)
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
const computeTreeCheckboxOpts = computed(() => {
|
|
278
|
+
const { showCheckbox, checkboxConfig } = props
|
|
279
|
+
const treeOpts = computeTreeOpts.value
|
|
280
|
+
return Object.assign(
|
|
281
|
+
{
|
|
282
|
+
showIcon: XEUtils.isBoolean(showCheckbox) ? showCheckbox : !!treeOpts.showCheckbox
|
|
283
|
+
},
|
|
284
|
+
treeOpts.checkboxConfig,
|
|
285
|
+
checkboxConfig,
|
|
286
|
+
{
|
|
287
|
+
trigger: 'node'
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
const computeTreeRadioOpts = computed(() => {
|
|
293
|
+
const { showRadio, radioConfig } = props
|
|
294
|
+
const treeOpts = computeTreeOpts.value
|
|
295
|
+
return Object.assign(
|
|
296
|
+
{
|
|
297
|
+
showIcon: XEUtils.isBoolean(showRadio) ? showRadio : !!treeOpts.showRadio
|
|
298
|
+
},
|
|
299
|
+
treeOpts.radioConfig,
|
|
300
|
+
radioConfig,
|
|
301
|
+
{
|
|
302
|
+
trigger: 'node'
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
const computePropsOpts = computed(() => {
|
|
308
|
+
return Object.assign({}, getConfig().treeSelect.optionProps, props.optionProps)
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
const computeNodeKeyField = computed(() => {
|
|
312
|
+
const treeOpts = computeTreeOpts.value
|
|
313
|
+
return treeOpts.keyField || 'id'
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
const computeLabelField = computed(() => {
|
|
317
|
+
const propsOpts = computePropsOpts.value
|
|
318
|
+
return propsOpts.label || 'label'
|
|
319
|
+
})
|
|
320
|
+
|
|
321
|
+
const computeValueField = computed(() => {
|
|
322
|
+
const propsOpts = computePropsOpts.value
|
|
323
|
+
return propsOpts.value || 'value'
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
const computeChildrenField = computed(() => {
|
|
327
|
+
const propsOpts = computePropsOpts.value
|
|
328
|
+
return propsOpts.children || 'children'
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
const computeNodeParentField = computed(() => {
|
|
332
|
+
const propsOpts = computePropsOpts.value
|
|
333
|
+
const treeOpts = computeTreeOpts.value
|
|
334
|
+
return propsOpts.parent || treeOpts.parentField || 'parentId'
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
const computeHasChildField = computed(() => {
|
|
338
|
+
const propsOpts = computePropsOpts.value
|
|
339
|
+
return propsOpts.hasChild || 'hasChild'
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
const computeVirtualYOpts = computed(() => {
|
|
343
|
+
return Object.assign({} as { gt: number }, getConfig().treeSelect.virtualYConfig, props.virtualYConfig)
|
|
344
|
+
})
|
|
345
|
+
|
|
346
|
+
const computeRemoteOpts = computed(() => {
|
|
347
|
+
return Object.assign({}, getConfig().treeSelect.remoteConfig, props.remoteConfig)
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
const computeFilterOpts = computed(() => {
|
|
351
|
+
const treeOpts = computeTreeOpts.value
|
|
352
|
+
return Object.assign({}, treeOpts.filterConfig, props.filterConfig)
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
const computeSelectVals = computed(() => {
|
|
356
|
+
const { modelValue } = props
|
|
357
|
+
return XEUtils.eqNull(modelValue) ? [] : XEUtils.isArray(modelValue) ? modelValue : [modelValue]
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
const computeSelectLabel = computed(() => {
|
|
361
|
+
const { showFullLabel } = props
|
|
362
|
+
const { fullOptFlag, lazyOptFlag } = reactData
|
|
363
|
+
const { fullNodeMaps, lazyNodeMaps } = internalData
|
|
364
|
+
const labelField = computeLabelField.value
|
|
365
|
+
const selectVals = computeSelectVals.value
|
|
366
|
+
return selectVals
|
|
367
|
+
.map((val) => {
|
|
368
|
+
const cacheItem = fullNodeMaps[val]
|
|
369
|
+
if (fullOptFlag && cacheItem) {
|
|
370
|
+
return showFullLabel ? cacheItem.fullLabel : cacheItem.item[labelField]
|
|
371
|
+
}
|
|
372
|
+
if (lazyOptFlag) {
|
|
373
|
+
const lazyCacheItem = lazyNodeMaps[val]
|
|
374
|
+
if (lazyCacheItem) {
|
|
375
|
+
return showFullLabel ? lazyCacheItem.fullLabel : lazyCacheItem.item[labelField]
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return val
|
|
379
|
+
})
|
|
380
|
+
.join(', ')
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
const computePopupWrapperStyle = computed(() => {
|
|
384
|
+
const popupOpts = computePopupOpts.value
|
|
385
|
+
const { height, width } = popupOpts
|
|
386
|
+
const stys: VxeComponentStyleType = {}
|
|
387
|
+
if (width) {
|
|
388
|
+
stys.width = toCssUnit(width)
|
|
389
|
+
}
|
|
390
|
+
if (height) {
|
|
391
|
+
stys.height = toCssUnit(height)
|
|
392
|
+
stys.maxHeight = toCssUnit(height)
|
|
393
|
+
}
|
|
394
|
+
return stys
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
const computeMaps: VxeTreeSelectPrivateComputed = {}
|
|
398
|
+
|
|
399
|
+
const $xeTreeSelect = {
|
|
400
|
+
xID,
|
|
401
|
+
props,
|
|
402
|
+
context,
|
|
403
|
+
reactData,
|
|
404
|
+
internalData,
|
|
405
|
+
|
|
406
|
+
getRefMaps: () => refMaps,
|
|
407
|
+
getComputeMaps: () => computeMaps
|
|
408
|
+
} as unknown as VxeTreeSelectConstructor & VxeTreeSelectPrivateMethods
|
|
409
|
+
|
|
410
|
+
const dispatchEvent = (type: ValueOf<VxeTreeSelectEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
411
|
+
emit(type, createEvent(evnt, { $treeSelect: $xeTreeSelect }, params))
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const emitModel = (value: any) => {
|
|
415
|
+
emit('update:modelValue', value)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
const callSlot = (slotFunc: ((params: any) => any) | string | null, params: any) => {
|
|
419
|
+
if (slotFunc) {
|
|
420
|
+
if (XEUtils.isString(slotFunc)) {
|
|
421
|
+
slotFunc = slots[slotFunc] || null
|
|
422
|
+
}
|
|
423
|
+
if (XEUtils.isFunction(slotFunc)) {
|
|
424
|
+
return getSlotVNs(slotFunc(params))
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return []
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const treeSelectMethods: TreeSelectMethods = {
|
|
431
|
+
dispatchEvent
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const getNodeid = (option: any) => {
|
|
435
|
+
const nodeKeyField = computeNodeKeyField.value
|
|
436
|
+
const nodeid = option[nodeKeyField]
|
|
437
|
+
return nodeid ? encodeURIComponent(nodeid) : ''
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
const handleCacheMap = (optList: VxeTreeSelectPropTypes.Options) => {
|
|
441
|
+
const { separator } = props
|
|
442
|
+
const treeOpts = computeTreeOpts.value
|
|
443
|
+
const nodeKeyField = computeNodeKeyField.value
|
|
444
|
+
const nodeParentField = computeNodeParentField.value
|
|
445
|
+
const childrenField = computeChildrenField.value
|
|
446
|
+
const valueField = computeValueField.value
|
|
447
|
+
const labelField = computeLabelField.value
|
|
448
|
+
const { transform } = treeOpts
|
|
449
|
+
const nodeMaps: Record<string, VxeTreeSelectDefines.NodeCacheObj> = {}
|
|
450
|
+
const keyMaps: Record<string, boolean> = {}
|
|
451
|
+
const handleOptNode = (item: any, index: number, items: any[], path: string[], parentItem: any, nodes: any[]) => {
|
|
452
|
+
let nodeid = getNodeid(item)
|
|
453
|
+
if (!nodeid) {
|
|
454
|
+
nodeid = getOptUniqueId()
|
|
455
|
+
}
|
|
456
|
+
if (keyMaps[nodeid]) {
|
|
457
|
+
errLog('vxe.error.repeatKey', [nodeKeyField, nodeid])
|
|
458
|
+
}
|
|
459
|
+
keyMaps[nodeid] = true
|
|
460
|
+
const value = item[valueField]
|
|
461
|
+
if (nodeMaps[value]) {
|
|
462
|
+
errLog('vxe.error.repeatKey', [valueField, value])
|
|
463
|
+
}
|
|
464
|
+
nodeMaps[value] = {
|
|
465
|
+
item,
|
|
466
|
+
index,
|
|
467
|
+
items,
|
|
468
|
+
parent: parentItem,
|
|
469
|
+
nodes,
|
|
470
|
+
fullLabel: nodes.map((item) => item[labelField]).join(separator || ' / ')
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (optList) {
|
|
474
|
+
if (transform) {
|
|
475
|
+
// if (showFullLabel) {
|
|
476
|
+
const treeList = XEUtils.toArrayTree(optList, {
|
|
477
|
+
key: nodeKeyField,
|
|
478
|
+
parentKey: nodeParentField,
|
|
479
|
+
mapChildren: childrenField,
|
|
480
|
+
rootParentValue: treeOpts.rootParentValue,
|
|
481
|
+
rootValues: treeOpts.rootValues
|
|
482
|
+
})
|
|
483
|
+
XEUtils.eachTree(treeList, handleOptNode, { children: childrenField })
|
|
484
|
+
// } else {
|
|
485
|
+
// optList.forEach((item, index, items) => {
|
|
486
|
+
// handleOptNode(item, index, items, [], null, [])
|
|
487
|
+
// })
|
|
488
|
+
// }
|
|
489
|
+
} else {
|
|
490
|
+
XEUtils.eachTree(optList, handleOptNode, { children: childrenField })
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return nodeMaps
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const cacheDataMap = () => {
|
|
497
|
+
const { options } = props
|
|
498
|
+
internalData.fullNodeMaps = handleCacheMap(options || [])
|
|
499
|
+
internalData.fullOptionList = options || []
|
|
500
|
+
reactData.fullOptFlag++
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const cacheLazyDataMap = () => {
|
|
504
|
+
const { lazyOptions } = props
|
|
505
|
+
internalData.lazyNodeMaps = handleCacheMap(lazyOptions || [])
|
|
506
|
+
reactData.lazyOptFlag++
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const updateZindex = () => {
|
|
510
|
+
const popupOpts = computePopupOpts.value
|
|
511
|
+
const customZIndex = popupOpts.zIndex || props.zIndex
|
|
512
|
+
if (customZIndex) {
|
|
513
|
+
reactData.panelIndex = XEUtils.toNumber(customZIndex)
|
|
514
|
+
} else if (reactData.panelIndex < getLastZIndex()) {
|
|
515
|
+
reactData.panelIndex = nextZIndex()
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
const updatePlacement = () => {
|
|
520
|
+
const { placement } = props
|
|
521
|
+
const { panelIndex } = reactData
|
|
522
|
+
const targetElem = refElem.value
|
|
523
|
+
const panelElem = refOptionPanel.value
|
|
524
|
+
const btnTransfer = computeBtnTransfer.value
|
|
525
|
+
const popupOpts = computePopupOpts.value
|
|
526
|
+
const handleStyle = () => {
|
|
527
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
528
|
+
isMinWidth: !popupOpts.width,
|
|
529
|
+
placement: popupOpts.placement || placement,
|
|
530
|
+
defaultPlacement: popupOpts.defaultPlacement,
|
|
531
|
+
appendTo: popupOpts.appendTo,
|
|
532
|
+
teleportTo: btnTransfer
|
|
533
|
+
})
|
|
534
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
535
|
+
zIndex: panelIndex
|
|
536
|
+
})
|
|
537
|
+
reactData.panelStyle = panelStyle
|
|
538
|
+
reactData.panelPlacement = ppObj.placement
|
|
539
|
+
}
|
|
540
|
+
handleStyle()
|
|
541
|
+
return nextTick().then(handleStyle)
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const showOptionPanel = (evnt?: Event) => {
|
|
545
|
+
const { loading, remote, filterable } = props
|
|
546
|
+
const { fullOptionList } = internalData
|
|
547
|
+
const isDisabled = computeIsDisabled.value
|
|
548
|
+
const remoteOpts = computeRemoteOpts.value
|
|
549
|
+
if (!loading && !isDisabled) {
|
|
550
|
+
clearTimeout(internalData.hpTimeout)
|
|
551
|
+
if (!reactData.initialized) {
|
|
552
|
+
reactData.initialized = true
|
|
553
|
+
}
|
|
554
|
+
reactData.isActivated = true
|
|
555
|
+
reactData.isAniVisible = true
|
|
556
|
+
if (filterable) {
|
|
557
|
+
if (remote && remoteOpts.enabled && remoteOpts.autoLoad && !fullOptionList.length) {
|
|
558
|
+
handleSearchEvent()
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
setTimeout(() => {
|
|
562
|
+
reactData.visiblePanel = true
|
|
563
|
+
handleFocusSearch()
|
|
564
|
+
updatePlacement()
|
|
565
|
+
}, 10)
|
|
566
|
+
updateZindex()
|
|
567
|
+
updatePlacement()
|
|
568
|
+
dispatchEvent('visible-change', { visible: true }, evnt || null)
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const hideOptionPanel = (evnt?: Event) => {
|
|
573
|
+
const { filterable } = props
|
|
574
|
+
const filterOpts = computeFilterOpts.value
|
|
575
|
+
if (filterable) {
|
|
576
|
+
if (filterOpts.clearOnClose) {
|
|
577
|
+
reactData.searchValue = ''
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
reactData.visiblePanel = false
|
|
581
|
+
internalData.hpTimeout = setTimeout(() => {
|
|
582
|
+
reactData.isAniVisible = false
|
|
583
|
+
}, 350)
|
|
584
|
+
dispatchEvent('visible-change', { visible: false }, evnt || null)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
const changeEvent = (evnt: Event, selectValue: any, node: any) => {
|
|
588
|
+
const value = XEUtils.isArray(selectValue) ? selectValue.map(deModelValue) : deModelValue(selectValue)
|
|
589
|
+
emitModel(value)
|
|
590
|
+
if (value !== props.modelValue) {
|
|
591
|
+
dispatchEvent('change', { value, node, option: node }, evnt)
|
|
592
|
+
// 自动更新校验状态
|
|
593
|
+
if ($xeForm && formItemInfo) {
|
|
594
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const clearValueEvent = (evnt: Event, selectValue: any) => {
|
|
600
|
+
changeEvent(evnt, selectValue, null)
|
|
601
|
+
dispatchEvent('clear', { value: selectValue }, evnt)
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
const clearEvent: VxeInputEvents.Clear = (params) => {
|
|
605
|
+
const { $event } = params
|
|
606
|
+
clearValueEvent($event, null)
|
|
607
|
+
hideOptionPanel($event)
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const allCheckedPanelEvent: VxeButtonEvents.Click = (params) => {
|
|
611
|
+
const { $event } = params
|
|
612
|
+
const { multiple, autoClose, checkedClosable } = props
|
|
613
|
+
const $tree = refTree.value
|
|
614
|
+
if (multiple) {
|
|
615
|
+
if ($tree) {
|
|
616
|
+
$tree.setAllCheckboxNode(true).then(({ checkNodeKeys, checkNodes }) => {
|
|
617
|
+
changeEvent($event, checkNodeKeys, checkNodes[0])
|
|
618
|
+
dispatchEvent('all-change', { value: checkNodeKeys }, $event)
|
|
619
|
+
if (XEUtils.isBoolean(checkedClosable) ? checkedClosable : autoClose) {
|
|
620
|
+
hideOptionPanel($event)
|
|
621
|
+
}
|
|
622
|
+
})
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const clearCheckedPanelEvent: VxeButtonEvents.Click = (params) => {
|
|
628
|
+
const { $event } = params
|
|
629
|
+
const { multiple, autoClose, clearClosable } = props
|
|
630
|
+
const $tree = refTree.value
|
|
631
|
+
if ($tree) {
|
|
632
|
+
const value = multiple ? [] : null
|
|
633
|
+
$tree.clearCheckboxNode().then(() => {
|
|
634
|
+
if (XEUtils.isBoolean(clearClosable) ? clearClosable : autoClose) {
|
|
635
|
+
hideOptionPanel($event)
|
|
636
|
+
}
|
|
637
|
+
})
|
|
638
|
+
changeEvent($event, value, null)
|
|
639
|
+
dispatchEvent('clear', { value }, $event)
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
const closePanelEvent: VxeButtonEvents.Click = (params) => {
|
|
644
|
+
const { $event } = params
|
|
645
|
+
hideOptionPanel($event)
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const allExpandPanelEvent: VxeButtonEvents.Click = () => {
|
|
649
|
+
const $tree = refTree.value
|
|
650
|
+
if ($tree) {
|
|
651
|
+
$tree.setAllExpandNode(true)
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const clearExpandPanelEvent: VxeButtonEvents.Click = () => {
|
|
656
|
+
const $tree = refTree.value
|
|
657
|
+
if ($tree) {
|
|
658
|
+
$tree.clearAllExpandNode()
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const handleGlobalMousedownEvent = (evnt: MouseEvent) => {
|
|
663
|
+
const { visiblePanel } = reactData
|
|
664
|
+
const isDisabled = computeIsDisabled.value
|
|
665
|
+
if (!isDisabled) {
|
|
666
|
+
const el = refElem.value
|
|
667
|
+
const panelElem = refOptionPanel.value
|
|
668
|
+
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag
|
|
669
|
+
if (visiblePanel && !reactData.isActivated) {
|
|
670
|
+
hideOptionPanel(evnt)
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
const handleGlobalBlurEvent = (evnt: Event) => {
|
|
676
|
+
const { visiblePanel, isActivated } = reactData
|
|
677
|
+
if (visiblePanel) {
|
|
678
|
+
hideOptionPanel(evnt)
|
|
679
|
+
}
|
|
680
|
+
if (isActivated) {
|
|
681
|
+
reactData.isActivated = false
|
|
682
|
+
}
|
|
683
|
+
if (visiblePanel || isActivated) {
|
|
684
|
+
const $input = refInput.value
|
|
685
|
+
if ($input) {
|
|
686
|
+
$input.blur()
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
const handleGlobalResizeEvent = () => {
|
|
692
|
+
const { visiblePanel } = reactData
|
|
693
|
+
if (visiblePanel) {
|
|
694
|
+
updatePlacement()
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const handleGlobalScrollEvent = () => {
|
|
699
|
+
const { visiblePanel } = reactData
|
|
700
|
+
if (visiblePanel) {
|
|
701
|
+
updatePlacement()
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const handleFocusSearch = () => {
|
|
706
|
+
if (props.filterable) {
|
|
707
|
+
nextTick(() => {
|
|
708
|
+
const inpSearch = refInpSearch.value
|
|
709
|
+
if (inpSearch) {
|
|
710
|
+
inpSearch.focus()
|
|
711
|
+
}
|
|
712
|
+
})
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const focusEvent = (evnt: FocusEvent) => {
|
|
717
|
+
const isDisabled = computeIsDisabled.value
|
|
718
|
+
if (!isDisabled) {
|
|
719
|
+
if (!reactData.visiblePanel) {
|
|
720
|
+
reactData.triggerFocusPanel = true
|
|
721
|
+
showOptionPanel(evnt)
|
|
722
|
+
setTimeout(() => {
|
|
723
|
+
reactData.triggerFocusPanel = false
|
|
724
|
+
}, 150)
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
dispatchEvent('focus', {}, evnt)
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
const clickEvent = (evnt: MouseEvent) => {
|
|
731
|
+
togglePanelEvent(evnt)
|
|
732
|
+
dispatchEvent('click', {}, evnt)
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
const blurEvent = (evnt: FocusEvent) => {
|
|
736
|
+
reactData.isActivated = false
|
|
737
|
+
dispatchEvent('blur', {}, evnt)
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
const modelSearchEvent = (value: string) => {
|
|
741
|
+
reactData.searchValue = value
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
const handleSearchEvent = () => {
|
|
745
|
+
const { modelValue, remote, remoteMethod } = props
|
|
746
|
+
const { searchValue } = reactData
|
|
747
|
+
const remoteOpts = computeRemoteOpts.value
|
|
748
|
+
const queryMethod = remoteOpts.queryMethod || remoteMethod
|
|
749
|
+
if (remote && queryMethod && remoteOpts.enabled) {
|
|
750
|
+
reactData.searchLoading = true
|
|
751
|
+
Promise.resolve(queryMethod({ $treeSelect: $xeTreeSelect, searchValue, value: modelValue }))
|
|
752
|
+
.then(() => nextTick())
|
|
753
|
+
.catch(() => nextTick())
|
|
754
|
+
.finally(() => {
|
|
755
|
+
reactData.searchLoading = false
|
|
756
|
+
})
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const togglePanelEvent = (params: any) => {
|
|
761
|
+
const { $event } = params
|
|
762
|
+
$event.preventDefault()
|
|
763
|
+
if (reactData.triggerFocusPanel) {
|
|
764
|
+
reactData.triggerFocusPanel = false
|
|
765
|
+
} else {
|
|
766
|
+
if (reactData.visiblePanel) {
|
|
767
|
+
hideOptionPanel($event)
|
|
768
|
+
} else {
|
|
769
|
+
showOptionPanel($event)
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const nodeExpandEvent = () => {
|
|
775
|
+
updatePlacement()
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
const nodeClickEvent: VxeTreeEvents.NodeClick = (params) => {
|
|
779
|
+
const { $event } = params
|
|
780
|
+
dispatchEvent('node-click', params, $event)
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const radioChangeEvent: VxeTreeEvents.RadioChange = (params) => {
|
|
784
|
+
const { value, $event, node } = params
|
|
785
|
+
changeEvent($event, value, node)
|
|
786
|
+
hideOptionPanel($event)
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const checkboxChangeEvent: VxeTreeEvents.CheckboxChange = (params) => {
|
|
790
|
+
const { value, $event, node } = params
|
|
791
|
+
changeEvent($event, value, node)
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const loadSuccessEvent = () => {
|
|
795
|
+
cacheDataMap()
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
const treeSelectPrivateMethods: TreeSelectPrivateMethods = {}
|
|
799
|
+
|
|
800
|
+
Object.assign($xeTreeSelect, treeSelectMethods, treeSelectPrivateMethods)
|
|
801
|
+
|
|
802
|
+
const renderVN = () => {
|
|
803
|
+
const { className, modelValue, multiple, options, loading, menuConfig, filterable, showTotalButton, showCheckedButton, showClearButton, showExpandButton, showCloseButton } = props
|
|
804
|
+
const { initialized, isActivated, isAniVisible, visiblePanel, searchValue } = reactData
|
|
805
|
+
const vSize = computeSize.value
|
|
806
|
+
const isDisabled = computeIsDisabled.value
|
|
807
|
+
const selectLabel = computeSelectLabel.value
|
|
808
|
+
const btnTransfer = computeBtnTransfer.value
|
|
809
|
+
const formReadonly = computeFormReadonly.value
|
|
810
|
+
const popupWrapperStyle = computePopupWrapperStyle.value
|
|
811
|
+
const headerSlot = slots.header
|
|
812
|
+
const footerSlot = slots.footer
|
|
813
|
+
const prefixSlot = slots.prefix
|
|
814
|
+
const popupOpts = computePopupOpts.value
|
|
815
|
+
const { appendTo } = popupOpts
|
|
816
|
+
const ppClassName = popupOpts.className || props.popupClassName
|
|
817
|
+
|
|
818
|
+
if (formReadonly) {
|
|
819
|
+
return h(
|
|
820
|
+
'div',
|
|
821
|
+
{
|
|
822
|
+
ref: refElem,
|
|
823
|
+
class: ['vxe-tree-select--readonly', className]
|
|
824
|
+
},
|
|
825
|
+
[
|
|
826
|
+
h(
|
|
827
|
+
'span',
|
|
828
|
+
{
|
|
829
|
+
class: 'vxe-tree-select-label'
|
|
830
|
+
},
|
|
831
|
+
selectLabel
|
|
832
|
+
)
|
|
833
|
+
]
|
|
834
|
+
)
|
|
835
|
+
}
|
|
836
|
+
const treeOpts = computeTreeOpts.value
|
|
837
|
+
const menuOpts = computeMenuOpts.value
|
|
838
|
+
const treeNodeOpts = computeTreeNodeOpts.value
|
|
839
|
+
const treeCheckboxOpts = computeTreeCheckboxOpts.value
|
|
840
|
+
const treeRadioOpts = computeTreeRadioOpts.value
|
|
841
|
+
const nodeKeyField = computeNodeKeyField.value
|
|
842
|
+
const labelField = computeLabelField.value
|
|
843
|
+
const valueField = computeValueField.value
|
|
844
|
+
const childrenField = computeChildrenField.value
|
|
845
|
+
const nodeParentField = computeNodeParentField.value
|
|
846
|
+
const hasChildField = computeHasChildField.value
|
|
847
|
+
const virtualYOpts = computeVirtualYOpts.value
|
|
848
|
+
const filterOpts = computeFilterOpts.value
|
|
849
|
+
const { slots: treeSlots } = treeOpts
|
|
850
|
+
const selectVals = XEUtils.eqNull(modelValue) ? [] : XEUtils.isArray(modelValue) ? modelValue : [modelValue]
|
|
851
|
+
const treeScopedSlots: {
|
|
852
|
+
icon?: (params: any) => VNode[]
|
|
853
|
+
title?: (params: any) => VNode[]
|
|
854
|
+
extra?: (params: any) => VNode[]
|
|
855
|
+
} = {}
|
|
856
|
+
if (treeSlots) {
|
|
857
|
+
const { icon: treeIconSlot, title: treeTitleSlot, extra: treeExtraSlot } = treeSlots
|
|
858
|
+
if (treeIconSlot) {
|
|
859
|
+
treeScopedSlots.icon = (slotParams) => callSlot(treeIconSlot, slotParams) as VNode[]
|
|
860
|
+
}
|
|
861
|
+
if (treeTitleSlot) {
|
|
862
|
+
treeScopedSlots.title = (slotParams) => callSlot(treeTitleSlot, slotParams) as VNode[]
|
|
863
|
+
}
|
|
864
|
+
if (treeExtraSlot) {
|
|
865
|
+
treeScopedSlots.extra = (slotParams) => callSlot(treeExtraSlot, slotParams) as VNode[]
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return h(
|
|
869
|
+
'div',
|
|
870
|
+
{
|
|
871
|
+
ref: refElem,
|
|
872
|
+
class: [
|
|
873
|
+
'vxe-tree-select',
|
|
874
|
+
className ? (XEUtils.isFunction(className) ? className({ $treeSelect: $xeTreeSelect }) : className) : '',
|
|
875
|
+
{
|
|
876
|
+
[`size--${vSize}`]: vSize,
|
|
877
|
+
'is--filterable': filterable,
|
|
878
|
+
'is--visible': visiblePanel,
|
|
879
|
+
'is--disabled': isDisabled,
|
|
880
|
+
'is--loading': loading,
|
|
881
|
+
'is--active': isActivated
|
|
882
|
+
}
|
|
883
|
+
]
|
|
884
|
+
},
|
|
885
|
+
[
|
|
886
|
+
h(
|
|
887
|
+
VxeInputComponent,
|
|
888
|
+
{
|
|
889
|
+
ref: refInput,
|
|
890
|
+
clearable: props.clearable,
|
|
891
|
+
placeholder: loading ? getI18n('vxe.select.loadingText') : props.placeholder,
|
|
892
|
+
editable: false,
|
|
893
|
+
disabled: isDisabled,
|
|
894
|
+
type: 'text',
|
|
895
|
+
prefixIcon: props.prefixIcon,
|
|
896
|
+
suffixIcon: loading ? getIcon().TREE_SELECT_LOADED : visiblePanel ? getIcon().TREE_SELECT_OPEN : getIcon().TREE_SELECT_CLOSE,
|
|
897
|
+
modelValue: loading ? '' : selectLabel,
|
|
898
|
+
title: selectLabel,
|
|
899
|
+
onClear: clearEvent,
|
|
900
|
+
onClick: clickEvent,
|
|
901
|
+
onFocus: focusEvent,
|
|
902
|
+
onBlur: blurEvent,
|
|
903
|
+
onSuffixClick: togglePanelEvent
|
|
904
|
+
},
|
|
905
|
+
prefixSlot
|
|
906
|
+
? {
|
|
907
|
+
prefix: () => prefixSlot({})
|
|
908
|
+
}
|
|
909
|
+
: {}
|
|
910
|
+
),
|
|
911
|
+
h(
|
|
912
|
+
Teleport,
|
|
913
|
+
{
|
|
914
|
+
to: getPopupContainer(appendTo),
|
|
915
|
+
disabled: btnTransfer ? !initialized : true
|
|
916
|
+
},
|
|
917
|
+
[
|
|
918
|
+
h(
|
|
919
|
+
'div',
|
|
920
|
+
{
|
|
921
|
+
ref: refOptionPanel,
|
|
922
|
+
class: [
|
|
923
|
+
'vxe-table--ignore-clear vxe-tree-select--panel',
|
|
924
|
+
ppClassName ? (XEUtils.isFunction(ppClassName) ? ppClassName({ $treeSelect: $xeTreeSelect }) : ppClassName) : '',
|
|
925
|
+
{
|
|
926
|
+
[`size--${vSize}`]: vSize,
|
|
927
|
+
'is--transfer': btnTransfer,
|
|
928
|
+
'ani--leave': !loading && isAniVisible,
|
|
929
|
+
'ani--enter': !loading && visiblePanel
|
|
930
|
+
}
|
|
931
|
+
],
|
|
932
|
+
placement: reactData.panelPlacement,
|
|
933
|
+
style: reactData.panelStyle
|
|
934
|
+
},
|
|
935
|
+
initialized
|
|
936
|
+
? [
|
|
937
|
+
h(
|
|
938
|
+
'div',
|
|
939
|
+
{
|
|
940
|
+
class: 'vxe-tree-select--panel-wrapper'
|
|
941
|
+
},
|
|
942
|
+
[
|
|
943
|
+
filterable
|
|
944
|
+
? h(
|
|
945
|
+
'div',
|
|
946
|
+
{
|
|
947
|
+
class: 'vxe-tree-select--panel-search'
|
|
948
|
+
},
|
|
949
|
+
[
|
|
950
|
+
h(VxeInputComponent, {
|
|
951
|
+
ref: refInpSearch,
|
|
952
|
+
class: 'vxe-tree-select-search--input',
|
|
953
|
+
modelValue: searchValue,
|
|
954
|
+
clearable: true,
|
|
955
|
+
disabled: false,
|
|
956
|
+
readonly: false,
|
|
957
|
+
placeholder: getI18n('vxe.treeSelect.search'),
|
|
958
|
+
prefixIcon: getIcon().INPUT_SEARCH,
|
|
959
|
+
'onUpdate:modelValue': modelSearchEvent
|
|
960
|
+
})
|
|
961
|
+
]
|
|
962
|
+
)
|
|
963
|
+
: renderEmptyElement($xeTreeSelect),
|
|
964
|
+
(showCheckedButton && multiple) || showClearButton || showExpandButton || headerSlot
|
|
965
|
+
? h(
|
|
966
|
+
'div',
|
|
967
|
+
{
|
|
968
|
+
class: 'vxe-tree-select--panel-header'
|
|
969
|
+
},
|
|
970
|
+
headerSlot
|
|
971
|
+
? headerSlot({})
|
|
972
|
+
: [
|
|
973
|
+
h(
|
|
974
|
+
'div',
|
|
975
|
+
{
|
|
976
|
+
class: 'vxe-tree-select--header-button'
|
|
977
|
+
},
|
|
978
|
+
[
|
|
979
|
+
(showCheckedButton && multiple) || showClearButton
|
|
980
|
+
? h(
|
|
981
|
+
'div',
|
|
982
|
+
{
|
|
983
|
+
class: 'vxe-tree-select--selected-btns'
|
|
984
|
+
},
|
|
985
|
+
[
|
|
986
|
+
showCheckedButton && multiple
|
|
987
|
+
? h(VxeButtonComponent, {
|
|
988
|
+
content: getI18n('vxe.treeSelect.allChecked'),
|
|
989
|
+
mode: 'text',
|
|
990
|
+
onClick: allCheckedPanelEvent
|
|
991
|
+
})
|
|
992
|
+
: renderEmptyElement($xeTreeSelect),
|
|
993
|
+
showClearButton
|
|
994
|
+
? h(VxeButtonComponent, {
|
|
995
|
+
content: getI18n('vxe.treeSelect.clearChecked'),
|
|
996
|
+
mode: 'text',
|
|
997
|
+
onClick: clearCheckedPanelEvent
|
|
998
|
+
})
|
|
999
|
+
: renderEmptyElement($xeTreeSelect)
|
|
1000
|
+
]
|
|
1001
|
+
)
|
|
1002
|
+
: renderEmptyElement($xeTreeSelect),
|
|
1003
|
+
showExpandButton
|
|
1004
|
+
? h(
|
|
1005
|
+
'div',
|
|
1006
|
+
{
|
|
1007
|
+
class: 'vxe-tree-select--expand-btns'
|
|
1008
|
+
},
|
|
1009
|
+
[
|
|
1010
|
+
h(VxeButtonComponent, {
|
|
1011
|
+
content: getI18n('vxe.treeSelect.allExpand'),
|
|
1012
|
+
mode: 'text',
|
|
1013
|
+
onClick: allExpandPanelEvent
|
|
1014
|
+
}),
|
|
1015
|
+
h(VxeButtonComponent, {
|
|
1016
|
+
content: getI18n('vxe.treeSelect.clearExpand'),
|
|
1017
|
+
mode: 'text',
|
|
1018
|
+
onClick: clearExpandPanelEvent
|
|
1019
|
+
})
|
|
1020
|
+
]
|
|
1021
|
+
)
|
|
1022
|
+
: renderEmptyElement($xeTreeSelect)
|
|
1023
|
+
]
|
|
1024
|
+
)
|
|
1025
|
+
]
|
|
1026
|
+
)
|
|
1027
|
+
: renderEmptyElement($xeTreeSelect),
|
|
1028
|
+
h(
|
|
1029
|
+
'div',
|
|
1030
|
+
{
|
|
1031
|
+
class: 'vxe-tree-select--panel-body'
|
|
1032
|
+
},
|
|
1033
|
+
[
|
|
1034
|
+
h(
|
|
1035
|
+
'div',
|
|
1036
|
+
{
|
|
1037
|
+
ref: refTreeWrapper,
|
|
1038
|
+
class: 'vxe-tree-select-tree--wrapper',
|
|
1039
|
+
style: popupWrapperStyle
|
|
1040
|
+
},
|
|
1041
|
+
[
|
|
1042
|
+
h(
|
|
1043
|
+
VxeTreeComponent,
|
|
1044
|
+
{
|
|
1045
|
+
ref: refTree,
|
|
1046
|
+
class: 'vxe-tree-select--tree',
|
|
1047
|
+
height: popupOpts.height ? '100%' : treeOpts.height,
|
|
1048
|
+
minHeight: treeOpts.minHeight,
|
|
1049
|
+
maxHeight: popupOpts.height ? '' : treeOpts.maxHeight,
|
|
1050
|
+
autoResize: true,
|
|
1051
|
+
data: options,
|
|
1052
|
+
indent: treeOpts.indent,
|
|
1053
|
+
showRadio: !multiple,
|
|
1054
|
+
radioConfig: treeRadioOpts,
|
|
1055
|
+
checkNodeKey: multiple ? null : modelValue,
|
|
1056
|
+
showCheckbox: !!multiple,
|
|
1057
|
+
checkNodeKeys: multiple ? modelValue : null,
|
|
1058
|
+
checkboxConfig: treeCheckboxOpts,
|
|
1059
|
+
titleField: labelField,
|
|
1060
|
+
valueField: valueField,
|
|
1061
|
+
keyField: nodeKeyField,
|
|
1062
|
+
childrenField: treeOpts.childrenField || childrenField,
|
|
1063
|
+
parentField: nodeParentField,
|
|
1064
|
+
hasChildField: treeOpts.hasChildField || hasChildField,
|
|
1065
|
+
accordion: treeOpts.accordion,
|
|
1066
|
+
expandAll: treeOpts.expandAll,
|
|
1067
|
+
expandNodeKeys: treeOpts.expandNodeKeys,
|
|
1068
|
+
nodeConfig: treeNodeOpts,
|
|
1069
|
+
lazy: treeOpts.lazy,
|
|
1070
|
+
loadMethod: treeOpts.loadMethod,
|
|
1071
|
+
toggleMethod: treeOpts.toggleMethod,
|
|
1072
|
+
transform: treeOpts.transform,
|
|
1073
|
+
rootParentValue: treeOpts.rootParentValue,
|
|
1074
|
+
rootValues: treeOpts.rootValues,
|
|
1075
|
+
trigger: treeOpts.trigger,
|
|
1076
|
+
showIcon: treeOpts.showIcon,
|
|
1077
|
+
showLine: treeOpts.showLine,
|
|
1078
|
+
iconOpen: treeOpts.iconOpen,
|
|
1079
|
+
iconLoaded: treeOpts.iconLoaded,
|
|
1080
|
+
iconClose: treeOpts.iconClose,
|
|
1081
|
+
filterValue: searchValue,
|
|
1082
|
+
filterConfig: filterOpts,
|
|
1083
|
+
menuConfig: menuConfig ? menuOpts : undefined,
|
|
1084
|
+
virtualYConfig: virtualYOpts,
|
|
1085
|
+
onNodeExpand: nodeExpandEvent,
|
|
1086
|
+
onNodeClick: nodeClickEvent,
|
|
1087
|
+
onRadioChange: radioChangeEvent,
|
|
1088
|
+
onCheckboxChange: checkboxChangeEvent,
|
|
1089
|
+
onLoadSuccess: loadSuccessEvent
|
|
1090
|
+
},
|
|
1091
|
+
treeScopedSlots
|
|
1092
|
+
)
|
|
1093
|
+
]
|
|
1094
|
+
)
|
|
1095
|
+
]
|
|
1096
|
+
),
|
|
1097
|
+
footerSlot || showTotalButton || showCloseButton
|
|
1098
|
+
? h(
|
|
1099
|
+
'div',
|
|
1100
|
+
{
|
|
1101
|
+
class: 'vxe-tree-select--panel-footer'
|
|
1102
|
+
},
|
|
1103
|
+
footerSlot
|
|
1104
|
+
? footerSlot({})
|
|
1105
|
+
: [
|
|
1106
|
+
h(
|
|
1107
|
+
'div',
|
|
1108
|
+
{
|
|
1109
|
+
class: 'vxe-tree-select--footer-button'
|
|
1110
|
+
},
|
|
1111
|
+
[
|
|
1112
|
+
showTotalButton
|
|
1113
|
+
? h(
|
|
1114
|
+
'div',
|
|
1115
|
+
{
|
|
1116
|
+
class: 'vxe-tree-select--total-btns'
|
|
1117
|
+
},
|
|
1118
|
+
getI18n('vxe.treeSelect.total', [selectVals.length])
|
|
1119
|
+
)
|
|
1120
|
+
: renderEmptyElement($xeTreeSelect),
|
|
1121
|
+
showCloseButton
|
|
1122
|
+
? h(
|
|
1123
|
+
'div',
|
|
1124
|
+
{
|
|
1125
|
+
class: 'vxe-tree-select--oper-btns'
|
|
1126
|
+
},
|
|
1127
|
+
[
|
|
1128
|
+
h(VxeButtonComponent, {
|
|
1129
|
+
content: getI18n('vxe.select.close'),
|
|
1130
|
+
mode: 'text',
|
|
1131
|
+
onClick: closePanelEvent
|
|
1132
|
+
})
|
|
1133
|
+
]
|
|
1134
|
+
)
|
|
1135
|
+
: renderEmptyElement($xeTreeSelect)
|
|
1136
|
+
]
|
|
1137
|
+
)
|
|
1138
|
+
]
|
|
1139
|
+
)
|
|
1140
|
+
: renderEmptyElement($xeTreeSelect)
|
|
1141
|
+
]
|
|
1142
|
+
)
|
|
1143
|
+
]
|
|
1144
|
+
: []
|
|
1145
|
+
)
|
|
1146
|
+
]
|
|
1147
|
+
)
|
|
1148
|
+
]
|
|
1149
|
+
)
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
const optFlag = ref(0)
|
|
1153
|
+
watch(
|
|
1154
|
+
() => (props.options ? props.options.length : -1),
|
|
1155
|
+
() => {
|
|
1156
|
+
optFlag.value++
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
watch(
|
|
1160
|
+
() => props.options,
|
|
1161
|
+
() => {
|
|
1162
|
+
optFlag.value++
|
|
1163
|
+
}
|
|
1164
|
+
)
|
|
1165
|
+
watch(optFlag, () => {
|
|
1166
|
+
cacheDataMap()
|
|
1167
|
+
})
|
|
1168
|
+
|
|
1169
|
+
const lazyOptFlag = ref(0)
|
|
1170
|
+
watch(
|
|
1171
|
+
() => (props.lazyOptions ? props.lazyOptions.length : -1),
|
|
1172
|
+
() => {
|
|
1173
|
+
lazyOptFlag.value++
|
|
1174
|
+
}
|
|
1175
|
+
)
|
|
1176
|
+
watch(
|
|
1177
|
+
() => props.lazyOptions,
|
|
1178
|
+
() => {
|
|
1179
|
+
lazyOptFlag.value++
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
watch(lazyOptFlag, () => {
|
|
1183
|
+
cacheLazyDataMap()
|
|
1184
|
+
})
|
|
1185
|
+
|
|
1186
|
+
cacheDataMap()
|
|
1187
|
+
cacheLazyDataMap()
|
|
1188
|
+
|
|
1189
|
+
onMounted(() => {
|
|
1190
|
+
if (XEUtils.isBoolean(props.autoClose)) {
|
|
1191
|
+
warnLog('vxe.error.delProp', ['auto-close', 'checked-closable | clear-closable'])
|
|
1192
|
+
}
|
|
1193
|
+
globalEvents.on($xeTreeSelect, 'mousedown', handleGlobalMousedownEvent)
|
|
1194
|
+
globalEvents.on($xeTreeSelect, 'blur', handleGlobalBlurEvent)
|
|
1195
|
+
globalEvents.on($xeTreeSelect, 'resize', handleGlobalResizeEvent)
|
|
1196
|
+
globalEvents.on($xeTreeSelect, 'scroll', handleGlobalScrollEvent)
|
|
1197
|
+
})
|
|
1198
|
+
|
|
1199
|
+
onBeforeUnmount(() => {
|
|
1200
|
+
globalEvents.off($xeTreeSelect, 'mousedown')
|
|
1201
|
+
globalEvents.off($xeTreeSelect, 'blur')
|
|
1202
|
+
globalEvents.off($xeTreeSelect, 'resize')
|
|
1203
|
+
globalEvents.off($xeTreeSelect, 'scroll')
|
|
1204
|
+
XEUtils.assign(reactData, createReactData())
|
|
1205
|
+
XEUtils.assign(internalData, createInternalData())
|
|
1206
|
+
})
|
|
1207
|
+
|
|
1208
|
+
provide('$xeTreeSelect', $xeTreeSelect)
|
|
1209
|
+
|
|
1210
|
+
$xeTreeSelect.renderVN = renderVN
|
|
1211
|
+
|
|
1212
|
+
return $xeTreeSelect
|
|
1213
|
+
},
|
|
1214
|
+
render() {
|
|
1215
|
+
return this.renderVN()
|
|
1216
|
+
}
|
|
1217
|
+
})
|