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.
Files changed (367) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  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 -36
  77. package/es/select/src/select.js +1914 -1896
  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 +307 -1
  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/src/timeline.js +74 -36
  107. package/es/timeline/src/util.js +7 -4
  108. package/es/tip/src/tip.js +117 -114
  109. package/es/tooltip/src/tooltip.js +552 -549
  110. package/es/tour/src/tour.js +49 -46
  111. package/es/transfer/src/transfer.js +95 -92
  112. package/es/tree/src/tree.js +3379 -3376
  113. package/es/tree-select/src/tree-select.js +969 -966
  114. package/es/ui/index.js +8 -2
  115. package/es/ui/src/log.js +1 -1
  116. package/es/upload/src/upload.js +1791 -1788
  117. package/es/vxe-icon/style.css +1 -1
  118. package/es/vxe-icon/style.mini.css +1 -1
  119. package/es/vxe-steps/style.css +297 -0
  120. package/es/vxe-steps/style.mini.css +1 -0
  121. package/es/watermark/src/watermark.js +158 -155
  122. package/lib/alert/src/alert.js +117 -114
  123. package/lib/anchor/src/anchor-link.js +110 -107
  124. package/lib/anchor/src/anchor.js +212 -209
  125. package/lib/avatar/src/avatar.js +132 -129
  126. package/lib/backtop/src/backtop.js +267 -264
  127. package/lib/badge/src/badge.js +102 -99
  128. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  129. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  130. package/lib/button/src/button-group.js +88 -85
  131. package/lib/calendar/src/calendar.js +1371 -1368
  132. package/lib/card/src/card.js +235 -232
  133. package/lib/carousel/src/carousel-item.js +78 -75
  134. package/lib/carousel/src/carousel.js +392 -389
  135. package/lib/cascader/src/cascader.js +1665 -1662
  136. package/lib/checkbox/src/button.js +198 -195
  137. package/lib/checkbox/src/checkbox.js +181 -178
  138. package/lib/checkbox/src/group.js +210 -207
  139. package/lib/collapse/src/collapse-pane.js +98 -95
  140. package/lib/collapse/src/collapse.js +340 -337
  141. package/lib/color-picker/src/color-picker.js +1116 -1113
  142. package/lib/components.js +3 -0
  143. package/lib/context-menu/src/context-menu.js +601 -598
  144. package/lib/countdown/src/countdown.js +224 -221
  145. package/lib/date-panel/src/date-panel.js +1905 -1902
  146. package/lib/date-picker/src/date-picker.js +1537 -1534
  147. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  148. package/lib/divider/src/divider.js +80 -77
  149. package/lib/drawer/src/drawer.js +778 -775
  150. package/lib/empty/src/empty.js +100 -97
  151. package/lib/form/src/form-group.js +74 -71
  152. package/lib/form/src/form-item.js +76 -73
  153. package/lib/form/src/form.js +789 -786
  154. package/lib/icon/src/icon.js +59 -56
  155. package/lib/icon/style/style.css +1 -1
  156. package/lib/icon/style/style.mini.css +1 -1
  157. package/lib/icon-picker/src/icon-picker.js +719 -716
  158. package/lib/image/src/group.js +130 -127
  159. package/lib/image/src/image.js +243 -240
  160. package/lib/image/src/preview.js +627 -624
  161. package/lib/index.common.js +2 -0
  162. package/lib/index.js +2 -0
  163. package/lib/index.umd.js +47411 -46732
  164. package/lib/index.umd.min.js +3 -3
  165. package/lib/input/src/input.js +2700 -2697
  166. package/lib/layout-aside/src/layout-aside.js +138 -135
  167. package/lib/layout-body/src/layout-body.js +145 -142
  168. package/lib/layout-container/src/layout-container.js +71 -68
  169. package/lib/layout-footer/src/layout-footer.js +60 -57
  170. package/lib/layout-header/src/layout-header.js +58 -55
  171. package/lib/link/src/link.js +131 -128
  172. package/lib/list/src/list.js +2173 -2170
  173. package/lib/loading/src/loading.js +141 -138
  174. package/lib/mention/src/mention.js +49 -46
  175. package/lib/menu/src/menu.js +799 -796
  176. package/lib/modal/src/modal.js +1519 -1527
  177. package/lib/notice-bar/src/notice-bar.js +168 -165
  178. package/lib/number-input/src/number-input.js +1094 -1091
  179. package/lib/pager/src/pager.js +767 -764
  180. package/lib/password-input/src/password-input.js +431 -428
  181. package/lib/print/src/page-break.js +63 -60
  182. package/lib/print/src/print.js +303 -300
  183. package/lib/pulldown/src/pulldown.js +403 -400
  184. package/lib/radio/src/button.js +214 -211
  185. package/lib/radio/src/group.js +195 -192
  186. package/lib/radio/src/radio.js +194 -191
  187. package/lib/rate/src/rate.js +164 -161
  188. package/lib/result/src/result.js +116 -113
  189. package/lib/row/src/col.js +133 -130
  190. package/lib/row/src/row.js +111 -108
  191. package/lib/scrollbar/src/scrollbar.js +518 -515
  192. package/lib/segmented/src/segmented.js +240 -237
  193. package/lib/select/src/optgroup.js +44 -41
  194. package/lib/select/src/option.js +39 -36
  195. package/lib/select/src/select.js +1915 -1897
  196. package/lib/slider/src/slider.js +419 -416
  197. package/lib/space/src/space.js +190 -187
  198. package/lib/splitter/src/splitter-panel.js +146 -143
  199. package/lib/splitter/src/splitter.js +917 -914
  200. package/lib/step-item/index.js +47 -0
  201. package/lib/steps/src/step-info.js +49 -0
  202. package/lib/steps/src/step-item.js +59 -0
  203. package/lib/steps/src/steps.js +298 -46
  204. package/lib/steps/src/util.js +74 -0
  205. package/lib/steps/style/style.css +297 -0
  206. package/lib/steps/style/style.mini.css +1 -0
  207. package/lib/style.css +307 -1
  208. package/lib/style.mini.css +1 -1
  209. package/lib/switch/src/switch.js +228 -225
  210. package/lib/table-select/src/table-select.js +865 -862
  211. package/lib/table-transfer/src/table-transfer.js +61 -58
  212. package/lib/tabs/src/tab-pane.js +102 -99
  213. package/lib/tabs/src/tabs.js +936 -933
  214. package/lib/tag/src/tag.js +163 -160
  215. package/lib/text/src/text.js +232 -229
  216. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  217. package/lib/textarea/src/textarea.js +434 -431
  218. package/lib/timeline/src/timeline.js +74 -36
  219. package/lib/timeline/src/util.js +7 -4
  220. package/lib/tip/src/tip.js +117 -114
  221. package/lib/tooltip/src/tooltip.js +552 -549
  222. package/lib/tour/src/tour.js +49 -46
  223. package/lib/transfer/src/transfer.js +95 -92
  224. package/lib/tree/src/tree.js +3379 -3376
  225. package/lib/tree-select/src/tree-select.js +969 -966
  226. package/lib/ui/index.js +8 -2
  227. package/lib/ui/src/log.js +1 -1
  228. package/lib/upload/src/upload.js +1788 -1785
  229. package/lib/vxe-icon/style/style.css +1 -1
  230. package/lib/vxe-icon/style/style.mini.css +1 -1
  231. package/lib/vxe-steps/style/style.css +297 -0
  232. package/lib/vxe-steps/style/style.mini.css +1 -0
  233. package/lib/watermark/src/watermark.js +158 -155
  234. package/package.json +1 -1
  235. package/packages/alert/src/alert.ts +2 -2
  236. package/packages/anchor/src/anchor-link.ts +2 -2
  237. package/packages/anchor/src/anchor.ts +2 -2
  238. package/packages/avatar/src/avatar.ts +2 -2
  239. package/packages/backtop/src/backtop.ts +2 -2
  240. package/packages/badge/src/badge.ts +2 -2
  241. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  242. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  243. package/packages/button/src/button-group.ts +2 -2
  244. package/packages/calendar/src/calendar.ts +2 -2
  245. package/packages/card/src/card.ts +2 -2
  246. package/packages/carousel/src/carousel-item.ts +2 -2
  247. package/packages/carousel/src/carousel.ts +2 -2
  248. package/packages/cascader/src/cascader.ts +2 -2
  249. package/packages/checkbox/src/button.ts +3 -15
  250. package/packages/checkbox/src/checkbox.ts +2 -2
  251. package/packages/checkbox/src/group.ts +2 -2
  252. package/packages/collapse/src/collapse-pane.ts +2 -2
  253. package/packages/collapse/src/collapse.ts +2 -2
  254. package/packages/color-picker/src/color-picker.ts +2 -2
  255. package/packages/components.ts +3 -0
  256. package/packages/context-menu/src/context-menu.ts +3 -16
  257. package/packages/countdown/src/countdown.ts +2 -2
  258. package/packages/date-panel/src/date-panel.ts +2 -2
  259. package/packages/date-picker/src/date-picker.ts +2 -2
  260. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  261. package/packages/divider/src/divider.ts +2 -2
  262. package/packages/drawer/src/drawer.ts +2 -2
  263. package/packages/empty/src/empty.ts +2 -2
  264. package/packages/form/src/form-group.ts +2 -2
  265. package/packages/form/src/form-item.ts +2 -2
  266. package/packages/form/src/form.ts +2 -2
  267. package/packages/icon/src/icon.ts +2 -2
  268. package/packages/icon-picker/src/icon-picker.ts +2 -2
  269. package/packages/image/src/group.ts +2 -2
  270. package/packages/image/src/image.ts +2 -2
  271. package/packages/image/src/preview.ts +3 -16
  272. package/packages/index.ts +2 -2
  273. package/packages/input/src/input.ts +2 -2
  274. package/packages/layout-aside/src/layout-aside.ts +2 -2
  275. package/packages/layout-body/src/layout-body.ts +2 -2
  276. package/packages/layout-container/src/layout-container.ts +3 -14
  277. package/packages/layout-footer/src/layout-footer.ts +2 -2
  278. package/packages/layout-header/src/layout-header.ts +2 -2
  279. package/packages/link/src/link.ts +2 -2
  280. package/packages/list/src/list.ts +2 -2
  281. package/packages/loading/src/loading.ts +2 -2
  282. package/packages/mention/src/mention.ts +2 -2
  283. package/packages/menu/src/menu.ts +2 -2
  284. package/packages/modal/src/modal.ts +5 -20
  285. package/packages/notice-bar/src/notice-bar.ts +2 -2
  286. package/packages/number-input/src/number-input.ts +3 -17
  287. package/packages/pager/src/pager.ts +2 -2
  288. package/packages/password-input/src/password-input.ts +2 -2
  289. package/packages/print/src/page-break.ts +2 -2
  290. package/packages/print/src/print.ts +2 -2
  291. package/packages/pulldown/src/pulldown.ts +2 -2
  292. package/packages/radio/src/button.ts +3 -16
  293. package/packages/radio/src/group.ts +3 -17
  294. package/packages/radio/src/radio.ts +2 -2
  295. package/packages/rate/src/rate.ts +2 -2
  296. package/packages/result/src/result.ts +2 -2
  297. package/packages/row/src/col.ts +2 -2
  298. package/packages/row/src/row.ts +2 -2
  299. package/packages/scrollbar/src/scrollbar.ts +3 -4
  300. package/packages/segmented/src/segmented.ts +2 -2
  301. package/packages/select/src/optgroup.ts +2 -2
  302. package/packages/select/src/option.ts +2 -2
  303. package/packages/select/src/select.ts +33 -19
  304. package/packages/slider/src/slider.ts +2 -2
  305. package/packages/space/src/space.ts +2 -2
  306. package/packages/splitter/src/splitter-panel.ts +2 -2
  307. package/packages/splitter/src/splitter.ts +2 -2
  308. package/packages/step-item/index.ts +16 -0
  309. package/packages/steps/src/step-info.ts +18 -0
  310. package/packages/steps/src/step-item.ts +41 -0
  311. package/packages/steps/src/steps.ts +273 -13
  312. package/packages/steps/src/util.ts +44 -0
  313. package/packages/switch/src/switch.ts +2 -2
  314. package/packages/table-select/src/table-select.ts +2 -2
  315. package/packages/table-transfer/src/table-transfer.ts +3 -15
  316. package/packages/tabs/src/tab-pane.ts +2 -2
  317. package/packages/tabs/src/tabs.ts +2 -2
  318. package/packages/tag/src/tag.ts +2 -2
  319. package/packages/text/src/text.ts +2 -2
  320. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  321. package/packages/textarea/src/textarea.ts +2 -2
  322. package/packages/timeline/src/timeline-info.ts +17 -17
  323. package/packages/timeline/src/timeline.ts +93 -49
  324. package/packages/timeline/src/util.ts +44 -41
  325. package/packages/tip/src/tip.ts +2 -2
  326. package/packages/tooltip/src/tooltip.ts +2 -2
  327. package/packages/tour/src/tour.ts +2 -2
  328. package/packages/transfer/src/transfer.ts +2 -2
  329. package/packages/tree/src/tree.ts +2 -2
  330. package/packages/tree-select/src/tree-select.ts +2 -2
  331. package/packages/ui/index.ts +8 -1
  332. package/packages/upload/src/upload.ts +2 -2
  333. package/packages/watermark/src/watermark.ts +2 -2
  334. package/styles/all.scss +1 -0
  335. package/styles/components/step-item.scss +0 -0
  336. package/styles/components/steps.scss +354 -0
  337. package/styles/theme/base.scss +9 -0
  338. package/types/all.d.ts +3 -0
  339. package/types/components/gantt.d.ts +1 -3
  340. package/types/components/select.d.ts +1 -13
  341. package/types/components/step-item.d.ts +72 -0
  342. package/types/components/steps.d.ts +67 -8
  343. package/types/components/table.d.ts +7 -66
  344. package/types/handles/form-design.d.ts +1 -4
  345. package/types/ui/global-config.d.ts +2 -0
  346. package/types/ui/global-icon.d.ts +7 -0
  347. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  348. /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  349. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  350. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  351. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  352. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  353. /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  354. /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  355. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  356. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  357. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  358. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  359. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  360. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  361. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  362. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  363. /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  364. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  365. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  366. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  367. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -41,1003 +41,1006 @@ var import_log = require("../../ui/src/log");
41
41
  var import_xe_utils = __toESM(require("xe-utils"));
42
42
  const { getConfig, getIcon, createEvent, globalEvents, globalResize, useFns, renderEmptyElement } = import_core.VxeUI;
43
43
  const { warnLog, errLog } = (0, import_log.createComponentLog)("splitter");
44
- var splitter_default = (0, import_comp.defineVxeComponent)({
45
- name: "VxeSplitter",
46
- props: {
47
- width: [Number, String],
48
- height: [Number, String],
49
- vertical: {
50
- type: Boolean,
51
- default: () => getConfig().splitter.vertical
52
- },
53
- border: {
54
- type: Boolean,
55
- default: () => getConfig().splitter.border
56
- },
57
- padding: {
58
- type: Boolean,
59
- default: () => getConfig().splitter.padding
60
- },
61
- resize: {
62
- type: Boolean,
63
- default: () => getConfig().splitter.resize
44
+ var splitter_default = (
45
+ /* define-vxe-component start */
46
+ (0, import_comp.defineVxeComponent)({
47
+ name: "VxeSplitter",
48
+ props: {
49
+ width: [Number, String],
50
+ height: [Number, String],
51
+ vertical: {
52
+ type: Boolean,
53
+ default: () => getConfig().splitter.vertical
54
+ },
55
+ border: {
56
+ type: Boolean,
57
+ default: () => getConfig().splitter.border
58
+ },
59
+ padding: {
60
+ type: Boolean,
61
+ default: () => getConfig().splitter.padding
62
+ },
63
+ resize: {
64
+ type: Boolean,
65
+ default: () => getConfig().splitter.resize
66
+ },
67
+ items: Array,
68
+ itemConfig: Object,
69
+ barConfig: Object,
70
+ resizeConfig: Object,
71
+ actionConfig: Object,
72
+ size: {
73
+ type: String,
74
+ default: () => getConfig().splitter.size || getConfig().size
75
+ }
64
76
  },
65
- items: Array,
66
- itemConfig: Object,
67
- barConfig: Object,
68
- resizeConfig: Object,
69
- actionConfig: Object,
70
- size: {
71
- type: String,
72
- default: () => getConfig().splitter.size || getConfig().size
73
- }
74
- },
75
- emits: ["action-dblclick", "action-click", "toggle-expand", "resize-start", "resize-drag", "resize-end"],
76
- setup(props, context) {
77
- const { emit, slots } = context;
78
- const xID = import_xe_utils.default.uniqueId();
79
- const refElem = (0, import_vue.ref)();
80
- const refBarInfoElem = (0, import_vue.ref)();
81
- const refResizableSplitterTip = (0, import_vue.ref)();
82
- const { computeSize } = useFns.useSize(props);
83
- const reactData = (0, import_vue.reactive)({
84
- staticItems: [],
85
- itemList: [],
86
- barWidth: 0,
87
- barHeight: 0,
88
- resizeFlag: 0
89
- });
90
- const internalData = {
91
- wrapperWidth: 0,
92
- wrapperHeight: 0
93
- };
94
- const computeItemOpts = (0, import_vue.computed)(() => {
95
- return Object.assign({}, getConfig().splitter.itemConfig, props.itemConfig);
96
- });
97
- const computeBarOpts = (0, import_vue.computed)(() => {
98
- return Object.assign({}, getConfig().splitter.barConfig, props.barConfig);
99
- });
100
- const computeResizeOpts = (0, import_vue.computed)(() => {
101
- return Object.assign({}, getConfig().splitter.resizeConfig, props.resizeConfig);
102
- });
103
- const computeActionOpts = (0, import_vue.computed)(() => {
104
- return Object.assign({}, getConfig().splitter.actionConfig, props.actionConfig);
105
- });
106
- const computeVisibleItems = (0, import_vue.computed)(() => {
107
- return reactData.itemList.filter((item) => item.isExpand);
108
- });
109
- const computeAutoItems = (0, import_vue.computed)(() => {
110
- const { vertical } = props;
111
- const autoItems = [];
112
- let heightCount = 0;
113
- let widthCount = 0;
114
- reactData.itemList.forEach(
115
- vertical ? (item) => {
116
- const { renderHeight, resizeHeight, foldHeight, isExpand, height } = item;
117
- const itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
118
- if (!height) {
119
- autoItems.push(item);
120
- }
121
- heightCount += itemHeight;
122
- } : (item) => {
123
- const { renderWidth, resizeWidth, foldWidth, isExpand, width } = item;
124
- const itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
125
- if (!width) {
126
- autoItems.push(item);
127
- }
128
- widthCount += itemWidth;
129
- }
130
- );
131
- return {
132
- autoItems,
133
- heightCount,
134
- heightRatio: heightCount / 100,
135
- widthCount,
136
- widthRatio: widthCount / 100
77
+ emits: ["action-dblclick", "action-click", "toggle-expand", "resize-start", "resize-drag", "resize-end"],
78
+ setup(props, context) {
79
+ const { emit, slots } = context;
80
+ const xID = import_xe_utils.default.uniqueId();
81
+ const refElem = (0, import_vue.ref)();
82
+ const refBarInfoElem = (0, import_vue.ref)();
83
+ const refResizableSplitterTip = (0, import_vue.ref)();
84
+ const { computeSize } = useFns.useSize(props);
85
+ const reactData = (0, import_vue.reactive)({
86
+ staticItems: [],
87
+ itemList: [],
88
+ barWidth: 0,
89
+ barHeight: 0,
90
+ resizeFlag: 0
91
+ });
92
+ const internalData = {
93
+ wrapperWidth: 0,
94
+ wrapperHeight: 0
137
95
  };
138
- });
139
- const computeWrapperStyle = (0, import_vue.computed)(() => {
140
- const { width, height } = props;
141
- const barOpts = computeBarOpts.value;
142
- const { width: barWidth, height: barHeight } = barOpts;
143
- const stys = {};
144
- if (height) {
145
- stys.height = (0, import_dom.toCssUnit)(height);
146
- }
147
- if (width) {
148
- stys.width = (0, import_dom.toCssUnit)(width);
149
- }
150
- if (barHeight) {
151
- stys["--vxe-ui-splitter-handle-bar-vertical-height"] = (0, import_dom.toCssUnit)(barHeight);
152
- }
153
- if (barWidth) {
154
- stys["--vxe-ui-splitter-handle-bar-horizontal-width"] = (0, import_dom.toCssUnit)(barWidth);
155
- }
156
- return stys;
157
- });
158
- const computeMaps = {
159
- computeItemOpts,
160
- computeBarOpts,
161
- computeActionOpts
162
- };
163
- const refMaps = {
164
- refElem
165
- };
166
- const $xeSplitter = {
167
- xID,
168
- props,
169
- context,
170
- reactData,
171
- internalData,
172
- getRefMaps: () => refMaps,
173
- getComputeMaps: () => computeMaps
174
- };
175
- const dispatchEvent = (type, params, evnt) => {
176
- emit(type, createEvent(evnt, { $splitter: $xeSplitter }, params));
177
- };
178
- const callSlot = (slotFunc, params) => {
179
- if (slotFunc) {
180
- if (import_xe_utils.default.isString(slotFunc)) {
181
- slotFunc = slots[slotFunc] || null;
96
+ const computeItemOpts = (0, import_vue.computed)(() => {
97
+ return Object.assign({}, getConfig().splitter.itemConfig, props.itemConfig);
98
+ });
99
+ const computeBarOpts = (0, import_vue.computed)(() => {
100
+ return Object.assign({}, getConfig().splitter.barConfig, props.barConfig);
101
+ });
102
+ const computeResizeOpts = (0, import_vue.computed)(() => {
103
+ return Object.assign({}, getConfig().splitter.resizeConfig, props.resizeConfig);
104
+ });
105
+ const computeActionOpts = (0, import_vue.computed)(() => {
106
+ return Object.assign({}, getConfig().splitter.actionConfig, props.actionConfig);
107
+ });
108
+ const computeVisibleItems = (0, import_vue.computed)(() => {
109
+ return reactData.itemList.filter((item) => item.isExpand);
110
+ });
111
+ const computeAutoItems = (0, import_vue.computed)(() => {
112
+ const { vertical } = props;
113
+ const autoItems = [];
114
+ let heightCount = 0;
115
+ let widthCount = 0;
116
+ reactData.itemList.forEach(
117
+ vertical ? (item) => {
118
+ const { renderHeight, resizeHeight, foldHeight, isExpand, height } = item;
119
+ const itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
120
+ if (!height) {
121
+ autoItems.push(item);
122
+ }
123
+ heightCount += itemHeight;
124
+ } : (item) => {
125
+ const { renderWidth, resizeWidth, foldWidth, isExpand, width } = item;
126
+ const itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
127
+ if (!width) {
128
+ autoItems.push(item);
129
+ }
130
+ widthCount += itemWidth;
131
+ }
132
+ );
133
+ return {
134
+ autoItems,
135
+ heightCount,
136
+ heightRatio: heightCount / 100,
137
+ widthCount,
138
+ widthRatio: widthCount / 100
139
+ };
140
+ });
141
+ const computeWrapperStyle = (0, import_vue.computed)(() => {
142
+ const { width, height } = props;
143
+ const barOpts = computeBarOpts.value;
144
+ const { width: barWidth, height: barHeight } = barOpts;
145
+ const stys = {};
146
+ if (height) {
147
+ stys.height = (0, import_dom.toCssUnit)(height);
182
148
  }
183
- if (import_xe_utils.default.isFunction(slotFunc)) {
184
- return (0, import_vn.getSlotVNs)(slotFunc(params));
149
+ if (width) {
150
+ stys.width = (0, import_dom.toCssUnit)(width);
185
151
  }
186
- }
187
- return [];
188
- };
189
- const getActionIcon = (prevItem, nextItem, isNext) => {
190
- const { vertical } = props;
191
- const topIcon = "SPLIT_TOP_ACTION";
192
- const bottomIcon = "SPLIT_BOTTOM_ACTION";
193
- const leftIcon = "SPLIT_LEFT_ACTION";
194
- const rightIcon = "SPLIT_RIGHT_ACTION";
195
- let iconName = "";
196
- if (vertical) {
197
- if (isNext) {
198
- iconName = nextItem.isExpand ? bottomIcon : topIcon;
199
- } else {
200
- iconName = prevItem.isExpand ? topIcon : bottomIcon;
152
+ if (barHeight) {
153
+ stys["--vxe-ui-splitter-handle-bar-vertical-height"] = (0, import_dom.toCssUnit)(barHeight);
201
154
  }
202
- } else {
203
- if (isNext) {
204
- iconName = nextItem.isExpand ? rightIcon : leftIcon;
205
- } else {
206
- iconName = prevItem.isExpand ? leftIcon : rightIcon;
155
+ if (barWidth) {
156
+ stys["--vxe-ui-splitter-handle-bar-horizontal-width"] = (0, import_dom.toCssUnit)(barWidth);
207
157
  }
208
- }
209
- if (iconName) {
210
- return getIcon()[iconName];
211
- }
212
- return "";
213
- };
214
- const reset = () => {
215
- const { itemList } = reactData;
216
- itemList.forEach((item) => {
217
- item.isExpand = true;
218
- item.foldHeight = 0;
219
- item.foldWidth = 0;
220
- item.resizeHeight = 0;
221
- item.resizeWidth = 0;
158
+ return stys;
222
159
  });
223
- return (0, import_vue.nextTick)();
224
- };
225
- const handleLoadItem = (list, isReset) => {
226
- const { staticItems } = reactData;
227
- const actionOpts = computeActionOpts.value;
228
- const { showPrevButton, showNextButton } = actionOpts;
229
- const itemDef = {
230
- isExpand: true,
231
- renderWidth: 0,
232
- resizeWidth: 0,
233
- foldWidth: 0,
234
- renderHeight: 0,
235
- resizeHeight: 0,
236
- foldHeight: 0
160
+ const computeMaps = {
161
+ computeItemOpts,
162
+ computeBarOpts,
163
+ computeActionOpts
164
+ };
165
+ const refMaps = {
166
+ refElem
237
167
  };
238
- reactData.itemList = list.map((item) => {
239
- if (item.showAction) {
240
- warnLog("vxe.error.removeProp", ["show-action"]);
168
+ const $xeSplitter = {
169
+ xID,
170
+ props,
171
+ context,
172
+ reactData,
173
+ internalData,
174
+ getRefMaps: () => refMaps,
175
+ getComputeMaps: () => computeMaps
176
+ };
177
+ const dispatchEvent = (type, params, evnt) => {
178
+ emit(type, createEvent(evnt, { $splitter: $xeSplitter }, params));
179
+ };
180
+ const callSlot = (slotFunc, params) => {
181
+ if (slotFunc) {
182
+ if (import_xe_utils.default.isString(slotFunc)) {
183
+ slotFunc = slots[slotFunc] || null;
184
+ }
185
+ if (import_xe_utils.default.isFunction(slotFunc)) {
186
+ return (0, import_vn.getSlotVNs)(slotFunc(params));
187
+ }
241
188
  }
242
- if (item.slots) {
243
- import_xe_utils.default.each(item.slots, (func) => {
244
- if (func && !import_xe_utils.default.isFunction(func)) {
245
- if (!slots[func]) {
246
- errLog("vxe.error.notSlot", [func]);
189
+ return [];
190
+ };
191
+ const getActionIcon = (prevItem, nextItem, isNext) => {
192
+ const { vertical } = props;
193
+ const topIcon = "SPLIT_TOP_ACTION";
194
+ const bottomIcon = "SPLIT_BOTTOM_ACTION";
195
+ const leftIcon = "SPLIT_LEFT_ACTION";
196
+ const rightIcon = "SPLIT_RIGHT_ACTION";
197
+ let iconName = "";
198
+ if (vertical) {
199
+ if (isNext) {
200
+ iconName = nextItem.isExpand ? bottomIcon : topIcon;
201
+ } else {
202
+ iconName = prevItem.isExpand ? topIcon : bottomIcon;
203
+ }
204
+ } else {
205
+ if (isNext) {
206
+ iconName = nextItem.isExpand ? rightIcon : leftIcon;
207
+ } else {
208
+ iconName = prevItem.isExpand ? leftIcon : rightIcon;
209
+ }
210
+ }
211
+ if (iconName) {
212
+ return getIcon()[iconName];
213
+ }
214
+ return "";
215
+ };
216
+ const reset = () => {
217
+ const { itemList } = reactData;
218
+ itemList.forEach((item) => {
219
+ item.isExpand = true;
220
+ item.foldHeight = 0;
221
+ item.foldWidth = 0;
222
+ item.resizeHeight = 0;
223
+ item.resizeWidth = 0;
224
+ });
225
+ return (0, import_vue.nextTick)();
226
+ };
227
+ const handleLoadItem = (list, isReset) => {
228
+ const { staticItems } = reactData;
229
+ const actionOpts = computeActionOpts.value;
230
+ const { showPrevButton, showNextButton } = actionOpts;
231
+ const itemDef = {
232
+ isExpand: true,
233
+ renderWidth: 0,
234
+ resizeWidth: 0,
235
+ foldWidth: 0,
236
+ renderHeight: 0,
237
+ resizeHeight: 0,
238
+ foldHeight: 0
239
+ };
240
+ reactData.itemList = list.map((item) => {
241
+ if (item.showAction) {
242
+ warnLog("vxe.error.removeProp", ["show-action"]);
243
+ }
244
+ if (item.slots) {
245
+ import_xe_utils.default.each(item.slots, (func) => {
246
+ if (func && !import_xe_utils.default.isFunction(func)) {
247
+ if (!slots[func]) {
248
+ errLog("vxe.error.notSlot", [func]);
249
+ }
247
250
  }
248
- }
251
+ });
252
+ }
253
+ return Object.assign({}, isReset ? null : itemDef, item, isReset ? itemDef : null, {
254
+ id: import_xe_utils.default.uniqueId()
249
255
  });
250
- }
251
- return Object.assign({}, isReset ? null : itemDef, item, isReset ? itemDef : null, {
252
- id: import_xe_utils.default.uniqueId()
253
256
  });
254
- });
255
- if (staticItems.length) {
256
- errLog("vxe.error.errConflicts", ["<vxe-splitter-panel ...>", "items"]);
257
- }
258
- if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
259
- errLog("vxe.error.errConflicts", ["action-config.showPrevButton | action-config.showNextButton", "Only supports 2 item"]);
260
- }
261
- return recalculate();
262
- };
263
- const loadItem = (list) => {
264
- return handleLoadItem(list || [], false);
265
- };
266
- const reloadItem = (list) => {
267
- return handleLoadItem(list || [], true);
268
- };
269
- const handleItemByName = (name) => {
270
- const { itemList } = reactData;
271
- let index = -1;
272
- let currItem = null;
273
- let prevItem = null;
274
- let nextItem = null;
275
- for (let i = 0; i < itemList.length; i++) {
276
- const item = itemList[i];
277
- if (item.name === name) {
278
- index = i;
279
- currItem = item;
280
- prevItem = itemList[i - 1] || null;
281
- nextItem = itemList[i + 1] || null;
282
- break;
257
+ if (staticItems.length) {
258
+ errLog("vxe.error.errConflicts", ["<vxe-splitter-panel ...>", "items"]);
283
259
  }
284
- }
285
- return {
286
- index,
287
- currItem,
288
- prevItem,
289
- nextItem
260
+ if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
261
+ errLog("vxe.error.errConflicts", ["action-config.showPrevButton | action-config.showNextButton", "Only supports 2 item"]);
262
+ }
263
+ return recalculate();
290
264
  };
291
- };
292
- const setItemExpand = (name, expanded) => {
293
- const restItem = handleItemByName(name);
294
- if (restItem) {
295
- const { currItem, prevItem, nextItem } = restItem;
296
- if (currItem) {
297
- if (expanded ? !currItem.isExpand : currItem.isExpand) {
298
- if (nextItem) {
299
- if (nextItem.isExpand) {
300
- handleItemActionEvent(null, currItem, nextItem, false);
301
- }
302
- } else if (prevItem) {
303
- if (prevItem.isExpand) {
304
- handleItemActionEvent(null, prevItem, currItem, true);
265
+ const loadItem = (list) => {
266
+ return handleLoadItem(list || [], false);
267
+ };
268
+ const reloadItem = (list) => {
269
+ return handleLoadItem(list || [], true);
270
+ };
271
+ const handleItemByName = (name) => {
272
+ const { itemList } = reactData;
273
+ let index = -1;
274
+ let currItem = null;
275
+ let prevItem = null;
276
+ let nextItem = null;
277
+ for (let i = 0; i < itemList.length; i++) {
278
+ const item = itemList[i];
279
+ if (item.name === name) {
280
+ index = i;
281
+ currItem = item;
282
+ prevItem = itemList[i - 1] || null;
283
+ nextItem = itemList[i + 1] || null;
284
+ break;
285
+ }
286
+ }
287
+ return {
288
+ index,
289
+ currItem,
290
+ prevItem,
291
+ nextItem
292
+ };
293
+ };
294
+ const setItemExpand = (name, expanded) => {
295
+ const restItem = handleItemByName(name);
296
+ if (restItem) {
297
+ const { currItem, prevItem, nextItem } = restItem;
298
+ if (currItem) {
299
+ if (expanded ? !currItem.isExpand : currItem.isExpand) {
300
+ if (nextItem) {
301
+ if (nextItem.isExpand) {
302
+ handleItemActionEvent(null, currItem, nextItem, false);
303
+ }
304
+ } else if (prevItem) {
305
+ if (prevItem.isExpand) {
306
+ handleItemActionEvent(null, prevItem, currItem, true);
307
+ }
305
308
  }
306
309
  }
307
310
  }
308
311
  }
309
- }
310
- return (0, import_vue.nextTick)();
311
- };
312
- const toggleItemExpand = (name) => {
313
- const restItem = handleItemByName(name);
314
- if (restItem) {
315
- const { currItem } = restItem;
316
- if (currItem) {
317
- return setItemExpand(name, !currItem.isExpand);
312
+ return (0, import_vue.nextTick)();
313
+ };
314
+ const toggleItemExpand = (name) => {
315
+ const restItem = handleItemByName(name);
316
+ if (restItem) {
317
+ const { currItem } = restItem;
318
+ if (currItem) {
319
+ return setItemExpand(name, !currItem.isExpand);
320
+ }
318
321
  }
319
- }
320
- return (0, import_vue.nextTick)();
321
- };
322
- const getItemExpand = (name) => {
323
- const restItem = handleItemByName(name);
324
- if (restItem) {
325
- const { currItem } = restItem;
326
- if (currItem) {
327
- return currItem.isExpand;
322
+ return (0, import_vue.nextTick)();
323
+ };
324
+ const getItemExpand = (name) => {
325
+ const restItem = handleItemByName(name);
326
+ if (restItem) {
327
+ const { currItem } = restItem;
328
+ if (currItem) {
329
+ return currItem.isExpand;
330
+ }
328
331
  }
329
- }
330
- return false;
331
- };
332
- const recalculate = () => {
333
- return (0, import_vue.nextTick)().then(() => {
334
- const { vertical } = props;
332
+ return false;
333
+ };
334
+ const recalculate = () => {
335
+ return (0, import_vue.nextTick)().then(() => {
336
+ const { vertical } = props;
337
+ const { itemList } = reactData;
338
+ const el = refElem.value;
339
+ const barInfoElem = refBarInfoElem.value;
340
+ if (!el) {
341
+ return;
342
+ }
343
+ const wWidth = el.clientWidth;
344
+ const wHeight = el.clientHeight;
345
+ if (!wWidth || !wHeight) {
346
+ return;
347
+ }
348
+ if (barInfoElem) {
349
+ reactData.barWidth = barInfoElem.offsetWidth;
350
+ reactData.barHeight = barInfoElem.offsetHeight;
351
+ }
352
+ const contentWidth = wWidth - (vertical ? 0 : reactData.barWidth * (itemList.length - 1));
353
+ const contentHeight = wHeight - (vertical ? reactData.barHeight * (itemList.length - 1) : 0);
354
+ const itemOpts = computeItemOpts.value;
355
+ const allMinWidth = import_xe_utils.default.toNumber(itemOpts.minWidth);
356
+ const allMinHeight = import_xe_utils.default.toNumber(itemOpts.minHeight);
357
+ const residueItems = [];
358
+ if (vertical) {
359
+ let countHeight = 0;
360
+ itemList.forEach((item) => {
361
+ const { height } = item;
362
+ let itemHeight = 0;
363
+ if (height) {
364
+ if ((0, import_dom.isScale)(height)) {
365
+ itemHeight = contentHeight * import_xe_utils.default.toNumber(height) / 100;
366
+ } else {
367
+ itemHeight = import_xe_utils.default.toNumber(height);
368
+ }
369
+ item.renderHeight = itemHeight;
370
+ } else {
371
+ residueItems.push(item);
372
+ }
373
+ countHeight += itemHeight;
374
+ });
375
+ if (residueItems.length) {
376
+ const reMeanHeight = (contentHeight - countHeight) / residueItems.length;
377
+ residueItems.forEach((item) => {
378
+ item.renderHeight = Math.max(import_xe_utils.default.toNumber((0, import_utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight)), reMeanHeight);
379
+ });
380
+ }
381
+ } else {
382
+ let countWidth = 0;
383
+ itemList.forEach((item) => {
384
+ const { width } = item;
385
+ let itemWidth = 0;
386
+ if (width) {
387
+ if ((0, import_dom.isScale)(width)) {
388
+ itemWidth = contentWidth * import_xe_utils.default.toNumber(width) / 100;
389
+ } else {
390
+ itemWidth = import_xe_utils.default.toNumber(width);
391
+ }
392
+ item.renderWidth = itemWidth;
393
+ } else {
394
+ residueItems.push(item);
395
+ }
396
+ countWidth += itemWidth;
397
+ });
398
+ if (residueItems.length) {
399
+ const reMeanWidth = (contentWidth - countWidth) / residueItems.length;
400
+ residueItems.forEach((item) => {
401
+ item.renderWidth = Math.max(import_xe_utils.default.toNumber((0, import_utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth)), reMeanWidth);
402
+ });
403
+ }
404
+ }
405
+ internalData.wrapperWidth = contentWidth;
406
+ internalData.wrapperHeight = contentHeight;
407
+ });
408
+ };
409
+ const dragEvent = (evnt) => {
410
+ const { resize, vertical } = props;
335
411
  const { itemList } = reactData;
412
+ if (!resize) {
413
+ return;
414
+ }
415
+ evnt.preventDefault();
416
+ const barEl = evnt.currentTarget;
417
+ const handleEl = barEl.parentElement;
336
418
  const el = refElem.value;
337
- const barInfoElem = refBarInfoElem.value;
338
419
  if (!el) {
339
420
  return;
340
421
  }
341
- const wWidth = el.clientWidth;
342
- const wHeight = el.clientHeight;
343
- if (!wWidth || !wHeight) {
422
+ const prevEl = handleEl.previousElementSibling;
423
+ const nextEl = handleEl.nextElementSibling;
424
+ if (!prevEl || !nextEl) {
344
425
  return;
345
426
  }
346
- if (barInfoElem) {
347
- reactData.barWidth = barInfoElem.offsetWidth;
348
- reactData.barHeight = barInfoElem.offsetHeight;
427
+ const prevId = prevEl.getAttribute("itemid");
428
+ const nextId = nextEl.getAttribute("itemid");
429
+ const prevItem = itemList.find((item) => item.id === prevId);
430
+ const nextItem = itemList.find((item) => item.id === nextId);
431
+ if (!prevItem || !nextItem) {
432
+ return;
349
433
  }
350
- const contentWidth = wWidth - (vertical ? 0 : reactData.barWidth * (itemList.length - 1));
351
- const contentHeight = wHeight - (vertical ? reactData.barHeight * (itemList.length - 1) : 0);
434
+ const containerRect = el.getBoundingClientRect();
435
+ const barRect = barEl.getBoundingClientRect();
436
+ const rsSplitterLineEl = refResizableSplitterTip.value;
437
+ const rsSplitterTipEl = rsSplitterLineEl ? rsSplitterLineEl.children[0] : null;
352
438
  const itemOpts = computeItemOpts.value;
439
+ const resizeOpts = computeResizeOpts.value;
440
+ const { immediate } = resizeOpts;
353
441
  const allMinWidth = import_xe_utils.default.toNumber(itemOpts.minWidth);
354
442
  const allMinHeight = import_xe_utils.default.toNumber(itemOpts.minHeight);
355
- const residueItems = [];
356
- if (vertical) {
357
- let countHeight = 0;
358
- itemList.forEach((item) => {
359
- const { height } = item;
360
- let itemHeight = 0;
361
- if (height) {
362
- if ((0, import_dom.isScale)(height)) {
363
- itemHeight = contentHeight * import_xe_utils.default.toNumber(height) / 100;
443
+ const barOffsetX = Math.ceil(barRect.width - (evnt.clientX - barRect.left));
444
+ const barOffsetY = Math.ceil(evnt.clientY - barRect.top);
445
+ const prevWidth = prevEl.offsetWidth;
446
+ const nextWidth = nextEl.offsetWidth;
447
+ const prevMinWidth = import_xe_utils.default.toNumber(prevItem ? (0, import_utils.getGlobalDefaultConfig)(prevItem.minWidth, allMinWidth) : allMinWidth);
448
+ const nextMinWidth = import_xe_utils.default.toNumber(nextItem ? (0, import_utils.getGlobalDefaultConfig)(nextItem.minWidth, allMinWidth) : allMinWidth);
449
+ const minOffsetLeft = prevEl.offsetLeft + prevMinWidth - barOffsetX;
450
+ const maxOffsetLeft = nextEl.offsetLeft + nextEl.offsetWidth - nextMinWidth - barOffsetX;
451
+ const startOffsetLeft = evnt.clientX - containerRect.left;
452
+ let targetOffsetWidth = -1;
453
+ let prevResizeWidth = 0;
454
+ let nextResizeWidth = 0;
455
+ let offsetLeft = startOffsetLeft;
456
+ const prevHeight = prevEl.offsetHeight;
457
+ const nextHeight = nextEl.offsetHeight;
458
+ const prevMinHeight = import_xe_utils.default.toNumber(prevItem ? (0, import_utils.getGlobalDefaultConfig)(prevItem.minHeight, allMinHeight) : allMinHeight);
459
+ const nextMinHeight = import_xe_utils.default.toNumber(nextItem ? (0, import_utils.getGlobalDefaultConfig)(nextItem.minHeight, allMinHeight) : allMinHeight);
460
+ const minOffsetTop = prevEl.offsetTop + prevMinHeight + barOffsetY;
461
+ const maxOffsetTop = nextEl.offsetTop + nextEl.offsetHeight - nextMinHeight + barOffsetY;
462
+ const startOffsetTop = evnt.clientY - containerRect.top;
463
+ let targetOffsetHeight = -1;
464
+ let prevResizeHeight = 0;
465
+ let nextResizeHeight = 0;
466
+ let offsetTop = startOffsetTop;
467
+ const handleReStyle = (evnt2) => {
468
+ if (!rsSplitterLineEl) {
469
+ return;
470
+ }
471
+ const rsNumPrevEl = rsSplitterTipEl ? rsSplitterTipEl.children[0] : null;
472
+ const rsNumNextEl = rsSplitterTipEl ? rsSplitterTipEl.children[1] : null;
473
+ if (vertical) {
474
+ let tipWidth = 0;
475
+ if (rsNumPrevEl) {
476
+ if (targetOffsetHeight < 0) {
477
+ rsNumPrevEl.style.display = "none";
364
478
  } else {
365
- itemHeight = import_xe_utils.default.toNumber(height);
479
+ rsNumPrevEl.textContent = `${Math.floor(prevResizeHeight)}px`;
480
+ rsNumPrevEl.style.display = "block";
481
+ tipWidth = rsNumPrevEl.offsetWidth;
366
482
  }
367
- item.renderHeight = itemHeight;
368
- } else {
369
- residueItems.push(item);
370
483
  }
371
- countHeight += itemHeight;
372
- });
373
- if (residueItems.length) {
374
- const reMeanHeight = (contentHeight - countHeight) / residueItems.length;
375
- residueItems.forEach((item) => {
376
- item.renderHeight = Math.max(import_xe_utils.default.toNumber((0, import_utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight)), reMeanHeight);
377
- });
378
- }
379
- } else {
380
- let countWidth = 0;
381
- itemList.forEach((item) => {
382
- const { width } = item;
383
- let itemWidth = 0;
384
- if (width) {
385
- if ((0, import_dom.isScale)(width)) {
386
- itemWidth = contentWidth * import_xe_utils.default.toNumber(width) / 100;
484
+ if (rsNumNextEl) {
485
+ if (targetOffsetHeight < 0) {
486
+ rsNumNextEl.textContent = `${Math.floor(nextResizeHeight)}px`;
487
+ rsNumNextEl.style.display = "block";
488
+ tipWidth = rsNumNextEl.offsetWidth;
387
489
  } else {
388
- itemWidth = import_xe_utils.default.toNumber(width);
490
+ rsNumNextEl.style.display = "none";
389
491
  }
390
- item.renderWidth = itemWidth;
391
- } else {
392
- residueItems.push(item);
393
492
  }
394
- countWidth += itemWidth;
395
- });
396
- if (residueItems.length) {
397
- const reMeanWidth = (contentWidth - countWidth) / residueItems.length;
398
- residueItems.forEach((item) => {
399
- item.renderWidth = Math.max(import_xe_utils.default.toNumber((0, import_utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth)), reMeanWidth);
400
- });
401
- }
402
- }
403
- internalData.wrapperWidth = contentWidth;
404
- internalData.wrapperHeight = contentHeight;
405
- });
406
- };
407
- const dragEvent = (evnt) => {
408
- const { resize, vertical } = props;
409
- const { itemList } = reactData;
410
- if (!resize) {
411
- return;
412
- }
413
- evnt.preventDefault();
414
- const barEl = evnt.currentTarget;
415
- const handleEl = barEl.parentElement;
416
- const el = refElem.value;
417
- if (!el) {
418
- return;
419
- }
420
- const prevEl = handleEl.previousElementSibling;
421
- const nextEl = handleEl.nextElementSibling;
422
- if (!prevEl || !nextEl) {
423
- return;
424
- }
425
- const prevId = prevEl.getAttribute("itemid");
426
- const nextId = nextEl.getAttribute("itemid");
427
- const prevItem = itemList.find((item) => item.id === prevId);
428
- const nextItem = itemList.find((item) => item.id === nextId);
429
- if (!prevItem || !nextItem) {
430
- return;
431
- }
432
- const containerRect = el.getBoundingClientRect();
433
- const barRect = barEl.getBoundingClientRect();
434
- const rsSplitterLineEl = refResizableSplitterTip.value;
435
- const rsSplitterTipEl = rsSplitterLineEl ? rsSplitterLineEl.children[0] : null;
436
- const itemOpts = computeItemOpts.value;
437
- const resizeOpts = computeResizeOpts.value;
438
- const { immediate } = resizeOpts;
439
- const allMinWidth = import_xe_utils.default.toNumber(itemOpts.minWidth);
440
- const allMinHeight = import_xe_utils.default.toNumber(itemOpts.minHeight);
441
- const barOffsetX = Math.ceil(barRect.width - (evnt.clientX - barRect.left));
442
- const barOffsetY = Math.ceil(evnt.clientY - barRect.top);
443
- const prevWidth = prevEl.offsetWidth;
444
- const nextWidth = nextEl.offsetWidth;
445
- const prevMinWidth = import_xe_utils.default.toNumber(prevItem ? (0, import_utils.getGlobalDefaultConfig)(prevItem.minWidth, allMinWidth) : allMinWidth);
446
- const nextMinWidth = import_xe_utils.default.toNumber(nextItem ? (0, import_utils.getGlobalDefaultConfig)(nextItem.minWidth, allMinWidth) : allMinWidth);
447
- const minOffsetLeft = prevEl.offsetLeft + prevMinWidth - barOffsetX;
448
- const maxOffsetLeft = nextEl.offsetLeft + nextEl.offsetWidth - nextMinWidth - barOffsetX;
449
- const startOffsetLeft = evnt.clientX - containerRect.left;
450
- let targetOffsetWidth = -1;
451
- let prevResizeWidth = 0;
452
- let nextResizeWidth = 0;
453
- let offsetLeft = startOffsetLeft;
454
- const prevHeight = prevEl.offsetHeight;
455
- const nextHeight = nextEl.offsetHeight;
456
- const prevMinHeight = import_xe_utils.default.toNumber(prevItem ? (0, import_utils.getGlobalDefaultConfig)(prevItem.minHeight, allMinHeight) : allMinHeight);
457
- const nextMinHeight = import_xe_utils.default.toNumber(nextItem ? (0, import_utils.getGlobalDefaultConfig)(nextItem.minHeight, allMinHeight) : allMinHeight);
458
- const minOffsetTop = prevEl.offsetTop + prevMinHeight + barOffsetY;
459
- const maxOffsetTop = nextEl.offsetTop + nextEl.offsetHeight - nextMinHeight + barOffsetY;
460
- const startOffsetTop = evnt.clientY - containerRect.top;
461
- let targetOffsetHeight = -1;
462
- let prevResizeHeight = 0;
463
- let nextResizeHeight = 0;
464
- let offsetTop = startOffsetTop;
465
- const handleReStyle = (evnt2) => {
466
- if (!rsSplitterLineEl) {
467
- return;
468
- }
469
- const rsNumPrevEl = rsSplitterTipEl ? rsSplitterTipEl.children[0] : null;
470
- const rsNumNextEl = rsSplitterTipEl ? rsSplitterTipEl.children[1] : null;
471
- if (vertical) {
472
- let tipWidth = 0;
473
- if (rsNumPrevEl) {
474
- if (targetOffsetHeight < 0) {
475
- rsNumPrevEl.style.display = "none";
476
- } else {
477
- rsNumPrevEl.textContent = `${Math.floor(prevResizeHeight)}px`;
478
- rsNumPrevEl.style.display = "block";
479
- tipWidth = rsNumPrevEl.offsetWidth;
493
+ let rsLeft = Math.max(1, evnt2.clientX - containerRect.left - tipWidth / 2);
494
+ if (rsLeft > containerRect.width - tipWidth - 1) {
495
+ rsLeft = containerRect.width - tipWidth - 1;
480
496
  }
481
- }
482
- if (rsNumNextEl) {
483
- if (targetOffsetHeight < 0) {
484
- rsNumNextEl.textContent = `${Math.floor(nextResizeHeight)}px`;
485
- rsNumNextEl.style.display = "block";
486
- tipWidth = rsNumNextEl.offsetWidth;
487
- } else {
488
- rsNumNextEl.style.display = "none";
497
+ rsSplitterLineEl.style.left = "0";
498
+ rsSplitterLineEl.style.top = `${offsetTop}px`;
499
+ if (rsSplitterTipEl) {
500
+ rsSplitterTipEl.style.left = `${rsLeft}px`;
501
+ }
502
+ } else {
503
+ let tipHeight = 0;
504
+ if (rsNumPrevEl) {
505
+ if (targetOffsetWidth < 0) {
506
+ rsNumPrevEl.style.display = "none";
507
+ } else {
508
+ rsNumPrevEl.textContent = `${Math.floor(prevResizeWidth)}px`;
509
+ rsNumPrevEl.style.display = "block";
510
+ tipHeight = rsNumPrevEl.offsetHeight;
511
+ }
512
+ }
513
+ if (rsNumNextEl) {
514
+ if (targetOffsetWidth < 0) {
515
+ rsNumNextEl.textContent = `${Math.floor(nextResizeWidth)}px`;
516
+ rsNumNextEl.style.display = "block";
517
+ tipHeight = rsNumNextEl.offsetHeight;
518
+ } else {
519
+ rsNumNextEl.style.display = "none";
520
+ }
521
+ }
522
+ let rsTop = Math.max(1, evnt2.clientY - containerRect.top - tipHeight / 2);
523
+ if (rsTop > containerRect.height - tipHeight - 1) {
524
+ rsTop = containerRect.height - tipHeight - 1;
525
+ }
526
+ rsSplitterLineEl.style.top = "0";
527
+ rsSplitterLineEl.style.left = `${offsetLeft}px`;
528
+ if (rsSplitterTipEl) {
529
+ rsSplitterTipEl.style.top = `${rsTop}px`;
489
530
  }
490
531
  }
491
- let rsLeft = Math.max(1, evnt2.clientX - containerRect.left - tipWidth / 2);
492
- if (rsLeft > containerRect.width - tipWidth - 1) {
493
- rsLeft = containerRect.width - tipWidth - 1;
494
- }
495
- rsSplitterLineEl.style.left = "0";
496
- rsSplitterLineEl.style.top = `${offsetTop}px`;
497
- if (rsSplitterTipEl) {
498
- rsSplitterTipEl.style.left = `${rsLeft}px`;
532
+ };
533
+ const handleUpdate = () => {
534
+ if (vertical) {
535
+ prevItem.resizeHeight = prevResizeHeight;
536
+ nextItem.resizeHeight = nextResizeHeight;
537
+ } else {
538
+ prevItem.resizeWidth = prevResizeWidth;
539
+ nextItem.resizeWidth = nextResizeWidth;
499
540
  }
500
- } else {
501
- let tipHeight = 0;
502
- if (rsNumPrevEl) {
503
- if (targetOffsetWidth < 0) {
504
- rsNumPrevEl.style.display = "none";
505
- } else {
506
- rsNumPrevEl.textContent = `${Math.floor(prevResizeWidth)}px`;
507
- rsNumPrevEl.style.display = "block";
508
- tipHeight = rsNumPrevEl.offsetHeight;
541
+ };
542
+ const handleDrag = (evnt2) => {
543
+ if (vertical) {
544
+ offsetTop = evnt2.clientY - containerRect.top;
545
+ if (offsetTop < minOffsetTop) {
546
+ offsetTop = minOffsetTop;
547
+ }
548
+ if (offsetTop > maxOffsetTop) {
549
+ offsetTop = maxOffsetTop;
550
+ }
551
+ targetOffsetHeight = offsetTop - startOffsetTop;
552
+ prevResizeHeight = prevHeight + targetOffsetHeight;
553
+ nextResizeHeight = nextHeight - targetOffsetHeight;
554
+ } else {
555
+ offsetLeft = evnt2.clientX - containerRect.left;
556
+ if (offsetLeft < minOffsetLeft) {
557
+ offsetLeft = minOffsetLeft;
558
+ }
559
+ if (offsetLeft > maxOffsetLeft) {
560
+ offsetLeft = maxOffsetLeft;
509
561
  }
562
+ targetOffsetWidth = offsetLeft - startOffsetLeft;
563
+ prevResizeWidth = prevWidth + targetOffsetWidth;
564
+ nextResizeWidth = nextWidth - targetOffsetWidth;
510
565
  }
511
- if (rsNumNextEl) {
512
- if (targetOffsetWidth < 0) {
513
- rsNumNextEl.textContent = `${Math.floor(nextResizeWidth)}px`;
514
- rsNumNextEl.style.display = "block";
515
- tipHeight = rsNumNextEl.offsetHeight;
566
+ if (immediate) {
567
+ if (vertical) {
568
+ prevEl.style.height = (0, import_dom.toCssUnit)(prevResizeHeight);
569
+ nextEl.style.height = (0, import_dom.toCssUnit)(nextResizeHeight);
516
570
  } else {
517
- rsNumNextEl.style.display = "none";
571
+ prevEl.style.width = (0, import_dom.toCssUnit)(prevResizeWidth);
572
+ nextEl.style.width = (0, import_dom.toCssUnit)(nextResizeWidth);
518
573
  }
519
574
  }
520
- let rsTop = Math.max(1, evnt2.clientY - containerRect.top - tipHeight / 2);
521
- if (rsTop > containerRect.height - tipHeight - 1) {
522
- rsTop = containerRect.height - tipHeight - 1;
575
+ if (rsSplitterLineEl) {
576
+ handleReStyle(evnt2);
523
577
  }
524
- rsSplitterLineEl.style.top = "0";
525
- rsSplitterLineEl.style.left = `${offsetLeft}px`;
526
- if (rsSplitterTipEl) {
527
- rsSplitterTipEl.style.top = `${rsTop}px`;
578
+ dispatchEvent("resize-drag", { prevItem, nextItem, offsetHeight: targetOffsetHeight, offsetWidth: targetOffsetWidth }, evnt2);
579
+ };
580
+ document.onmousemove = (evnt2) => {
581
+ evnt2.preventDefault();
582
+ handleDrag(evnt2);
583
+ reactData.resizeFlag++;
584
+ };
585
+ document.onmouseup = (evnt2) => {
586
+ document.onmousemove = null;
587
+ document.onmouseup = null;
588
+ if (rsSplitterLineEl) {
589
+ rsSplitterLineEl.style.display = "";
528
590
  }
591
+ handleUpdate();
592
+ (0, import_dom.removeClass)(el, "is--drag");
593
+ dispatchEvent("resize-end", { prevItem, nextItem, offsetHeight: targetOffsetHeight, offsetWidth: targetOffsetWidth }, evnt2);
594
+ recalculate();
595
+ reactData.resizeFlag++;
596
+ };
597
+ if (rsSplitterLineEl) {
598
+ rsSplitterLineEl.style.display = "block";
599
+ handleReStyle(evnt);
529
600
  }
601
+ handleDrag(evnt);
602
+ (0, import_dom.addClass)(el, "is--drag");
603
+ dispatchEvent("resize-start", { prevItem, nextItem }, evnt);
530
604
  };
531
- const handleUpdate = () => {
532
- if (vertical) {
533
- prevItem.resizeHeight = prevResizeHeight;
534
- nextItem.resizeHeight = nextResizeHeight;
605
+ const handleItemActionEvent = (evnt, prevItem, nextItem, isNext) => {
606
+ const { vertical } = props;
607
+ let expanded = false;
608
+ let item = prevItem;
609
+ if (isNext) {
610
+ item = nextItem;
611
+ expanded = !nextItem.isExpand;
612
+ nextItem.isExpand = expanded;
535
613
  } else {
536
- prevItem.resizeWidth = prevResizeWidth;
537
- nextItem.resizeWidth = nextResizeWidth;
614
+ expanded = !prevItem.isExpand;
615
+ prevItem.isExpand = expanded;
538
616
  }
539
- };
540
- const handleDrag = (evnt2) => {
541
617
  if (vertical) {
542
- offsetTop = evnt2.clientY - containerRect.top;
543
- if (offsetTop < minOffsetTop) {
544
- offsetTop = minOffsetTop;
545
- }
546
- if (offsetTop > maxOffsetTop) {
547
- offsetTop = maxOffsetTop;
618
+ if (prevItem.isExpand && nextItem.isExpand) {
619
+ prevItem.foldHeight = 0;
620
+ nextItem.foldHeight = 0;
621
+ } else if (prevItem.isExpand) {
622
+ nextItem.foldHeight = 0;
623
+ prevItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
624
+ } else {
625
+ prevItem.foldHeight = 0;
626
+ nextItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
548
627
  }
549
- targetOffsetHeight = offsetTop - startOffsetTop;
550
- prevResizeHeight = prevHeight + targetOffsetHeight;
551
- nextResizeHeight = nextHeight - targetOffsetHeight;
552
628
  } else {
553
- offsetLeft = evnt2.clientX - containerRect.left;
554
- if (offsetLeft < minOffsetLeft) {
555
- offsetLeft = minOffsetLeft;
556
- }
557
- if (offsetLeft > maxOffsetLeft) {
558
- offsetLeft = maxOffsetLeft;
559
- }
560
- targetOffsetWidth = offsetLeft - startOffsetLeft;
561
- prevResizeWidth = prevWidth + targetOffsetWidth;
562
- nextResizeWidth = nextWidth - targetOffsetWidth;
563
- }
564
- if (immediate) {
565
- if (vertical) {
566
- prevEl.style.height = (0, import_dom.toCssUnit)(prevResizeHeight);
567
- nextEl.style.height = (0, import_dom.toCssUnit)(nextResizeHeight);
629
+ if (prevItem.isExpand && nextItem.isExpand) {
630
+ prevItem.foldWidth = 0;
631
+ nextItem.foldWidth = 0;
632
+ } else if (prevItem.isExpand) {
633
+ nextItem.foldWidth = 0;
634
+ prevItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
568
635
  } else {
569
- prevEl.style.width = (0, import_dom.toCssUnit)(prevResizeWidth);
570
- nextEl.style.width = (0, import_dom.toCssUnit)(nextResizeWidth);
636
+ prevItem.foldWidth = 0;
637
+ nextItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
571
638
  }
572
639
  }
573
- if (rsSplitterLineEl) {
574
- handleReStyle(evnt2);
640
+ if (evnt) {
641
+ dispatchEvent("toggle-expand", { prevItem, nextItem, expanded, item }, evnt);
575
642
  }
576
- dispatchEvent("resize-drag", { prevItem, nextItem, offsetHeight: targetOffsetHeight, offsetWidth: targetOffsetWidth }, evnt2);
577
- };
578
- document.onmousemove = (evnt2) => {
579
- evnt2.preventDefault();
580
- handleDrag(evnt2);
581
- reactData.resizeFlag++;
582
- };
583
- document.onmouseup = (evnt2) => {
584
- document.onmousemove = null;
585
- document.onmouseup = null;
586
- if (rsSplitterLineEl) {
587
- rsSplitterLineEl.style.display = "";
588
- }
589
- handleUpdate();
590
- (0, import_dom.removeClass)(el, "is--drag");
591
- dispatchEvent("resize-end", { prevItem, nextItem, offsetHeight: targetOffsetHeight, offsetWidth: targetOffsetWidth }, evnt2);
592
643
  recalculate();
593
644
  reactData.resizeFlag++;
594
645
  };
595
- if (rsSplitterLineEl) {
596
- rsSplitterLineEl.style.display = "block";
597
- handleReStyle(evnt);
598
- }
599
- handleDrag(evnt);
600
- (0, import_dom.addClass)(el, "is--drag");
601
- dispatchEvent("resize-start", { prevItem, nextItem }, evnt);
602
- };
603
- const handleItemActionEvent = (evnt, prevItem, nextItem, isNext) => {
604
- const { vertical } = props;
605
- let expanded = false;
606
- let item = prevItem;
607
- if (isNext) {
608
- item = nextItem;
609
- expanded = !nextItem.isExpand;
610
- nextItem.isExpand = expanded;
611
- } else {
612
- expanded = !prevItem.isExpand;
613
- prevItem.isExpand = expanded;
614
- }
615
- if (vertical) {
616
- if (prevItem.isExpand && nextItem.isExpand) {
617
- prevItem.foldHeight = 0;
618
- nextItem.foldHeight = 0;
619
- } else if (prevItem.isExpand) {
620
- nextItem.foldHeight = 0;
621
- prevItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
622
- } else {
623
- prevItem.foldHeight = 0;
624
- nextItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
625
- }
626
- } else {
627
- if (prevItem.isExpand && nextItem.isExpand) {
628
- prevItem.foldWidth = 0;
629
- nextItem.foldWidth = 0;
630
- } else if (prevItem.isExpand) {
631
- nextItem.foldWidth = 0;
632
- prevItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
633
- } else {
634
- prevItem.foldWidth = 0;
635
- nextItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
636
- }
637
- }
638
- if (evnt) {
639
- dispatchEvent("toggle-expand", { prevItem, nextItem, expanded, item }, evnt);
640
- }
641
- recalculate();
642
- reactData.resizeFlag++;
643
- };
644
- const handlePrevActionDblclickEvent = (evnt) => {
645
- const { itemList } = reactData;
646
- const actionOpts = computeActionOpts.value;
647
- const btnEl = evnt.currentTarget;
648
- const btnWrapperEl = btnEl.parentElement;
649
- const handleEl = btnWrapperEl.parentElement;
650
- const prevEl = handleEl.previousElementSibling;
651
- const prevId = prevEl.getAttribute("itemid");
652
- const prevItem = itemList.find((item) => item.id === prevId);
653
- const nextEl = handleEl.nextElementSibling;
654
- const nextId = nextEl.getAttribute("itemid");
655
- const nextItem = itemList.find((item) => item.id === nextId);
656
- if (actionOpts.trigger === "dblclick") {
657
- if (prevItem && nextItem && nextItem.isExpand) {
658
- handleItemActionEvent(evnt, prevItem, nextItem, false);
646
+ const handlePrevActionDblclickEvent = (evnt) => {
647
+ const { itemList } = reactData;
648
+ const actionOpts = computeActionOpts.value;
649
+ const btnEl = evnt.currentTarget;
650
+ const btnWrapperEl = btnEl.parentElement;
651
+ const handleEl = btnWrapperEl.parentElement;
652
+ const prevEl = handleEl.previousElementSibling;
653
+ const prevId = prevEl.getAttribute("itemid");
654
+ const prevItem = itemList.find((item) => item.id === prevId);
655
+ const nextEl = handleEl.nextElementSibling;
656
+ const nextId = nextEl.getAttribute("itemid");
657
+ const nextItem = itemList.find((item) => item.id === nextId);
658
+ if (actionOpts.trigger === "dblclick") {
659
+ if (prevItem && nextItem && nextItem.isExpand) {
660
+ handleItemActionEvent(evnt, prevItem, nextItem, false);
661
+ }
659
662
  }
660
- }
661
- dispatchEvent("action-dblclick", { prevItem, nextItem }, evnt);
662
- };
663
- const handlePrevActionClickEvent = (evnt) => {
664
- const { itemList } = reactData;
665
- const actionOpts = computeActionOpts.value;
666
- const btnEl = evnt.currentTarget;
667
- const btnWrapperEl = btnEl.parentElement;
668
- const handleEl = btnWrapperEl.parentElement;
669
- const prevEl = handleEl.previousElementSibling;
670
- const prevId = prevEl.getAttribute("itemid");
671
- const prevItem = itemList.find((item) => item.id === prevId);
672
- const nextEl = handleEl.nextElementSibling;
673
- const nextId = nextEl.getAttribute("itemid");
674
- const nextItem = itemList.find((item) => item.id === nextId);
675
- if (actionOpts.trigger !== "dblclick") {
676
- if (prevItem && nextItem && nextItem.isExpand) {
677
- handleItemActionEvent(evnt, prevItem, nextItem, false);
663
+ dispatchEvent("action-dblclick", { prevItem, nextItem }, evnt);
664
+ };
665
+ const handlePrevActionClickEvent = (evnt) => {
666
+ const { itemList } = reactData;
667
+ const actionOpts = computeActionOpts.value;
668
+ const btnEl = evnt.currentTarget;
669
+ const btnWrapperEl = btnEl.parentElement;
670
+ const handleEl = btnWrapperEl.parentElement;
671
+ const prevEl = handleEl.previousElementSibling;
672
+ const prevId = prevEl.getAttribute("itemid");
673
+ const prevItem = itemList.find((item) => item.id === prevId);
674
+ const nextEl = handleEl.nextElementSibling;
675
+ const nextId = nextEl.getAttribute("itemid");
676
+ const nextItem = itemList.find((item) => item.id === nextId);
677
+ if (actionOpts.trigger !== "dblclick") {
678
+ if (prevItem && nextItem && nextItem.isExpand) {
679
+ handleItemActionEvent(evnt, prevItem, nextItem, false);
680
+ }
678
681
  }
679
- }
680
- dispatchEvent("action-click", { prevItem, nextItem }, evnt);
681
- };
682
- const handleNextActionDblclickEvent = (evnt) => {
683
- const { itemList } = reactData;
684
- const actionOpts = computeActionOpts.value;
685
- const btnEl = evnt.currentTarget;
686
- const btnWrapperEl = btnEl.parentElement;
687
- const handleEl = btnWrapperEl.parentElement;
688
- const prevEl = handleEl.previousElementSibling;
689
- const prevId = prevEl.getAttribute("itemid");
690
- const prevItem = itemList.find((item) => item.id === prevId);
691
- const nextEl = handleEl.nextElementSibling;
692
- const nextId = nextEl.getAttribute("itemid");
693
- const nextItem = itemList.find((item) => item.id === nextId);
694
- if (actionOpts.trigger === "dblclick") {
695
- if (prevItem && nextItem && prevItem.isExpand) {
696
- handleItemActionEvent(evnt, prevItem, nextItem, true);
682
+ dispatchEvent("action-click", { prevItem, nextItem }, evnt);
683
+ };
684
+ const handleNextActionDblclickEvent = (evnt) => {
685
+ const { itemList } = reactData;
686
+ const actionOpts = computeActionOpts.value;
687
+ const btnEl = evnt.currentTarget;
688
+ const btnWrapperEl = btnEl.parentElement;
689
+ const handleEl = btnWrapperEl.parentElement;
690
+ const prevEl = handleEl.previousElementSibling;
691
+ const prevId = prevEl.getAttribute("itemid");
692
+ const prevItem = itemList.find((item) => item.id === prevId);
693
+ const nextEl = handleEl.nextElementSibling;
694
+ const nextId = nextEl.getAttribute("itemid");
695
+ const nextItem = itemList.find((item) => item.id === nextId);
696
+ if (actionOpts.trigger === "dblclick") {
697
+ if (prevItem && nextItem && prevItem.isExpand) {
698
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
699
+ }
697
700
  }
698
- }
699
- dispatchEvent("action-dblclick", { prevItem, nextItem }, evnt);
700
- };
701
- const handleNextActionClickEvent = (evnt) => {
702
- const { itemList } = reactData;
703
- const actionOpts = computeActionOpts.value;
704
- const btnEl = evnt.currentTarget;
705
- const btnWrapperEl = btnEl.parentElement;
706
- const handleEl = btnWrapperEl.parentElement;
707
- const prevEl = handleEl.previousElementSibling;
708
- const prevId = prevEl.getAttribute("itemid");
709
- const prevItem = itemList.find((item) => item.id === prevId);
710
- const nextEl = handleEl.nextElementSibling;
711
- const nextId = nextEl.getAttribute("itemid");
712
- const nextItem = itemList.find((item) => item.id === nextId);
713
- if (actionOpts.trigger !== "dblclick") {
714
- if (prevItem && nextItem && prevItem.isExpand) {
715
- handleItemActionEvent(evnt, prevItem, nextItem, true);
701
+ dispatchEvent("action-dblclick", { prevItem, nextItem }, evnt);
702
+ };
703
+ const handleNextActionClickEvent = (evnt) => {
704
+ const { itemList } = reactData;
705
+ const actionOpts = computeActionOpts.value;
706
+ const btnEl = evnt.currentTarget;
707
+ const btnWrapperEl = btnEl.parentElement;
708
+ const handleEl = btnWrapperEl.parentElement;
709
+ const prevEl = handleEl.previousElementSibling;
710
+ const prevId = prevEl.getAttribute("itemid");
711
+ const prevItem = itemList.find((item) => item.id === prevId);
712
+ const nextEl = handleEl.nextElementSibling;
713
+ const nextId = nextEl.getAttribute("itemid");
714
+ const nextItem = itemList.find((item) => item.id === nextId);
715
+ if (actionOpts.trigger !== "dblclick") {
716
+ if (prevItem && nextItem && prevItem.isExpand) {
717
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
718
+ }
716
719
  }
717
- }
718
- dispatchEvent("action-click", { prevItem, nextItem }, evnt);
719
- };
720
- const handleGlobalResizeEvent = () => {
721
- recalculate();
722
- };
723
- const splitterMethods = {
724
- dispatchEvent,
725
- setItemExpand,
726
- toggleItemExpand,
727
- getItemExpand,
728
- recalculate,
729
- reset,
730
- loadItem,
731
- reloadItem
732
- };
733
- const splitterPrivateMethods = {};
734
- Object.assign($xeSplitter, splitterMethods, splitterPrivateMethods);
735
- const renderHandleBar = (prevItem, nextItem) => {
736
- const { border, resize, vertical } = props;
737
- const { itemList } = reactData;
738
- const actionOpts = computeActionOpts.value;
739
- const { direction } = actionOpts;
740
- const showPrevButton = import_xe_utils.default.isBoolean(actionOpts.showPrevButton) ? actionOpts.showPrevButton : itemList.some((item) => item.showAction);
741
- const showNextButton = import_xe_utils.default.isBoolean(actionOpts.showNextButton) ? actionOpts.showNextButton : direction === "next" && itemList.some((item) => item.showAction);
742
- const resizeOpts = computeResizeOpts.value;
743
- const { immediate } = resizeOpts;
744
- return (0, import_vue.h)(
745
- "div",
746
- {
747
- class: [
748
- "vxe-splitter-panel-handle",
749
- vertical ? "is--vertical" : "is--horizontal",
750
- immediate ? "is-resize--immediate" : "is-resize--lazy",
751
- {
752
- "is--resize": resize,
753
- "is--border": border
754
- }
755
- ]
756
- },
757
- [
758
- (0, import_vue.h)("div", {
759
- class: "vxe-splitter-panel-handle-bar",
760
- onMousedown: dragEvent
761
- }),
762
- itemList.length === 2 ? (0, import_vue.h)(
763
- "div",
764
- {
765
- class: "vxe-splitter-panel-action-btn-wrapper"
766
- },
767
- [
768
- showPrevButton && nextItem.isExpand ? (0, import_vue.h)(
769
- "div",
770
- {
771
- class: ["vxe-splitter-panel-action-btn", prevItem.isExpand ? "is--prev" : "is--next"],
772
- onDblclick: handlePrevActionDblclickEvent,
773
- onClick: handlePrevActionClickEvent
774
- },
775
- [
776
- (0, import_vue.h)("i", {
777
- class: getActionIcon(prevItem, nextItem, false)
778
- })
779
- ]
780
- ) : renderEmptyElement($xeSplitter),
781
- showNextButton && prevItem.isExpand ? (0, import_vue.h)(
782
- "div",
783
- {
784
- class: ["vxe-splitter-panel-action-btn", nextItem.isExpand ? "is--next" : "is--prev"],
785
- onDblclick: handleNextActionDblclickEvent,
786
- onClick: handleNextActionClickEvent
787
- },
788
- [
789
- (0, import_vue.h)("i", {
790
- class: getActionIcon(prevItem, nextItem, true)
791
- })
792
- ]
793
- ) : renderEmptyElement($xeSplitter)
720
+ dispatchEvent("action-click", { prevItem, nextItem }, evnt);
721
+ };
722
+ const handleGlobalResizeEvent = () => {
723
+ recalculate();
724
+ };
725
+ const splitterMethods = {
726
+ dispatchEvent,
727
+ setItemExpand,
728
+ toggleItemExpand,
729
+ getItemExpand,
730
+ recalculate,
731
+ reset,
732
+ loadItem,
733
+ reloadItem
734
+ };
735
+ const splitterPrivateMethods = {};
736
+ Object.assign($xeSplitter, splitterMethods, splitterPrivateMethods);
737
+ const renderHandleBar = (prevItem, nextItem) => {
738
+ const { border, resize, vertical } = props;
739
+ const { itemList } = reactData;
740
+ const actionOpts = computeActionOpts.value;
741
+ const { direction } = actionOpts;
742
+ const showPrevButton = import_xe_utils.default.isBoolean(actionOpts.showPrevButton) ? actionOpts.showPrevButton : itemList.some((item) => item.showAction);
743
+ const showNextButton = import_xe_utils.default.isBoolean(actionOpts.showNextButton) ? actionOpts.showNextButton : direction === "next" && itemList.some((item) => item.showAction);
744
+ const resizeOpts = computeResizeOpts.value;
745
+ const { immediate } = resizeOpts;
746
+ return (0, import_vue.h)(
747
+ "div",
748
+ {
749
+ class: [
750
+ "vxe-splitter-panel-handle",
751
+ vertical ? "is--vertical" : "is--horizontal",
752
+ immediate ? "is-resize--immediate" : "is-resize--lazy",
753
+ {
754
+ "is--resize": resize,
755
+ "is--border": border
756
+ }
794
757
  ]
795
- ) : renderEmptyElement($xeSplitter)
796
- ]
797
- );
798
- };
799
- const renderItems = () => {
800
- const { border, padding, resize, vertical } = props;
801
- const { itemList } = reactData;
802
- const vSize = computeSize.value;
803
- const actionOpts = computeActionOpts.value;
804
- const { autoHideButton } = actionOpts;
805
- const resizeOpts = computeResizeOpts.value;
806
- const { immediate } = resizeOpts;
807
- const visibleItems = computeVisibleItems.value;
808
- const { autoItems } = computeAutoItems.value;
809
- const isOnlyView = visibleItems.length <= 1;
810
- const itemVNs = [];
811
- itemList.forEach((prevItem, index) => {
812
- const { id, name, slots: slots2, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isExpand } = prevItem;
813
- const nextItem = itemList[index + 1];
814
- const defaultSlot = slots2 ? slots2.default : null;
815
- const stys = {};
816
- let itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
817
- let itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
818
- if (autoItems.length === 1) {
758
+ },
759
+ [
760
+ (0, import_vue.h)("div", {
761
+ class: "vxe-splitter-panel-handle-bar",
762
+ onMousedown: dragEvent
763
+ }),
764
+ itemList.length === 2 ? (0, import_vue.h)(
765
+ "div",
766
+ {
767
+ class: "vxe-splitter-panel-action-btn-wrapper"
768
+ },
769
+ [
770
+ showPrevButton && nextItem.isExpand ? (0, import_vue.h)(
771
+ "div",
772
+ {
773
+ class: ["vxe-splitter-panel-action-btn", prevItem.isExpand ? "is--prev" : "is--next"],
774
+ onDblclick: handlePrevActionDblclickEvent,
775
+ onClick: handlePrevActionClickEvent
776
+ },
777
+ [
778
+ (0, import_vue.h)("i", {
779
+ class: getActionIcon(prevItem, nextItem, false)
780
+ })
781
+ ]
782
+ ) : renderEmptyElement($xeSplitter),
783
+ showNextButton && prevItem.isExpand ? (0, import_vue.h)(
784
+ "div",
785
+ {
786
+ class: ["vxe-splitter-panel-action-btn", nextItem.isExpand ? "is--next" : "is--prev"],
787
+ onDblclick: handleNextActionDblclickEvent,
788
+ onClick: handleNextActionClickEvent
789
+ },
790
+ [
791
+ (0, import_vue.h)("i", {
792
+ class: getActionIcon(prevItem, nextItem, true)
793
+ })
794
+ ]
795
+ ) : renderEmptyElement($xeSplitter)
796
+ ]
797
+ ) : renderEmptyElement($xeSplitter)
798
+ ]
799
+ );
800
+ };
801
+ const renderItems = () => {
802
+ const { border, padding, resize, vertical } = props;
803
+ const { itemList } = reactData;
804
+ const vSize = computeSize.value;
805
+ const actionOpts = computeActionOpts.value;
806
+ const { autoHideButton } = actionOpts;
807
+ const resizeOpts = computeResizeOpts.value;
808
+ const { immediate } = resizeOpts;
809
+ const visibleItems = computeVisibleItems.value;
810
+ const { autoItems } = computeAutoItems.value;
811
+ const isOnlyView = visibleItems.length <= 1;
812
+ const itemVNs = [];
813
+ itemList.forEach((prevItem, index) => {
814
+ const { id, name, slots: slots2, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isExpand } = prevItem;
815
+ const nextItem = itemList[index + 1];
816
+ const defaultSlot = slots2 ? slots2.default : null;
817
+ const stys = {};
818
+ let itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
819
+ let itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
820
+ if (autoItems.length === 1) {
821
+ if (vertical) {
822
+ if (!prevItem.height) {
823
+ itemHeight = 0;
824
+ }
825
+ } else {
826
+ if (!prevItem.width) {
827
+ itemWidth = 0;
828
+ }
829
+ }
830
+ }
831
+ let isFill = true;
819
832
  if (vertical) {
820
- if (!prevItem.height) {
821
- itemHeight = 0;
833
+ if (itemHeight && visibleItems.length > 1) {
834
+ isFill = false;
835
+ stys.height = (0, import_dom.toCssUnit)(itemHeight);
822
836
  }
823
837
  } else {
824
- if (!prevItem.width) {
825
- itemWidth = 0;
838
+ if (itemWidth && visibleItems.length > 1) {
839
+ isFill = false;
840
+ stys.width = (0, import_dom.toCssUnit)(itemWidth);
826
841
  }
827
842
  }
828
- }
829
- let isFill = true;
830
- if (vertical) {
831
- if (itemHeight && visibleItems.length > 1) {
832
- isFill = false;
833
- stys.height = (0, import_dom.toCssUnit)(itemHeight);
834
- }
835
- } else {
836
- if (itemWidth && visibleItems.length > 1) {
837
- isFill = false;
838
- stys.width = (0, import_dom.toCssUnit)(itemWidth);
843
+ itemVNs.push(
844
+ (0, import_vue.h)(
845
+ "div",
846
+ {
847
+ itemid: id,
848
+ class: [
849
+ "vxe-splitter-panel",
850
+ vertical ? "is--vertical" : "is--horizontal",
851
+ immediate ? "is-resize--immediate" : "is-resize--lazy",
852
+ {
853
+ [`size--${vSize}`]: vSize,
854
+ "is--resize": resize,
855
+ "is--padding": padding,
856
+ "is--border": border,
857
+ "is--height": itemHeight,
858
+ "is--width": itemWidth,
859
+ "is--visible": isExpand,
860
+ "is--hidden": !isExpand,
861
+ "is--fill": isExpand && isFill
862
+ }
863
+ ],
864
+ style: stys
865
+ },
866
+ [
867
+ (0, import_vue.h)(
868
+ "div",
869
+ {
870
+ itemid: id,
871
+ class: "vxe-splitter-panel--wrapper"
872
+ },
873
+ [
874
+ (0, import_vue.h)(
875
+ "div",
876
+ {
877
+ class: "vxe-splitter-panel--inner"
878
+ },
879
+ defaultSlot ? callSlot(defaultSlot, { name, isExpand }) : []
880
+ )
881
+ ]
882
+ )
883
+ ]
884
+ )
885
+ );
886
+ if (nextItem) {
887
+ itemVNs.push(renderHandleBar(prevItem, nextItem));
839
888
  }
840
- }
841
- itemVNs.push(
842
- (0, import_vue.h)(
843
- "div",
844
- {
845
- itemid: id,
846
- class: [
847
- "vxe-splitter-panel",
848
- vertical ? "is--vertical" : "is--horizontal",
849
- immediate ? "is-resize--immediate" : "is-resize--lazy",
850
- {
851
- [`size--${vSize}`]: vSize,
852
- "is--resize": resize,
853
- "is--padding": padding,
854
- "is--border": border,
855
- "is--height": itemHeight,
856
- "is--width": itemWidth,
857
- "is--visible": isExpand,
858
- "is--hidden": !isExpand,
859
- "is--fill": isExpand && isFill
860
- }
861
- ],
862
- style: stys
863
- },
864
- [
865
- (0, import_vue.h)(
866
- "div",
867
- {
868
- itemid: id,
869
- class: "vxe-splitter-panel--wrapper"
870
- },
871
- [
872
- (0, import_vue.h)(
873
- "div",
874
- {
875
- class: "vxe-splitter-panel--inner"
876
- },
877
- defaultSlot ? callSlot(defaultSlot, { name, isExpand }) : []
878
- )
879
- ]
880
- )
889
+ });
890
+ return (0, import_vue.h)(
891
+ "div",
892
+ {
893
+ class: [
894
+ "vxe-splitter-wrapper",
895
+ {
896
+ "is--ah-btn": autoHideButton,
897
+ "is--only-view": isOnlyView
898
+ }
881
899
  ]
882
- )
900
+ },
901
+ itemVNs
883
902
  );
884
- if (nextItem) {
885
- itemVNs.push(renderHandleBar(prevItem, nextItem));
886
- }
887
- });
888
- return (0, import_vue.h)(
889
- "div",
890
- {
891
- class: [
892
- "vxe-splitter-wrapper",
893
- {
894
- "is--ah-btn": autoHideButton,
895
- "is--only-view": isOnlyView
896
- }
903
+ };
904
+ const renderVN = () => {
905
+ const { vertical } = props;
906
+ const vSize = computeSize.value;
907
+ const resizeOpts = computeResizeOpts.value;
908
+ const wrapperStyle = computeWrapperStyle.value;
909
+ const { immediate, showTip } = resizeOpts;
910
+ const defaultSlot = slots.default;
911
+ return (0, import_vue.h)(
912
+ "div",
913
+ {
914
+ ref: refElem,
915
+ class: [
916
+ "vxe-splitter",
917
+ vertical ? "is--vertical" : "is--horizontal",
918
+ immediate ? "is-resize--immediate" : "is-resize--lazy",
919
+ {
920
+ [`size--${vSize}`]: vSize
921
+ }
922
+ ],
923
+ style: wrapperStyle
924
+ },
925
+ [
926
+ (0, import_vue.h)(
927
+ "div",
928
+ {
929
+ class: "vxe-splitter-slots"
930
+ },
931
+ defaultSlot ? defaultSlot({}) : []
932
+ ),
933
+ renderItems(),
934
+ (0, import_vue.h)(
935
+ "div",
936
+ {
937
+ ref: refResizableSplitterTip,
938
+ class: ["vxe-splitter--resizable-splitter-tip", vertical ? "is--vertical" : "is--horizontal", immediate ? "is-resize--immediate" : "is-resize--lazy"]
939
+ },
940
+ showTip ? [
941
+ (0, import_vue.h)(
942
+ "div",
943
+ {
944
+ class: "vxe-splitter--resizable-splitter-tip-number"
945
+ },
946
+ [
947
+ (0, import_vue.h)("div", {
948
+ class: "vxe-splitter--resizable-splitter-number-prev"
949
+ }),
950
+ (0, import_vue.h)("div", {
951
+ class: "vxe-splitter--resizable-splitter-number-next"
952
+ })
953
+ ]
954
+ )
955
+ ] : []
956
+ ),
957
+ (0, import_vue.h)(
958
+ "div",
959
+ {
960
+ class: "vxe-splitter--render-vars"
961
+ },
962
+ [
963
+ (0, import_vue.h)("div", {
964
+ ref: refBarInfoElem,
965
+ class: "vxe-splitter--handle-bar-info"
966
+ })
967
+ ]
968
+ )
897
969
  ]
898
- },
899
- itemVNs
970
+ );
971
+ };
972
+ const itemFlag = (0, import_vue.ref)(0);
973
+ (0, import_vue.watch)(
974
+ () => props.items ? props.items.length : -1,
975
+ () => {
976
+ itemFlag.value++;
977
+ }
900
978
  );
901
- };
902
- const renderVN = () => {
903
- const { vertical } = props;
904
- const vSize = computeSize.value;
905
- const resizeOpts = computeResizeOpts.value;
906
- const wrapperStyle = computeWrapperStyle.value;
907
- const { immediate, showTip } = resizeOpts;
908
- const defaultSlot = slots.default;
909
- return (0, import_vue.h)(
910
- "div",
911
- {
912
- ref: refElem,
913
- class: [
914
- "vxe-splitter",
915
- vertical ? "is--vertical" : "is--horizontal",
916
- immediate ? "is-resize--immediate" : "is-resize--lazy",
917
- {
918
- [`size--${vSize}`]: vSize
979
+ (0, import_vue.watch)(
980
+ () => props.items,
981
+ () => {
982
+ itemFlag.value++;
983
+ }
984
+ );
985
+ (0, import_vue.watch)(itemFlag, () => {
986
+ loadItem(props.items || []);
987
+ });
988
+ (0, import_vue.watch)(
989
+ () => reactData.staticItems,
990
+ (val) => {
991
+ const actionOpts = computeActionOpts.value;
992
+ const { showPrevButton, showNextButton } = actionOpts;
993
+ if (props.items && props.items.length) {
994
+ errLog("vxe.error.errConflicts", ["<vxe-splitter-panel ...>", "items"]);
995
+ }
996
+ reactData.itemList = val || [];
997
+ if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
998
+ errLog("vxe.error.modelConflicts", ["action-config.showPrevButton | action-config.showNextButton", "<vxe-splitter-panel ...> Only supports 2 panel"]);
999
+ }
1000
+ reactData.itemList.forEach((item) => {
1001
+ if (item.showAction) {
1002
+ warnLog("vxe.error.removeProp", ["showAction"]);
919
1003
  }
920
- ],
921
- style: wrapperStyle
922
- },
923
- [
924
- (0, import_vue.h)(
925
- "div",
926
- {
927
- class: "vxe-splitter-slots"
928
- },
929
- defaultSlot ? defaultSlot({}) : []
930
- ),
931
- renderItems(),
932
- (0, import_vue.h)(
933
- "div",
934
- {
935
- ref: refResizableSplitterTip,
936
- class: ["vxe-splitter--resizable-splitter-tip", vertical ? "is--vertical" : "is--horizontal", immediate ? "is-resize--immediate" : "is-resize--lazy"]
937
- },
938
- showTip ? [
939
- (0, import_vue.h)(
940
- "div",
941
- {
942
- class: "vxe-splitter--resizable-splitter-tip-number"
943
- },
944
- [
945
- (0, import_vue.h)("div", {
946
- class: "vxe-splitter--resizable-splitter-number-prev"
947
- }),
948
- (0, import_vue.h)("div", {
949
- class: "vxe-splitter--resizable-splitter-number-next"
950
- })
951
- ]
952
- )
953
- ] : []
954
- ),
955
- (0, import_vue.h)(
956
- "div",
957
- {
958
- class: "vxe-splitter--render-vars"
959
- },
960
- [
961
- (0, import_vue.h)("div", {
962
- ref: refBarInfoElem,
963
- class: "vxe-splitter--handle-bar-info"
964
- })
965
- ]
966
- )
967
- ]
1004
+ });
1005
+ recalculate();
1006
+ }
968
1007
  );
969
- };
970
- const itemFlag = (0, import_vue.ref)(0);
971
- (0, import_vue.watch)(
972
- () => props.items ? props.items.length : -1,
973
- () => {
974
- itemFlag.value++;
975
- }
976
- );
977
- (0, import_vue.watch)(
978
- () => props.items,
979
- () => {
980
- itemFlag.value++;
981
- }
982
- );
983
- (0, import_vue.watch)(itemFlag, () => {
984
- loadItem(props.items || []);
985
- });
986
- (0, import_vue.watch)(
987
- () => reactData.staticItems,
988
- (val) => {
1008
+ let resizeObserver;
1009
+ (0, import_vue.onMounted)(() => {
1010
+ (0, import_vue.nextTick)(() => {
1011
+ recalculate();
1012
+ });
1013
+ const el = refElem.value;
1014
+ if (el) {
1015
+ resizeObserver = globalResize.create(() => {
1016
+ recalculate();
1017
+ });
1018
+ resizeObserver.observe(el);
1019
+ }
989
1020
  const actionOpts = computeActionOpts.value;
990
- const { showPrevButton, showNextButton } = actionOpts;
991
- if (props.items && props.items.length) {
992
- errLog("vxe.error.errConflicts", ["<vxe-splitter-panel ...>", "items"]);
1021
+ if (actionOpts.direction) {
1022
+ errLog("vxe.error.delProp", ["action-config.direction", "action-config.showPrevButton | action-config.showNextButton"]);
993
1023
  }
994
- reactData.itemList = val || [];
995
- if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
996
- errLog("vxe.error.modelConflicts", ["action-config.showPrevButton | action-config.showNextButton", "<vxe-splitter-panel ...> Only supports 2 panel"]);
1024
+ globalEvents.on($xeSplitter, "resize", handleGlobalResizeEvent);
1025
+ });
1026
+ (0, import_vue.onUnmounted)(() => {
1027
+ if (resizeObserver) {
1028
+ resizeObserver.disconnect();
997
1029
  }
998
- reactData.itemList.forEach((item) => {
999
- if (item.showAction) {
1000
- warnLog("vxe.error.removeProp", ["showAction"]);
1001
- }
1002
- });
1003
- recalculate();
1004
- }
1005
- );
1006
- let resizeObserver;
1007
- (0, import_vue.onMounted)(() => {
1008
- (0, import_vue.nextTick)(() => {
1030
+ globalEvents.off($xeSplitter, "resize");
1031
+ });
1032
+ (0, import_vue.onActivated)(() => {
1009
1033
  recalculate();
1010
1034
  });
1011
- const el = refElem.value;
1012
- if (el) {
1013
- resizeObserver = globalResize.create(() => {
1014
- recalculate();
1015
- });
1016
- resizeObserver.observe(el);
1017
- }
1018
- const actionOpts = computeActionOpts.value;
1019
- if (actionOpts.direction) {
1020
- errLog("vxe.error.delProp", ["action-config.direction", "action-config.showPrevButton | action-config.showNextButton"]);
1035
+ if (props.items) {
1036
+ loadItem(props.items);
1021
1037
  }
1022
- globalEvents.on($xeSplitter, "resize", handleGlobalResizeEvent);
1023
- });
1024
- (0, import_vue.onUnmounted)(() => {
1025
- if (resizeObserver) {
1026
- resizeObserver.disconnect();
1027
- }
1028
- globalEvents.off($xeSplitter, "resize");
1029
- });
1030
- (0, import_vue.onActivated)(() => {
1031
- recalculate();
1032
- });
1033
- if (props.items) {
1034
- loadItem(props.items);
1038
+ (0, import_vue.provide)("$xeSplitter", $xeSplitter);
1039
+ $xeSplitter.renderVN = renderVN;
1040
+ return $xeSplitter;
1041
+ },
1042
+ render() {
1043
+ return this.renderVN();
1035
1044
  }
1036
- (0, import_vue.provide)("$xeSplitter", $xeSplitter);
1037
- $xeSplitter.renderVN = renderVN;
1038
- return $xeSplitter;
1039
- },
1040
- render() {
1041
- return this.renderVN();
1042
- }
1043
- });
1045
+ })
1046
+ );