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/lib/tabs/src/tabs.js
CHANGED
|
@@ -45,1008 +45,1011 @@ const { baseUtils, useFns, createEvent, getConfig, getIcon, globalEvents, permis
|
|
|
45
45
|
const { getDefVal } = baseUtils;
|
|
46
46
|
const { warnLog, errLog } = (0, import_log.createComponentLog)("tabs");
|
|
47
47
|
const scrollbarOffsetSize = 20;
|
|
48
|
-
var tabs_default = (
|
|
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
|
-
|
|
48
|
+
var tabs_default = (
|
|
49
|
+
/* define-vxe-component start */
|
|
50
|
+
(0, import_comp.defineVxeComponent)({
|
|
51
|
+
name: "VxeTabs",
|
|
52
|
+
props: {
|
|
53
|
+
modelValue: [String, Number, Boolean],
|
|
54
|
+
options: Array,
|
|
55
|
+
width: [String, Number],
|
|
56
|
+
height: [String, Number],
|
|
57
|
+
destroyOnClose: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: () => getConfig().tabs.destroyOnClose
|
|
60
|
+
},
|
|
61
|
+
titleWidth: [String, Number],
|
|
62
|
+
titleAlign: [String, Number],
|
|
63
|
+
type: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: () => getConfig().tabs.type
|
|
66
|
+
},
|
|
67
|
+
position: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: () => getConfig().tabs.position
|
|
70
|
+
},
|
|
71
|
+
showClose: Boolean,
|
|
72
|
+
showBody: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true
|
|
75
|
+
},
|
|
76
|
+
padding: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: () => getConfig().tabs.padding
|
|
79
|
+
},
|
|
80
|
+
trigger: String,
|
|
81
|
+
beforeChangeMethod: Function,
|
|
82
|
+
closeConfig: Object,
|
|
83
|
+
refreshConfig: Object,
|
|
84
|
+
size: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: () => getConfig().tabs.size || getConfig().size
|
|
87
|
+
},
|
|
88
|
+
useScrollbar: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: () => getDefVal(getConfig().tabs.useScrollbar, getConfig().useScrollbar)
|
|
91
|
+
},
|
|
92
|
+
scrollbarConfig: Object,
|
|
93
|
+
// 已废弃
|
|
94
|
+
beforeCloseMethod: Function
|
|
89
95
|
},
|
|
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
|
-
cacheTabMaps: {}
|
|
118
|
-
});
|
|
119
|
-
const internalData = {
|
|
120
|
-
slTimeout: void 0
|
|
121
|
-
};
|
|
122
|
-
const refMaps = {
|
|
123
|
-
refElem
|
|
124
|
-
};
|
|
125
|
-
const computeTabType = (0, import_vue.computed)(() => {
|
|
126
|
-
const { type } = props;
|
|
127
|
-
return type || "default";
|
|
128
|
-
});
|
|
129
|
-
const computeTabPosition = (0, import_vue.computed)(() => {
|
|
130
|
-
const { position } = props;
|
|
131
|
-
return position || "top";
|
|
132
|
-
});
|
|
133
|
-
const computeLrPosition = (0, import_vue.computed)(() => {
|
|
134
|
-
const tabPosition = computeTabPosition.value;
|
|
135
|
-
return tabPosition === "left" || tabPosition === "right";
|
|
136
|
-
});
|
|
137
|
-
const computeLineStyle = (0, import_vue.computed)(() => {
|
|
138
|
-
const { lintLeft, lintTop, lintWidth, lintHeight } = reactData;
|
|
139
|
-
const lrPosition = computeLrPosition.value;
|
|
140
|
-
return lrPosition ? {
|
|
141
|
-
top: `${lintTop}px`,
|
|
142
|
-
height: `${lintHeight}px`
|
|
143
|
-
} : {
|
|
144
|
-
left: `${lintLeft}px`,
|
|
145
|
-
width: `${lintWidth}px`
|
|
96
|
+
emits: ["update:modelValue", "change", "tab-change", "tab-change-fail", "tab-close", "tab-close-fail", "tab-click", "tab-load"],
|
|
97
|
+
setup(props, context) {
|
|
98
|
+
const { slots, emit } = context;
|
|
99
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
100
|
+
const $xeParentTabs = (0, import_vue.inject)("$xeTabs", null);
|
|
101
|
+
const { computeSize } = useFns.useSize(props);
|
|
102
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
103
|
+
const refElem = (0, import_vue.ref)();
|
|
104
|
+
const refHeadWrapperElem = (0, import_vue.ref)();
|
|
105
|
+
const refHeadPrevElem = (0, import_vue.ref)();
|
|
106
|
+
const refHeadNextElem = (0, import_vue.ref)();
|
|
107
|
+
const reactData = (0, import_vue.reactive)({
|
|
108
|
+
staticTabs: [],
|
|
109
|
+
activeName: null,
|
|
110
|
+
initNames: [],
|
|
111
|
+
lintLeft: 0,
|
|
112
|
+
lintTop: 0,
|
|
113
|
+
lintWidth: 0,
|
|
114
|
+
lintHeight: 0,
|
|
115
|
+
scrollbarWidth: 0,
|
|
116
|
+
scrollbarHeight: 0,
|
|
117
|
+
isTabOver: false,
|
|
118
|
+
resizeFlag: 1,
|
|
119
|
+
cacheTabMaps: {}
|
|
120
|
+
});
|
|
121
|
+
const internalData = {
|
|
122
|
+
slTimeout: void 0
|
|
146
123
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const { width, height } = props;
|
|
150
|
-
const stys = {};
|
|
151
|
-
if (width) {
|
|
152
|
-
stys.width = (0, import_dom.toCssUnit)(width);
|
|
153
|
-
}
|
|
154
|
-
if (height) {
|
|
155
|
-
stys.height = height === "auto" ? "100%" : (0, import_dom.toCssUnit)(height);
|
|
156
|
-
}
|
|
157
|
-
return stys;
|
|
158
|
-
});
|
|
159
|
-
const computeCloseOpts = (0, import_vue.computed)(() => {
|
|
160
|
-
return Object.assign({}, getConfig().tabs.closeConfig, props.closeConfig);
|
|
161
|
-
});
|
|
162
|
-
const computeRefreshOpts = (0, import_vue.computed)(() => {
|
|
163
|
-
return Object.assign({}, getConfig().tabs.refreshConfig, props.refreshConfig);
|
|
164
|
-
});
|
|
165
|
-
const computeTabOptions = (0, import_vue.computed)(() => {
|
|
166
|
-
const { options } = props;
|
|
167
|
-
return (options || []).filter((item) => handleFilterTab(item));
|
|
168
|
-
});
|
|
169
|
-
const computeTabStaticOptions = (0, import_vue.computed)(() => {
|
|
170
|
-
const { staticTabs } = reactData;
|
|
171
|
-
return staticTabs.filter((item) => handleFilterTab(item));
|
|
172
|
-
});
|
|
173
|
-
const computeParentTabsResizeFlag = (0, import_vue.computed)(() => {
|
|
174
|
-
return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null;
|
|
175
|
-
});
|
|
176
|
-
const computeScrollbarOpts = (0, import_vue.computed)(() => {
|
|
177
|
-
return Object.assign({}, getConfig().tabs.scrollbarConfig, props.scrollbarConfig);
|
|
178
|
-
});
|
|
179
|
-
const computeScrollbarProps = (0, import_vue.computed)(() => {
|
|
180
|
-
const scrollbarOpts = computeScrollbarOpts.value;
|
|
181
|
-
const { viewClassName, viewInnerClassName } = scrollbarOpts;
|
|
182
|
-
return {
|
|
183
|
-
width: scrollbarOpts.width,
|
|
184
|
-
height: scrollbarOpts.height,
|
|
185
|
-
autoHide: scrollbarOpts.autoHide,
|
|
186
|
-
visible: scrollbarOpts.visible,
|
|
187
|
-
xConfig: scrollbarOpts.xConfig,
|
|
188
|
-
yConfig: scrollbarOpts.yConfig,
|
|
189
|
-
className: scrollbarOpts.className,
|
|
190
|
-
viewAttrs: scrollbarOpts.viewAttrs,
|
|
191
|
-
viewClassName: "vxe-tabs-pane--scrollbar-item-view" + (viewClassName ? " " + viewClassName : ""),
|
|
192
|
-
viewInnerClassName: "vxe-tabs-pane--scrollbar-item-inner" + (viewClassName ? " " + viewInnerClassName : "")
|
|
124
|
+
const refMaps = {
|
|
125
|
+
refElem
|
|
193
126
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
127
|
+
const computeTabType = (0, import_vue.computed)(() => {
|
|
128
|
+
const { type } = props;
|
|
129
|
+
return type || "default";
|
|
130
|
+
});
|
|
131
|
+
const computeTabPosition = (0, import_vue.computed)(() => {
|
|
132
|
+
const { position } = props;
|
|
133
|
+
return position || "top";
|
|
134
|
+
});
|
|
135
|
+
const computeLrPosition = (0, import_vue.computed)(() => {
|
|
136
|
+
const tabPosition = computeTabPosition.value;
|
|
137
|
+
return tabPosition === "left" || tabPosition === "right";
|
|
138
|
+
});
|
|
139
|
+
const computeLineStyle = (0, import_vue.computed)(() => {
|
|
140
|
+
const { lintLeft, lintTop, lintWidth, lintHeight } = reactData;
|
|
141
|
+
const lrPosition = computeLrPosition.value;
|
|
142
|
+
return lrPosition ? {
|
|
143
|
+
top: `${lintTop}px`,
|
|
144
|
+
height: `${lintHeight}px`
|
|
145
|
+
} : {
|
|
146
|
+
left: `${lintLeft}px`,
|
|
147
|
+
width: `${lintWidth}px`
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
const computeWrapperStyle = (0, import_vue.computed)(() => {
|
|
151
|
+
const { width, height } = props;
|
|
152
|
+
const stys = {};
|
|
153
|
+
if (width) {
|
|
154
|
+
stys.width = (0, import_dom.toCssUnit)(width);
|
|
217
155
|
}
|
|
218
|
-
if (
|
|
219
|
-
|
|
156
|
+
if (height) {
|
|
157
|
+
stys.height = height === "auto" ? "100%" : (0, import_dom.toCssUnit)(height);
|
|
220
158
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
159
|
+
return stys;
|
|
160
|
+
});
|
|
161
|
+
const computeCloseOpts = (0, import_vue.computed)(() => {
|
|
162
|
+
return Object.assign({}, getConfig().tabs.closeConfig, props.closeConfig);
|
|
163
|
+
});
|
|
164
|
+
const computeRefreshOpts = (0, import_vue.computed)(() => {
|
|
165
|
+
return Object.assign({}, getConfig().tabs.refreshConfig, props.refreshConfig);
|
|
166
|
+
});
|
|
167
|
+
const computeTabOptions = (0, import_vue.computed)(() => {
|
|
168
|
+
const { options } = props;
|
|
169
|
+
return (options || []).filter((item) => handleFilterTab(item));
|
|
170
|
+
});
|
|
171
|
+
const computeTabStaticOptions = (0, import_vue.computed)(() => {
|
|
172
|
+
const { staticTabs } = reactData;
|
|
173
|
+
return staticTabs.filter((item) => handleFilterTab(item));
|
|
174
|
+
});
|
|
175
|
+
const computeParentTabsResizeFlag = (0, import_vue.computed)(() => {
|
|
176
|
+
return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null;
|
|
177
|
+
});
|
|
178
|
+
const computeScrollbarOpts = (0, import_vue.computed)(() => {
|
|
179
|
+
return Object.assign({}, getConfig().tabs.scrollbarConfig, props.scrollbarConfig);
|
|
180
|
+
});
|
|
181
|
+
const computeScrollbarProps = (0, import_vue.computed)(() => {
|
|
182
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
183
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts;
|
|
184
|
+
return {
|
|
185
|
+
width: scrollbarOpts.width,
|
|
186
|
+
height: scrollbarOpts.height,
|
|
187
|
+
autoHide: scrollbarOpts.autoHide,
|
|
188
|
+
visible: scrollbarOpts.visible,
|
|
189
|
+
xConfig: scrollbarOpts.xConfig,
|
|
190
|
+
yConfig: scrollbarOpts.yConfig,
|
|
191
|
+
className: scrollbarOpts.className,
|
|
192
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
193
|
+
viewClassName: "vxe-tabs-pane--scrollbar-item-view" + (viewClassName ? " " + viewClassName : ""),
|
|
194
|
+
viewInnerClassName: "vxe-tabs-pane--scrollbar-item-inner" + (viewClassName ? " " + viewInnerClassName : "")
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
const computeMaps = {};
|
|
198
|
+
const $xeTabs = {
|
|
199
|
+
xID,
|
|
200
|
+
props,
|
|
201
|
+
context,
|
|
202
|
+
reactData,
|
|
203
|
+
getRefMaps: () => refMaps,
|
|
204
|
+
getComputeMaps: () => computeMaps
|
|
205
|
+
};
|
|
206
|
+
const handleFilterTab = (item) => {
|
|
207
|
+
const { permissionCode } = item;
|
|
208
|
+
if (permissionCode) {
|
|
209
|
+
if (!permission.checkVisible(permissionCode)) {
|
|
210
|
+
return false;
|
|
236
211
|
}
|
|
237
212
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
213
|
+
return true;
|
|
214
|
+
};
|
|
215
|
+
const callSlot = (slotFunc, params) => {
|
|
216
|
+
if (slotFunc) {
|
|
217
|
+
if (import_xe_utils.default.isString(slotFunc)) {
|
|
218
|
+
slotFunc = slots[slotFunc] || null;
|
|
219
|
+
}
|
|
220
|
+
if (import_xe_utils.default.isFunction(slotFunc)) {
|
|
221
|
+
return (0, import_vn.getSlotVNs)(slotFunc(params));
|
|
243
222
|
}
|
|
244
223
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const handleStyle = () => {
|
|
249
|
-
const { activeName } = reactData;
|
|
250
|
-
const tabType = computeTabType.value;
|
|
251
|
-
const tabOptions = computeTabOptions.value;
|
|
252
|
-
const tabStaticOptions = computeTabStaticOptions.value;
|
|
253
|
-
const headerWrapperEl = refHeadWrapperElem.value;
|
|
224
|
+
return [];
|
|
225
|
+
};
|
|
226
|
+
const checkScrolling = () => {
|
|
254
227
|
const lrPosition = computeLrPosition.value;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
let lintTop = 0;
|
|
259
|
-
let sBarWidth = 0;
|
|
260
|
-
let sBarHeight = 0;
|
|
261
|
-
let isOver = false;
|
|
228
|
+
const headerWrapperEl = refHeadWrapperElem.value;
|
|
229
|
+
const headPrevEl = refHeadPrevElem.value;
|
|
230
|
+
const headNextEl = refHeadNextElem.value;
|
|
262
231
|
if (headerWrapperEl) {
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
232
|
+
const { scrollLeft, scrollTop, clientWidth, clientHeight, scrollWidth, scrollHeight } = headerWrapperEl;
|
|
233
|
+
if (headPrevEl) {
|
|
234
|
+
if ((lrPosition ? scrollTop : scrollLeft) > 0) {
|
|
235
|
+
(0, import_dom.addClass)(headPrevEl, "scrolling--middle");
|
|
236
|
+
} else {
|
|
237
|
+
(0, import_dom.removeClass)(headPrevEl, "scrolling--middle");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (headNextEl) {
|
|
241
|
+
if (lrPosition ? clientHeight < scrollHeight - Math.ceil(scrollTop) : clientWidth < scrollWidth - Math.ceil(scrollLeft)) {
|
|
242
|
+
(0, import_dom.addClass)(headNextEl, "scrolling--middle");
|
|
243
|
+
} else {
|
|
244
|
+
(0, import_dom.removeClass)(headNextEl, "scrolling--middle");
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const updateTabStyle = () => {
|
|
250
|
+
const handleStyle = () => {
|
|
251
|
+
const { activeName } = reactData;
|
|
252
|
+
const tabType = computeTabType.value;
|
|
253
|
+
const tabOptions = computeTabOptions.value;
|
|
254
|
+
const tabStaticOptions = computeTabStaticOptions.value;
|
|
255
|
+
const headerWrapperEl = refHeadWrapperElem.value;
|
|
256
|
+
const lrPosition = computeLrPosition.value;
|
|
257
|
+
let lintWidth = 0;
|
|
258
|
+
let lintHeight = 0;
|
|
259
|
+
let lintLeft = 0;
|
|
260
|
+
let lintTop = 0;
|
|
261
|
+
let sBarWidth = 0;
|
|
262
|
+
let sBarHeight = 0;
|
|
263
|
+
let isOver = false;
|
|
264
|
+
if (headerWrapperEl) {
|
|
265
|
+
const index = import_xe_utils.default.findIndexOf(tabStaticOptions.length ? tabStaticOptions : tabOptions, (item) => item.name === activeName);
|
|
266
|
+
const { children, offsetWidth, scrollWidth, offsetHeight, scrollHeight, clientWidth, clientHeight } = headerWrapperEl;
|
|
267
|
+
sBarWidth = offsetWidth - clientWidth;
|
|
268
|
+
sBarHeight = offsetHeight - clientHeight;
|
|
269
|
+
if (lrPosition) {
|
|
270
|
+
isOver = scrollHeight !== clientHeight;
|
|
271
|
+
if (index > -1) {
|
|
272
|
+
const tabEl = children[index];
|
|
273
|
+
if (tabEl) {
|
|
274
|
+
let tabHeight = tabEl.clientHeight;
|
|
275
|
+
const tabWidth = tabEl.clientWidth;
|
|
276
|
+
if (tabType === "card") {
|
|
277
|
+
lintWidth = tabWidth;
|
|
278
|
+
lintHeight = tabHeight;
|
|
279
|
+
lintTop = tabEl.offsetTop;
|
|
280
|
+
} else if (tabType === "border-card") {
|
|
281
|
+
lintWidth = tabWidth;
|
|
282
|
+
lintHeight = tabHeight;
|
|
283
|
+
lintTop = tabEl.offsetTop - 1;
|
|
284
|
+
} else {
|
|
285
|
+
const tabStyle = getComputedStyle(tabEl);
|
|
286
|
+
const paddingTop = import_xe_utils.default.toNumber(tabStyle.paddingTop);
|
|
287
|
+
const paddingBottom = import_xe_utils.default.toNumber(tabStyle.paddingBottom);
|
|
288
|
+
tabHeight -= paddingTop + paddingBottom;
|
|
289
|
+
lintHeight = Math.max(4, tabHeight);
|
|
290
|
+
lintTop = tabEl.offsetTop + paddingTop + Math.floor((tabHeight - lintHeight) / 2);
|
|
291
|
+
}
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
294
|
+
} else {
|
|
295
|
+
isOver = scrollWidth !== clientWidth;
|
|
296
|
+
if (index > -1) {
|
|
297
|
+
const tabEl = children[index];
|
|
298
|
+
if (tabEl) {
|
|
299
|
+
let tabWidth = tabEl.clientWidth;
|
|
300
|
+
if (tabType === "card") {
|
|
301
|
+
lintWidth = tabWidth + 1;
|
|
302
|
+
lintLeft = tabEl.offsetLeft;
|
|
303
|
+
} else if (tabType === "border-card") {
|
|
304
|
+
lintWidth = tabWidth;
|
|
305
|
+
lintLeft = tabEl.offsetLeft - 1;
|
|
306
|
+
} else {
|
|
307
|
+
const tabStyle = getComputedStyle(tabEl);
|
|
308
|
+
const paddingLeft = import_xe_utils.default.toNumber(tabStyle.paddingLeft);
|
|
309
|
+
const paddingRight = import_xe_utils.default.toNumber(tabStyle.paddingRight);
|
|
310
|
+
tabWidth -= paddingLeft + paddingRight;
|
|
311
|
+
lintWidth = Math.max(4, tabWidth);
|
|
312
|
+
lintLeft = tabEl.offsetLeft + paddingLeft + Math.floor((tabWidth - lintWidth) / 2);
|
|
313
|
+
}
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
317
|
}
|
|
318
|
+
reactData.scrollbarWidth = sBarWidth;
|
|
319
|
+
reactData.scrollbarHeight = sBarHeight;
|
|
320
|
+
reactData.lintLeft = lintLeft;
|
|
321
|
+
reactData.lintTop = lintTop;
|
|
322
|
+
reactData.lintWidth = lintWidth;
|
|
323
|
+
reactData.lintHeight = lintHeight;
|
|
324
|
+
reactData.isTabOver = isOver;
|
|
325
|
+
checkScrolling();
|
|
326
|
+
};
|
|
327
|
+
handleStyle();
|
|
328
|
+
(0, import_vue.nextTick)(handleStyle);
|
|
329
|
+
};
|
|
330
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
331
|
+
emit(type, createEvent(evnt, { $tabs: $xeTabs }, params));
|
|
332
|
+
};
|
|
333
|
+
const emitModel = (value) => {
|
|
334
|
+
emit("update:modelValue", value);
|
|
335
|
+
};
|
|
336
|
+
const addInitName = (name, evnt) => {
|
|
337
|
+
const { initNames } = reactData;
|
|
338
|
+
if (name && !initNames.includes(name)) {
|
|
339
|
+
dispatchEvent("tab-load", { name }, evnt);
|
|
340
|
+
initNames.push(name);
|
|
341
|
+
return true;
|
|
315
342
|
}
|
|
316
|
-
|
|
317
|
-
reactData.scrollbarHeight = sBarHeight;
|
|
318
|
-
reactData.lintLeft = lintLeft;
|
|
319
|
-
reactData.lintTop = lintTop;
|
|
320
|
-
reactData.lintWidth = lintWidth;
|
|
321
|
-
reactData.lintHeight = lintHeight;
|
|
322
|
-
reactData.isTabOver = isOver;
|
|
323
|
-
checkScrolling();
|
|
343
|
+
return false;
|
|
324
344
|
};
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
345
|
+
const initDefaultName = (list) => {
|
|
346
|
+
let activeName = null;
|
|
347
|
+
const nameMaps = {};
|
|
348
|
+
if (list && list.length) {
|
|
349
|
+
let validVal = false;
|
|
350
|
+
activeName = props.modelValue;
|
|
351
|
+
list.forEach((item) => {
|
|
352
|
+
const { name, preload } = item || {};
|
|
353
|
+
if (name) {
|
|
354
|
+
nameMaps[`${name}`] = {
|
|
355
|
+
loading: false
|
|
356
|
+
};
|
|
357
|
+
if (activeName === name) {
|
|
358
|
+
validVal = true;
|
|
359
|
+
}
|
|
360
|
+
if (preload) {
|
|
361
|
+
addInitName(name, null);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
if (!validVal) {
|
|
366
|
+
activeName = list[0].name;
|
|
367
|
+
addInitName(activeName, null);
|
|
368
|
+
emitModel(activeName);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
reactData.activeName = activeName;
|
|
372
|
+
reactData.cacheTabMaps = nameMaps;
|
|
373
|
+
};
|
|
374
|
+
const clickEvent = (evnt, item) => {
|
|
375
|
+
const { trigger } = props;
|
|
376
|
+
const beforeMethod = props.beforeChangeMethod || getConfig().tabs.beforeChangeMethod;
|
|
377
|
+
const { activeName } = reactData;
|
|
378
|
+
const { name } = item;
|
|
379
|
+
const value = name;
|
|
380
|
+
dispatchEvent("tab-click", { name }, evnt);
|
|
381
|
+
if (trigger === "manual") {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (name !== activeName) {
|
|
385
|
+
Promise.resolve(!beforeMethod || beforeMethod({ $tabs: $xeTabs, name, oldName: activeName, newName: name, option: item })).then((status) => {
|
|
386
|
+
if (status) {
|
|
387
|
+
reactData.activeName = name;
|
|
388
|
+
emitModel(value);
|
|
389
|
+
addInitName(name, evnt);
|
|
390
|
+
dispatchEvent("change", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
391
|
+
dispatchEvent("tab-change", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
392
|
+
} else {
|
|
393
|
+
dispatchEvent("tab-change-fail", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
357
394
|
}
|
|
358
|
-
|
|
359
|
-
|
|
395
|
+
}).catch(() => {
|
|
396
|
+
dispatchEvent("tab-change-fail", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const handleRefreshTabEvent = (evnt, item) => {
|
|
401
|
+
evnt.stopPropagation();
|
|
402
|
+
const { activeName, cacheTabMaps } = reactData;
|
|
403
|
+
const { name } = item;
|
|
404
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
405
|
+
const { queryMethod } = refreshOpts;
|
|
406
|
+
const cacheItem = name ? cacheTabMaps[`${name}`] : null;
|
|
407
|
+
if (cacheItem) {
|
|
408
|
+
if (queryMethod) {
|
|
409
|
+
if (cacheItem.loading) {
|
|
410
|
+
return;
|
|
360
411
|
}
|
|
412
|
+
cacheItem.loading = true;
|
|
413
|
+
Promise.resolve(queryMethod({ $tabs: $xeTabs, value: activeName, name, option: item })).finally(() => {
|
|
414
|
+
cacheItem.loading = false;
|
|
415
|
+
});
|
|
416
|
+
} else {
|
|
417
|
+
errLog("vxe.error.notFunc", ["refresh-config.queryMethod"]);
|
|
361
418
|
}
|
|
362
|
-
});
|
|
363
|
-
if (!validVal) {
|
|
364
|
-
activeName = list[0].name;
|
|
365
|
-
addInitName(activeName, null);
|
|
366
|
-
emitModel(activeName);
|
|
367
419
|
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if (name !== activeName) {
|
|
383
|
-
Promise.resolve(!beforeMethod || beforeMethod({ $tabs: $xeTabs, name, oldName: activeName, newName: name, option: item })).then((status) => {
|
|
420
|
+
};
|
|
421
|
+
const handleCloseTabEvent = (evnt, item, index, list) => {
|
|
422
|
+
evnt.stopPropagation();
|
|
423
|
+
const { activeName } = reactData;
|
|
424
|
+
const closeOpts = computeCloseOpts.value;
|
|
425
|
+
const beforeMethod = closeOpts.beforeMethod || props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
|
|
426
|
+
const { name } = item;
|
|
427
|
+
const value = activeName;
|
|
428
|
+
let nextName = value;
|
|
429
|
+
if (activeName === name) {
|
|
430
|
+
const nextItem = index < list.length - 1 ? list[index + 1] : list[index - 1];
|
|
431
|
+
nextName = nextItem ? nextItem.name : null;
|
|
432
|
+
}
|
|
433
|
+
Promise.resolve(!beforeMethod || beforeMethod({ $tabs: $xeTabs, value, name, nextName, option: item })).then((status) => {
|
|
384
434
|
if (status) {
|
|
385
|
-
|
|
386
|
-
emitModel(value);
|
|
387
|
-
addInitName(name, evnt);
|
|
388
|
-
dispatchEvent("change", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
389
|
-
dispatchEvent("tab-change", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
435
|
+
dispatchEvent("tab-close", { value, name, nextName }, evnt);
|
|
390
436
|
} else {
|
|
391
|
-
dispatchEvent("tab-
|
|
437
|
+
dispatchEvent("tab-close-fail", { value, name, nextName }, evnt);
|
|
392
438
|
}
|
|
393
439
|
}).catch(() => {
|
|
394
|
-
dispatchEvent("tab-change-fail", { value, name, oldName: activeName, newName: name, option: item }, evnt);
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
const handleRefreshTabEvent = (evnt, item) => {
|
|
399
|
-
evnt.stopPropagation();
|
|
400
|
-
const { activeName, cacheTabMaps } = reactData;
|
|
401
|
-
const { name } = item;
|
|
402
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
403
|
-
const { queryMethod } = refreshOpts;
|
|
404
|
-
const cacheItem = name ? cacheTabMaps[`${name}`] : null;
|
|
405
|
-
if (cacheItem) {
|
|
406
|
-
if (queryMethod) {
|
|
407
|
-
if (cacheItem.loading) {
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
cacheItem.loading = true;
|
|
411
|
-
Promise.resolve(queryMethod({ $tabs: $xeTabs, value: activeName, name, option: item })).finally(() => {
|
|
412
|
-
cacheItem.loading = false;
|
|
413
|
-
});
|
|
414
|
-
} else {
|
|
415
|
-
errLog("vxe.error.notFunc", ["refresh-config.queryMethod"]);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
const handleCloseTabEvent = (evnt, item, index, list) => {
|
|
420
|
-
evnt.stopPropagation();
|
|
421
|
-
const { activeName } = reactData;
|
|
422
|
-
const closeOpts = computeCloseOpts.value;
|
|
423
|
-
const beforeMethod = closeOpts.beforeMethod || props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
|
|
424
|
-
const { name } = item;
|
|
425
|
-
const value = activeName;
|
|
426
|
-
let nextName = value;
|
|
427
|
-
if (activeName === name) {
|
|
428
|
-
const nextItem = index < list.length - 1 ? list[index + 1] : list[index - 1];
|
|
429
|
-
nextName = nextItem ? nextItem.name : null;
|
|
430
|
-
}
|
|
431
|
-
Promise.resolve(!beforeMethod || beforeMethod({ $tabs: $xeTabs, value, name, nextName, option: item })).then((status) => {
|
|
432
|
-
if (status) {
|
|
433
|
-
dispatchEvent("tab-close", { value, name, nextName }, evnt);
|
|
434
|
-
} else {
|
|
435
440
|
dispatchEvent("tab-close-fail", { value, name, nextName }, evnt);
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
const startScrollAnimation = (offsetPos, offsetSize) => {
|
|
444
|
+
const { slTimeout } = internalData;
|
|
445
|
+
const lrPosition = computeLrPosition.value;
|
|
446
|
+
let offsetLeft = lrPosition ? 0 : offsetSize;
|
|
447
|
+
let offsetTop = lrPosition ? offsetSize : 0;
|
|
448
|
+
let scrollCount = 6;
|
|
449
|
+
let delayNum = 35;
|
|
450
|
+
if (slTimeout) {
|
|
451
|
+
clearTimeout(slTimeout);
|
|
452
|
+
internalData.slTimeout = void 0;
|
|
436
453
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = headerWrapperEl;
|
|
458
|
-
if (lrPosition) {
|
|
459
|
-
offsetTop = Math.floor(offsetTop / 2);
|
|
460
|
-
if (offsetPos > 0) {
|
|
461
|
-
if (clientHeight + scrollTop < scrollHeight) {
|
|
462
|
-
headerWrapperEl.scrollTop += offsetTop;
|
|
463
|
-
delayNum -= 4;
|
|
464
|
-
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
465
|
-
}
|
|
466
|
-
} else {
|
|
467
|
-
if (scrollTop > 0) {
|
|
468
|
-
headerWrapperEl.scrollTop -= offsetTop;
|
|
469
|
-
delayNum -= 4;
|
|
470
|
-
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
} else {
|
|
474
|
-
offsetLeft = Math.floor(offsetLeft / 2);
|
|
475
|
-
if (offsetPos > 0) {
|
|
476
|
-
if (clientWidth + scrollLeft < scrollWidth) {
|
|
477
|
-
headerWrapperEl.scrollLeft += offsetLeft;
|
|
478
|
-
delayNum -= 4;
|
|
479
|
-
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
454
|
+
const scrollAnimate = () => {
|
|
455
|
+
const headerWrapperEl = refHeadWrapperElem.value;
|
|
456
|
+
if (scrollCount > 0) {
|
|
457
|
+
scrollCount--;
|
|
458
|
+
if (headerWrapperEl) {
|
|
459
|
+
const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = headerWrapperEl;
|
|
460
|
+
if (lrPosition) {
|
|
461
|
+
offsetTop = Math.floor(offsetTop / 2);
|
|
462
|
+
if (offsetPos > 0) {
|
|
463
|
+
if (clientHeight + scrollTop < scrollHeight) {
|
|
464
|
+
headerWrapperEl.scrollTop += offsetTop;
|
|
465
|
+
delayNum -= 4;
|
|
466
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
467
|
+
}
|
|
468
|
+
} else {
|
|
469
|
+
if (scrollTop > 0) {
|
|
470
|
+
headerWrapperEl.scrollTop -= offsetTop;
|
|
471
|
+
delayNum -= 4;
|
|
472
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
473
|
+
}
|
|
480
474
|
}
|
|
481
475
|
} else {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
476
|
+
offsetLeft = Math.floor(offsetLeft / 2);
|
|
477
|
+
if (offsetPos > 0) {
|
|
478
|
+
if (clientWidth + scrollLeft < scrollWidth) {
|
|
479
|
+
headerWrapperEl.scrollLeft += offsetLeft;
|
|
480
|
+
delayNum -= 4;
|
|
481
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
482
|
+
}
|
|
483
|
+
} else {
|
|
484
|
+
if (scrollLeft > 0) {
|
|
485
|
+
headerWrapperEl.scrollLeft -= offsetLeft;
|
|
486
|
+
delayNum -= 4;
|
|
487
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
488
|
+
}
|
|
486
489
|
}
|
|
487
490
|
}
|
|
491
|
+
updateTabStyle();
|
|
488
492
|
}
|
|
489
|
-
updateTabStyle();
|
|
490
493
|
}
|
|
491
|
-
}
|
|
494
|
+
};
|
|
495
|
+
scrollAnimate();
|
|
492
496
|
};
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
const handleScrollToLeft = (offsetPos) => {
|
|
496
|
-
const lrPosition = computeLrPosition.value;
|
|
497
|
-
const headerWrapperEl = refHeadWrapperElem.value;
|
|
498
|
-
if (headerWrapperEl) {
|
|
499
|
-
const { clientWidth, clientHeight } = headerWrapperEl;
|
|
500
|
-
const offsetSize = Math.floor((lrPosition ? clientHeight : clientWidth) * 0.75);
|
|
501
|
-
startScrollAnimation(offsetPos, offsetSize);
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
const scrollLeftEvent = () => {
|
|
505
|
-
handleScrollToLeft(-1);
|
|
506
|
-
};
|
|
507
|
-
const scrollRightEvent = () => {
|
|
508
|
-
handleScrollToLeft(1);
|
|
509
|
-
};
|
|
510
|
-
const scrollToTab = (name) => {
|
|
511
|
-
const tabOptions = computeTabOptions.value;
|
|
512
|
-
const tabStaticOptions = computeTabStaticOptions.value;
|
|
513
|
-
const lrPosition = computeLrPosition.value;
|
|
514
|
-
return (0, import_vue.nextTick)().then(() => {
|
|
497
|
+
const handleScrollToLeft = (offsetPos) => {
|
|
498
|
+
const lrPosition = computeLrPosition.value;
|
|
515
499
|
const headerWrapperEl = refHeadWrapperElem.value;
|
|
516
500
|
if (headerWrapperEl) {
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
501
|
+
const { clientWidth, clientHeight } = headerWrapperEl;
|
|
502
|
+
const offsetSize = Math.floor((lrPosition ? clientHeight : clientWidth) * 0.75);
|
|
503
|
+
startScrollAnimation(offsetPos, offsetSize);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
const scrollLeftEvent = () => {
|
|
507
|
+
handleScrollToLeft(-1);
|
|
508
|
+
};
|
|
509
|
+
const scrollRightEvent = () => {
|
|
510
|
+
handleScrollToLeft(1);
|
|
511
|
+
};
|
|
512
|
+
const scrollToTab = (name) => {
|
|
513
|
+
const tabOptions = computeTabOptions.value;
|
|
514
|
+
const tabStaticOptions = computeTabStaticOptions.value;
|
|
515
|
+
const lrPosition = computeLrPosition.value;
|
|
516
|
+
return (0, import_vue.nextTick)().then(() => {
|
|
517
|
+
const headerWrapperEl = refHeadWrapperElem.value;
|
|
518
|
+
if (headerWrapperEl) {
|
|
519
|
+
const index = import_xe_utils.default.findIndexOf(tabStaticOptions.length ? tabStaticOptions : tabOptions, (item) => item.name === name);
|
|
520
|
+
if (index > -1) {
|
|
521
|
+
const { scrollLeft, scrollTop, clientWidth, clientHeight, children } = headerWrapperEl;
|
|
522
|
+
const tabEl = children[index];
|
|
523
|
+
if (tabEl) {
|
|
524
|
+
if (lrPosition) {
|
|
525
|
+
const tabOffsetTop = tabEl.offsetTop;
|
|
526
|
+
const tabClientHeight = tabEl.clientHeight;
|
|
527
|
+
const overSize = tabOffsetTop + tabClientHeight - (scrollTop + clientHeight);
|
|
528
|
+
if (overSize > 0) {
|
|
529
|
+
headerWrapperEl.scrollTop += overSize;
|
|
530
|
+
}
|
|
531
|
+
if (tabOffsetTop < scrollTop) {
|
|
532
|
+
headerWrapperEl.scrollTop = tabOffsetTop;
|
|
533
|
+
}
|
|
534
|
+
} else {
|
|
535
|
+
const tabOffsetLeft = tabEl.offsetLeft;
|
|
536
|
+
const tabClientWidth = tabEl.clientWidth;
|
|
537
|
+
const overSize = tabOffsetLeft + tabClientWidth - (scrollLeft + clientWidth);
|
|
538
|
+
if (overSize > 0) {
|
|
539
|
+
headerWrapperEl.scrollLeft += overSize;
|
|
540
|
+
}
|
|
541
|
+
if (tabOffsetLeft < scrollLeft) {
|
|
542
|
+
headerWrapperEl.scrollLeft = tabOffsetLeft;
|
|
543
|
+
}
|
|
541
544
|
}
|
|
542
545
|
}
|
|
543
546
|
}
|
|
547
|
+
updateTabStyle();
|
|
544
548
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
const handlePrevNext = (isNext) => {
|
|
552
|
+
const { activeName } = reactData;
|
|
553
|
+
const tabOptions = computeTabOptions.value;
|
|
554
|
+
const tabStaticOptions = computeTabStaticOptions.value;
|
|
555
|
+
const list = tabStaticOptions.length ? tabStaticOptions : tabOptions;
|
|
556
|
+
const index = import_xe_utils.default.findIndexOf(list, (item) => item.name === activeName);
|
|
557
|
+
if (index > -1) {
|
|
558
|
+
let item = null;
|
|
559
|
+
if (isNext) {
|
|
560
|
+
if (index < list.length - 1) {
|
|
561
|
+
item = list[index + 1];
|
|
562
|
+
}
|
|
563
|
+
} else {
|
|
564
|
+
if (index > 0) {
|
|
565
|
+
item = list[index - 1];
|
|
566
|
+
}
|
|
560
567
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
568
|
+
if (item) {
|
|
569
|
+
const name = item.name;
|
|
570
|
+
const value = name;
|
|
571
|
+
reactData.activeName = name;
|
|
572
|
+
emitModel(value);
|
|
573
|
+
addInitName(name, null);
|
|
564
574
|
}
|
|
565
575
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
return (0, import_vue.nextTick)();
|
|
575
|
-
};
|
|
576
|
-
const tabsMethods = {
|
|
577
|
-
dispatchEvent,
|
|
578
|
-
scrollToTab,
|
|
579
|
-
prev() {
|
|
580
|
-
return handlePrevNext(false);
|
|
581
|
-
},
|
|
582
|
-
next() {
|
|
583
|
-
return handlePrevNext(true);
|
|
584
|
-
},
|
|
585
|
-
prevTab() {
|
|
586
|
-
warnLog("vxe.error.delFunc", ["prevTab", "prev"]);
|
|
587
|
-
return tabsMethods.prev();
|
|
588
|
-
},
|
|
589
|
-
nextTab() {
|
|
590
|
-
warnLog("vxe.error.delFunc", ["nextTab", "next"]);
|
|
591
|
-
return tabsMethods.next();
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
const tabsPrivateMethods = {};
|
|
595
|
-
Object.assign($xeTabs, tabsMethods, tabsPrivateMethods);
|
|
596
|
-
const renderTabHeader = (tabList) => {
|
|
597
|
-
const { titleWidth: allTitleWidth, titleAlign: allTitleAlign, showClose, closeConfig, refreshConfig } = props;
|
|
598
|
-
const { activeName, scrollbarWidth, scrollbarHeight, isTabOver, cacheTabMaps } = reactData;
|
|
599
|
-
const tabType = computeTabType.value;
|
|
600
|
-
const tabPosition = computeTabPosition.value;
|
|
601
|
-
const lrPosition = computeLrPosition.value;
|
|
602
|
-
const lineStyle = computeLineStyle.value;
|
|
603
|
-
const tabPrefixSlot = slots.tabPrefix || slots["tab-prefix"] || slots.prefix;
|
|
604
|
-
const tabSuffixSlot = slots.tabSuffix || slots["tab-suffix"] || slots.suffix || slots.extra;
|
|
605
|
-
const closeOpts = computeCloseOpts.value;
|
|
606
|
-
const closeVisibleMethod = closeOpts.visibleMethod;
|
|
607
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
608
|
-
const refreshVisibleMethod = refreshOpts.visibleMethod;
|
|
609
|
-
return (0, import_vue.h)(
|
|
610
|
-
"div",
|
|
611
|
-
{
|
|
612
|
-
key: "th",
|
|
613
|
-
class: ["vxe-tabs-header", `type--${tabType}`, `pos--${tabPosition}`]
|
|
576
|
+
return (0, import_vue.nextTick)();
|
|
577
|
+
};
|
|
578
|
+
const tabsMethods = {
|
|
579
|
+
dispatchEvent,
|
|
580
|
+
scrollToTab,
|
|
581
|
+
prev() {
|
|
582
|
+
return handlePrevNext(false);
|
|
614
583
|
},
|
|
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
|
-
|
|
584
|
+
next() {
|
|
585
|
+
return handlePrevNext(true);
|
|
586
|
+
},
|
|
587
|
+
prevTab() {
|
|
588
|
+
warnLog("vxe.error.delFunc", ["prevTab", "prev"]);
|
|
589
|
+
return tabsMethods.prev();
|
|
590
|
+
},
|
|
591
|
+
nextTab() {
|
|
592
|
+
warnLog("vxe.error.delFunc", ["nextTab", "next"]);
|
|
593
|
+
return tabsMethods.next();
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
const tabsPrivateMethods = {};
|
|
597
|
+
Object.assign($xeTabs, tabsMethods, tabsPrivateMethods);
|
|
598
|
+
const renderTabHeader = (tabList) => {
|
|
599
|
+
const { titleWidth: allTitleWidth, titleAlign: allTitleAlign, showClose, closeConfig, refreshConfig } = props;
|
|
600
|
+
const { activeName, scrollbarWidth, scrollbarHeight, isTabOver, cacheTabMaps } = reactData;
|
|
601
|
+
const tabType = computeTabType.value;
|
|
602
|
+
const tabPosition = computeTabPosition.value;
|
|
603
|
+
const lrPosition = computeLrPosition.value;
|
|
604
|
+
const lineStyle = computeLineStyle.value;
|
|
605
|
+
const tabPrefixSlot = slots.tabPrefix || slots["tab-prefix"] || slots.prefix;
|
|
606
|
+
const tabSuffixSlot = slots.tabSuffix || slots["tab-suffix"] || slots.suffix || slots.extra;
|
|
607
|
+
const closeOpts = computeCloseOpts.value;
|
|
608
|
+
const closeVisibleMethod = closeOpts.visibleMethod;
|
|
609
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
610
|
+
const refreshVisibleMethod = refreshOpts.visibleMethod;
|
|
611
|
+
return (0, import_vue.h)(
|
|
612
|
+
"div",
|
|
613
|
+
{
|
|
614
|
+
key: "th",
|
|
615
|
+
class: ["vxe-tabs-header", `type--${tabType}`, `pos--${tabPosition}`]
|
|
616
|
+
},
|
|
617
|
+
[
|
|
618
|
+
tabPrefixSlot ? (0, import_vue.h)(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
class: ["vxe-tabs-header--prefix", `type--${tabType}`, `pos--${tabPosition}`]
|
|
622
|
+
},
|
|
623
|
+
callSlot(tabPrefixSlot, { name: activeName })
|
|
624
|
+
) : renderEmptyElement($xeTabs),
|
|
625
|
+
isTabOver ? (0, import_vue.h)(
|
|
626
|
+
"div",
|
|
627
|
+
{
|
|
628
|
+
ref: refHeadPrevElem,
|
|
629
|
+
class: ["vxe-tabs-header--bar vxe-tabs-header--prev-bar", `type--${tabType}`, `pos--${tabPosition}`],
|
|
630
|
+
onClick: scrollLeftEvent
|
|
631
|
+
},
|
|
632
|
+
[
|
|
633
|
+
(0, import_vue.h)("span", {
|
|
634
|
+
class: lrPosition ? getIcon().TABS_TAB_BUTTON_TOP : getIcon().TABS_TAB_BUTTON_LEFT
|
|
635
|
+
})
|
|
636
|
+
]
|
|
637
|
+
) : renderEmptyElement($xeTabs),
|
|
638
|
+
(0, import_vue.h)(
|
|
639
|
+
"div",
|
|
640
|
+
{
|
|
641
|
+
class: ["vxe-tabs-header--wrapper", `type--${tabType}`, `pos--${tabPosition}`]
|
|
642
|
+
},
|
|
643
|
+
[
|
|
644
|
+
(0, import_vue.h)(
|
|
645
|
+
"div",
|
|
646
|
+
{
|
|
647
|
+
ref: refHeadWrapperElem,
|
|
648
|
+
class: "vxe-tabs-header--item-wrapper",
|
|
649
|
+
style: lrPosition ? {
|
|
650
|
+
marginRight: `-${scrollbarWidth + scrollbarOffsetSize}px`,
|
|
651
|
+
paddingRight: `${scrollbarOffsetSize}px`
|
|
652
|
+
} : {
|
|
653
|
+
marginBottom: `-${scrollbarHeight + scrollbarOffsetSize}px`,
|
|
654
|
+
paddingBottom: `${scrollbarOffsetSize}px`
|
|
655
|
+
},
|
|
656
|
+
onScroll: checkScrolling
|
|
653
657
|
},
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
658
|
+
tabList.map((item, index) => {
|
|
659
|
+
const { title, titleWidth, titleAlign, icon, name } = item;
|
|
660
|
+
const itemSlots = item.slots || {};
|
|
661
|
+
const titleSlot = itemSlots.title || itemSlots.tab;
|
|
662
|
+
const titlePrefixSlot = itemSlots.titlePrefix || itemSlots["title-prefix"];
|
|
663
|
+
const titleSuffixSlot = itemSlots.titleSuffix || itemSlots["title-suffix"];
|
|
664
|
+
const itemWidth = titleWidth || allTitleWidth;
|
|
665
|
+
const itemAlign = titleAlign || allTitleAlign;
|
|
666
|
+
const params = { $tabs: $xeTabs, value: activeName, name, option: item };
|
|
667
|
+
const isActive = activeName === name;
|
|
668
|
+
const cacheItem = name ? cacheTabMaps[`${name}`] : null;
|
|
669
|
+
const isLoading = cacheItem ? cacheItem.loading : false;
|
|
670
|
+
return (0, import_vue.h)(
|
|
671
|
+
"div",
|
|
672
|
+
{
|
|
673
|
+
key: `${name}`,
|
|
674
|
+
class: [
|
|
675
|
+
"vxe-tabs-header--item",
|
|
676
|
+
`type--${tabType}`,
|
|
677
|
+
`pos--${tabPosition}`,
|
|
678
|
+
itemAlign ? `align--${itemAlign}` : "",
|
|
679
|
+
{
|
|
680
|
+
"is--active": isActive
|
|
681
|
+
}
|
|
682
|
+
],
|
|
683
|
+
style: itemWidth ? {
|
|
684
|
+
width: (0, import_dom.toCssUnit)(itemWidth)
|
|
685
|
+
} : void 0,
|
|
686
|
+
onClick(evnt) {
|
|
687
|
+
clickEvent(evnt, item);
|
|
679
688
|
}
|
|
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
|
-
class:
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
"is--active": isActive,
|
|
742
|
-
"is--loading": isLoading,
|
|
743
|
-
"is--disabled": isLoading
|
|
689
|
+
},
|
|
690
|
+
[
|
|
691
|
+
(0, import_vue.h)(
|
|
692
|
+
"div",
|
|
693
|
+
{
|
|
694
|
+
class: "vxe-tabs-header--item-inner"
|
|
695
|
+
},
|
|
696
|
+
[
|
|
697
|
+
(0, import_vue.h)(
|
|
698
|
+
"div",
|
|
699
|
+
{
|
|
700
|
+
class: "vxe-tabs-header--item-content"
|
|
701
|
+
},
|
|
702
|
+
[
|
|
703
|
+
icon ? (0, import_vue.h)(
|
|
704
|
+
"span",
|
|
705
|
+
{
|
|
706
|
+
class: "vxe-tabs-header--item-icon"
|
|
707
|
+
},
|
|
708
|
+
[
|
|
709
|
+
(0, import_vue.h)("i", {
|
|
710
|
+
class: icon
|
|
711
|
+
})
|
|
712
|
+
]
|
|
713
|
+
) : renderEmptyElement($xeTabs),
|
|
714
|
+
titlePrefixSlot ? (0, import_vue.h)(
|
|
715
|
+
"span",
|
|
716
|
+
{
|
|
717
|
+
class: "vxe-tabs-header--item-prefix"
|
|
718
|
+
},
|
|
719
|
+
callSlot(titlePrefixSlot, { name, title })
|
|
720
|
+
) : renderEmptyElement($xeTabs),
|
|
721
|
+
(0, import_vue.h)(
|
|
722
|
+
"span",
|
|
723
|
+
{
|
|
724
|
+
class: "vxe-tabs-header--item-name"
|
|
725
|
+
},
|
|
726
|
+
titleSlot ? callSlot(titleSlot, { name, title }) : `${title}`
|
|
727
|
+
),
|
|
728
|
+
titleSuffixSlot ? (0, import_vue.h)(
|
|
729
|
+
"span",
|
|
730
|
+
{
|
|
731
|
+
class: "vxe-tabs-header--item-suffix"
|
|
732
|
+
},
|
|
733
|
+
callSlot(titleSuffixSlot, { name, title })
|
|
734
|
+
) : renderEmptyElement($xeTabs)
|
|
735
|
+
]
|
|
736
|
+
),
|
|
737
|
+
((0, import_utils.isEnableConf)(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) : true) ? (0, import_vue.h)(
|
|
738
|
+
"div",
|
|
739
|
+
{
|
|
740
|
+
class: [
|
|
741
|
+
"vxe-tabs-header--refresh-btn",
|
|
742
|
+
{
|
|
743
|
+
"is--active": isActive,
|
|
744
|
+
"is--loading": isLoading,
|
|
745
|
+
"is--disabled": isLoading
|
|
746
|
+
}
|
|
747
|
+
],
|
|
748
|
+
onClick(evnt) {
|
|
749
|
+
handleRefreshTabEvent(evnt, item);
|
|
744
750
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
{
|
|
762
|
-
|
|
751
|
+
},
|
|
752
|
+
[
|
|
753
|
+
(0, import_vue.h)("i", {
|
|
754
|
+
class: isLoading ? getIcon().TABS_TAB_REFRESH_LOADING : getIcon().TABS_TAB_REFRESH
|
|
755
|
+
})
|
|
756
|
+
]
|
|
757
|
+
) : renderEmptyElement($xeTabs),
|
|
758
|
+
(showClose || (0, import_utils.isEnableConf)(closeConfig) || closeOpts.enabled) && (!closeVisibleMethod || closeVisibleMethod(params)) ? (0, import_vue.h)(
|
|
759
|
+
"div",
|
|
760
|
+
{
|
|
761
|
+
class: [
|
|
762
|
+
"vxe-tabs-header--close-btn",
|
|
763
|
+
{
|
|
764
|
+
"is--active": isActive
|
|
765
|
+
}
|
|
766
|
+
],
|
|
767
|
+
onClick(evnt) {
|
|
768
|
+
handleCloseTabEvent(evnt, item, index, tabList);
|
|
763
769
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
770
|
+
},
|
|
771
|
+
[
|
|
772
|
+
(0, import_vue.h)("i", {
|
|
773
|
+
class: getIcon().TABS_TAB_CLOSE
|
|
774
|
+
})
|
|
775
|
+
]
|
|
776
|
+
) : renderEmptyElement($xeTabs)
|
|
777
|
+
]
|
|
778
|
+
)
|
|
779
|
+
]
|
|
780
|
+
);
|
|
781
|
+
}).concat([
|
|
782
|
+
(0, import_vue.h)("span", {
|
|
783
|
+
key: "line",
|
|
784
|
+
class: ["vxe-tabs-header--active-line", `type--${tabType}`, `pos--${tabPosition}`],
|
|
785
|
+
style: lineStyle
|
|
786
|
+
})
|
|
787
|
+
])
|
|
788
|
+
)
|
|
789
|
+
]
|
|
790
|
+
),
|
|
791
|
+
isTabOver ? (0, import_vue.h)(
|
|
792
|
+
"div",
|
|
793
|
+
{
|
|
794
|
+
ref: refHeadNextElem,
|
|
795
|
+
class: ["vxe-tabs-header--bar vxe-tabs-header--next-bar", `type--${tabType}`, `pos--${tabPosition}`],
|
|
796
|
+
onClick: scrollRightEvent
|
|
797
|
+
},
|
|
798
|
+
[
|
|
799
|
+
(0, import_vue.h)("span", {
|
|
800
|
+
class: lrPosition ? getIcon().TABS_TAB_BUTTON_BOTTOM : getIcon().TABS_TAB_BUTTON_RIGHT
|
|
801
|
+
})
|
|
802
|
+
]
|
|
803
|
+
) : renderEmptyElement($xeTabs),
|
|
804
|
+
tabSuffixSlot ? (0, import_vue.h)(
|
|
805
|
+
"div",
|
|
806
|
+
{
|
|
807
|
+
class: ["vxe-tabs-header--suffix", `type--${tabType}`, `pos--${tabPosition}`]
|
|
808
|
+
},
|
|
809
|
+
callSlot(tabSuffixSlot, { name: activeName })
|
|
810
|
+
) : renderEmptyElement($xeTabs)
|
|
811
|
+
]
|
|
812
|
+
);
|
|
813
|
+
};
|
|
814
|
+
const renderTabPane = (item) => {
|
|
815
|
+
const { initNames, activeName } = reactData;
|
|
816
|
+
const { name, slots: slots2 } = item;
|
|
817
|
+
const defaultSlot = slots2 ? slots2.default : null;
|
|
818
|
+
const scrollbarProps = computeScrollbarProps.value;
|
|
819
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
820
|
+
if (name && initNames.includes(name)) {
|
|
821
|
+
return isVScrollbar ? (0, import_vue.h)(
|
|
822
|
+
import_scrollbar.default,
|
|
791
823
|
{
|
|
792
|
-
|
|
793
|
-
class: [
|
|
794
|
-
|
|
824
|
+
key: `${name}`,
|
|
825
|
+
class: [
|
|
826
|
+
"vxe-tabs-pane--scrollbar-item",
|
|
827
|
+
{
|
|
828
|
+
"is--visible": activeName === name
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
...scrollbarProps
|
|
795
832
|
},
|
|
796
|
-
|
|
797
|
-
(
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
]
|
|
801
|
-
) : renderEmptyElement($xeTabs),
|
|
802
|
-
tabSuffixSlot ? (0, import_vue.h)(
|
|
833
|
+
{
|
|
834
|
+
default: () => defaultSlot ? callSlot(defaultSlot, { name }) : []
|
|
835
|
+
}
|
|
836
|
+
) : (0, import_vue.h)(
|
|
803
837
|
"div",
|
|
804
838
|
{
|
|
805
|
-
|
|
839
|
+
key: `${name}`,
|
|
840
|
+
class: [
|
|
841
|
+
"vxe-tabs-pane--item",
|
|
842
|
+
{
|
|
843
|
+
"is--visible": activeName === name
|
|
844
|
+
}
|
|
845
|
+
]
|
|
806
846
|
},
|
|
807
|
-
callSlot(
|
|
808
|
-
)
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
return
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
847
|
+
defaultSlot ? callSlot(defaultSlot, { name }) : []
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
return renderEmptyElement($xeTabs);
|
|
851
|
+
};
|
|
852
|
+
const renderTabContent = (tabList) => {
|
|
853
|
+
const { destroyOnClose } = props;
|
|
854
|
+
const { activeName } = reactData;
|
|
855
|
+
if (destroyOnClose) {
|
|
856
|
+
const activeTab = tabList.find((item) => item.name === activeName);
|
|
857
|
+
return [activeTab ? renderTabPane(activeTab) : renderEmptyElement($xeTabs)];
|
|
858
|
+
}
|
|
859
|
+
return tabList.map((item) => renderTabPane(item));
|
|
860
|
+
};
|
|
861
|
+
const rendetTabBody = (tabList) => {
|
|
862
|
+
const { height, padding, showBody } = props;
|
|
863
|
+
const { activeName, cacheTabMaps } = reactData;
|
|
864
|
+
const vSize = computeSize.value;
|
|
865
|
+
const tabType = computeTabType.value;
|
|
866
|
+
const tabPosition = computeTabPosition.value;
|
|
867
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
868
|
+
const { showLoading } = refreshOpts;
|
|
869
|
+
const headerpSlot = slots.header;
|
|
870
|
+
const footerSlot = slots.footer;
|
|
871
|
+
if (!showBody) {
|
|
872
|
+
return renderEmptyElement($xeTabs);
|
|
873
|
+
}
|
|
874
|
+
const cacheItem = activeName ? cacheTabMaps[`${activeName}`] : null;
|
|
875
|
+
const isLoading = cacheItem ? cacheItem.loading : false;
|
|
876
|
+
const defParams = { name: activeName };
|
|
877
|
+
return (0, import_vue.h)(
|
|
835
878
|
"div",
|
|
836
879
|
{
|
|
837
|
-
key:
|
|
880
|
+
key: "tb",
|
|
838
881
|
class: [
|
|
839
|
-
"vxe-tabs-pane--
|
|
882
|
+
"vxe-tabs-pane--wrapper",
|
|
883
|
+
`type--${tabType}`,
|
|
884
|
+
`pos--${tabPosition}`,
|
|
840
885
|
{
|
|
841
|
-
"is--
|
|
886
|
+
"is--content": showBody
|
|
842
887
|
}
|
|
843
888
|
]
|
|
844
889
|
},
|
|
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
|
-
"vxe-tabs-pane--wrapper",
|
|
881
|
-
`type--${tabType}`,
|
|
882
|
-
`pos--${tabPosition}`,
|
|
883
|
-
{
|
|
884
|
-
"is--content": showBody
|
|
885
|
-
}
|
|
890
|
+
[
|
|
891
|
+
headerpSlot ? (0, import_vue.h)(
|
|
892
|
+
"div",
|
|
893
|
+
{
|
|
894
|
+
class: "vxe-tabs-pane--header"
|
|
895
|
+
},
|
|
896
|
+
callSlot(headerpSlot, defParams)
|
|
897
|
+
) : renderEmptyElement($xeTabs),
|
|
898
|
+
(0, import_vue.h)(
|
|
899
|
+
"div",
|
|
900
|
+
{
|
|
901
|
+
class: [
|
|
902
|
+
"vxe-tabs-pane--body",
|
|
903
|
+
`type--${tabType}`,
|
|
904
|
+
`pos--${tabPosition}`,
|
|
905
|
+
{
|
|
906
|
+
[`size--${vSize}`]: vSize,
|
|
907
|
+
"is--padding": padding,
|
|
908
|
+
"is--height": height
|
|
909
|
+
}
|
|
910
|
+
]
|
|
911
|
+
},
|
|
912
|
+
renderTabContent(tabList)
|
|
913
|
+
),
|
|
914
|
+
footerSlot ? (0, import_vue.h)(
|
|
915
|
+
"div",
|
|
916
|
+
{
|
|
917
|
+
class: "vxe-tabs-pane--footer"
|
|
918
|
+
},
|
|
919
|
+
callSlot(footerSlot, defParams)
|
|
920
|
+
) : renderEmptyElement($xeTabs),
|
|
921
|
+
showLoading && isLoading ? renderEmptyElement($xeTabs) : (0, import_vue.h)(import_loading.default, {
|
|
922
|
+
class: "vxe-tabs--loading",
|
|
923
|
+
modelValue: isLoading
|
|
924
|
+
})
|
|
886
925
|
]
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
926
|
+
);
|
|
927
|
+
};
|
|
928
|
+
const renderVN = () => {
|
|
929
|
+
const { height, padding, trigger } = props;
|
|
930
|
+
const { activeName } = reactData;
|
|
931
|
+
const vSize = computeSize.value;
|
|
932
|
+
const tabOptions = computeTabOptions.value;
|
|
933
|
+
const tabStaticOptions = computeTabStaticOptions.value;
|
|
934
|
+
const tabType = computeTabType.value;
|
|
935
|
+
const tabPosition = computeTabPosition.value;
|
|
936
|
+
const wrapperStyle = computeWrapperStyle.value;
|
|
937
|
+
const defaultSlot = slots.default;
|
|
938
|
+
const tabList = defaultSlot ? tabStaticOptions : tabOptions;
|
|
939
|
+
const vns = [
|
|
896
940
|
(0, import_vue.h)(
|
|
897
941
|
"div",
|
|
898
942
|
{
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
`type--${tabType}`,
|
|
902
|
-
`pos--${tabPosition}`,
|
|
903
|
-
{
|
|
904
|
-
[`size--${vSize}`]: vSize,
|
|
905
|
-
"is--padding": padding,
|
|
906
|
-
"is--height": height
|
|
907
|
-
}
|
|
908
|
-
]
|
|
943
|
+
key: "ts",
|
|
944
|
+
class: "vxe-tabs-slots"
|
|
909
945
|
},
|
|
910
|
-
|
|
911
|
-
)
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
showLoading && isLoading ? renderEmptyElement($xeTabs) : (0, import_vue.h)(import_loading.default, {
|
|
920
|
-
class: "vxe-tabs--loading",
|
|
921
|
-
modelValue: isLoading
|
|
922
|
-
})
|
|
923
|
-
]
|
|
924
|
-
);
|
|
925
|
-
};
|
|
926
|
-
const renderVN = () => {
|
|
927
|
-
const { height, padding, trigger } = props;
|
|
928
|
-
const { activeName } = reactData;
|
|
929
|
-
const vSize = computeSize.value;
|
|
930
|
-
const tabOptions = computeTabOptions.value;
|
|
931
|
-
const tabStaticOptions = computeTabStaticOptions.value;
|
|
932
|
-
const tabType = computeTabType.value;
|
|
933
|
-
const tabPosition = computeTabPosition.value;
|
|
934
|
-
const wrapperStyle = computeWrapperStyle.value;
|
|
935
|
-
const defaultSlot = slots.default;
|
|
936
|
-
const tabList = defaultSlot ? tabStaticOptions : tabOptions;
|
|
937
|
-
const vns = [
|
|
938
|
-
(0, import_vue.h)(
|
|
946
|
+
defaultSlot ? defaultSlot({ name: activeName }) : []
|
|
947
|
+
)
|
|
948
|
+
];
|
|
949
|
+
if (tabPosition === "right" || tabPosition === "bottom") {
|
|
950
|
+
vns.push(rendetTabBody(tabList), renderTabHeader(tabList));
|
|
951
|
+
} else {
|
|
952
|
+
vns.push(renderTabHeader(tabList), rendetTabBody(tabList));
|
|
953
|
+
}
|
|
954
|
+
return (0, import_vue.h)(
|
|
939
955
|
"div",
|
|
940
956
|
{
|
|
941
|
-
|
|
942
|
-
class:
|
|
957
|
+
ref: refElem,
|
|
958
|
+
class: [
|
|
959
|
+
"vxe-tabs",
|
|
960
|
+
`pos--${tabPosition}`,
|
|
961
|
+
`vxe-tabs--${tabType}`,
|
|
962
|
+
`trigger--${trigger === "manual" ? "trigger" : "default"}`,
|
|
963
|
+
{
|
|
964
|
+
[`size--${vSize}`]: vSize,
|
|
965
|
+
"is--padding": padding,
|
|
966
|
+
"is--height": height
|
|
967
|
+
}
|
|
968
|
+
],
|
|
969
|
+
style: wrapperStyle
|
|
943
970
|
},
|
|
944
|
-
|
|
945
|
-
)
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
`vxe-tabs--${tabType}`,
|
|
960
|
-
`trigger--${trigger === "manual" ? "trigger" : "default"}`,
|
|
961
|
-
{
|
|
962
|
-
[`size--${vSize}`]: vSize,
|
|
963
|
-
"is--padding": padding,
|
|
964
|
-
"is--height": height
|
|
965
|
-
}
|
|
966
|
-
],
|
|
967
|
-
style: wrapperStyle
|
|
968
|
-
},
|
|
969
|
-
vns
|
|
971
|
+
vns
|
|
972
|
+
);
|
|
973
|
+
};
|
|
974
|
+
(0, import_vue.watch)(
|
|
975
|
+
() => props.position,
|
|
976
|
+
() => {
|
|
977
|
+
reactData.resizeFlag++;
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
(0, import_vue.watch)(
|
|
981
|
+
() => props.modelValue,
|
|
982
|
+
(val) => {
|
|
983
|
+
addInitName(val, null);
|
|
984
|
+
reactData.activeName = val;
|
|
985
|
+
}
|
|
970
986
|
);
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
987
|
+
(0, import_vue.watch)(
|
|
988
|
+
() => reactData.activeName,
|
|
989
|
+
(val) => {
|
|
990
|
+
scrollToTab(val);
|
|
991
|
+
}
|
|
992
|
+
);
|
|
993
|
+
const optsFlag = (0, import_vue.ref)(0);
|
|
994
|
+
(0, import_vue.watch)(
|
|
995
|
+
() => props.options ? props.options.length : -1,
|
|
996
|
+
() => {
|
|
997
|
+
optsFlag.value++;
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1000
|
+
(0, import_vue.watch)(
|
|
1001
|
+
() => props.options,
|
|
1002
|
+
() => {
|
|
1003
|
+
optsFlag.value++;
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
(0, import_vue.watch)(optsFlag, () => {
|
|
1007
|
+
initDefaultName(props.options);
|
|
975
1008
|
reactData.resizeFlag++;
|
|
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
|
-
reactData.resizeFlag++;
|
|
1024
|
-
});
|
|
1025
|
-
(0, import_vue.watch)(computeParentTabsResizeFlag, () => {
|
|
1026
|
-
reactData.resizeFlag++;
|
|
1027
|
-
});
|
|
1028
|
-
(0, import_vue.watch)(
|
|
1029
|
-
() => reactData.resizeFlag,
|
|
1030
|
-
() => {
|
|
1031
|
-
(0, import_vue.nextTick)(() => {
|
|
1032
|
-
updateTabStyle();
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
);
|
|
1036
|
-
(0, import_vue.onMounted)(() => {
|
|
1037
|
-
updateTabStyle();
|
|
1038
|
-
globalEvents.on($xeTabs, "resize", updateTabStyle);
|
|
1039
|
-
});
|
|
1040
|
-
(0, import_vue.onUnmounted)(() => {
|
|
1041
|
-
globalEvents.off($xeTabs, "resize");
|
|
1042
|
-
});
|
|
1043
|
-
(0, import_vue.provide)("$xeTabs", $xeTabs);
|
|
1044
|
-
addInitName(props.modelValue, null);
|
|
1045
|
-
initDefaultName(reactData.staticTabs.length ? reactData.staticTabs : props.options);
|
|
1046
|
-
$xeTabs.renderVN = renderVN;
|
|
1047
|
-
return $xeTabs;
|
|
1048
|
-
},
|
|
1049
|
-
render() {
|
|
1050
|
-
return this.renderVN();
|
|
1051
|
-
}
|
|
1052
|
-
});
|
|
1009
|
+
});
|
|
1010
|
+
const stFlag = (0, import_vue.ref)(0);
|
|
1011
|
+
(0, import_vue.watch)(
|
|
1012
|
+
() => reactData.staticTabs ? reactData.staticTabs.length : -1,
|
|
1013
|
+
() => {
|
|
1014
|
+
stFlag.value++;
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
(0, import_vue.watch)(
|
|
1018
|
+
() => reactData.staticTabs,
|
|
1019
|
+
() => {
|
|
1020
|
+
stFlag.value++;
|
|
1021
|
+
}
|
|
1022
|
+
);
|
|
1023
|
+
(0, import_vue.watch)(stFlag, () => {
|
|
1024
|
+
initDefaultName(reactData.staticTabs);
|
|
1025
|
+
reactData.resizeFlag++;
|
|
1026
|
+
});
|
|
1027
|
+
(0, import_vue.watch)(computeParentTabsResizeFlag, () => {
|
|
1028
|
+
reactData.resizeFlag++;
|
|
1029
|
+
});
|
|
1030
|
+
(0, import_vue.watch)(
|
|
1031
|
+
() => reactData.resizeFlag,
|
|
1032
|
+
() => {
|
|
1033
|
+
(0, import_vue.nextTick)(() => {
|
|
1034
|
+
updateTabStyle();
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
(0, import_vue.onMounted)(() => {
|
|
1039
|
+
updateTabStyle();
|
|
1040
|
+
globalEvents.on($xeTabs, "resize", updateTabStyle);
|
|
1041
|
+
});
|
|
1042
|
+
(0, import_vue.onUnmounted)(() => {
|
|
1043
|
+
globalEvents.off($xeTabs, "resize");
|
|
1044
|
+
});
|
|
1045
|
+
(0, import_vue.provide)("$xeTabs", $xeTabs);
|
|
1046
|
+
addInitName(props.modelValue, null);
|
|
1047
|
+
initDefaultName(reactData.staticTabs.length ? reactData.staticTabs : props.options);
|
|
1048
|
+
$xeTabs.renderVN = renderVN;
|
|
1049
|
+
return $xeTabs;
|
|
1050
|
+
},
|
|
1051
|
+
render() {
|
|
1052
|
+
return this.renderVN();
|
|
1053
|
+
}
|
|
1054
|
+
})
|
|
1055
|
+
);
|