vxe-pc-ui 4.20.34 → 4.20.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +45718 -45038
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +307 -1
- package/dist/style.mini.css +1 -1
- package/es/alert/src/alert.js +117 -114
- package/es/anchor/src/anchor-link.js +110 -107
- package/es/anchor/src/anchor.js +212 -209
- package/es/avatar/src/avatar.js +132 -129
- package/es/backtop/src/backtop.js +267 -264
- package/es/badge/src/badge.js +102 -99
- package/es/breadcrumb/src/breadcrumb-item.js +104 -101
- package/es/breadcrumb/src/breadcrumb.js +70 -67
- package/es/button/src/button-group.js +88 -85
- package/es/calendar/src/calendar.js +1371 -1368
- package/es/card/src/card.js +235 -232
- package/es/carousel/src/carousel-item.js +78 -75
- package/es/carousel/src/carousel.js +392 -389
- package/es/cascader/src/cascader.js +1667 -1664
- package/es/checkbox/src/button.js +198 -195
- package/es/checkbox/src/checkbox.js +181 -178
- package/es/checkbox/src/group.js +210 -207
- package/es/collapse/src/collapse-pane.js +98 -95
- package/es/collapse/src/collapse.js +340 -337
- package/es/color-picker/src/color-picker.js +1116 -1113
- package/es/components.d.ts +1 -0
- package/es/components.js +3 -0
- package/es/context-menu/src/context-menu.js +601 -598
- package/es/countdown/src/countdown.js +224 -221
- package/es/date-panel/src/date-panel.js +1905 -1902
- package/es/date-picker/src/date-picker.js +1537 -1534
- package/es/date-range-picker/src/date-range-picker.js +1412 -1409
- package/es/divider/src/divider.js +80 -77
- package/es/drawer/src/drawer.js +778 -775
- package/es/empty/src/empty.js +100 -97
- package/es/form/src/form-group.js +74 -71
- package/es/form/src/form-item.js +76 -73
- package/es/form/src/form.js +789 -786
- package/es/icon/src/icon.js +59 -56
- package/es/icon/style.css +1 -1
- package/es/icon/style.mini.css +1 -1
- package/es/icon-picker/src/icon-picker.js +719 -716
- package/es/image/src/group.js +130 -127
- package/es/image/src/image.js +243 -240
- package/es/image/src/preview.js +627 -624
- package/es/index.esm.js +2 -0
- package/es/index.js +2 -0
- package/es/input/src/input.js +2700 -2697
- package/es/layout-aside/src/layout-aside.js +138 -135
- package/es/layout-body/src/layout-body.js +145 -142
- package/es/layout-container/src/layout-container.js +71 -68
- package/es/layout-footer/src/layout-footer.js +60 -57
- package/es/layout-header/src/layout-header.js +58 -55
- package/es/link/src/link.js +131 -128
- package/es/list/src/list.js +2174 -2171
- package/es/loading/src/loading.js +141 -138
- package/es/mention/src/mention.js +49 -46
- package/es/menu/src/menu.js +799 -796
- package/es/modal/src/modal.js +1519 -1527
- package/es/notice-bar/src/notice-bar.js +168 -165
- package/es/number-input/src/number-input.js +1094 -1091
- package/es/pager/src/pager.js +767 -764
- package/es/password-input/src/password-input.js +431 -428
- package/es/print/src/page-break.js +63 -60
- package/es/print/src/print.js +303 -300
- package/es/pulldown/src/pulldown.js +403 -400
- package/es/radio/src/button.js +214 -211
- package/es/radio/src/group.js +195 -192
- package/es/radio/src/radio.js +194 -191
- package/es/rate/src/rate.js +164 -161
- package/es/result/src/result.js +116 -113
- package/es/row/src/col.js +133 -130
- package/es/row/src/row.js +111 -108
- package/es/scrollbar/src/scrollbar.js +518 -515
- package/es/segmented/src/segmented.js +240 -237
- package/es/select/src/optgroup.js +44 -41
- package/es/select/src/option.js +39 -36
- package/es/select/src/select.js +1914 -1896
- package/es/slider/src/slider.js +419 -416
- package/es/space/src/space.js +190 -187
- package/es/splitter/src/splitter-panel.js +146 -143
- package/es/splitter/src/splitter.js +917 -914
- package/es/step-item/index.d.ts +76 -0
- package/es/step-item/index.js +17 -0
- package/es/steps/index.d.ts +288 -34
- package/es/steps/src/step-info.d.ts +6 -0
- package/es/steps/src/step-info.js +20 -0
- package/es/steps/src/step-item.d.ts +14 -0
- package/es/steps/src/step-item.js +39 -0
- package/es/steps/src/steps.d.ts +68 -8
- package/es/steps/src/steps.js +299 -47
- package/es/steps/src/util.d.ts +7 -0
- package/es/steps/src/util.js +44 -0
- package/es/steps/style.css +297 -0
- package/es/steps/style.mini.css +1 -0
- package/es/style.css +307 -1
- package/es/style.mini.css +1 -1
- package/es/switch/src/switch.js +228 -225
- package/es/table-select/src/table-select.js +865 -862
- package/es/table-transfer/src/table-transfer.js +61 -58
- package/es/tabs/src/tab-pane.js +102 -99
- package/es/tabs/src/tabs.js +936 -933
- package/es/tag/src/tag.js +163 -160
- package/es/text/src/text.js +232 -229
- package/es/text-ellipsis/src/text-ellipsis.js +252 -249
- package/es/textarea/src/textarea.js +434 -431
- package/es/timeline/src/timeline.js +74 -36
- package/es/timeline/src/util.js +7 -4
- package/es/tip/src/tip.js +117 -114
- package/es/tooltip/src/tooltip.js +552 -549
- package/es/tour/src/tour.js +49 -46
- package/es/transfer/src/transfer.js +95 -92
- package/es/tree/src/tree.js +3379 -3376
- package/es/tree-select/src/tree-select.js +969 -966
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +1791 -1788
- package/es/vxe-icon/style.css +1 -1
- package/es/vxe-icon/style.mini.css +1 -1
- package/es/vxe-steps/style.css +297 -0
- package/es/vxe-steps/style.mini.css +1 -0
- package/es/watermark/src/watermark.js +158 -155
- package/lib/alert/src/alert.js +117 -114
- package/lib/anchor/src/anchor-link.js +110 -107
- package/lib/anchor/src/anchor.js +212 -209
- package/lib/avatar/src/avatar.js +132 -129
- package/lib/backtop/src/backtop.js +267 -264
- package/lib/badge/src/badge.js +102 -99
- package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
- package/lib/breadcrumb/src/breadcrumb.js +70 -67
- package/lib/button/src/button-group.js +88 -85
- package/lib/calendar/src/calendar.js +1371 -1368
- package/lib/card/src/card.js +235 -232
- package/lib/carousel/src/carousel-item.js +78 -75
- package/lib/carousel/src/carousel.js +392 -389
- package/lib/cascader/src/cascader.js +1665 -1662
- package/lib/checkbox/src/button.js +198 -195
- package/lib/checkbox/src/checkbox.js +181 -178
- package/lib/checkbox/src/group.js +210 -207
- package/lib/collapse/src/collapse-pane.js +98 -95
- package/lib/collapse/src/collapse.js +340 -337
- package/lib/color-picker/src/color-picker.js +1116 -1113
- package/lib/components.js +3 -0
- package/lib/context-menu/src/context-menu.js +601 -598
- package/lib/countdown/src/countdown.js +224 -221
- package/lib/date-panel/src/date-panel.js +1905 -1902
- package/lib/date-picker/src/date-picker.js +1537 -1534
- package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
- package/lib/divider/src/divider.js +80 -77
- package/lib/drawer/src/drawer.js +778 -775
- package/lib/empty/src/empty.js +100 -97
- package/lib/form/src/form-group.js +74 -71
- package/lib/form/src/form-item.js +76 -73
- package/lib/form/src/form.js +789 -786
- package/lib/icon/src/icon.js +59 -56
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.mini.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +719 -716
- package/lib/image/src/group.js +130 -127
- package/lib/image/src/image.js +243 -240
- package/lib/image/src/preview.js +627 -624
- package/lib/index.common.js +2 -0
- package/lib/index.js +2 -0
- package/lib/index.umd.js +47411 -46732
- package/lib/index.umd.min.js +3 -3
- package/lib/input/src/input.js +2700 -2697
- package/lib/layout-aside/src/layout-aside.js +138 -135
- package/lib/layout-body/src/layout-body.js +145 -142
- package/lib/layout-container/src/layout-container.js +71 -68
- package/lib/layout-footer/src/layout-footer.js +60 -57
- package/lib/layout-header/src/layout-header.js +58 -55
- package/lib/link/src/link.js +131 -128
- package/lib/list/src/list.js +2173 -2170
- package/lib/loading/src/loading.js +141 -138
- package/lib/mention/src/mention.js +49 -46
- package/lib/menu/src/menu.js +799 -796
- package/lib/modal/src/modal.js +1519 -1527
- package/lib/notice-bar/src/notice-bar.js +168 -165
- package/lib/number-input/src/number-input.js +1094 -1091
- package/lib/pager/src/pager.js +767 -764
- package/lib/password-input/src/password-input.js +431 -428
- package/lib/print/src/page-break.js +63 -60
- package/lib/print/src/print.js +303 -300
- package/lib/pulldown/src/pulldown.js +403 -400
- package/lib/radio/src/button.js +214 -211
- package/lib/radio/src/group.js +195 -192
- package/lib/radio/src/radio.js +194 -191
- package/lib/rate/src/rate.js +164 -161
- package/lib/result/src/result.js +116 -113
- package/lib/row/src/col.js +133 -130
- package/lib/row/src/row.js +111 -108
- package/lib/scrollbar/src/scrollbar.js +518 -515
- package/lib/segmented/src/segmented.js +240 -237
- package/lib/select/src/optgroup.js +44 -41
- package/lib/select/src/option.js +39 -36
- package/lib/select/src/select.js +1915 -1897
- package/lib/slider/src/slider.js +419 -416
- package/lib/space/src/space.js +190 -187
- package/lib/splitter/src/splitter-panel.js +146 -143
- package/lib/splitter/src/splitter.js +917 -914
- package/lib/step-item/index.js +47 -0
- package/lib/steps/src/step-info.js +49 -0
- package/lib/steps/src/step-item.js +59 -0
- package/lib/steps/src/steps.js +298 -46
- package/lib/steps/src/util.js +74 -0
- package/lib/steps/style/style.css +297 -0
- package/lib/steps/style/style.mini.css +1 -0
- package/lib/style.css +307 -1
- package/lib/style.mini.css +1 -1
- package/lib/switch/src/switch.js +228 -225
- package/lib/table-select/src/table-select.js +865 -862
- package/lib/table-transfer/src/table-transfer.js +61 -58
- package/lib/tabs/src/tab-pane.js +102 -99
- package/lib/tabs/src/tabs.js +936 -933
- package/lib/tag/src/tag.js +163 -160
- package/lib/text/src/text.js +232 -229
- package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
- package/lib/textarea/src/textarea.js +434 -431
- package/lib/timeline/src/timeline.js +74 -36
- package/lib/timeline/src/util.js +7 -4
- package/lib/tip/src/tip.js +117 -114
- package/lib/tooltip/src/tooltip.js +552 -549
- package/lib/tour/src/tour.js +49 -46
- package/lib/transfer/src/transfer.js +95 -92
- package/lib/tree/src/tree.js +3379 -3376
- package/lib/tree-select/src/tree-select.js +969 -966
- package/lib/ui/index.js +8 -2
- package/lib/ui/src/log.js +1 -1
- package/lib/upload/src/upload.js +1788 -1785
- package/lib/vxe-icon/style/style.css +1 -1
- package/lib/vxe-icon/style/style.mini.css +1 -1
- package/lib/vxe-steps/style/style.css +297 -0
- package/lib/vxe-steps/style/style.mini.css +1 -0
- package/lib/watermark/src/watermark.js +158 -155
- package/package.json +1 -1
- package/packages/alert/src/alert.ts +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/avatar/src/avatar.ts +2 -2
- package/packages/backtop/src/backtop.ts +2 -2
- package/packages/badge/src/badge.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +2 -2
- package/packages/calendar/src/calendar.ts +2 -2
- package/packages/card/src/card.ts +2 -2
- package/packages/carousel/src/carousel-item.ts +2 -2
- package/packages/carousel/src/carousel.ts +2 -2
- package/packages/cascader/src/cascader.ts +2 -2
- package/packages/checkbox/src/button.ts +3 -15
- package/packages/checkbox/src/checkbox.ts +2 -2
- package/packages/checkbox/src/group.ts +2 -2
- package/packages/collapse/src/collapse-pane.ts +2 -2
- package/packages/collapse/src/collapse.ts +2 -2
- package/packages/color-picker/src/color-picker.ts +2 -2
- package/packages/components.ts +3 -0
- package/packages/context-menu/src/context-menu.ts +3 -16
- package/packages/countdown/src/countdown.ts +2 -2
- package/packages/date-panel/src/date-panel.ts +2 -2
- package/packages/date-picker/src/date-picker.ts +2 -2
- package/packages/date-range-picker/src/date-range-picker.ts +2 -2
- package/packages/divider/src/divider.ts +2 -2
- package/packages/drawer/src/drawer.ts +2 -2
- package/packages/empty/src/empty.ts +2 -2
- package/packages/form/src/form-group.ts +2 -2
- package/packages/form/src/form-item.ts +2 -2
- package/packages/form/src/form.ts +2 -2
- package/packages/icon/src/icon.ts +2 -2
- package/packages/icon-picker/src/icon-picker.ts +2 -2
- package/packages/image/src/group.ts +2 -2
- package/packages/image/src/image.ts +2 -2
- package/packages/image/src/preview.ts +3 -16
- package/packages/index.ts +2 -2
- package/packages/input/src/input.ts +2 -2
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/layout-body/src/layout-body.ts +2 -2
- package/packages/layout-container/src/layout-container.ts +3 -14
- package/packages/layout-footer/src/layout-footer.ts +2 -2
- package/packages/layout-header/src/layout-header.ts +2 -2
- package/packages/link/src/link.ts +2 -2
- package/packages/list/src/list.ts +2 -2
- package/packages/loading/src/loading.ts +2 -2
- package/packages/mention/src/mention.ts +2 -2
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +5 -20
- package/packages/notice-bar/src/notice-bar.ts +2 -2
- package/packages/number-input/src/number-input.ts +3 -17
- package/packages/pager/src/pager.ts +2 -2
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +2 -2
- package/packages/print/src/print.ts +2 -2
- package/packages/pulldown/src/pulldown.ts +2 -2
- package/packages/radio/src/button.ts +3 -16
- package/packages/radio/src/group.ts +3 -17
- package/packages/radio/src/radio.ts +2 -2
- package/packages/rate/src/rate.ts +2 -2
- package/packages/result/src/result.ts +2 -2
- package/packages/row/src/col.ts +2 -2
- package/packages/row/src/row.ts +2 -2
- package/packages/scrollbar/src/scrollbar.ts +3 -4
- package/packages/segmented/src/segmented.ts +2 -2
- package/packages/select/src/optgroup.ts +2 -2
- package/packages/select/src/option.ts +2 -2
- package/packages/select/src/select.ts +33 -19
- package/packages/slider/src/slider.ts +2 -2
- package/packages/space/src/space.ts +2 -2
- package/packages/splitter/src/splitter-panel.ts +2 -2
- package/packages/splitter/src/splitter.ts +2 -2
- package/packages/step-item/index.ts +16 -0
- package/packages/steps/src/step-info.ts +18 -0
- package/packages/steps/src/step-item.ts +41 -0
- package/packages/steps/src/steps.ts +273 -13
- package/packages/steps/src/util.ts +44 -0
- package/packages/switch/src/switch.ts +2 -2
- package/packages/table-select/src/table-select.ts +2 -2
- package/packages/table-transfer/src/table-transfer.ts +3 -15
- package/packages/tabs/src/tab-pane.ts +2 -2
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tag/src/tag.ts +2 -2
- package/packages/text/src/text.ts +2 -2
- package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
- package/packages/textarea/src/textarea.ts +2 -2
- package/packages/timeline/src/timeline-info.ts +17 -17
- package/packages/timeline/src/timeline.ts +93 -49
- package/packages/timeline/src/util.ts +44 -41
- package/packages/tip/src/tip.ts +2 -2
- package/packages/tooltip/src/tooltip.ts +2 -2
- package/packages/tour/src/tour.ts +2 -2
- package/packages/transfer/src/transfer.ts +2 -2
- package/packages/tree/src/tree.ts +2 -2
- package/packages/tree-select/src/tree-select.ts +2 -2
- package/packages/ui/index.ts +8 -1
- package/packages/upload/src/upload.ts +2 -2
- package/packages/watermark/src/watermark.ts +2 -2
- package/styles/all.scss +1 -0
- package/styles/components/step-item.scss +0 -0
- package/styles/components/steps.scss +354 -0
- package/styles/theme/base.scss +9 -0
- package/types/all.d.ts +3 -0
- package/types/components/gantt.d.ts +1 -3
- package/types/components/select.d.ts +1 -13
- package/types/components/step-item.d.ts +72 -0
- package/types/components/steps.d.ts +67 -8
- package/types/components/table.d.ts +7 -66
- package/types/handles/form-design.d.ts +1 -4
- package/types/ui/global-config.d.ts +2 -0
- package/types/ui/global-icon.d.ts +7 -0
- /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
package/es/drawer/src/drawer.js
CHANGED
|
@@ -10,827 +10,830 @@ import VxeButtonComponent from "../../button";
|
|
|
10
10
|
import VxeLoadingComponent from "../../loading";
|
|
11
11
|
import VxeScrollbarComponent from "../../scrollbar";
|
|
12
12
|
const { getIcon, getConfig, getI18n, useFns, globalEvents, GLOBAL_EVENT_KEYS, createEvent, renderEmptyElement } = VxeUI;
|
|
13
|
-
var drawer_default =
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
13
|
+
var drawer_default = (
|
|
14
|
+
/* define-vxe-component start */
|
|
15
|
+
defineVxeComponent({
|
|
16
|
+
name: "VxeDrawer",
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: Boolean,
|
|
19
|
+
id: String,
|
|
20
|
+
title: String,
|
|
21
|
+
loading: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
className: String,
|
|
26
|
+
position: {
|
|
27
|
+
type: [String, Object],
|
|
28
|
+
default: () => getConfig().drawer.position
|
|
29
|
+
},
|
|
30
|
+
lockView: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: () => getConfig().drawer.lockView
|
|
33
|
+
},
|
|
34
|
+
lockScroll: Boolean,
|
|
35
|
+
mask: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: () => getConfig().drawer.mask
|
|
38
|
+
},
|
|
39
|
+
maskClosable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: () => getConfig().drawer.maskClosable
|
|
42
|
+
},
|
|
43
|
+
escClosable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: () => getConfig().drawer.escClosable
|
|
46
|
+
},
|
|
47
|
+
cancelClosable: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: () => getConfig().drawer.cancelClosable
|
|
50
|
+
},
|
|
51
|
+
confirmClosable: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: () => getConfig().drawer.confirmClosable
|
|
54
|
+
},
|
|
55
|
+
showHeader: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: () => getConfig().drawer.showHeader
|
|
58
|
+
},
|
|
59
|
+
showFooter: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: () => getConfig().drawer.showFooter
|
|
62
|
+
},
|
|
63
|
+
showClose: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: () => getConfig().drawer.showClose
|
|
66
|
+
},
|
|
67
|
+
content: [Number, String],
|
|
68
|
+
useHtml: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: () => getConfig().drawer.useHtml
|
|
71
|
+
},
|
|
72
|
+
showCancelButton: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
cancelButtonText: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: () => getConfig().drawer.cancelButtonText
|
|
79
|
+
},
|
|
80
|
+
showConfirmButton: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: () => getConfig().drawer.showConfirmButton
|
|
83
|
+
},
|
|
84
|
+
confirmButtonText: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: () => getConfig().drawer.confirmButtonText
|
|
87
|
+
},
|
|
88
|
+
destroyOnClose: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: () => getConfig().drawer.destroyOnClose
|
|
91
|
+
},
|
|
92
|
+
showTitleOverflow: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: () => getConfig().drawer.showTitleOverflow
|
|
95
|
+
},
|
|
96
|
+
preload: Boolean,
|
|
97
|
+
width: {
|
|
98
|
+
type: [Number, String],
|
|
99
|
+
default: () => getConfig().drawer.width
|
|
100
|
+
},
|
|
101
|
+
height: {
|
|
102
|
+
type: [Number, String],
|
|
103
|
+
default: () => getConfig().drawer.height
|
|
104
|
+
},
|
|
105
|
+
minWidth: {
|
|
106
|
+
type: [Number, String],
|
|
107
|
+
default: () => getConfig().drawer.minWidth
|
|
108
|
+
},
|
|
109
|
+
minHeight: {
|
|
110
|
+
type: [Number, String],
|
|
111
|
+
default: () => getConfig().drawer.minHeight
|
|
112
|
+
},
|
|
113
|
+
resize: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: () => getConfig().drawer.resize
|
|
116
|
+
},
|
|
117
|
+
border: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: () => getConfig().drawer.border
|
|
120
|
+
},
|
|
121
|
+
showTitleBackground: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: () => getConfig().drawer.showTitleBackground
|
|
124
|
+
},
|
|
125
|
+
zIndex: Number,
|
|
126
|
+
transfer: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: () => getConfig().drawer.transfer
|
|
129
|
+
},
|
|
130
|
+
appendTo: {
|
|
131
|
+
type: [String, Function],
|
|
132
|
+
default: () => getConfig().drawer.appendTo
|
|
133
|
+
},
|
|
134
|
+
isWithinAppendTo: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: () => getConfig().drawer.isWithinAppendTo
|
|
137
|
+
},
|
|
138
|
+
padding: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: () => getConfig().drawer.padding
|
|
141
|
+
},
|
|
142
|
+
size: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: () => getConfig().drawer.size || getConfig().size
|
|
145
|
+
},
|
|
146
|
+
beforeHideMethod: Function,
|
|
147
|
+
slots: Object,
|
|
148
|
+
useScrollbar: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
default: () => getDefaultConfig(getConfig().drawer.useScrollbar, getConfig().useScrollbar)
|
|
151
|
+
},
|
|
152
|
+
scrollbarConfig: Object
|
|
149
153
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
154
|
+
emits: ["update:modelValue", "show", "hide", "before-hide", "close", "confirm", "cancel", "resize"],
|
|
155
|
+
setup(props, context) {
|
|
156
|
+
const { slots, emit } = context;
|
|
157
|
+
const xID = XEUtils.uniqueId();
|
|
158
|
+
const $xeModal = inject("$xeModal", null);
|
|
159
|
+
const $xeParentDrawer = inject("$xeDrawer", null);
|
|
160
|
+
const $xeTable = inject("$xeTable", null);
|
|
161
|
+
const $xeForm = inject("$xeForm", null);
|
|
162
|
+
const { computeSize } = useFns.useSize(props);
|
|
163
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
164
|
+
const refElem = ref();
|
|
165
|
+
const refDrawerBox = ref();
|
|
166
|
+
const refConfirmBtn = ref();
|
|
167
|
+
const refCancelBtn = ref();
|
|
168
|
+
const reactData = reactive({
|
|
169
|
+
initialized: false,
|
|
170
|
+
visible: false,
|
|
171
|
+
contentVisible: false,
|
|
172
|
+
drawerZIndex: 0,
|
|
173
|
+
resizeFlag: 1
|
|
174
|
+
});
|
|
175
|
+
const defaultFuncProps = {
|
|
176
|
+
beforeHideMethod: getConfig().drawer.beforeHideMethod
|
|
177
|
+
};
|
|
178
|
+
const refMaps = {
|
|
179
|
+
refElem
|
|
180
|
+
};
|
|
181
|
+
const computeBtnTransfer = computed(() => {
|
|
182
|
+
const { transfer } = props;
|
|
183
|
+
if (transfer === null) {
|
|
184
|
+
const globalTransfer = getConfig().modal.transfer;
|
|
185
|
+
if (XEUtils.isBoolean(globalTransfer)) {
|
|
186
|
+
return globalTransfer;
|
|
187
|
+
}
|
|
188
|
+
if ($xeTable || $xeModal || $xeParentDrawer || $xeForm) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
185
191
|
}
|
|
186
|
-
|
|
187
|
-
|
|
192
|
+
return transfer;
|
|
193
|
+
});
|
|
194
|
+
const computeDragType = computed(() => {
|
|
195
|
+
switch (props.position) {
|
|
196
|
+
case "top":
|
|
197
|
+
return "sb";
|
|
198
|
+
case "bottom":
|
|
199
|
+
return "st";
|
|
200
|
+
case "left":
|
|
201
|
+
return "wr";
|
|
188
202
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
viewClassName: "vxe-drawer--scrollbar-content-view" + (viewClassName ? " " + viewClassName : ""),
|
|
219
|
-
viewInnerClassName: "vxe-drawer--scrollbar-content-inner" + (viewClassName ? " " + viewInnerClassName : "")
|
|
203
|
+
return "wl";
|
|
204
|
+
});
|
|
205
|
+
const computeScrollbarOpts = computed(() => {
|
|
206
|
+
return Object.assign({}, getConfig().modal.scrollbarConfig, props.scrollbarConfig);
|
|
207
|
+
});
|
|
208
|
+
const computeScrollbarProps = computed(() => {
|
|
209
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
210
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts;
|
|
211
|
+
return {
|
|
212
|
+
width: scrollbarOpts.width,
|
|
213
|
+
height: scrollbarOpts.height,
|
|
214
|
+
autoHide: scrollbarOpts.autoHide,
|
|
215
|
+
visible: scrollbarOpts.visible,
|
|
216
|
+
xConfig: scrollbarOpts.xConfig,
|
|
217
|
+
yConfig: scrollbarOpts.yConfig,
|
|
218
|
+
className: scrollbarOpts.className,
|
|
219
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
220
|
+
viewClassName: "vxe-drawer--scrollbar-content-view" + (viewClassName ? " " + viewClassName : ""),
|
|
221
|
+
viewInnerClassName: "vxe-drawer--scrollbar-content-inner" + (viewClassName ? " " + viewInnerClassName : "")
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
const computeMaps = {};
|
|
225
|
+
const $xeDrawer = {
|
|
226
|
+
xID,
|
|
227
|
+
props,
|
|
228
|
+
context,
|
|
229
|
+
reactData,
|
|
230
|
+
getRefMaps: () => refMaps,
|
|
231
|
+
getComputeMaps: () => computeMaps
|
|
220
232
|
};
|
|
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
|
-
const closeDrawer = (type) => {
|
|
260
|
-
const { visible } = reactData;
|
|
261
|
-
const beHideMethod = props.beforeHideMethod || defaultFuncProps.beforeHideMethod;
|
|
262
|
-
const params = { type };
|
|
263
|
-
if (visible) {
|
|
264
|
-
Promise.resolve(beHideMethod ? beHideMethod(params) : null).then((rest) => {
|
|
265
|
-
if (!XEUtils.isError(rest)) {
|
|
266
|
-
const el = refElem.value;
|
|
267
|
-
if (el) {
|
|
268
|
-
el.setAttribute("data-effect", "y");
|
|
269
|
-
}
|
|
270
|
-
reactData.contentVisible = false;
|
|
271
|
-
removeActiveQueue();
|
|
272
|
-
dispatchEvent("before-hide", params, null);
|
|
273
|
-
setTimeout(() => {
|
|
274
|
-
reactData.visible = false;
|
|
275
|
-
emit("update:modelValue", false);
|
|
276
|
-
dispatchEvent("hide", params, null);
|
|
277
|
-
}, 200);
|
|
278
|
-
setTimeout(() => {
|
|
279
|
-
const el2 = refElem.value;
|
|
280
|
-
if (el2) {
|
|
281
|
-
el2.removeAttribute("data-effect");
|
|
233
|
+
const getBox = () => {
|
|
234
|
+
const boxElem = refDrawerBox.value;
|
|
235
|
+
return boxElem;
|
|
236
|
+
};
|
|
237
|
+
const recalculate = () => {
|
|
238
|
+
const { position, width, height } = props;
|
|
239
|
+
const boxElem = getBox();
|
|
240
|
+
if (boxElem) {
|
|
241
|
+
const isTb = position === "top" || position === "bottom";
|
|
242
|
+
boxElem.style.height = isTb ? toCssUnit(height) : "";
|
|
243
|
+
boxElem.style.width = isTb ? "" : toCssUnit(width);
|
|
244
|
+
}
|
|
245
|
+
return nextTick();
|
|
246
|
+
};
|
|
247
|
+
const updateZindex = () => {
|
|
248
|
+
const { zIndex } = props;
|
|
249
|
+
const { drawerZIndex } = reactData;
|
|
250
|
+
if (zIndex) {
|
|
251
|
+
reactData.drawerZIndex = zIndex;
|
|
252
|
+
} else if (drawerZIndex < getLastZIndex()) {
|
|
253
|
+
reactData.drawerZIndex = nextZIndex();
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const removeActiveQueue = () => {
|
|
257
|
+
if (allActiveDrawers.indexOf($xeDrawer) > -1) {
|
|
258
|
+
XEUtils.remove(allActiveDrawers, (item) => item === $xeDrawer);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const closeDrawer = (type) => {
|
|
262
|
+
const { visible } = reactData;
|
|
263
|
+
const beHideMethod = props.beforeHideMethod || defaultFuncProps.beforeHideMethod;
|
|
264
|
+
const params = { type };
|
|
265
|
+
if (visible) {
|
|
266
|
+
Promise.resolve(beHideMethod ? beHideMethod(params) : null).then((rest) => {
|
|
267
|
+
if (!XEUtils.isError(rest)) {
|
|
268
|
+
const el = refElem.value;
|
|
269
|
+
if (el) {
|
|
270
|
+
el.setAttribute("data-effect", "y");
|
|
282
271
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
dispatchEvent(type, { type }, evnt);
|
|
306
|
-
if (cancelClosable) {
|
|
272
|
+
reactData.contentVisible = false;
|
|
273
|
+
removeActiveQueue();
|
|
274
|
+
dispatchEvent("before-hide", params, null);
|
|
275
|
+
setTimeout(() => {
|
|
276
|
+
reactData.visible = false;
|
|
277
|
+
emit("update:modelValue", false);
|
|
278
|
+
dispatchEvent("hide", params, null);
|
|
279
|
+
}, 200);
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
const el2 = refElem.value;
|
|
282
|
+
if (el2) {
|
|
283
|
+
el2.removeAttribute("data-effect");
|
|
284
|
+
}
|
|
285
|
+
}, 350);
|
|
286
|
+
}
|
|
287
|
+
}).catch((e) => e);
|
|
288
|
+
}
|
|
289
|
+
return nextTick();
|
|
290
|
+
};
|
|
291
|
+
const closeEvent = (evnt) => {
|
|
292
|
+
const type = "close";
|
|
293
|
+
dispatchEvent(type, { type }, evnt);
|
|
307
294
|
closeDrawer(type);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
reactData.
|
|
295
|
+
};
|
|
296
|
+
const confirmEvent = (evnt) => {
|
|
297
|
+
const { confirmClosable } = props;
|
|
298
|
+
const type = "confirm";
|
|
299
|
+
dispatchEvent(type, { type }, evnt);
|
|
300
|
+
if (confirmClosable) {
|
|
301
|
+
closeDrawer(type);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
const cancelEvent = (evnt) => {
|
|
305
|
+
const { cancelClosable } = props;
|
|
306
|
+
const type = "cancel";
|
|
307
|
+
dispatchEvent(type, { type }, evnt);
|
|
308
|
+
if (cancelClosable) {
|
|
309
|
+
closeDrawer(type);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const openDrawer = () => {
|
|
313
|
+
const { showFooter } = props;
|
|
314
|
+
const { initialized, visible } = reactData;
|
|
315
|
+
if (!initialized) {
|
|
316
|
+
reactData.initialized = true;
|
|
317
|
+
}
|
|
318
|
+
if (!visible) {
|
|
319
|
+
reactData.visible = true;
|
|
320
|
+
reactData.contentVisible = false;
|
|
321
|
+
updateZindex();
|
|
322
|
+
allActiveDrawers.push($xeDrawer);
|
|
330
323
|
nextTick(() => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const operBtn = confirmBtn || cancelBtn;
|
|
335
|
-
if (operBtn) {
|
|
336
|
-
operBtn.focus();
|
|
337
|
-
}
|
|
324
|
+
const el = refElem.value;
|
|
325
|
+
if (el) {
|
|
326
|
+
el.setAttribute("data-effect", "y");
|
|
338
327
|
}
|
|
339
|
-
const type = "";
|
|
340
|
-
const params = { type };
|
|
341
|
-
emit("update:modelValue", true);
|
|
342
|
-
dispatchEvent("show", params, null);
|
|
343
328
|
});
|
|
344
|
-
}, 10);
|
|
345
|
-
setTimeout(() => {
|
|
346
|
-
const el = refElem.value;
|
|
347
|
-
if (el) {
|
|
348
|
-
el.removeAttribute("data-effect");
|
|
349
|
-
}
|
|
350
|
-
}, 350);
|
|
351
|
-
}
|
|
352
|
-
return nextTick();
|
|
353
|
-
};
|
|
354
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
355
|
-
emit(type, createEvent(evnt, { $drawer: $xeDrawer }, params));
|
|
356
|
-
};
|
|
357
|
-
const drawerMethods = {
|
|
358
|
-
dispatchEvent,
|
|
359
|
-
open: openDrawer,
|
|
360
|
-
close() {
|
|
361
|
-
return closeDrawer("close");
|
|
362
|
-
},
|
|
363
|
-
getBox
|
|
364
|
-
};
|
|
365
|
-
const selfClickEvent = (evnt) => {
|
|
366
|
-
const el = refElem.value;
|
|
367
|
-
if (props.maskClosable && evnt.target === el) {
|
|
368
|
-
const type = "mask";
|
|
369
|
-
closeDrawer(type);
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
const handleGlobalKeydownEvent = (evnt) => {
|
|
373
|
-
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
374
|
-
if (isEsc) {
|
|
375
|
-
const lastDrawer = XEUtils.max(allActiveDrawers, (item) => item.reactData.drawerZIndex);
|
|
376
|
-
if (lastDrawer) {
|
|
377
329
|
setTimeout(() => {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
330
|
+
recalculate();
|
|
331
|
+
reactData.contentVisible = true;
|
|
332
|
+
nextTick(() => {
|
|
333
|
+
if (showFooter) {
|
|
334
|
+
const confirmBtn = refConfirmBtn.value;
|
|
335
|
+
const cancelBtn = refCancelBtn.value;
|
|
336
|
+
const operBtn = confirmBtn || cancelBtn;
|
|
337
|
+
if (operBtn) {
|
|
338
|
+
operBtn.focus();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const type = "";
|
|
342
|
+
const params = { type };
|
|
343
|
+
emit("update:modelValue", true);
|
|
344
|
+
dispatchEvent("show", params, null);
|
|
345
|
+
});
|
|
383
346
|
}, 10);
|
|
347
|
+
setTimeout(() => {
|
|
348
|
+
const el = refElem.value;
|
|
349
|
+
if (el) {
|
|
350
|
+
el.removeAttribute("data-effect");
|
|
351
|
+
}
|
|
352
|
+
}, 350);
|
|
384
353
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const offsetTop = boxElem.offsetTop;
|
|
416
|
-
const offsetLeft = boxElem.offsetLeft;
|
|
417
|
-
const params = { type: "resize" };
|
|
418
|
-
document.onmousemove = (evnt2) => {
|
|
419
|
-
evnt2.preventDefault();
|
|
420
|
-
let dragLeft;
|
|
421
|
-
let dragTop;
|
|
422
|
-
let width;
|
|
423
|
-
let height;
|
|
424
|
-
switch (type) {
|
|
425
|
-
case "wl":
|
|
426
|
-
dragLeft = disX - evnt2.clientX;
|
|
427
|
-
width = dragLeft + clientWidth;
|
|
428
|
-
if (offsetLeft - dragLeft > marginSize) {
|
|
429
|
-
if (width > minWidth) {
|
|
430
|
-
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
354
|
+
return nextTick();
|
|
355
|
+
};
|
|
356
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
357
|
+
emit(type, createEvent(evnt, { $drawer: $xeDrawer }, params));
|
|
358
|
+
};
|
|
359
|
+
const drawerMethods = {
|
|
360
|
+
dispatchEvent,
|
|
361
|
+
open: openDrawer,
|
|
362
|
+
close() {
|
|
363
|
+
return closeDrawer("close");
|
|
364
|
+
},
|
|
365
|
+
getBox
|
|
366
|
+
};
|
|
367
|
+
const selfClickEvent = (evnt) => {
|
|
368
|
+
const el = refElem.value;
|
|
369
|
+
if (props.maskClosable && evnt.target === el) {
|
|
370
|
+
const type = "mask";
|
|
371
|
+
closeDrawer(type);
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const handleGlobalKeydownEvent = (evnt) => {
|
|
375
|
+
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
376
|
+
if (isEsc) {
|
|
377
|
+
const lastDrawer = XEUtils.max(allActiveDrawers, (item) => item.reactData.drawerZIndex);
|
|
378
|
+
if (lastDrawer) {
|
|
379
|
+
setTimeout(() => {
|
|
380
|
+
if (lastDrawer === $xeDrawer && lastDrawer.props.escClosable) {
|
|
381
|
+
const type = "exit";
|
|
382
|
+
dispatchEvent("close", { type }, evnt);
|
|
383
|
+
closeDrawer(type);
|
|
431
384
|
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
385
|
+
}, 10);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
const boxMousedownEvent = () => {
|
|
390
|
+
const { drawerZIndex } = reactData;
|
|
391
|
+
if (allActiveDrawers.some((comp) => comp.reactData.visible && comp.reactData.drawerZIndex > drawerZIndex)) {
|
|
392
|
+
updateZindex();
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const dragEvent = (evnt) => {
|
|
396
|
+
evnt.preventDefault();
|
|
397
|
+
const { resize, isWithinAppendTo } = props;
|
|
398
|
+
const el = refElem.value;
|
|
399
|
+
const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo ? el : document.body);
|
|
400
|
+
if (!parentWrapperEl) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const visibleWidth = parentWrapperEl.clientWidth - (resize && isWithinAppendTo ? 8 : 0);
|
|
404
|
+
const visibleHeight = parentWrapperEl.clientHeight - (resize && isWithinAppendTo ? 8 : 0);
|
|
405
|
+
const marginSize = 0;
|
|
406
|
+
const targetElem = evnt.target;
|
|
407
|
+
const type = targetElem.getAttribute("type");
|
|
408
|
+
const minWidth = XEUtils.toNumber(props.minWidth);
|
|
409
|
+
const minHeight = XEUtils.toNumber(props.minHeight);
|
|
410
|
+
const maxWidth = visibleWidth;
|
|
411
|
+
const maxHeight = visibleHeight;
|
|
412
|
+
const boxElem = getBox();
|
|
413
|
+
const clientWidth = boxElem.clientWidth;
|
|
414
|
+
const clientHeight = boxElem.clientHeight;
|
|
415
|
+
const disX = evnt.clientX;
|
|
416
|
+
const disY = evnt.clientY;
|
|
417
|
+
const offsetTop = boxElem.offsetTop;
|
|
418
|
+
const offsetLeft = boxElem.offsetLeft;
|
|
419
|
+
const params = { type: "resize" };
|
|
420
|
+
document.onmousemove = (evnt2) => {
|
|
421
|
+
evnt2.preventDefault();
|
|
422
|
+
let dragLeft;
|
|
423
|
+
let dragTop;
|
|
424
|
+
let width;
|
|
425
|
+
let height;
|
|
426
|
+
switch (type) {
|
|
427
|
+
case "wl":
|
|
428
|
+
dragLeft = disX - evnt2.clientX;
|
|
429
|
+
width = dragLeft + clientWidth;
|
|
430
|
+
if (offsetLeft - dragLeft > marginSize) {
|
|
431
|
+
if (width > minWidth) {
|
|
432
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
433
|
+
}
|
|
440
434
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
435
|
+
break;
|
|
436
|
+
case "st":
|
|
437
|
+
dragTop = disY - evnt2.clientY;
|
|
438
|
+
height = clientHeight + dragTop;
|
|
439
|
+
if (offsetTop - dragTop > marginSize) {
|
|
440
|
+
if (height > minHeight) {
|
|
441
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
442
|
+
}
|
|
449
443
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
444
|
+
break;
|
|
445
|
+
case "wr":
|
|
446
|
+
dragLeft = evnt2.clientX - disX;
|
|
447
|
+
width = dragLeft + clientWidth;
|
|
448
|
+
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
449
|
+
if (width > minWidth) {
|
|
450
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
451
|
+
}
|
|
458
452
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
453
|
+
break;
|
|
454
|
+
case "sb":
|
|
455
|
+
dragTop = evnt2.clientY - disY;
|
|
456
|
+
height = dragTop + clientHeight;
|
|
457
|
+
if (offsetTop + height + marginSize < visibleHeight) {
|
|
458
|
+
if (height > minHeight) {
|
|
459
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, "") + " is--drag";
|
|
465
|
+
dispatchEvent("resize", params, evnt2);
|
|
466
|
+
reactData.resizeFlag++;
|
|
467
|
+
};
|
|
468
|
+
document.onmouseup = () => {
|
|
469
|
+
document.onmousemove = null;
|
|
470
|
+
document.onmouseup = null;
|
|
471
|
+
reactData.resizeFlag++;
|
|
472
|
+
setTimeout(() => {
|
|
473
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, "");
|
|
474
|
+
}, 50);
|
|
475
|
+
};
|
|
465
476
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
477
|
+
const formDesignPrivateMethods = {};
|
|
478
|
+
Object.assign($xeDrawer, drawerMethods, formDesignPrivateMethods);
|
|
479
|
+
const renderTitles = () => {
|
|
480
|
+
const { slots: propSlots = {}, showClose, title } = props;
|
|
481
|
+
const titleSlot = slots.title || propSlots.title;
|
|
482
|
+
const cornerSlot = slots.corner || propSlots.corner;
|
|
483
|
+
return [
|
|
484
|
+
h(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
class: "vxe-drawer--header-title"
|
|
488
|
+
},
|
|
489
|
+
titleSlot ? getSlotVNs(titleSlot({ $drawer: $xeDrawer })) : title ? getFuncText(title) : getI18n("vxe.alert.title")
|
|
490
|
+
),
|
|
491
|
+
h(
|
|
492
|
+
"div",
|
|
493
|
+
{
|
|
494
|
+
class: "vxe-drawer--header-right"
|
|
495
|
+
},
|
|
496
|
+
[
|
|
497
|
+
cornerSlot ? h(
|
|
498
|
+
"div",
|
|
499
|
+
{
|
|
500
|
+
class: "vxe-drawer--corner-wrapper"
|
|
501
|
+
},
|
|
502
|
+
getSlotVNs(cornerSlot({ $drawer: $xeDrawer }))
|
|
503
|
+
) : renderEmptyElement($xeDrawer),
|
|
504
|
+
showClose ? h(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
class: ["vxe-drawer--close-btn", "trigger--btn"],
|
|
508
|
+
title: getI18n("vxe.drawer.close"),
|
|
509
|
+
onClick: closeEvent
|
|
510
|
+
},
|
|
511
|
+
[
|
|
512
|
+
h("i", {
|
|
513
|
+
class: getIcon().DRAWER_CLOSE
|
|
514
|
+
})
|
|
515
|
+
]
|
|
516
|
+
) : renderEmptyElement($xeDrawer)
|
|
517
|
+
]
|
|
518
|
+
)
|
|
519
|
+
];
|
|
473
520
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
521
|
+
const renderHeader = () => {
|
|
522
|
+
const { slots: propSlots = {}, showTitleOverflow } = props;
|
|
523
|
+
const headerSlot = slots.header || propSlots.header;
|
|
524
|
+
if (props.showHeader) {
|
|
525
|
+
return h(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
class: [
|
|
529
|
+
"vxe-drawer--header",
|
|
530
|
+
{
|
|
531
|
+
"is--ellipsis": showTitleOverflow
|
|
532
|
+
}
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
headerSlot ? getSlotVNs(headerSlot({ $drawer: $xeDrawer })) : renderTitles()
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
return renderEmptyElement($xeDrawer);
|
|
539
|
+
};
|
|
540
|
+
const renderBody = () => {
|
|
541
|
+
const { slots: propSlots = {}, content, useHtml } = props;
|
|
542
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
543
|
+
const scrollbarProps = computeScrollbarProps.value;
|
|
544
|
+
const defaultSlot = slots.default || propSlots.default;
|
|
545
|
+
const leftSlot = slots.left || propSlots.left;
|
|
546
|
+
const rightSlot = slots.right || propSlots.right;
|
|
547
|
+
const contVNs = [];
|
|
548
|
+
if (useHtml && !defaultSlot) {
|
|
549
|
+
contVNs.push(
|
|
550
|
+
isVScrollbar ? h(
|
|
551
|
+
VxeScrollbarComponent,
|
|
552
|
+
{
|
|
553
|
+
key: "shc",
|
|
554
|
+
class: "vxe-drawer--scrollbar-content",
|
|
555
|
+
...scrollbarProps
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
default() {
|
|
559
|
+
return [
|
|
560
|
+
h("div", {
|
|
561
|
+
class: "vxe-drawer--scrollbar-content-html",
|
|
562
|
+
innerHTML: getFuncText(content)
|
|
563
|
+
})
|
|
564
|
+
];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
) : h("div", {
|
|
568
|
+
key: "hc",
|
|
569
|
+
class: "vxe-drawer--content",
|
|
570
|
+
innerHTML: getFuncText(content)
|
|
571
|
+
})
|
|
572
|
+
);
|
|
573
|
+
} else {
|
|
574
|
+
contVNs.push(
|
|
575
|
+
isVScrollbar ? h(
|
|
576
|
+
VxeScrollbarComponent,
|
|
577
|
+
{
|
|
578
|
+
key: "sdc",
|
|
579
|
+
class: "vxe-drawer--scrollbar-content",
|
|
580
|
+
...scrollbarProps
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
default: () => defaultSlot ? getSlotVNs(defaultSlot({ $drawer: $xeDrawer })) : getFuncText(content)
|
|
584
|
+
}
|
|
585
|
+
) : h(
|
|
586
|
+
"div",
|
|
587
|
+
{
|
|
588
|
+
key: "dc",
|
|
589
|
+
class: "vxe-drawer--content"
|
|
590
|
+
},
|
|
591
|
+
defaultSlot ? getSlotVNs(defaultSlot({ $drawer: $xeDrawer })) : getFuncText(content)
|
|
592
|
+
)
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
return h(
|
|
490
596
|
"div",
|
|
491
597
|
{
|
|
492
|
-
class: "vxe-drawer--
|
|
598
|
+
class: "vxe-drawer--body"
|
|
493
599
|
},
|
|
494
600
|
[
|
|
495
|
-
|
|
601
|
+
leftSlot ? h(
|
|
496
602
|
"div",
|
|
497
603
|
{
|
|
498
|
-
class: "vxe-drawer--
|
|
604
|
+
class: "vxe-drawer--body-left"
|
|
499
605
|
},
|
|
500
|
-
getSlotVNs(
|
|
606
|
+
getSlotVNs(leftSlot({ $drawer: $xeDrawer }))
|
|
501
607
|
) : renderEmptyElement($xeDrawer),
|
|
502
|
-
|
|
608
|
+
h(
|
|
503
609
|
"div",
|
|
504
610
|
{
|
|
505
|
-
class:
|
|
506
|
-
title: getI18n("vxe.drawer.close"),
|
|
507
|
-
onClick: closeEvent
|
|
611
|
+
class: "vxe-drawer--body-default"
|
|
508
612
|
},
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
613
|
+
contVNs
|
|
614
|
+
),
|
|
615
|
+
rightSlot ? h(
|
|
616
|
+
"div",
|
|
617
|
+
{
|
|
618
|
+
class: "vxe-drawer--body-right"
|
|
619
|
+
},
|
|
620
|
+
getSlotVNs(rightSlot({ $drawer: $xeDrawer }))
|
|
621
|
+
) : renderEmptyElement($xeDrawer),
|
|
622
|
+
h(VxeLoadingComponent, {
|
|
623
|
+
class: "vxe-drawer--loading",
|
|
624
|
+
modelValue: props.loading
|
|
625
|
+
})
|
|
515
626
|
]
|
|
516
|
-
)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
627
|
+
);
|
|
628
|
+
};
|
|
629
|
+
const renderDefaultFooter = () => {
|
|
630
|
+
const { slots: propSlots = {}, showCancelButton, showConfirmButton, loading } = props;
|
|
631
|
+
const lfSlot = slots.leftfoot || propSlots.leftfoot;
|
|
632
|
+
const rfSlot = slots.rightfoot || propSlots.rightfoot;
|
|
633
|
+
const btnVNs = [];
|
|
634
|
+
if (showCancelButton) {
|
|
635
|
+
btnVNs.push(
|
|
636
|
+
h(VxeButtonComponent, {
|
|
637
|
+
key: 1,
|
|
638
|
+
ref: refCancelBtn,
|
|
639
|
+
content: props.cancelButtonText || getI18n("vxe.button.cancel"),
|
|
640
|
+
onClick: cancelEvent
|
|
641
|
+
})
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
if (showConfirmButton) {
|
|
645
|
+
btnVNs.push(
|
|
646
|
+
h(VxeButtonComponent, {
|
|
647
|
+
key: 2,
|
|
648
|
+
ref: refConfirmBtn,
|
|
649
|
+
loading,
|
|
650
|
+
status: "primary",
|
|
651
|
+
content: props.confirmButtonText || getI18n("vxe.button.confirm"),
|
|
652
|
+
onClick: confirmEvent
|
|
653
|
+
})
|
|
654
|
+
);
|
|
655
|
+
}
|
|
523
656
|
return h(
|
|
524
657
|
"div",
|
|
525
658
|
{
|
|
526
|
-
class:
|
|
527
|
-
"vxe-drawer--header",
|
|
528
|
-
{
|
|
529
|
-
"is--ellipsis": showTitleOverflow
|
|
530
|
-
}
|
|
531
|
-
]
|
|
659
|
+
class: "vxe-drawer--footer-wrapper"
|
|
532
660
|
},
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
VxeScrollbarComponent,
|
|
550
|
-
{
|
|
551
|
-
key: "shc",
|
|
552
|
-
class: "vxe-drawer--scrollbar-content",
|
|
553
|
-
...scrollbarProps
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
default() {
|
|
557
|
-
return [
|
|
558
|
-
h("div", {
|
|
559
|
-
class: "vxe-drawer--scrollbar-content-html",
|
|
560
|
-
innerHTML: getFuncText(content)
|
|
561
|
-
})
|
|
562
|
-
];
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
) : h("div", {
|
|
566
|
-
key: "hc",
|
|
567
|
-
class: "vxe-drawer--content",
|
|
568
|
-
innerHTML: getFuncText(content)
|
|
569
|
-
})
|
|
570
|
-
);
|
|
571
|
-
} else {
|
|
572
|
-
contVNs.push(
|
|
573
|
-
isVScrollbar ? h(
|
|
574
|
-
VxeScrollbarComponent,
|
|
575
|
-
{
|
|
576
|
-
key: "sdc",
|
|
577
|
-
class: "vxe-drawer--scrollbar-content",
|
|
578
|
-
...scrollbarProps
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
default: () => defaultSlot ? getSlotVNs(defaultSlot({ $drawer: $xeDrawer })) : getFuncText(content)
|
|
582
|
-
}
|
|
583
|
-
) : h(
|
|
584
|
-
"div",
|
|
585
|
-
{
|
|
586
|
-
key: "dc",
|
|
587
|
-
class: "vxe-drawer--content"
|
|
588
|
-
},
|
|
589
|
-
defaultSlot ? getSlotVNs(defaultSlot({ $drawer: $xeDrawer })) : getFuncText(content)
|
|
590
|
-
)
|
|
591
|
-
);
|
|
592
|
-
}
|
|
593
|
-
return h(
|
|
594
|
-
"div",
|
|
595
|
-
{
|
|
596
|
-
class: "vxe-drawer--body"
|
|
597
|
-
},
|
|
598
|
-
[
|
|
599
|
-
leftSlot ? h(
|
|
600
|
-
"div",
|
|
601
|
-
{
|
|
602
|
-
class: "vxe-drawer--body-left"
|
|
603
|
-
},
|
|
604
|
-
getSlotVNs(leftSlot({ $drawer: $xeDrawer }))
|
|
605
|
-
) : renderEmptyElement($xeDrawer),
|
|
606
|
-
h(
|
|
607
|
-
"div",
|
|
608
|
-
{
|
|
609
|
-
class: "vxe-drawer--body-default"
|
|
610
|
-
},
|
|
611
|
-
contVNs
|
|
612
|
-
),
|
|
613
|
-
rightSlot ? h(
|
|
614
|
-
"div",
|
|
615
|
-
{
|
|
616
|
-
class: "vxe-drawer--body-right"
|
|
617
|
-
},
|
|
618
|
-
getSlotVNs(rightSlot({ $drawer: $xeDrawer }))
|
|
619
|
-
) : renderEmptyElement($xeDrawer),
|
|
620
|
-
h(VxeLoadingComponent, {
|
|
621
|
-
class: "vxe-drawer--loading",
|
|
622
|
-
modelValue: props.loading
|
|
623
|
-
})
|
|
624
|
-
]
|
|
625
|
-
);
|
|
626
|
-
};
|
|
627
|
-
const renderDefaultFooter = () => {
|
|
628
|
-
const { slots: propSlots = {}, showCancelButton, showConfirmButton, loading } = props;
|
|
629
|
-
const lfSlot = slots.leftfoot || propSlots.leftfoot;
|
|
630
|
-
const rfSlot = slots.rightfoot || propSlots.rightfoot;
|
|
631
|
-
const btnVNs = [];
|
|
632
|
-
if (showCancelButton) {
|
|
633
|
-
btnVNs.push(
|
|
634
|
-
h(VxeButtonComponent, {
|
|
635
|
-
key: 1,
|
|
636
|
-
ref: refCancelBtn,
|
|
637
|
-
content: props.cancelButtonText || getI18n("vxe.button.cancel"),
|
|
638
|
-
onClick: cancelEvent
|
|
639
|
-
})
|
|
640
|
-
);
|
|
641
|
-
}
|
|
642
|
-
if (showConfirmButton) {
|
|
643
|
-
btnVNs.push(
|
|
644
|
-
h(VxeButtonComponent, {
|
|
645
|
-
key: 2,
|
|
646
|
-
ref: refConfirmBtn,
|
|
647
|
-
loading,
|
|
648
|
-
status: "primary",
|
|
649
|
-
content: props.confirmButtonText || getI18n("vxe.button.confirm"),
|
|
650
|
-
onClick: confirmEvent
|
|
651
|
-
})
|
|
661
|
+
[
|
|
662
|
+
h(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
class: "vxe-drawer--footer-left"
|
|
666
|
+
},
|
|
667
|
+
lfSlot ? getSlotVNs(lfSlot({ $drawer: $xeDrawer })) : []
|
|
668
|
+
),
|
|
669
|
+
h(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
class: "vxe-drawer--footer-right"
|
|
673
|
+
},
|
|
674
|
+
rfSlot ? getSlotVNs(rfSlot({ $drawer: $xeDrawer })) : btnVNs
|
|
675
|
+
)
|
|
676
|
+
]
|
|
652
677
|
);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
[
|
|
660
|
-
h(
|
|
661
|
-
"div",
|
|
662
|
-
{
|
|
663
|
-
class: "vxe-drawer--footer-left"
|
|
664
|
-
},
|
|
665
|
-
lfSlot ? getSlotVNs(lfSlot({ $drawer: $xeDrawer })) : []
|
|
666
|
-
),
|
|
667
|
-
h(
|
|
678
|
+
};
|
|
679
|
+
const renderFooter = () => {
|
|
680
|
+
const { slots: propSlots = {} } = props;
|
|
681
|
+
const footerSlot = slots.footer || propSlots.footer;
|
|
682
|
+
if (props.showFooter) {
|
|
683
|
+
return h(
|
|
668
684
|
"div",
|
|
669
685
|
{
|
|
670
|
-
class: "vxe-drawer--footer
|
|
686
|
+
class: "vxe-drawer--footer"
|
|
671
687
|
},
|
|
672
|
-
|
|
673
|
-
)
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
688
|
+
footerSlot ? getSlotVNs(footerSlot({ $drawer: $xeDrawer })) : [renderDefaultFooter()]
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
return renderEmptyElement($xeDrawer);
|
|
692
|
+
};
|
|
693
|
+
const renderVN = () => {
|
|
694
|
+
const { border, showTitleBackground, slots: propSlots = {}, className, position, loading, lockScroll, padding, lockView, mask, resize, appendTo, destroyOnClose, isWithinAppendTo } = props;
|
|
695
|
+
const { initialized, contentVisible, visible } = reactData;
|
|
696
|
+
const asideSlot = slots.aside || propSlots.aside;
|
|
697
|
+
const vSize = computeSize.value;
|
|
698
|
+
const dragType = computeDragType.value;
|
|
699
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
681
700
|
return h(
|
|
682
|
-
|
|
701
|
+
Teleport,
|
|
683
702
|
{
|
|
684
|
-
|
|
703
|
+
to: getPopupContainer(appendTo),
|
|
704
|
+
disabled: btnTransfer ? !initialized : true
|
|
685
705
|
},
|
|
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
|
-
isWithinAppendTo ? "ctx--within" : "ctx--free",
|
|
713
|
-
className || "",
|
|
714
|
-
{
|
|
715
|
-
[`size--${vSize}`]: vSize,
|
|
716
|
-
"is--padding": padding,
|
|
717
|
-
"is--border": border,
|
|
718
|
-
"is--title-bg": showTitleBackground,
|
|
719
|
-
"lock--scroll": lockScroll,
|
|
720
|
-
"lock--view": lockView,
|
|
721
|
-
"is--resize": resize,
|
|
722
|
-
"is--mask": mask,
|
|
723
|
-
"is--visible": contentVisible,
|
|
724
|
-
"is--active": visible,
|
|
725
|
-
"is--loading": loading
|
|
726
|
-
}
|
|
727
|
-
],
|
|
728
|
-
style: {
|
|
729
|
-
zIndex: reactData.drawerZIndex
|
|
730
|
-
},
|
|
731
|
-
onClick: selfClickEvent
|
|
732
|
-
},
|
|
733
|
-
[
|
|
734
|
-
h(
|
|
735
|
-
"div",
|
|
736
|
-
{
|
|
737
|
-
ref: refDrawerBox,
|
|
738
|
-
class: "vxe-drawer--box",
|
|
739
|
-
onMousedown: boxMousedownEvent
|
|
706
|
+
[
|
|
707
|
+
h(
|
|
708
|
+
"div",
|
|
709
|
+
{
|
|
710
|
+
ref: refElem,
|
|
711
|
+
class: [
|
|
712
|
+
"vxe-drawer--wrapper",
|
|
713
|
+
`pos--${position}`,
|
|
714
|
+
isWithinAppendTo ? "ctx--within" : "ctx--free",
|
|
715
|
+
className || "",
|
|
716
|
+
{
|
|
717
|
+
[`size--${vSize}`]: vSize,
|
|
718
|
+
"is--padding": padding,
|
|
719
|
+
"is--border": border,
|
|
720
|
+
"is--title-bg": showTitleBackground,
|
|
721
|
+
"lock--scroll": lockScroll,
|
|
722
|
+
"lock--view": lockView,
|
|
723
|
+
"is--resize": resize,
|
|
724
|
+
"is--mask": mask,
|
|
725
|
+
"is--visible": contentVisible,
|
|
726
|
+
"is--active": visible,
|
|
727
|
+
"is--loading": loading
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
style: {
|
|
731
|
+
zIndex: reactData.drawerZIndex
|
|
740
732
|
},
|
|
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
|
-
|
|
733
|
+
onClick: selfClickEvent
|
|
734
|
+
},
|
|
735
|
+
[
|
|
736
|
+
h(
|
|
737
|
+
"div",
|
|
738
|
+
{
|
|
739
|
+
ref: refDrawerBox,
|
|
740
|
+
class: "vxe-drawer--box",
|
|
741
|
+
onMousedown: boxMousedownEvent
|
|
742
|
+
},
|
|
743
|
+
[
|
|
744
|
+
asideSlot ? h(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
class: "vxe-drawer--aside"
|
|
748
|
+
},
|
|
749
|
+
getSlotVNs(asideSlot({ $drawer: $xeDrawer }))
|
|
750
|
+
) : renderEmptyElement($xeDrawer),
|
|
751
|
+
h(
|
|
752
|
+
"div",
|
|
753
|
+
{
|
|
754
|
+
class: "vxe-drawer--container"
|
|
755
|
+
},
|
|
756
|
+
!reactData.initialized || destroyOnClose && !reactData.visible ? [] : [
|
|
757
|
+
renderHeader(),
|
|
758
|
+
renderBody(),
|
|
759
|
+
renderFooter(),
|
|
760
|
+
resize ? h(
|
|
761
|
+
"span",
|
|
762
|
+
{
|
|
763
|
+
class: "vxe-drawer--resize"
|
|
764
|
+
},
|
|
765
|
+
[
|
|
766
|
+
h("span", {
|
|
767
|
+
class: `${dragType}-resize`,
|
|
768
|
+
type: dragType,
|
|
769
|
+
onMousedown: dragEvent
|
|
770
|
+
})
|
|
771
|
+
]
|
|
772
|
+
) : renderEmptyElement($xeDrawer)
|
|
773
|
+
]
|
|
774
|
+
)
|
|
775
|
+
]
|
|
776
|
+
)
|
|
777
|
+
]
|
|
778
|
+
)
|
|
779
|
+
]
|
|
780
|
+
);
|
|
781
|
+
};
|
|
782
|
+
const reFlag = ref(0);
|
|
783
|
+
watch(
|
|
784
|
+
() => props.width,
|
|
785
|
+
() => {
|
|
786
|
+
reFlag.value++;
|
|
787
|
+
}
|
|
778
788
|
);
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
watch(
|
|
801
|
-
() => props.modelValue,
|
|
802
|
-
(value) => {
|
|
803
|
-
if (value) {
|
|
804
|
-
openDrawer();
|
|
805
|
-
} else {
|
|
806
|
-
closeDrawer("model");
|
|
789
|
+
watch(
|
|
790
|
+
() => props.height,
|
|
791
|
+
() => {
|
|
792
|
+
reFlag.value++;
|
|
793
|
+
}
|
|
794
|
+
);
|
|
795
|
+
watch(
|
|
796
|
+
() => props.position,
|
|
797
|
+
() => {
|
|
798
|
+
reFlag.value++;
|
|
799
|
+
}
|
|
800
|
+
);
|
|
801
|
+
watch(reFlag, recalculate);
|
|
802
|
+
watch(
|
|
803
|
+
() => props.modelValue,
|
|
804
|
+
(value) => {
|
|
805
|
+
if (value) {
|
|
806
|
+
openDrawer();
|
|
807
|
+
} else {
|
|
808
|
+
closeDrawer("model");
|
|
809
|
+
}
|
|
807
810
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
811
|
+
);
|
|
812
|
+
onMounted(() => {
|
|
813
|
+
reactData.initialized = !!props.preload;
|
|
814
|
+
nextTick(() => {
|
|
815
|
+
if (props.modelValue) {
|
|
816
|
+
openDrawer();
|
|
817
|
+
}
|
|
818
|
+
recalculate();
|
|
819
|
+
});
|
|
820
|
+
if (props.escClosable) {
|
|
821
|
+
globalEvents.on($xeDrawer, "keydown", handleGlobalKeydownEvent);
|
|
815
822
|
}
|
|
816
|
-
recalculate();
|
|
817
823
|
});
|
|
818
|
-
|
|
819
|
-
globalEvents.
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
return this.renderVN();
|
|
832
|
-
}
|
|
833
|
-
});
|
|
824
|
+
onUnmounted(() => {
|
|
825
|
+
globalEvents.off($xeDrawer, "keydown");
|
|
826
|
+
removeActiveQueue();
|
|
827
|
+
});
|
|
828
|
+
provide("$xeDrawer", $xeDrawer);
|
|
829
|
+
$xeDrawer.renderVN = renderVN;
|
|
830
|
+
return $xeDrawer;
|
|
831
|
+
},
|
|
832
|
+
render() {
|
|
833
|
+
return this.renderVN();
|
|
834
|
+
}
|
|
835
|
+
})
|
|
836
|
+
);
|
|
834
837
|
export {
|
|
835
838
|
drawer_default as default
|
|
836
839
|
};
|