vxe-pc-ui 4.20.33 → 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.
Files changed (394) hide show
  1. package/dist/all.esm.js +44793 -43931
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +433 -2
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/src/anchor-link.js +110 -107
  7. package/es/anchor/src/anchor.js +212 -209
  8. package/es/avatar/src/avatar.js +132 -129
  9. package/es/backtop/src/backtop.js +267 -264
  10. package/es/badge/src/badge.js +102 -99
  11. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  12. package/es/breadcrumb/src/breadcrumb.js +70 -67
  13. package/es/button/src/button-group.js +88 -85
  14. package/es/calendar/src/calendar.js +1371 -1368
  15. package/es/card/src/card.js +235 -232
  16. package/es/carousel/src/carousel-item.js +78 -75
  17. package/es/carousel/src/carousel.js +392 -389
  18. package/es/cascader/src/cascader.js +1667 -1664
  19. package/es/checkbox/src/button.js +198 -195
  20. package/es/checkbox/src/checkbox.js +181 -178
  21. package/es/checkbox/src/group.js +210 -207
  22. package/es/collapse/src/collapse-pane.js +98 -95
  23. package/es/collapse/src/collapse.js +340 -337
  24. package/es/color-picker/src/color-picker.js +1116 -1113
  25. package/es/components.d.ts +1 -0
  26. package/es/components.js +3 -0
  27. package/es/context-menu/src/context-menu.js +601 -598
  28. package/es/countdown/src/countdown.js +224 -221
  29. package/es/date-panel/src/date-panel.js +1905 -1902
  30. package/es/date-picker/src/date-picker.js +1537 -1534
  31. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  32. package/es/divider/src/divider.js +80 -77
  33. package/es/drawer/src/drawer.js +778 -775
  34. package/es/empty/src/empty.js +100 -97
  35. package/es/form/src/form-group.js +74 -71
  36. package/es/form/src/form-item.js +76 -73
  37. package/es/form/src/form.js +789 -786
  38. package/es/icon/src/icon.js +59 -56
  39. package/es/icon/style.css +1 -1
  40. package/es/icon/style.mini.css +1 -1
  41. package/es/icon-picker/src/icon-picker.js +719 -716
  42. package/es/image/src/group.js +130 -127
  43. package/es/image/src/image.js +243 -240
  44. package/es/image/src/preview.js +627 -624
  45. package/es/index.esm.js +2 -0
  46. package/es/index.js +2 -0
  47. package/es/input/src/input.js +2700 -2697
  48. package/es/layout-aside/src/layout-aside.js +138 -135
  49. package/es/layout-body/src/layout-body.js +145 -142
  50. package/es/layout-container/src/layout-container.js +71 -68
  51. package/es/layout-footer/src/layout-footer.js +60 -57
  52. package/es/layout-header/src/layout-header.js +58 -55
  53. package/es/link/src/link.js +131 -128
  54. package/es/list/src/list.js +2174 -2171
  55. package/es/loading/src/loading.js +141 -138
  56. package/es/mention/src/mention.js +49 -46
  57. package/es/menu/src/menu.js +799 -796
  58. package/es/modal/src/modal.js +1519 -1527
  59. package/es/notice-bar/src/notice-bar.js +168 -165
  60. package/es/number-input/src/number-input.js +1094 -1091
  61. package/es/pager/src/pager.js +767 -764
  62. package/es/password-input/src/password-input.js +431 -428
  63. package/es/print/src/page-break.js +63 -60
  64. package/es/print/src/print.js +303 -300
  65. package/es/pulldown/src/pulldown.js +403 -400
  66. package/es/radio/src/button.js +214 -211
  67. package/es/radio/src/group.js +195 -192
  68. package/es/radio/src/radio.js +194 -191
  69. package/es/rate/src/rate.js +164 -161
  70. package/es/result/src/result.js +116 -113
  71. package/es/row/src/col.js +133 -130
  72. package/es/row/src/row.js +111 -108
  73. package/es/scrollbar/src/scrollbar.js +518 -515
  74. package/es/segmented/src/segmented.js +240 -237
  75. package/es/select/src/optgroup.js +44 -41
  76. package/es/select/src/option.js +39 -35
  77. package/es/select/src/select.js +1914 -1891
  78. package/es/slider/src/slider.js +419 -416
  79. package/es/space/src/space.js +190 -187
  80. package/es/splitter/src/splitter-panel.js +146 -143
  81. package/es/splitter/src/splitter.js +917 -914
  82. package/es/step-item/index.d.ts +76 -0
  83. package/es/step-item/index.js +17 -0
  84. package/es/steps/index.d.ts +288 -34
  85. package/es/steps/src/step-info.d.ts +6 -0
  86. package/es/steps/src/step-info.js +20 -0
  87. package/es/steps/src/step-item.d.ts +14 -0
  88. package/es/steps/src/step-item.js +39 -0
  89. package/es/steps/src/steps.d.ts +68 -8
  90. package/es/steps/src/steps.js +299 -47
  91. package/es/steps/src/util.d.ts +7 -0
  92. package/es/steps/src/util.js +44 -0
  93. package/es/steps/style.css +297 -0
  94. package/es/steps/style.mini.css +1 -0
  95. package/es/style.css +433 -2
  96. package/es/style.mini.css +1 -1
  97. package/es/switch/src/switch.js +228 -225
  98. package/es/table-select/src/table-select.js +865 -862
  99. package/es/table-transfer/src/table-transfer.js +61 -58
  100. package/es/tabs/src/tab-pane.js +102 -99
  101. package/es/tabs/src/tabs.js +936 -933
  102. package/es/tag/src/tag.js +163 -160
  103. package/es/text/src/text.js +232 -229
  104. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  105. package/es/textarea/src/textarea.js +434 -431
  106. package/es/timeline/index.d.ts +92 -0
  107. package/es/timeline/src/timeline-info.d.ts +6 -0
  108. package/es/timeline/src/timeline-info.js +19 -0
  109. package/es/timeline/src/timeline-item.d.ts +11 -8
  110. package/es/timeline/src/timeline-item.js +33 -45
  111. package/es/timeline/src/timeline.d.ts +22 -0
  112. package/es/timeline/src/timeline.js +220 -48
  113. package/es/timeline/src/util.d.ts +7 -0
  114. package/es/timeline/src/util.js +44 -0
  115. package/es/timeline/style.css +122 -0
  116. package/es/timeline/style.mini.css +1 -0
  117. package/es/timeline-item/index.d.ts +42 -34
  118. package/es/tip/src/tip.js +117 -114
  119. package/es/tooltip/src/tooltip.js +552 -549
  120. package/es/tour/src/tour.js +49 -46
  121. package/es/transfer/src/transfer.js +95 -92
  122. package/es/tree/src/tree.js +3379 -3376
  123. package/es/tree-select/src/tree-select.js +969 -966
  124. package/es/ui/index.js +8 -2
  125. package/es/ui/src/log.js +1 -1
  126. package/es/upload/src/upload.js +1791 -1788
  127. package/es/vxe-icon/style.css +1 -1
  128. package/es/vxe-icon/style.mini.css +1 -1
  129. package/es/vxe-steps/style.css +297 -0
  130. package/es/vxe-steps/style.mini.css +1 -0
  131. package/es/vxe-timeline/style.css +122 -0
  132. package/es/vxe-timeline/style.mini.css +1 -0
  133. package/es/watermark/src/watermark.js +158 -155
  134. package/lib/alert/src/alert.js +117 -114
  135. package/lib/anchor/src/anchor-link.js +110 -107
  136. package/lib/anchor/src/anchor.js +212 -209
  137. package/lib/avatar/src/avatar.js +132 -129
  138. package/lib/backtop/src/backtop.js +267 -264
  139. package/lib/badge/src/badge.js +102 -99
  140. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  141. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  142. package/lib/button/src/button-group.js +88 -85
  143. package/lib/calendar/src/calendar.js +1371 -1368
  144. package/lib/card/src/card.js +235 -232
  145. package/lib/carousel/src/carousel-item.js +78 -75
  146. package/lib/carousel/src/carousel.js +392 -389
  147. package/lib/cascader/src/cascader.js +1665 -1662
  148. package/lib/checkbox/src/button.js +198 -195
  149. package/lib/checkbox/src/checkbox.js +181 -178
  150. package/lib/checkbox/src/group.js +210 -207
  151. package/lib/collapse/src/collapse-pane.js +98 -95
  152. package/lib/collapse/src/collapse.js +340 -337
  153. package/lib/color-picker/src/color-picker.js +1116 -1113
  154. package/lib/components.js +3 -0
  155. package/lib/context-menu/src/context-menu.js +601 -598
  156. package/lib/countdown/src/countdown.js +224 -221
  157. package/lib/date-panel/src/date-panel.js +1905 -1902
  158. package/lib/date-picker/src/date-picker.js +1537 -1534
  159. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  160. package/lib/divider/src/divider.js +80 -77
  161. package/lib/drawer/src/drawer.js +778 -775
  162. package/lib/empty/src/empty.js +100 -97
  163. package/lib/form/src/form-group.js +74 -71
  164. package/lib/form/src/form-item.js +76 -73
  165. package/lib/form/src/form.js +789 -786
  166. package/lib/icon/src/icon.js +59 -56
  167. package/lib/icon/style/style.css +1 -1
  168. package/lib/icon/style/style.mini.css +1 -1
  169. package/lib/icon-picker/src/icon-picker.js +719 -716
  170. package/lib/image/src/group.js +130 -127
  171. package/lib/image/src/image.js +243 -240
  172. package/lib/image/src/preview.js +627 -624
  173. package/lib/index.common.js +2 -0
  174. package/lib/index.js +2 -0
  175. package/lib/index.umd.js +47724 -46862
  176. package/lib/index.umd.min.js +3 -3
  177. package/lib/input/src/input.js +2700 -2697
  178. package/lib/layout-aside/src/layout-aside.js +138 -135
  179. package/lib/layout-body/src/layout-body.js +145 -142
  180. package/lib/layout-container/src/layout-container.js +71 -68
  181. package/lib/layout-footer/src/layout-footer.js +60 -57
  182. package/lib/layout-header/src/layout-header.js +58 -55
  183. package/lib/link/src/link.js +131 -128
  184. package/lib/list/src/list.js +2173 -2170
  185. package/lib/loading/src/loading.js +141 -138
  186. package/lib/mention/src/mention.js +49 -46
  187. package/lib/menu/src/menu.js +799 -796
  188. package/lib/modal/src/modal.js +1519 -1527
  189. package/lib/notice-bar/src/notice-bar.js +168 -165
  190. package/lib/number-input/src/number-input.js +1094 -1091
  191. package/lib/pager/src/pager.js +767 -764
  192. package/lib/password-input/src/password-input.js +431 -428
  193. package/lib/print/src/page-break.js +63 -60
  194. package/lib/print/src/print.js +303 -300
  195. package/lib/pulldown/src/pulldown.js +403 -400
  196. package/lib/radio/src/button.js +214 -211
  197. package/lib/radio/src/group.js +195 -192
  198. package/lib/radio/src/radio.js +194 -191
  199. package/lib/rate/src/rate.js +164 -161
  200. package/lib/result/src/result.js +116 -113
  201. package/lib/row/src/col.js +133 -130
  202. package/lib/row/src/row.js +111 -108
  203. package/lib/scrollbar/src/scrollbar.js +518 -515
  204. package/lib/segmented/src/segmented.js +240 -237
  205. package/lib/select/src/optgroup.js +44 -41
  206. package/lib/select/src/option.js +39 -35
  207. package/lib/select/src/select.js +1915 -1892
  208. package/lib/slider/src/slider.js +419 -416
  209. package/lib/space/src/space.js +190 -187
  210. package/lib/splitter/src/splitter-panel.js +146 -143
  211. package/lib/splitter/src/splitter.js +917 -914
  212. package/lib/step-item/index.js +47 -0
  213. package/lib/steps/src/step-info.js +49 -0
  214. package/lib/steps/src/step-item.js +59 -0
  215. package/lib/steps/src/steps.js +298 -46
  216. package/lib/steps/src/util.js +74 -0
  217. package/lib/steps/style/style.css +297 -0
  218. package/lib/steps/style/style.mini.css +1 -0
  219. package/lib/style.css +433 -2
  220. package/lib/style.mini.css +1 -1
  221. package/lib/switch/src/switch.js +228 -225
  222. package/lib/table-select/src/table-select.js +865 -862
  223. package/lib/table-transfer/src/table-transfer.js +61 -58
  224. package/lib/tabs/src/tab-pane.js +102 -99
  225. package/lib/tabs/src/tabs.js +936 -933
  226. package/lib/tag/src/tag.js +163 -160
  227. package/lib/text/src/text.js +232 -229
  228. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  229. package/lib/textarea/src/textarea.js +434 -431
  230. package/lib/timeline/src/timeline-info.js +48 -0
  231. package/lib/timeline/src/timeline-item.js +32 -54
  232. package/lib/timeline/src/timeline.js +219 -47
  233. package/lib/timeline/src/util.js +74 -0
  234. package/lib/timeline/style/style.css +122 -0
  235. package/lib/timeline/style/style.mini.css +1 -0
  236. package/lib/tip/src/tip.js +117 -114
  237. package/lib/tooltip/src/tooltip.js +552 -549
  238. package/lib/tour/src/tour.js +49 -46
  239. package/lib/transfer/src/transfer.js +95 -92
  240. package/lib/tree/src/tree.js +3379 -3376
  241. package/lib/tree-select/src/tree-select.js +969 -966
  242. package/lib/ui/index.js +8 -2
  243. package/lib/ui/src/log.js +1 -1
  244. package/lib/upload/src/upload.js +1788 -1785
  245. package/lib/vxe-icon/style/style.css +1 -1
  246. package/lib/vxe-icon/style/style.mini.css +1 -1
  247. package/lib/vxe-steps/style/style.css +297 -0
  248. package/lib/vxe-steps/style/style.mini.css +1 -0
  249. package/lib/vxe-timeline/style/style.css +122 -0
  250. package/lib/vxe-timeline/style/style.mini.css +1 -0
  251. package/lib/watermark/src/watermark.js +158 -155
  252. package/package.json +10 -3
  253. package/packages/alert/src/alert.ts +2 -2
  254. package/packages/anchor/src/anchor-link.ts +2 -2
  255. package/packages/anchor/src/anchor.ts +2 -2
  256. package/packages/avatar/src/avatar.ts +2 -2
  257. package/packages/backtop/src/backtop.ts +2 -2
  258. package/packages/badge/src/badge.ts +2 -2
  259. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  260. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  261. package/packages/button/src/button-group.ts +2 -2
  262. package/packages/calendar/src/calendar.ts +2 -2
  263. package/packages/card/src/card.ts +2 -2
  264. package/packages/carousel/src/carousel-item.ts +2 -2
  265. package/packages/carousel/src/carousel.ts +2 -2
  266. package/packages/cascader/src/cascader.ts +2 -2
  267. package/packages/checkbox/src/button.ts +3 -15
  268. package/packages/checkbox/src/checkbox.ts +2 -2
  269. package/packages/checkbox/src/group.ts +2 -2
  270. package/packages/collapse/src/collapse-pane.ts +2 -2
  271. package/packages/collapse/src/collapse.ts +2 -2
  272. package/packages/color-picker/src/color-picker.ts +2 -2
  273. package/packages/components.ts +3 -0
  274. package/packages/context-menu/src/context-menu.ts +3 -16
  275. package/packages/countdown/src/countdown.ts +2 -2
  276. package/packages/date-panel/src/date-panel.ts +2 -2
  277. package/packages/date-picker/src/date-picker.ts +2 -2
  278. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  279. package/packages/divider/src/divider.ts +2 -2
  280. package/packages/drawer/src/drawer.ts +2 -2
  281. package/packages/empty/src/empty.ts +2 -2
  282. package/packages/form/src/form-group.ts +2 -2
  283. package/packages/form/src/form-item.ts +2 -2
  284. package/packages/form/src/form.ts +2 -2
  285. package/packages/icon/src/icon.ts +2 -2
  286. package/packages/icon-picker/src/icon-picker.ts +2 -2
  287. package/packages/image/src/group.ts +2 -2
  288. package/packages/image/src/image.ts +2 -2
  289. package/packages/image/src/preview.ts +3 -16
  290. package/packages/index.ts +2 -2
  291. package/packages/input/src/input.ts +2 -2
  292. package/packages/layout-aside/src/layout-aside.ts +2 -2
  293. package/packages/layout-body/src/layout-body.ts +2 -2
  294. package/packages/layout-container/src/layout-container.ts +3 -14
  295. package/packages/layout-footer/src/layout-footer.ts +2 -2
  296. package/packages/layout-header/src/layout-header.ts +2 -2
  297. package/packages/link/src/link.ts +2 -2
  298. package/packages/list/src/list.ts +2 -2
  299. package/packages/loading/src/loading.ts +2 -2
  300. package/packages/mention/src/mention.ts +2 -2
  301. package/packages/menu/src/menu.ts +2 -2
  302. package/packages/modal/src/modal.ts +5 -20
  303. package/packages/notice-bar/src/notice-bar.ts +2 -2
  304. package/packages/number-input/src/number-input.ts +3 -17
  305. package/packages/pager/src/pager.ts +2 -2
  306. package/packages/password-input/src/password-input.ts +2 -2
  307. package/packages/print/src/page-break.ts +2 -2
  308. package/packages/print/src/print.ts +2 -2
  309. package/packages/pulldown/src/pulldown.ts +2 -2
  310. package/packages/radio/src/button.ts +3 -16
  311. package/packages/radio/src/group.ts +3 -17
  312. package/packages/radio/src/radio.ts +2 -2
  313. package/packages/rate/src/rate.ts +2 -2
  314. package/packages/result/src/result.ts +2 -2
  315. package/packages/row/src/col.ts +2 -2
  316. package/packages/row/src/row.ts +2 -2
  317. package/packages/scrollbar/src/scrollbar.ts +3 -4
  318. package/packages/segmented/src/segmented.ts +2 -2
  319. package/packages/select/src/optgroup.ts +2 -2
  320. package/packages/select/src/option.ts +5 -3
  321. package/packages/select/src/select.ts +29 -10
  322. package/packages/slider/src/slider.ts +3 -18
  323. package/packages/space/src/space.ts +2 -2
  324. package/packages/splitter/src/splitter-panel.ts +2 -2
  325. package/packages/splitter/src/splitter.ts +2 -2
  326. package/packages/step-item/index.ts +16 -0
  327. package/packages/steps/src/step-info.ts +18 -0
  328. package/packages/steps/src/step-item.ts +41 -0
  329. package/packages/steps/src/steps.ts +273 -13
  330. package/packages/steps/src/util.ts +44 -0
  331. package/packages/switch/src/switch.ts +2 -2
  332. package/packages/table-select/src/table-select.ts +2 -2
  333. package/packages/table-transfer/src/table-transfer.ts +3 -15
  334. package/packages/tabs/src/tab-pane.ts +2 -2
  335. package/packages/tabs/src/tabs.ts +2 -2
  336. package/packages/tag/src/tag.ts +2 -2
  337. package/packages/text/src/text.ts +2 -2
  338. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  339. package/packages/textarea/src/textarea.ts +2 -2
  340. package/packages/timeline/src/timeline-info.ts +17 -0
  341. package/packages/timeline/src/timeline-item.ts +25 -50
  342. package/packages/timeline/src/timeline.ts +201 -18
  343. package/packages/timeline/src/util.ts +44 -0
  344. package/packages/tip/src/tip.ts +2 -2
  345. package/packages/tooltip/src/tooltip.ts +2 -2
  346. package/packages/tour/src/tour.ts +2 -2
  347. package/packages/transfer/src/transfer.ts +2 -2
  348. package/packages/tree/src/tree.ts +2 -2
  349. package/packages/tree-select/src/tree-select.ts +2 -2
  350. package/packages/ui/index.ts +8 -1
  351. package/packages/upload/src/upload.ts +2 -2
  352. package/packages/watermark/src/watermark.ts +2 -2
  353. package/styles/all.scss +1 -0
  354. package/styles/components/step-item.scss +0 -0
  355. package/styles/components/steps.scss +354 -0
  356. package/styles/components/timeline.scss +133 -0
  357. package/styles/theme/base.scss +9 -0
  358. package/styles/theme/dark.scss +2 -1
  359. package/styles/theme/light.scss +1 -0
  360. package/styles/variable.scss +2 -1
  361. package/types/all.d.ts +3 -0
  362. package/types/components/gantt.d.ts +1 -3
  363. package/types/components/optgroup.d.ts +0 -1
  364. package/types/components/option.d.ts +0 -1
  365. package/types/components/select.d.ts +1 -13
  366. package/types/components/step-item.d.ts +72 -0
  367. package/types/components/steps.d.ts +67 -8
  368. package/types/components/table.d.ts +7 -66
  369. package/types/components/timeline-item.d.ts +21 -17
  370. package/types/components/timeline.d.ts +41 -8
  371. package/types/handles/form-design.d.ts +1 -4
  372. package/types/ui/global-config.d.ts +2 -0
  373. package/types/ui/global-icon.d.ts +7 -0
  374. /package/dist/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  375. /package/dist/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  376. /package/dist/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  377. /package/es/icon/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  378. /package/es/icon/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  379. /package/es/icon/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  380. /package/es/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  381. /package/es/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  382. /package/es/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  383. /package/es/vxe-icon/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  384. /package/es/vxe-icon/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  385. /package/es/vxe-icon/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  386. /package/lib/icon/style/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  387. /package/lib/icon/style/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  388. /package/lib/icon/style/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  389. /package/lib/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  390. /package/lib/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  391. /package/lib/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
  392. /package/lib/vxe-icon/style/{iconfont.1793089621562.ttf → iconfont.1793359478136.ttf} +0 -0
  393. /package/lib/vxe-icon/style/{iconfont.1793089621562.woff → iconfont.1793359478136.woff} +0 -0
  394. /package/lib/vxe-icon/style/{iconfont.1793089621562.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -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 = (0, import_comp.defineVxeComponent)({
49
- name: "VxeTabs",
50
- props: {
51
- modelValue: [String, Number, Boolean],
52
- options: Array,
53
- width: [String, Number],
54
- height: [String, Number],
55
- destroyOnClose: {
56
- type: Boolean,
57
- default: () => getConfig().tabs.destroyOnClose
58
- },
59
- titleWidth: [String, Number],
60
- titleAlign: [String, Number],
61
- type: {
62
- type: String,
63
- default: () => getConfig().tabs.type
64
- },
65
- position: {
66
- type: String,
67
- default: () => getConfig().tabs.position
68
- },
69
- showClose: Boolean,
70
- showBody: {
71
- type: Boolean,
72
- default: true
73
- },
74
- padding: {
75
- type: Boolean,
76
- default: () => getConfig().tabs.padding
77
- },
78
- trigger: String,
79
- beforeChangeMethod: Function,
80
- closeConfig: Object,
81
- refreshConfig: Object,
82
- size: {
83
- type: String,
84
- default: () => getConfig().tabs.size || getConfig().size
85
- },
86
- useScrollbar: {
87
- type: Boolean,
88
- default: () => getDefVal(getConfig().tabs.useScrollbar, getConfig().useScrollbar)
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
- scrollbarConfig: Object,
91
- // 已废弃
92
- beforeCloseMethod: Function
93
- },
94
- emits: ["update:modelValue", "change", "tab-change", "tab-change-fail", "tab-close", "tab-close-fail", "tab-click", "tab-load"],
95
- setup(props, context) {
96
- const { slots, emit } = context;
97
- const xID = import_xe_utils.default.uniqueId();
98
- const $xeParentTabs = (0, import_vue.inject)("$xeTabs", null);
99
- const { computeSize } = useFns.useSize(props);
100
- const { computeIsVScrollbar } = useFns.useVScrollbar(props);
101
- const refElem = (0, import_vue.ref)();
102
- const refHeadWrapperElem = (0, import_vue.ref)();
103
- const refHeadPrevElem = (0, import_vue.ref)();
104
- const refHeadNextElem = (0, import_vue.ref)();
105
- const reactData = (0, import_vue.reactive)({
106
- staticTabs: [],
107
- activeName: null,
108
- initNames: [],
109
- lintLeft: 0,
110
- lintTop: 0,
111
- lintWidth: 0,
112
- lintHeight: 0,
113
- scrollbarWidth: 0,
114
- scrollbarHeight: 0,
115
- isTabOver: false,
116
- resizeFlag: 1,
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
- const computeWrapperStyle = (0, import_vue.computed)(() => {
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
- const computeMaps = {};
196
- const $xeTabs = {
197
- xID,
198
- props,
199
- context,
200
- reactData,
201
- getRefMaps: () => refMaps,
202
- getComputeMaps: () => computeMaps
203
- };
204
- const handleFilterTab = (item) => {
205
- const { permissionCode } = item;
206
- if (permissionCode) {
207
- if (!permission.checkVisible(permissionCode)) {
208
- return false;
209
- }
210
- }
211
- return true;
212
- };
213
- const callSlot = (slotFunc, params) => {
214
- if (slotFunc) {
215
- if (import_xe_utils.default.isString(slotFunc)) {
216
- slotFunc = slots[slotFunc] || null;
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 (import_xe_utils.default.isFunction(slotFunc)) {
219
- return (0, import_vn.getSlotVNs)(slotFunc(params));
156
+ if (height) {
157
+ stys.height = height === "auto" ? "100%" : (0, import_dom.toCssUnit)(height);
220
158
  }
221
- }
222
- return [];
223
- };
224
- const checkScrolling = () => {
225
- const lrPosition = computeLrPosition.value;
226
- const headerWrapperEl = refHeadWrapperElem.value;
227
- const headPrevEl = refHeadPrevElem.value;
228
- const headNextEl = refHeadNextElem.value;
229
- if (headerWrapperEl) {
230
- const { scrollLeft, scrollTop, clientWidth, clientHeight, scrollWidth, scrollHeight } = headerWrapperEl;
231
- if (headPrevEl) {
232
- if ((lrPosition ? scrollTop : scrollLeft) > 0) {
233
- (0, import_dom.addClass)(headPrevEl, "scrolling--middle");
234
- } else {
235
- (0, import_dom.removeClass)(headPrevEl, "scrolling--middle");
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
- if (headNextEl) {
239
- if (lrPosition ? clientHeight < scrollHeight - Math.ceil(scrollTop) : clientWidth < scrollWidth - Math.ceil(scrollLeft)) {
240
- (0, import_dom.addClass)(headNextEl, "scrolling--middle");
241
- } else {
242
- (0, import_dom.removeClass)(headNextEl, "scrolling--middle");
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
- const updateTabStyle = () => {
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
- let lintWidth = 0;
256
- let lintHeight = 0;
257
- let lintLeft = 0;
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 index = import_xe_utils.default.findIndexOf(tabStaticOptions.length ? tabStaticOptions : tabOptions, (item) => item.name === activeName);
264
- const { children, offsetWidth, scrollWidth, offsetHeight, scrollHeight, clientWidth, clientHeight } = headerWrapperEl;
265
- sBarWidth = offsetWidth - clientWidth;
266
- sBarHeight = offsetHeight - clientHeight;
267
- if (lrPosition) {
268
- isOver = scrollHeight !== clientHeight;
269
- if (index > -1) {
270
- const tabEl = children[index];
271
- if (tabEl) {
272
- let tabHeight = tabEl.clientHeight;
273
- const tabWidth = tabEl.clientWidth;
274
- if (tabType === "card") {
275
- lintWidth = tabWidth;
276
- lintHeight = tabHeight;
277
- lintTop = tabEl.offsetTop;
278
- } else if (tabType === "border-card") {
279
- lintWidth = tabWidth;
280
- lintHeight = tabHeight;
281
- lintTop = tabEl.offsetTop - 1;
282
- } else {
283
- const tabStyle = getComputedStyle(tabEl);
284
- const paddingTop = import_xe_utils.default.toNumber(tabStyle.paddingTop);
285
- const paddingBottom = import_xe_utils.default.toNumber(tabStyle.paddingBottom);
286
- tabHeight -= paddingTop + paddingBottom;
287
- lintHeight = Math.max(4, tabHeight);
288
- lintTop = tabEl.offsetTop + paddingTop + Math.floor((tabHeight - lintHeight) / 2);
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
- } else {
293
- isOver = scrollWidth !== clientWidth;
294
- if (index > -1) {
295
- const tabEl = children[index];
296
- if (tabEl) {
297
- let tabWidth = tabEl.clientWidth;
298
- if (tabType === "card") {
299
- lintWidth = tabWidth + 1;
300
- lintLeft = tabEl.offsetLeft;
301
- } else if (tabType === "border-card") {
302
- lintWidth = tabWidth;
303
- lintLeft = tabEl.offsetLeft - 1;
304
- } else {
305
- const tabStyle = getComputedStyle(tabEl);
306
- const paddingLeft = import_xe_utils.default.toNumber(tabStyle.paddingLeft);
307
- const paddingRight = import_xe_utils.default.toNumber(tabStyle.paddingRight);
308
- tabWidth -= paddingLeft + paddingRight;
309
- lintWidth = Math.max(4, tabWidth);
310
- lintLeft = tabEl.offsetLeft + paddingLeft + Math.floor((tabWidth - lintWidth) / 2);
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
- reactData.scrollbarWidth = sBarWidth;
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
- handleStyle();
326
- (0, import_vue.nextTick)(handleStyle);
327
- };
328
- const dispatchEvent = (type, params, evnt) => {
329
- emit(type, createEvent(evnt, { $tabs: $xeTabs }, params));
330
- };
331
- const emitModel = (value) => {
332
- emit("update:modelValue", value);
333
- };
334
- const addInitName = (name, evnt) => {
335
- const { initNames } = reactData;
336
- if (name && !initNames.includes(name)) {
337
- dispatchEvent("tab-load", { name }, evnt);
338
- initNames.push(name);
339
- return true;
340
- }
341
- return false;
342
- };
343
- const initDefaultName = (list) => {
344
- let activeName = null;
345
- const nameMaps = {};
346
- if (list && list.length) {
347
- let validVal = false;
348
- activeName = props.modelValue;
349
- list.forEach((item) => {
350
- const { name, preload } = item || {};
351
- if (name) {
352
- nameMaps[`${name}`] = {
353
- loading: false
354
- };
355
- if (activeName === name) {
356
- validVal = true;
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
- if (preload) {
359
- addInitName(name, null);
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
- reactData.activeName = activeName;
370
- reactData.cacheTabMaps = nameMaps;
371
- };
372
- const clickEvent = (evnt, item) => {
373
- const { trigger } = props;
374
- const beforeMethod = props.beforeChangeMethod || getConfig().tabs.beforeChangeMethod;
375
- const { activeName } = reactData;
376
- const { name } = item;
377
- const value = name;
378
- dispatchEvent("tab-click", { name }, evnt);
379
- if (trigger === "manual") {
380
- return;
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
- reactData.activeName = name;
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-change-fail", { value, name, oldName: activeName, newName: name, option: item }, evnt);
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
- }).catch(() => {
438
- dispatchEvent("tab-close-fail", { value, name, nextName }, evnt);
439
- });
440
- };
441
- const startScrollAnimation = (offsetPos, offsetSize) => {
442
- const { slTimeout } = internalData;
443
- const lrPosition = computeLrPosition.value;
444
- let offsetLeft = lrPosition ? 0 : offsetSize;
445
- let offsetTop = lrPosition ? offsetSize : 0;
446
- let scrollCount = 6;
447
- let delayNum = 35;
448
- if (slTimeout) {
449
- clearTimeout(slTimeout);
450
- internalData.slTimeout = void 0;
451
- }
452
- const scrollAnimate = () => {
453
- const headerWrapperEl = refHeadWrapperElem.value;
454
- if (scrollCount > 0) {
455
- scrollCount--;
456
- if (headerWrapperEl) {
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
- if (scrollLeft > 0) {
483
- headerWrapperEl.scrollLeft -= offsetLeft;
484
- delayNum -= 4;
485
- internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
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
- scrollAnimate();
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 index = import_xe_utils.default.findIndexOf(tabStaticOptions.length ? tabStaticOptions : tabOptions, (item) => item.name === name);
518
- if (index > -1) {
519
- const { scrollLeft, scrollTop, clientWidth, clientHeight, children } = headerWrapperEl;
520
- const tabEl = children[index];
521
- if (tabEl) {
522
- if (lrPosition) {
523
- const tabOffsetTop = tabEl.offsetTop;
524
- const tabClientHeight = tabEl.clientHeight;
525
- const overSize = tabOffsetTop + tabClientHeight - (scrollTop + clientHeight);
526
- if (overSize > 0) {
527
- headerWrapperEl.scrollTop += overSize;
528
- }
529
- if (tabOffsetTop < scrollTop) {
530
- headerWrapperEl.scrollTop = tabOffsetTop;
531
- }
532
- } else {
533
- const tabOffsetLeft = tabEl.offsetLeft;
534
- const tabClientWidth = tabEl.clientWidth;
535
- const overSize = tabOffsetLeft + tabClientWidth - (scrollLeft + clientWidth);
536
- if (overSize > 0) {
537
- headerWrapperEl.scrollLeft += overSize;
538
- }
539
- if (tabOffsetLeft < scrollLeft) {
540
- headerWrapperEl.scrollLeft = tabOffsetLeft;
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
- updateTabStyle();
546
- }
547
- });
548
- };
549
- const handlePrevNext = (isNext) => {
550
- const { activeName } = reactData;
551
- const tabOptions = computeTabOptions.value;
552
- const tabStaticOptions = computeTabStaticOptions.value;
553
- const list = tabStaticOptions.length ? tabStaticOptions : tabOptions;
554
- const index = import_xe_utils.default.findIndexOf(list, (item) => item.name === activeName);
555
- if (index > -1) {
556
- let item = null;
557
- if (isNext) {
558
- if (index < list.length - 1) {
559
- item = list[index + 1];
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
- } else {
562
- if (index > 0) {
563
- item = list[index - 1];
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
- if (item) {
567
- const name = item.name;
568
- const value = name;
569
- reactData.activeName = name;
570
- emitModel(value);
571
- addInitName(name, null);
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
- tabPrefixSlot ? (0, import_vue.h)(
617
- "div",
618
- {
619
- class: ["vxe-tabs-header--prefix", `type--${tabType}`, `pos--${tabPosition}`]
620
- },
621
- callSlot(tabPrefixSlot, { name: activeName })
622
- ) : renderEmptyElement($xeTabs),
623
- isTabOver ? (0, import_vue.h)(
624
- "div",
625
- {
626
- ref: refHeadPrevElem,
627
- class: ["vxe-tabs-header--bar vxe-tabs-header--prev-bar", `type--${tabType}`, `pos--${tabPosition}`],
628
- onClick: scrollLeftEvent
629
- },
630
- [
631
- (0, import_vue.h)("span", {
632
- class: lrPosition ? getIcon().TABS_TAB_BUTTON_TOP : getIcon().TABS_TAB_BUTTON_LEFT
633
- })
634
- ]
635
- ) : renderEmptyElement($xeTabs),
636
- (0, import_vue.h)(
637
- "div",
638
- {
639
- class: ["vxe-tabs-header--wrapper", `type--${tabType}`, `pos--${tabPosition}`]
640
- },
641
- [
642
- (0, import_vue.h)(
643
- "div",
644
- {
645
- ref: refHeadWrapperElem,
646
- class: "vxe-tabs-header--item-wrapper",
647
- style: lrPosition ? {
648
- marginRight: `-${scrollbarWidth + scrollbarOffsetSize}px`,
649
- paddingRight: `${scrollbarOffsetSize}px`
650
- } : {
651
- marginBottom: `-${scrollbarHeight + scrollbarOffsetSize}px`,
652
- paddingBottom: `${scrollbarOffsetSize}px`
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
- onScroll: checkScrolling
655
- },
656
- tabList.map((item, index) => {
657
- const { title, titleWidth, titleAlign, icon, name } = item;
658
- const itemSlots = item.slots || {};
659
- const titleSlot = itemSlots.title || itemSlots.tab;
660
- const titlePrefixSlot = itemSlots.titlePrefix || itemSlots["title-prefix"];
661
- const titleSuffixSlot = itemSlots.titleSuffix || itemSlots["title-suffix"];
662
- const itemWidth = titleWidth || allTitleWidth;
663
- const itemAlign = titleAlign || allTitleAlign;
664
- const params = { $tabs: $xeTabs, value: activeName, name, option: item };
665
- const isActive = activeName === name;
666
- const cacheItem = name ? cacheTabMaps[`${name}`] : null;
667
- const isLoading = cacheItem ? cacheItem.loading : false;
668
- return (0, import_vue.h)(
669
- "div",
670
- {
671
- key: `${name}`,
672
- class: [
673
- "vxe-tabs-header--item",
674
- `type--${tabType}`,
675
- `pos--${tabPosition}`,
676
- itemAlign ? `align--${itemAlign}` : "",
677
- {
678
- "is--active": isActive
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
- style: itemWidth ? {
682
- width: (0, import_dom.toCssUnit)(itemWidth)
683
- } : void 0,
684
- onClick(evnt) {
685
- clickEvent(evnt, item);
686
- }
687
- },
688
- [
689
- (0, import_vue.h)(
690
- "div",
691
- {
692
- class: "vxe-tabs-header--item-inner"
693
- },
694
- [
695
- (0, import_vue.h)(
696
- "div",
697
- {
698
- class: "vxe-tabs-header--item-content"
699
- },
700
- [
701
- icon ? (0, import_vue.h)(
702
- "span",
703
- {
704
- class: "vxe-tabs-header--item-icon"
705
- },
706
- [
707
- (0, import_vue.h)("i", {
708
- class: icon
709
- })
710
- ]
711
- ) : renderEmptyElement($xeTabs),
712
- titlePrefixSlot ? (0, import_vue.h)(
713
- "span",
714
- {
715
- class: "vxe-tabs-header--item-prefix"
716
- },
717
- callSlot(titlePrefixSlot, { name, title })
718
- ) : renderEmptyElement($xeTabs),
719
- (0, import_vue.h)(
720
- "span",
721
- {
722
- class: "vxe-tabs-header--item-name"
723
- },
724
- titleSlot ? callSlot(titleSlot, { name, title }) : `${title}`
725
- ),
726
- titleSuffixSlot ? (0, import_vue.h)(
727
- "span",
728
- {
729
- class: "vxe-tabs-header--item-suffix"
730
- },
731
- callSlot(titleSuffixSlot, { name, title })
732
- ) : renderEmptyElement($xeTabs)
733
- ]
734
- ),
735
- ((0, import_utils.isEnableConf)(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) : true) ? (0, import_vue.h)(
736
- "div",
737
- {
738
- class: [
739
- "vxe-tabs-header--refresh-btn",
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
- onClick(evnt) {
747
- handleRefreshTabEvent(evnt, item);
748
- }
749
- },
750
- [
751
- (0, import_vue.h)("i", {
752
- class: isLoading ? getIcon().TABS_TAB_REFRESH_LOADING : getIcon().TABS_TAB_REFRESH
753
- })
754
- ]
755
- ) : renderEmptyElement($xeTabs),
756
- (showClose || (0, import_utils.isEnableConf)(closeConfig) || closeOpts.enabled) && (!closeVisibleMethod || closeVisibleMethod(params)) ? (0, import_vue.h)(
757
- "div",
758
- {
759
- class: [
760
- "vxe-tabs-header--close-btn",
761
- {
762
- "is--active": isActive
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
- onClick(evnt) {
766
- handleCloseTabEvent(evnt, item, index, tabList);
767
- }
768
- },
769
- [
770
- (0, import_vue.h)("i", {
771
- class: getIcon().TABS_TAB_CLOSE
772
- })
773
- ]
774
- ) : renderEmptyElement($xeTabs)
775
- ]
776
- )
777
- ]
778
- );
779
- }).concat([
780
- (0, import_vue.h)("span", {
781
- key: "line",
782
- class: ["vxe-tabs-header--active-line", `type--${tabType}`, `pos--${tabPosition}`],
783
- style: lineStyle
784
- })
785
- ])
786
- )
787
- ]
788
- ),
789
- isTabOver ? (0, import_vue.h)(
790
- "div",
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
- ref: refHeadNextElem,
793
- class: ["vxe-tabs-header--bar vxe-tabs-header--next-bar", `type--${tabType}`, `pos--${tabPosition}`],
794
- onClick: scrollRightEvent
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
- (0, import_vue.h)("span", {
798
- class: lrPosition ? getIcon().TABS_TAB_BUTTON_BOTTOM : getIcon().TABS_TAB_BUTTON_RIGHT
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
- class: ["vxe-tabs-header--suffix", `type--${tabType}`, `pos--${tabPosition}`]
839
+ key: `${name}`,
840
+ class: [
841
+ "vxe-tabs-pane--item",
842
+ {
843
+ "is--visible": activeName === name
844
+ }
845
+ ]
806
846
  },
807
- callSlot(tabSuffixSlot, { name: activeName })
808
- ) : renderEmptyElement($xeTabs)
809
- ]
810
- );
811
- };
812
- const renderTabPane = (item) => {
813
- const { initNames, activeName } = reactData;
814
- const { name, slots: slots2 } = item;
815
- const defaultSlot = slots2 ? slots2.default : null;
816
- const scrollbarProps = computeScrollbarProps.value;
817
- const isVScrollbar = computeIsVScrollbar.value;
818
- if (name && initNames.includes(name)) {
819
- return isVScrollbar ? (0, import_vue.h)(
820
- import_scrollbar.default,
821
- {
822
- key: `${name}`,
823
- class: [
824
- "vxe-tabs-pane--scrollbar-item",
825
- {
826
- "is--visible": activeName === name
827
- }
828
- ],
829
- ...scrollbarProps
830
- },
831
- {
832
- default: () => defaultSlot ? callSlot(defaultSlot, { name }) : []
833
- }
834
- ) : (0, import_vue.h)(
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: `${name}`,
880
+ key: "tb",
838
881
  class: [
839
- "vxe-tabs-pane--item",
882
+ "vxe-tabs-pane--wrapper",
883
+ `type--${tabType}`,
884
+ `pos--${tabPosition}`,
840
885
  {
841
- "is--visible": activeName === name
886
+ "is--content": showBody
842
887
  }
843
888
  ]
844
889
  },
845
- defaultSlot ? callSlot(defaultSlot, { name }) : []
846
- );
847
- }
848
- return renderEmptyElement($xeTabs);
849
- };
850
- const renderTabContent = (tabList) => {
851
- const { destroyOnClose } = props;
852
- const { activeName } = reactData;
853
- if (destroyOnClose) {
854
- const activeTab = tabList.find((item) => item.name === activeName);
855
- return [activeTab ? renderTabPane(activeTab) : renderEmptyElement($xeTabs)];
856
- }
857
- return tabList.map((item) => renderTabPane(item));
858
- };
859
- const rendetTabBody = (tabList) => {
860
- const { height, padding, showBody } = props;
861
- const { activeName, cacheTabMaps } = reactData;
862
- const vSize = computeSize.value;
863
- const tabType = computeTabType.value;
864
- const tabPosition = computeTabPosition.value;
865
- const refreshOpts = computeRefreshOpts.value;
866
- const { showLoading } = refreshOpts;
867
- const headerpSlot = slots.header;
868
- const footerSlot = slots.footer;
869
- if (!showBody) {
870
- return renderEmptyElement($xeTabs);
871
- }
872
- const cacheItem = activeName ? cacheTabMaps[`${activeName}`] : null;
873
- const isLoading = cacheItem ? cacheItem.loading : false;
874
- const defParams = { name: activeName };
875
- return (0, import_vue.h)(
876
- "div",
877
- {
878
- key: "tb",
879
- class: [
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
- headerpSlot ? (0, import_vue.h)(
890
- "div",
891
- {
892
- class: "vxe-tabs-pane--header"
893
- },
894
- callSlot(headerpSlot, defParams)
895
- ) : renderEmptyElement($xeTabs),
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
- class: [
900
- "vxe-tabs-pane--body",
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
- renderTabContent(tabList)
911
- ),
912
- footerSlot ? (0, import_vue.h)(
913
- "div",
914
- {
915
- class: "vxe-tabs-pane--footer"
916
- },
917
- callSlot(footerSlot, defParams)
918
- ) : renderEmptyElement($xeTabs),
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
- key: "ts",
942
- class: "vxe-tabs-slots"
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
- defaultSlot ? defaultSlot({ name: activeName }) : []
945
- )
946
- ];
947
- if (tabPosition === "right" || tabPosition === "bottom") {
948
- vns.push(rendetTabBody(tabList), renderTabHeader(tabList));
949
- } else {
950
- vns.push(renderTabHeader(tabList), rendetTabBody(tabList));
951
- }
952
- return (0, import_vue.h)(
953
- "div",
954
- {
955
- ref: refElem,
956
- class: [
957
- "vxe-tabs",
958
- `pos--${tabPosition}`,
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
- (0, import_vue.watch)(
973
- () => props.position,
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
- (0, import_vue.watch)(
979
- () => props.modelValue,
980
- (val) => {
981
- addInitName(val, null);
982
- reactData.activeName = val;
983
- }
984
- );
985
- (0, import_vue.watch)(
986
- () => reactData.activeName,
987
- (val) => {
988
- scrollToTab(val);
989
- }
990
- );
991
- const optsFlag = (0, import_vue.ref)(0);
992
- (0, import_vue.watch)(
993
- () => props.options ? props.options.length : -1,
994
- () => {
995
- optsFlag.value++;
996
- }
997
- );
998
- (0, import_vue.watch)(
999
- () => props.options,
1000
- () => {
1001
- optsFlag.value++;
1002
- }
1003
- );
1004
- (0, import_vue.watch)(optsFlag, () => {
1005
- initDefaultName(props.options);
1006
- reactData.resizeFlag++;
1007
- });
1008
- const stFlag = (0, import_vue.ref)(0);
1009
- (0, import_vue.watch)(
1010
- () => reactData.staticTabs ? reactData.staticTabs.length : -1,
1011
- () => {
1012
- stFlag.value++;
1013
- }
1014
- );
1015
- (0, import_vue.watch)(
1016
- () => reactData.staticTabs,
1017
- () => {
1018
- stFlag.value++;
1019
- }
1020
- );
1021
- (0, import_vue.watch)(stFlag, () => {
1022
- initDefaultName(reactData.staticTabs);
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
+ );