tomtaw-vxe-table 3.25.13 → 3.25.14

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 (593) hide show
  1. package/es/colgroup/index.d.ts +122 -0
  2. package/es/colgroup/index.js +16 -13
  3. package/es/column/index.d.ts +122 -0
  4. package/es/column/index.js +16 -13
  5. package/es/components.d.ts +12 -0
  6. package/es/components.js +28 -31
  7. package/es/grid/index.d.ts +1252 -0
  8. package/es/grid/index.js +18 -13
  9. package/es/grid/src/grid.d.ts +638 -0
  10. package/es/grid/src/grid.js +1883 -1876
  11. package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
  12. package/es/index.d.ts +3 -0
  13. package/es/index.esm.js +14 -21
  14. package/es/index.js +15 -0
  15. package/es/locale/lang/ar-EG.d.ts +908 -2
  16. package/es/locale/lang/ar-EG.js +906 -899
  17. package/es/locale/lang/de-DE.d.ts +908 -2
  18. package/es/locale/lang/de-DE.js +906 -899
  19. package/es/locale/lang/en-US.d.ts +908 -2
  20. package/es/locale/lang/en-US.js +906 -899
  21. package/es/locale/lang/es-ES.d.ts +908 -2
  22. package/es/locale/lang/es-ES.js +906 -899
  23. package/es/locale/lang/fr-FR.d.ts +908 -2
  24. package/es/locale/lang/fr-FR.js +906 -899
  25. package/es/locale/lang/hu-HU.d.ts +908 -2
  26. package/es/locale/lang/hu-HU.js +906 -899
  27. package/es/locale/lang/hy-AM.d.ts +908 -2
  28. package/es/locale/lang/hy-AM.js +906 -899
  29. package/es/locale/lang/id-ID.d.ts +908 -2
  30. package/es/locale/lang/id-ID.js +906 -899
  31. package/es/locale/lang/it-IT.d.ts +908 -2
  32. package/es/locale/lang/it-IT.js +906 -899
  33. package/es/locale/lang/ja-JP.d.ts +908 -2
  34. package/es/locale/lang/ja-JP.js +906 -899
  35. package/es/locale/lang/ko-KR.d.ts +908 -2
  36. package/es/locale/lang/ko-KR.js +906 -899
  37. package/es/locale/lang/ms-MY.d.ts +908 -2
  38. package/es/locale/lang/ms-MY.js +906 -899
  39. package/es/locale/lang/nb-NO.d.ts +908 -2
  40. package/es/locale/lang/nb-NO.js +906 -899
  41. package/es/locale/lang/pt-BR.d.ts +908 -2
  42. package/es/locale/lang/pt-BR.js +906 -899
  43. package/es/locale/lang/ru-RU.d.ts +908 -2
  44. package/es/locale/lang/ru-RU.js +906 -899
  45. package/es/locale/lang/th-TH.d.ts +908 -2
  46. package/es/locale/lang/th-TH.js +906 -899
  47. package/es/locale/lang/ug-CN.d.ts +908 -2
  48. package/es/locale/lang/ug-CN.js +906 -899
  49. package/es/locale/lang/uk-UA.d.ts +908 -2
  50. package/es/locale/lang/uk-UA.js +906 -899
  51. package/es/locale/lang/uz-UZ.d.ts +908 -2
  52. package/es/locale/lang/uz-UZ.js +906 -899
  53. package/es/locale/lang/vi-VN.d.ts +908 -2
  54. package/es/locale/lang/vi-VN.js +906 -899
  55. package/es/locale/lang/zh-CHT.d.ts +908 -2
  56. package/es/locale/lang/zh-CHT.js +906 -899
  57. package/es/locale/lang/zh-CN.d.ts +908 -2
  58. package/es/locale/lang/zh-CN.js +906 -899
  59. package/es/locale/lang/zh-HK.d.ts +908 -2
  60. package/es/locale/lang/zh-HK.js +910 -2
  61. package/es/locale/lang/zh-MO.d.ts +908 -2
  62. package/es/locale/lang/zh-MO.js +910 -2
  63. package/es/locale/lang/zh-TC.d.ts +908 -0
  64. package/es/locale/lang/zh-TC.js +910 -2
  65. package/es/locale/lang/zh-TW.d.ts +908 -2
  66. package/es/locale/lang/zh-TW.js +910 -2
  67. package/es/style.css +4499 -1
  68. package/es/style.mini.css +1 -0
  69. package/es/table/index.d.ts +4 -0
  70. package/es/table/index.js +49 -44
  71. package/es/table/module/custom/mixin.d.ts +4 -0
  72. package/es/table/module/custom/mixin.js +476 -487
  73. package/es/table/module/custom/panel.d.ts +57 -0
  74. package/es/table/module/custom/panel.js +1939 -1771
  75. package/es/table/module/edit/mixin.d.ts +2 -0
  76. package/es/table/module/edit/mixin.js +1097 -1110
  77. package/es/table/module/export/export-panel.d.ts +51 -0
  78. package/es/table/module/export/export-panel.js +718 -683
  79. package/es/table/module/export/import-panel.d.ts +39 -0
  80. package/es/table/module/export/import-panel.js +327 -294
  81. package/es/table/module/export/mixin.d.ts +2 -0
  82. package/es/table/module/export/mixin.js +1838 -1860
  83. package/es/table/module/export/util.d.ts +5 -0
  84. package/es/table/module/export/util.js +20 -17
  85. package/es/table/module/filter/mixin.d.ts +4 -0
  86. package/es/table/module/filter/mixin.js +492 -508
  87. package/es/table/module/filter/panel.d.ts +41 -0
  88. package/es/table/module/filter/panel.js +342 -293
  89. package/es/table/module/keyboard/mixin.d.ts +12 -0
  90. package/es/table/module/keyboard/mixin.js +462 -507
  91. package/es/table/module/menu/mixin.d.ts +25 -0
  92. package/es/table/module/menu/mixin.js +302 -320
  93. package/es/table/module/menu/panel.d.ts +22 -0
  94. package/es/table/module/menu/panel.js +246 -197
  95. package/es/table/module/validator/mixin.d.ts +4 -0
  96. package/es/table/module/validator/mixin.js +516 -561
  97. package/es/table/render/index.d.ts +1 -0
  98. package/es/table/render/index.js +1472 -1476
  99. package/es/table/src/body.d.ts +8 -0
  100. package/es/table/src/body.js +950 -886
  101. package/es/table/src/cell.d.ts +148 -0
  102. package/es/table/src/cell.js +1348 -1212
  103. package/es/table/src/column.d.ts +150 -0
  104. package/es/table/src/column.js +202 -199
  105. package/es/table/src/columnInfo.d.ts +12 -0
  106. package/es/table/src/columnInfo.js +210 -205
  107. package/es/table/src/expand-height.d.ts +14 -0
  108. package/es/table/src/expand-height.js +109 -127
  109. package/es/table/src/footer.d.ts +8 -0
  110. package/es/table/src/footer.js +388 -354
  111. package/es/table/src/group.d.ts +59 -0
  112. package/es/table/src/group.js +52 -50
  113. package/es/table/src/header.d.ts +11 -0
  114. package/es/table/src/header.js +611 -564
  115. package/es/table/src/layout-scheduler.d.ts +13 -0
  116. package/es/table/src/layout-scheduler.js +118 -138
  117. package/es/table/src/methods.d.ts +2 -0
  118. package/es/table/src/methods.js +13243 -13956
  119. package/es/table/src/props.d.ts +239 -0
  120. package/es/table/src/props.js +315 -312
  121. package/es/table/src/scroll-sync.d.ts +9 -0
  122. package/es/table/src/scroll-sync.js +57 -65
  123. package/es/table/src/store.d.ts +7 -0
  124. package/es/table/src/store.js +9 -6
  125. package/es/table/src/table.d.ts +2 -0
  126. package/es/table/src/table.js +2729 -2668
  127. package/es/table/src/util.d.ts +70 -0
  128. package/es/table/src/util.js +1018 -1017
  129. package/es/table/style.css +31 -12
  130. package/es/table/style.mini.css +1 -0
  131. package/es/toolbar/index.d.ts +148 -0
  132. package/es/toolbar/index.js +14 -9
  133. package/es/toolbar/src/toolbar.d.ts +81 -0
  134. package/es/toolbar/src/toolbar.js +791 -766
  135. package/es/toolbar/{style.min.css → style.mini.css} +1 -1
  136. package/es/ui/index.d.ts +85 -0
  137. package/es/ui/index.js +460 -503
  138. package/es/ui/src/anime.d.ts +10 -0
  139. package/es/ui/src/anime.js +40 -40
  140. package/es/ui/src/comp.d.ts +2 -0
  141. package/es/ui/src/comp.js +4 -1
  142. package/es/ui/src/dom.d.ts +80 -0
  143. package/es/ui/src/dom.js +373 -378
  144. package/es/ui/src/log.d.ts +6 -0
  145. package/es/ui/src/log.js +18 -13
  146. package/es/ui/src/utils.d.ts +24 -0
  147. package/es/ui/src/utils.js +61 -56
  148. package/es/ui/src/vn.d.ts +7 -0
  149. package/es/ui/src/vn.js +61 -52
  150. package/es/v-x-e-table/index.d.ts +2 -0
  151. package/es/v-x-e-table/index.js +5 -3
  152. package/es/vxe-colgroup/index.d.ts +3 -0
  153. package/es/vxe-colgroup/index.js +6 -3
  154. package/es/vxe-column/index.d.ts +3 -0
  155. package/es/vxe-column/index.js +6 -3
  156. package/es/vxe-grid/index.d.ts +3 -0
  157. package/es/vxe-grid/index.js +6 -3
  158. package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
  159. package/es/vxe-table/index.d.ts +3 -0
  160. package/es/vxe-table/index.js +6 -3
  161. package/es/vxe-table/style.css +31 -12
  162. package/es/vxe-table/style.mini.css +1 -0
  163. package/es/vxe-toolbar/index.d.ts +3 -0
  164. package/es/vxe-toolbar/index.js +6 -3
  165. package/{lib/toolbar/style/style.min.css → es/vxe-toolbar/style.mini.css} +1 -1
  166. package/es/vxe-ui/index.d.ts +3 -0
  167. package/es/vxe-ui/index.js +6 -3
  168. package/lib/colgroup/index.js +44 -18
  169. package/lib/colgroup/style/index.js +1 -1
  170. package/lib/column/index.js +44 -18
  171. package/lib/column/style/index.js +1 -1
  172. package/lib/components.js +55 -92
  173. package/lib/grid/index.js +42 -14
  174. package/lib/grid/src/grid.js +860 -1112
  175. package/lib/grid/style/index.js +1 -1
  176. package/{es/grid/style.min.css → lib/grid/style/style.mini.css} +1 -1
  177. package/lib/index.common.js +43 -19
  178. package/lib/index.js +46 -0
  179. package/lib/index.umd.js +26848 -20027
  180. package/lib/index.umd.min.js +3 -1
  181. package/lib/locale/ar-EG.umd.js +948 -0
  182. package/lib/locale/ar-EG.umd.min.js +1 -0
  183. package/lib/locale/de-DE.umd.js +948 -0
  184. package/lib/locale/de-DE.umd.min.js +1 -0
  185. package/lib/locale/en-US.umd.js +948 -0
  186. package/lib/locale/en-US.umd.min.js +1 -0
  187. package/lib/locale/es-ES.umd.js +948 -0
  188. package/lib/locale/es-ES.umd.min.js +1 -0
  189. package/lib/locale/fr-FR.umd.js +948 -0
  190. package/lib/locale/fr-FR.umd.min.js +1 -0
  191. package/lib/locale/hu-HU.umd.js +948 -0
  192. package/lib/locale/hu-HU.umd.min.js +1 -0
  193. package/lib/locale/hy-AM.umd.js +948 -0
  194. package/lib/locale/hy-AM.umd.min.js +1 -0
  195. package/lib/locale/id-ID.umd.js +948 -0
  196. package/lib/locale/id-ID.umd.min.js +1 -0
  197. package/lib/locale/it-IT.umd.js +948 -0
  198. package/lib/locale/it-IT.umd.min.js +1 -0
  199. package/lib/locale/ja-JP.umd.js +948 -0
  200. package/lib/locale/ja-JP.umd.min.js +1 -0
  201. package/lib/locale/ko-KR.umd.js +948 -0
  202. package/lib/locale/ko-KR.umd.min.js +1 -0
  203. package/lib/locale/lang/ar-EG.js +683 -662
  204. package/lib/locale/lang/ar-EG.umd.js +913 -888
  205. package/lib/locale/lang/ar-EG.umd.min.js +1 -0
  206. package/lib/locale/lang/de-DE.js +683 -662
  207. package/lib/locale/lang/de-DE.umd.js +913 -888
  208. package/lib/locale/lang/de-DE.umd.min.js +1 -0
  209. package/lib/locale/lang/en-US.js +680 -659
  210. package/lib/locale/lang/en-US.umd.js +913 -888
  211. package/lib/locale/lang/en-US.umd.min.js +1 -0
  212. package/lib/locale/lang/es-ES.js +683 -662
  213. package/lib/locale/lang/es-ES.umd.js +913 -888
  214. package/lib/locale/lang/es-ES.umd.min.js +1 -0
  215. package/lib/locale/lang/fr-FR.js +656 -635
  216. package/lib/locale/lang/fr-FR.umd.js +913 -888
  217. package/lib/locale/lang/fr-FR.umd.min.js +1 -0
  218. package/lib/locale/lang/hu-HU.js +683 -662
  219. package/lib/locale/lang/hu-HU.umd.js +913 -888
  220. package/lib/locale/lang/hu-HU.umd.min.js +1 -0
  221. package/lib/locale/lang/hy-AM.js +683 -662
  222. package/lib/locale/lang/hy-AM.umd.js +913 -888
  223. package/lib/locale/lang/hy-AM.umd.min.js +1 -0
  224. package/lib/locale/lang/id-ID.js +683 -662
  225. package/lib/locale/lang/id-ID.umd.js +913 -888
  226. package/lib/locale/lang/id-ID.umd.min.js +1 -0
  227. package/lib/locale/lang/it-IT.js +663 -642
  228. package/lib/locale/lang/it-IT.umd.js +912 -887
  229. package/lib/locale/lang/it-IT.umd.min.js +1 -0
  230. package/lib/locale/lang/ja-JP.js +712 -691
  231. package/lib/locale/lang/ja-JP.umd.js +913 -888
  232. package/lib/locale/lang/ja-JP.umd.min.js +1 -0
  233. package/lib/locale/lang/ko-KR.js +683 -662
  234. package/lib/locale/lang/ko-KR.umd.js +913 -888
  235. package/lib/locale/lang/ko-KR.umd.min.js +1 -0
  236. package/lib/locale/lang/ms-MY.js +683 -662
  237. package/lib/locale/lang/ms-MY.umd.js +913 -888
  238. package/lib/locale/lang/ms-MY.umd.min.js +1 -0
  239. package/lib/locale/lang/nb-NO.js +683 -662
  240. package/lib/locale/lang/nb-NO.umd.js +913 -888
  241. package/lib/locale/lang/nb-NO.umd.min.js +1 -0
  242. package/lib/locale/lang/pt-BR.js +683 -662
  243. package/lib/locale/lang/pt-BR.umd.js +913 -888
  244. package/lib/locale/lang/pt-BR.umd.min.js +1 -0
  245. package/lib/locale/lang/ru-RU.js +692 -671
  246. package/lib/locale/lang/ru-RU.umd.js +913 -888
  247. package/lib/locale/lang/ru-RU.umd.min.js +1 -0
  248. package/lib/locale/lang/th-TH.js +683 -662
  249. package/lib/locale/lang/th-TH.umd.js +913 -888
  250. package/lib/locale/lang/th-TH.umd.min.js +1 -0
  251. package/lib/locale/lang/ug-CN.js +683 -662
  252. package/lib/locale/lang/ug-CN.umd.js +913 -888
  253. package/lib/locale/lang/ug-CN.umd.min.js +1 -0
  254. package/lib/locale/lang/uk-UA.js +676 -655
  255. package/lib/locale/lang/uk-UA.umd.js +913 -888
  256. package/lib/locale/lang/uk-UA.umd.min.js +1 -0
  257. package/lib/locale/lang/uz-UZ.js +585 -564
  258. package/lib/locale/lang/uz-UZ.umd.js +908 -883
  259. package/lib/locale/lang/uz-UZ.umd.min.js +1 -0
  260. package/lib/locale/lang/vi-VN.js +683 -662
  261. package/lib/locale/lang/vi-VN.umd.js +913 -888
  262. package/lib/locale/lang/vi-VN.umd.min.js +1 -0
  263. package/lib/locale/lang/zh-CHT.js +683 -662
  264. package/lib/locale/lang/zh-CHT.umd.js +913 -888
  265. package/lib/locale/lang/zh-CHT.umd.min.js +1 -0
  266. package/lib/locale/lang/zh-CN.js +683 -662
  267. package/lib/locale/lang/zh-CN.umd.js +913 -888
  268. package/lib/locale/lang/zh-CN.umd.min.js +1 -0
  269. package/lib/locale/lang/zh-HK.js +928 -7
  270. package/lib/locale/lang/zh-HK.umd.js +945 -20
  271. package/lib/locale/lang/zh-HK.umd.min.js +1 -0
  272. package/lib/locale/lang/zh-MO.js +928 -7
  273. package/lib/locale/lang/zh-MO.umd.js +945 -20
  274. package/lib/locale/lang/zh-MO.umd.min.js +1 -0
  275. package/lib/locale/lang/zh-TC.js +928 -7
  276. package/lib/locale/lang/zh-TC.umd.js +948 -0
  277. package/lib/locale/lang/zh-TC.umd.min.js +1 -0
  278. package/lib/locale/lang/zh-TW.js +928 -7
  279. package/lib/locale/lang/zh-TW.umd.js +945 -20
  280. package/lib/locale/lang/zh-TW.umd.min.js +1 -0
  281. package/lib/locale/ms-MY.umd.js +948 -0
  282. package/lib/locale/ms-MY.umd.min.js +1 -0
  283. package/lib/locale/nb-NO.umd.js +948 -0
  284. package/lib/locale/nb-NO.umd.min.js +1 -0
  285. package/lib/locale/pt-BR.umd.js +948 -0
  286. package/lib/locale/pt-BR.umd.min.js +1 -0
  287. package/lib/locale/ru-RU.umd.js +948 -0
  288. package/lib/locale/ru-RU.umd.min.js +1 -0
  289. package/lib/locale/th-TH.umd.js +948 -0
  290. package/lib/locale/th-TH.umd.min.js +1 -0
  291. package/lib/locale/ug-CN.umd.js +948 -0
  292. package/lib/locale/ug-CN.umd.min.js +1 -0
  293. package/lib/locale/uk-UA.umd.js +948 -0
  294. package/lib/locale/uk-UA.umd.min.js +1 -0
  295. package/lib/locale/uz-UZ.umd.js +948 -0
  296. package/lib/locale/uz-UZ.umd.min.js +1 -0
  297. package/lib/locale/vi-VN.umd.js +948 -0
  298. package/lib/locale/vi-VN.umd.min.js +1 -0
  299. package/lib/locale/zh-CHT.umd.js +948 -0
  300. package/lib/locale/zh-CHT.umd.min.js +1 -0
  301. package/lib/locale/zh-CN.umd.js +948 -0
  302. package/lib/locale/zh-CN.umd.min.js +1 -0
  303. package/lib/locale/zh-HK.umd.js +948 -0
  304. package/lib/locale/zh-HK.umd.min.js +1 -0
  305. package/lib/locale/zh-MO.umd.js +948 -0
  306. package/lib/locale/zh-MO.umd.min.js +1 -0
  307. package/lib/locale/zh-TC.umd.js +948 -0
  308. package/lib/locale/zh-TC.umd.min.js +1 -0
  309. package/lib/locale/zh-TW.umd.js +948 -0
  310. package/lib/locale/zh-TW.umd.min.js +1 -0
  311. package/lib/style.css +4499 -1
  312. package/lib/style.mini.css +1 -0
  313. package/lib/table/index.js +60 -32
  314. package/lib/table/module/custom/mixin.js +166 -262
  315. package/lib/table/module/custom/panel.js +1277 -1076
  316. package/lib/table/module/edit/mixin.js +347 -645
  317. package/lib/table/module/export/export-panel.js +526 -399
  318. package/lib/table/module/export/import-panel.js +210 -141
  319. package/lib/table/module/export/mixin.js +898 -1253
  320. package/lib/table/module/export/util.js +37 -14
  321. package/lib/table/module/filter/mixin.js +110 -196
  322. package/lib/table/module/filter/panel.js +229 -186
  323. package/lib/table/module/keyboard/mixin.js +104 -153
  324. package/lib/table/module/menu/mixin.js +89 -151
  325. package/lib/table/module/menu/panel.js +243 -140
  326. package/lib/table/module/validator/mixin.js +188 -278
  327. package/lib/table/render/index.js +777 -1230
  328. package/lib/table/src/body.js +542 -556
  329. package/lib/table/src/cell.js +783 -933
  330. package/lib/table/src/column.js +49 -23
  331. package/lib/table/src/columnInfo.js +86 -104
  332. package/lib/table/src/expand-height.js +43 -47
  333. package/lib/table/src/footer.js +231 -234
  334. package/lib/table/src/group.js +45 -23
  335. package/lib/table/src/header.js +352 -357
  336. package/lib/table/src/layout-scheduler.js +44 -48
  337. package/lib/table/src/methods.js +13656 -945
  338. package/lib/table/src/props.js +33 -36
  339. package/lib/table/src/scroll-sync.js +28 -17
  340. package/lib/table/src/store.js +24 -8
  341. package/lib/table/src/table.js +1217 -1302
  342. package/lib/table/src/util.js +218 -304
  343. package/lib/table/style/index.js +1 -1
  344. package/lib/table/style/style.css +31 -12
  345. package/lib/table/style/style.mini.css +1 -0
  346. package/lib/toolbar/index.js +42 -14
  347. package/lib/toolbar/src/toolbar.js +302 -357
  348. package/lib/toolbar/style/index.js +1 -1
  349. package/lib/{vxe-toolbar/style/style.min.css → toolbar/style/style.mini.css} +1 -1
  350. package/lib/ui/index.js +152 -194
  351. package/lib/ui/src/anime.js +49 -29
  352. package/lib/ui/src/comp.js +22 -6
  353. package/lib/ui/src/dom.js +126 -158
  354. package/lib/ui/src/log.js +34 -18
  355. package/lib/ui/src/utils.js +59 -47
  356. package/lib/ui/src/vn.js +72 -45
  357. package/lib/ui/style/index.js +1 -1
  358. package/lib/v-x-e-table/index.js +33 -20
  359. package/lib/vxe-colgroup/index.js +35 -20
  360. package/lib/vxe-colgroup/style/index.js +1 -1
  361. package/lib/vxe-column/index.js +35 -20
  362. package/lib/vxe-column/style/index.js +1 -1
  363. package/lib/vxe-grid/index.js +35 -20
  364. package/lib/vxe-grid/style/index.js +1 -1
  365. package/lib/vxe-grid/style/{style.min.css → style.mini.css} +1 -1
  366. package/lib/vxe-table/index.js +35 -20
  367. package/lib/vxe-table/style/index.js +1 -1
  368. package/lib/vxe-table/style/style.css +31 -12
  369. package/lib/vxe-table/style/style.mini.css +1 -0
  370. package/lib/vxe-toolbar/index.js +35 -20
  371. package/lib/vxe-toolbar/style/index.js +1 -1
  372. package/{es/vxe-toolbar/style.min.css → lib/vxe-toolbar/style/style.mini.css} +1 -1
  373. package/lib/vxe-ui/index.js +35 -20
  374. package/lib/vxe-ui/style/index.js +1 -1
  375. package/package.json +21 -6
  376. package/packages/colgroup/index.ts +2 -2
  377. package/packages/column/index.ts +2 -2
  378. package/packages/components.ts +12 -10
  379. package/packages/grid/index.ts +2 -2
  380. package/packages/grid/src/grid.ts +437 -351
  381. package/packages/index.ts +11 -0
  382. package/packages/locale/lang/ar-EG.ts +4 -0
  383. package/packages/locale/lang/de-DE.ts +4 -0
  384. package/packages/locale/lang/en-US.ts +4 -0
  385. package/packages/locale/lang/es-ES.ts +4 -0
  386. package/packages/locale/lang/fr-FR.ts +22 -18
  387. package/packages/locale/lang/hu-HU.ts +4 -0
  388. package/packages/locale/lang/hy-AM.ts +4 -0
  389. package/packages/locale/lang/id-ID.ts +4 -0
  390. package/packages/locale/lang/it-IT.ts +8 -4
  391. package/packages/locale/lang/ja-JP.ts +4 -0
  392. package/packages/locale/lang/ko-KR.ts +4 -0
  393. package/packages/locale/lang/ms-MY.ts +4 -0
  394. package/packages/locale/lang/nb-NO.ts +4 -0
  395. package/packages/locale/lang/pt-BR.ts +4 -0
  396. package/packages/locale/lang/ru-RU.ts +4 -0
  397. package/packages/locale/lang/th-TH.ts +4 -0
  398. package/packages/locale/lang/ug-CN.ts +4 -0
  399. package/packages/locale/lang/uk-UA.ts +5 -1
  400. package/packages/locale/lang/uz-UZ.ts +17 -13
  401. package/packages/locale/lang/vi-VN.ts +4 -0
  402. package/packages/locale/lang/zh-CHT.ts +4 -0
  403. package/packages/locale/lang/zh-CN.ts +4 -0
  404. package/packages/locale/lang/zh-HK.ts +907 -3
  405. package/packages/locale/lang/zh-MO.ts +907 -3
  406. package/packages/locale/lang/zh-TC.ts +907 -3
  407. package/packages/locale/lang/zh-TW.ts +907 -3
  408. package/packages/table/index.ts +6 -6
  409. package/packages/table/module/custom/mixin.ts +73 -66
  410. package/packages/table/module/custom/panel.ts +1176 -925
  411. package/packages/table/module/edit/mixin.ts +253 -173
  412. package/packages/table/module/export/export-panel.ts +541 -461
  413. package/packages/table/module/export/import-panel.ts +179 -136
  414. package/packages/table/module/export/mixin.ts +725 -633
  415. package/packages/table/module/export/util.ts +4 -3
  416. package/packages/table/module/filter/mixin.ts +58 -54
  417. package/packages/table/module/filter/panel.ts +176 -122
  418. package/packages/table/module/keyboard/mixin.ts +35 -31
  419. package/packages/table/module/menu/mixin.ts +12 -12
  420. package/packages/table/module/menu/panel.ts +225 -158
  421. package/packages/table/module/validator/mixin.ts +179 -162
  422. package/packages/table/render/index.ts +362 -285
  423. package/packages/table/src/body.ts +383 -284
  424. package/packages/table/src/cell.ts +579 -410
  425. package/packages/table/src/column.ts +6 -6
  426. package/packages/table/src/columnInfo.ts +7 -7
  427. package/packages/table/src/expand-height.ts +27 -26
  428. package/packages/table/src/footer.ts +172 -127
  429. package/packages/table/src/group.ts +5 -5
  430. package/packages/table/src/header.ts +275 -211
  431. package/packages/table/src/layout-scheduler.ts +7 -9
  432. package/packages/table/src/methods.ts +2132 -1809
  433. package/packages/table/src/props.ts +1 -1
  434. package/packages/table/src/scroll-sync.ts +5 -5
  435. package/packages/table/src/store.ts +1 -1
  436. package/packages/table/src/table.ts +1062 -871
  437. package/packages/table/src/util.ts +58 -71
  438. package/packages/toolbar/index.ts +2 -2
  439. package/packages/toolbar/src/toolbar.ts +245 -191
  440. package/packages/ui/index.ts +9 -36
  441. package/packages/ui/src/anime.ts +10 -11
  442. package/packages/ui/src/dom.ts +52 -49
  443. package/packages/ui/src/log.ts +2 -2
  444. package/packages/ui/src/utils.ts +13 -13
  445. package/packages/ui/src/vn.ts +8 -7
  446. package/packages/v-x-e-table/index.ts +0 -1
  447. package/styles/components/table-module/filter.scss +26 -13
  448. package/styles/components/table.scss +6 -0
  449. package/styles/theme/base.scss +1 -0
  450. package/types/all.d.ts +1 -1
  451. package/es/index.css +0 -1
  452. package/es/index.min.css +0 -1
  453. package/es/style.min.css +0 -1
  454. package/es/table/style.min.css +0 -1
  455. package/es/vxe-table/style.min.css +0 -1
  456. package/es/vxe-v-x-e-table/index.js +0 -3
  457. package/lib/colgroup/index.min.js +0 -1
  458. package/lib/column/index.min.js +0 -1
  459. package/lib/components.min.js +0 -1
  460. package/lib/grid/index.min.js +0 -1
  461. package/lib/grid/src/grid.min.js +0 -1
  462. package/lib/index.css +0 -1
  463. package/lib/index.min.css +0 -1
  464. package/lib/locale/lang/ar-EG.d.ts +0 -2
  465. package/lib/locale/lang/ar-EG.min.js +0 -1
  466. package/lib/locale/lang/de-DE.d.ts +0 -2
  467. package/lib/locale/lang/de-DE.min.js +0 -1
  468. package/lib/locale/lang/en-US.d.ts +0 -2
  469. package/lib/locale/lang/en-US.min.js +0 -1
  470. package/lib/locale/lang/es-ES.d.ts +0 -2
  471. package/lib/locale/lang/es-ES.min.js +0 -1
  472. package/lib/locale/lang/fr-FR.d.ts +0 -2
  473. package/lib/locale/lang/fr-FR.min.js +0 -1
  474. package/lib/locale/lang/hu-HU.d.ts +0 -2
  475. package/lib/locale/lang/hu-HU.min.js +0 -1
  476. package/lib/locale/lang/hy-AM.d.ts +0 -2
  477. package/lib/locale/lang/hy-AM.min.js +0 -1
  478. package/lib/locale/lang/id-ID.d.ts +0 -2
  479. package/lib/locale/lang/id-ID.min.js +0 -1
  480. package/lib/locale/lang/it-IT.d.ts +0 -2
  481. package/lib/locale/lang/it-IT.min.js +0 -1
  482. package/lib/locale/lang/ja-JP.d.ts +0 -2
  483. package/lib/locale/lang/ja-JP.min.js +0 -1
  484. package/lib/locale/lang/ko-KR.d.ts +0 -2
  485. package/lib/locale/lang/ko-KR.min.js +0 -1
  486. package/lib/locale/lang/ms-MY.d.ts +0 -2
  487. package/lib/locale/lang/ms-MY.min.js +0 -1
  488. package/lib/locale/lang/nb-NO.d.ts +0 -2
  489. package/lib/locale/lang/nb-NO.min.js +0 -1
  490. package/lib/locale/lang/pt-BR.d.ts +0 -2
  491. package/lib/locale/lang/pt-BR.min.js +0 -1
  492. package/lib/locale/lang/ru-RU.d.ts +0 -2
  493. package/lib/locale/lang/ru-RU.min.js +0 -1
  494. package/lib/locale/lang/th-TH.d.ts +0 -2
  495. package/lib/locale/lang/th-TH.min.js +0 -1
  496. package/lib/locale/lang/ug-CN.d.ts +0 -2
  497. package/lib/locale/lang/ug-CN.min.js +0 -1
  498. package/lib/locale/lang/uk-UA.d.ts +0 -2
  499. package/lib/locale/lang/uk-UA.min.js +0 -1
  500. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  501. package/lib/locale/lang/uz-UZ.min.js +0 -1
  502. package/lib/locale/lang/vi-VN.d.ts +0 -2
  503. package/lib/locale/lang/vi-VN.min.js +0 -1
  504. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  505. package/lib/locale/lang/zh-CHT.min.js +0 -1
  506. package/lib/locale/lang/zh-CN.d.ts +0 -2
  507. package/lib/locale/lang/zh-CN.min.js +0 -1
  508. package/lib/locale/lang/zh-HK.d.ts +0 -2
  509. package/lib/locale/lang/zh-HK.min.js +0 -1
  510. package/lib/locale/lang/zh-MO.d.ts +0 -2
  511. package/lib/locale/lang/zh-MO.min.js +0 -1
  512. package/lib/locale/lang/zh-TC.min.js +0 -1
  513. package/lib/locale/lang/zh-TW.d.ts +0 -2
  514. package/lib/locale/lang/zh-TW.min.js +0 -1
  515. package/lib/style.min.css +0 -1
  516. package/lib/table/index.min.js +0 -1
  517. package/lib/table/module/custom/mixin.min.js +0 -1
  518. package/lib/table/module/custom/panel.min.js +0 -1
  519. package/lib/table/module/edit/mixin.min.js +0 -1
  520. package/lib/table/module/export/export-panel.min.js +0 -1
  521. package/lib/table/module/export/import-panel.min.js +0 -1
  522. package/lib/table/module/export/mixin.min.js +0 -1
  523. package/lib/table/module/export/util.min.js +0 -1
  524. package/lib/table/module/filter/mixin.min.js +0 -1
  525. package/lib/table/module/filter/panel.min.js +0 -1
  526. package/lib/table/module/keyboard/mixin.min.js +0 -1
  527. package/lib/table/module/menu/mixin.min.js +0 -1
  528. package/lib/table/module/menu/panel.min.js +0 -1
  529. package/lib/table/module/validator/mixin.min.js +0 -1
  530. package/lib/table/render/index.min.js +0 -1
  531. package/lib/table/src/body.min.js +0 -1
  532. package/lib/table/src/cell.min.js +0 -1
  533. package/lib/table/src/column.min.js +0 -1
  534. package/lib/table/src/columnInfo.min.js +0 -1
  535. package/lib/table/src/expand-height.min.js +0 -1
  536. package/lib/table/src/footer.min.js +0 -1
  537. package/lib/table/src/group.min.js +0 -1
  538. package/lib/table/src/header.min.js +0 -1
  539. package/lib/table/src/layout-scheduler.min.js +0 -1
  540. package/lib/table/src/methods.min.js +0 -1
  541. package/lib/table/src/props.min.js +0 -1
  542. package/lib/table/src/scroll-sync.min.js +0 -1
  543. package/lib/table/src/store.min.js +0 -1
  544. package/lib/table/src/table.min.js +0 -1
  545. package/lib/table/src/util.min.js +0 -1
  546. package/lib/table/style/style.min.css +0 -1
  547. package/lib/toolbar/index.min.js +0 -1
  548. package/lib/toolbar/src/toolbar.min.js +0 -1
  549. package/lib/ui/index.min.js +0 -1
  550. package/lib/ui/src/anime.min.js +0 -1
  551. package/lib/ui/src/comp.min.js +0 -1
  552. package/lib/ui/src/dom.min.js +0 -1
  553. package/lib/ui/src/log.min.js +0 -1
  554. package/lib/ui/src/utils.min.js +0 -1
  555. package/lib/ui/src/vn.min.js +0 -1
  556. package/lib/ui/style/style.min.css +0 -0
  557. package/lib/v-x-e-table/index.min.js +0 -1
  558. package/lib/v-x-e-table/style/index.js +0 -1
  559. package/lib/v-x-e-table/style/style.css +0 -0
  560. package/lib/v-x-e-table/style/style.min.css +0 -0
  561. package/lib/vxe-colgroup/index.min.js +0 -1
  562. package/lib/vxe-colgroup/style/style.min.css +0 -0
  563. package/lib/vxe-column/index.min.js +0 -1
  564. package/lib/vxe-column/style/style.min.css +0 -0
  565. package/lib/vxe-grid/index.min.js +0 -1
  566. package/lib/vxe-table/index.min.js +0 -1
  567. package/lib/vxe-table/style/style.min.css +0 -1
  568. package/lib/vxe-toolbar/index.min.js +0 -1
  569. package/lib/vxe-ui/index.min.js +0 -1
  570. package/lib/vxe-ui/style/style.min.css +0 -0
  571. package/lib/vxe-v-x-e-table/index.js +0 -22
  572. package/lib/vxe-v-x-e-table/index.min.js +0 -1
  573. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  574. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  575. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  576. /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
  577. /package/es/column/{style.min.css → style.mini.css} +0 -0
  578. /package/es/{iconfont.1792648484860.ttf → iconfont.1793178568083.ttf} +0 -0
  579. /package/es/{iconfont.1792648484860.woff → iconfont.1793178568083.woff} +0 -0
  580. /package/es/{iconfont.1792648484860.woff2 → iconfont.1793178568083.woff2} +0 -0
  581. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  582. /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
  583. /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
  584. /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
  585. /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
  586. /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
  587. /package/lib/{iconfont.1792648484860.ttf → iconfont.1793178568083.ttf} +0 -0
  588. /package/lib/{iconfont.1792648484860.woff → iconfont.1793178568083.woff} +0 -0
  589. /package/lib/{iconfont.1792648484860.woff2 → iconfont.1793178568083.woff2} +0 -0
  590. /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
  591. /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
  592. /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
  593. /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
@@ -1,1833 +1,2001 @@
1
- import { defineVxeComponent } from '../../../ui/src/comp';
2
- import { VxeUI } from '../../../ui';
3
- import { formatText, hasEnableConf } from '../../../ui/src/utils';
4
- import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
5
- import { createComponentLog } from '../../../ui/src/log';
6
- import XEUtils from 'xe-utils';
7
- const { errLog } = createComponentLog('table');
1
+ import { VxeUI } from "@vxe-ui/core";
2
+ import { formatText, hasEnableConf } from "../../../ui/src/utils";
3
+ import { getTpImg, addClass, removeClass, hasControlKey } from "../../../ui/src/dom";
4
+ import { createComponentLog } from "../../../ui/src/log";
5
+ import XEUtils from "xe-utils";
6
+ const { errLog } = createComponentLog("table");
8
7
  const { getI18n, getIcon, renderEmptyElement } = VxeUI;
9
8
  function showDropTip($xeTableCustomPanel, evnt, optEl, showLine, dragPos) {
10
- const customPanelInternalData = $xeTableCustomPanel.internalData;
11
- const bodyWrapperElem = $xeTableCustomPanel.$refs.refBodyWrapperElem;
12
- if (!bodyWrapperElem) {
13
- return;
14
- }
15
- const customBodyElem = $xeTableCustomPanel.$refs.refCustomBodyElem;
16
- if (!customBodyElem) {
17
- return;
18
- }
19
- const { prevDragToChild } = customPanelInternalData;
20
- const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
21
- const customBodyRect = customBodyElem.getBoundingClientRect();
22
- const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
23
- if (optEl) {
24
- if (dragLineEl) {
25
- if (showLine) {
26
- const optRect = optEl.getBoundingClientRect();
27
- dragLineEl.style.display = 'block';
28
- dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`;
29
- dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
30
- dragLineEl.style.height = `${optRect.height}px`;
31
- dragLineEl.style.width = `${optRect.width}px`;
32
- dragLineEl.setAttribute('drag-pos', dragPos);
33
- dragLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
34
- }
35
- else {
36
- dragLineEl.style.display = '';
37
- }
38
- }
39
- }
40
- else {
41
- if (dragLineEl) {
42
- dragLineEl.style.display = 'node';
43
- }
9
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
10
+ const bodyWrapperElem = $xeTableCustomPanel.$refs.refBodyWrapperElem;
11
+ if (!bodyWrapperElem) {
12
+ return;
13
+ }
14
+ const customBodyElem = $xeTableCustomPanel.$refs.refCustomBodyElem;
15
+ if (!customBodyElem) {
16
+ return;
17
+ }
18
+ const { prevDragToChild } = customPanelInternalData;
19
+ const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
20
+ const customBodyRect = customBodyElem.getBoundingClientRect();
21
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
22
+ if (optEl) {
23
+ if (dragLineEl) {
24
+ if (showLine) {
25
+ const optRect = optEl.getBoundingClientRect();
26
+ dragLineEl.style.display = "block";
27
+ dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`;
28
+ dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
29
+ dragLineEl.style.height = `${optRect.height}px`;
30
+ dragLineEl.style.width = `${optRect.width}px`;
31
+ dragLineEl.setAttribute("drag-pos", dragPos);
32
+ dragLineEl.setAttribute("drag-to-child", prevDragToChild ? "y" : "n");
33
+ } else {
34
+ dragLineEl.style.display = "";
35
+ }
44
36
  }
45
- const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
46
- if (dragTipEl) {
47
- dragTipEl.style.display = 'block';
48
- dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
49
- dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`;
50
- dragTipEl.setAttribute('drag-status', showLine ? (prevDragToChild ? 'sub' : 'normal') : 'disabled');
37
+ } else {
38
+ if (dragLineEl) {
39
+ dragLineEl.style.display = "node";
51
40
  }
41
+ }
42
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
43
+ if (dragTipEl) {
44
+ dragTipEl.style.display = "block";
45
+ dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
46
+ dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`;
47
+ dragTipEl.setAttribute("drag-status", showLine ? prevDragToChild ? "sub" : "normal" : "disabled");
48
+ }
52
49
  }
53
50
  function hideDropTip($xeTableCustomPanel) {
54
- const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
55
- const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
56
- if (dragTipEl) {
57
- dragTipEl.style.display = '';
51
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
52
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
53
+ if (dragTipEl) {
54
+ dragTipEl.style.display = "";
55
+ }
56
+ if (dragLineEl) {
57
+ dragLineEl.style.display = "";
58
+ }
59
+ }
60
+ var panel_default = {
61
+ name: "VxeTableCustomPanel",
62
+ props: {
63
+ customStore: {
64
+ type: Object,
65
+ default: () => ({})
58
66
  }
59
- if (dragLineEl) {
60
- dragLineEl.style.display = '';
67
+ },
68
+ provide() {
69
+ const $xeTableCustomPanel = this;
70
+ return {
71
+ $xeTableCustomPanel
72
+ };
73
+ },
74
+ inject: {
75
+ $xeTable: {
76
+ default: null
61
77
  }
62
- }
63
- export default {
64
- name: 'VxeTableCustomPanel',
65
- props: {
66
- customStore: {
67
- type: Object,
68
- default: () => ({})
78
+ },
79
+ data() {
80
+ const reactData = {
81
+ dragCol: null,
82
+ dragGroupField: null,
83
+ dragAggFnCol: null,
84
+ dragTipText: ""
85
+ };
86
+ const internalData = {
87
+ // prevDragCol: undefined,
88
+ // prevDragGroupField: undefined,
89
+ // prevDragAggFnColid: undefined,
90
+ // prevDragToChild: false,
91
+ // prevDragPos: null
92
+ };
93
+ return {
94
+ reactData,
95
+ internalData
96
+ };
97
+ },
98
+ computed: {
99
+ ...{}
100
+ },
101
+ created() {
102
+ const $xeTableCustomPanel = this;
103
+ const VxeUIModalComponent = VxeUI.getComponent("VxeModal");
104
+ const VxeUIDrawerComponent = VxeUI.getComponent("VxeDrawer");
105
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
106
+ const VxeUINumberInputComponent = VxeUI.getComponent("VxeNumberInput");
107
+ const VxeUIRadioGroupComponent = VxeUI.getComponent("VxeRadioGroup");
108
+ $xeTableCustomPanel.$nextTick(() => {
109
+ const $xeTable = $xeTableCustomPanel.$xeTable;
110
+ const { customOpts } = $xeTable;
111
+ const { mode } = customOpts;
112
+ if (!VxeUIModalComponent && mode === "modal") {
113
+ errLog("vxe.error.reqComp", ["vxe-modal"]);
114
+ }
115
+ if (!VxeUIDrawerComponent && mode === "drawer") {
116
+ errLog("vxe.error.reqComp", ["vxe-drawer"]);
117
+ }
118
+ if (!VxeUIButtonComponent) {
119
+ errLog("vxe.error.reqComp", ["vxe-button"]);
120
+ }
121
+ if (!VxeUINumberInputComponent) {
122
+ errLog("vxe.error.reqComp", ["vxe-number-input"]);
123
+ }
124
+ if (!VxeUIRadioGroupComponent) {
125
+ errLog("vxe.error.reqComp", ["vxe-radio-group"]);
126
+ }
127
+ });
128
+ },
129
+ methods: {
130
+ handleWrapperMouseenterEvent(evnt) {
131
+ const $xeTableCustomPanel = this;
132
+ const props = $xeTableCustomPanel;
133
+ const $xeTable = $xeTableCustomPanel.$xeTable;
134
+ const { customStore } = props;
135
+ customStore.activeWrapper = true;
136
+ $xeTable.customOpenEvent(evnt);
137
+ },
138
+ handleWrapperMouseleaveEvent(evnt) {
139
+ const $xeTableCustomPanel = this;
140
+ const $xeTable = $xeTableCustomPanel.$xeTable;
141
+ const props = $xeTableCustomPanel;
142
+ const { customStore } = props;
143
+ customStore.activeWrapper = false;
144
+ setTimeout(() => {
145
+ if (!customStore.activeBtn && !customStore.activeWrapper) {
146
+ $xeTable.customCloseEvent(evnt);
69
147
  }
148
+ }, 300);
70
149
  },
71
- provide() {
72
- const $xeTableCustomPanel = this;
73
- return {
74
- $xeTableCustomPanel
75
- };
150
+ getStoreData() {
151
+ return {};
152
+ },
153
+ confirmCustomEvent({ $event }) {
154
+ const $xeTableCustomPanel = this;
155
+ const $xeTable = $xeTableCustomPanel.$xeTable;
156
+ const tableReactData = $xeTable;
157
+ tableReactData.isCustomStatus = true;
158
+ $xeTable.saveCustom();
159
+ $xeTable.closeCustom();
160
+ $xeTable.emitCustomEvent("confirm", $event);
161
+ $xeTable.dispatchEvent("custom-confirm", {}, $event);
162
+ $xeTable.emitCustomEvent("close", $event);
163
+ $xeTable.dispatchEvent("custom-close", {}, $event);
164
+ },
165
+ cancelCloseEvent({ $event }) {
166
+ const $xeTableCustomPanel = this;
167
+ const $xeTable = $xeTableCustomPanel.$xeTable;
168
+ $xeTable.closeCustom();
169
+ $xeTable.emitCustomEvent("close", $event);
170
+ $xeTable.dispatchEvent("custom-close", {}, $event);
171
+ },
172
+ cancelCustomEvent({ $event }) {
173
+ const $xeTableCustomPanel = this;
174
+ const $xeTable = $xeTableCustomPanel.$xeTable;
175
+ $xeTable.cancelCustom();
176
+ $xeTable.closeCustom();
177
+ $xeTable.emitCustomEvent("cancel", $event);
178
+ $xeTable.dispatchEvent("custom-cancel", {}, $event);
179
+ $xeTable.emitCustomEvent("close", $event);
180
+ $xeTable.dispatchEvent("custom-close", {}, $event);
181
+ },
182
+ handleResetCustomEvent(evnt) {
183
+ const $xeTableCustomPanel = this;
184
+ const $xeTable = $xeTableCustomPanel.$xeTable;
185
+ $xeTable.resetCustom(true);
186
+ $xeTable.closeCustom();
187
+ $xeTable.emitCustomEvent("reset", evnt);
188
+ $xeTable.dispatchEvent("custom-reset", {}, evnt);
189
+ $xeTable.emitCustomEvent("close", evnt);
190
+ $xeTable.dispatchEvent("custom-close", {}, evnt);
191
+ },
192
+ resetCustomEvent(evnt) {
193
+ if (VxeUI.modal) {
194
+ VxeUI.modal.confirm({
195
+ content: getI18n("vxe.custom.cstmConfirmRestore"),
196
+ className: "vxe-table--ignore-clear",
197
+ escClosable: true
198
+ }).then((type) => {
199
+ if (type === "confirm") {
200
+ this.handleResetCustomEvent(evnt);
201
+ }
202
+ });
203
+ } else {
204
+ this.handleResetCustomEvent(evnt);
205
+ }
76
206
  },
77
- inject: {
78
- $xeTable: {
79
- default: null
207
+ handleOptionCheck(column) {
208
+ const $xeTableCustomPanel = this;
209
+ const $xeTable = $xeTableCustomPanel.$xeTable;
210
+ const tableReactData = $xeTable;
211
+ const { customColumnList } = tableReactData;
212
+ const matchObj = XEUtils.findTree(customColumnList, (item) => item === column);
213
+ if (matchObj && matchObj.parent) {
214
+ const { parent: parentItem } = matchObj;
215
+ if (parentItem.children && parentItem.children.length) {
216
+ parentItem.renderVisible = parentItem.children.every((column2) => column2.renderVisible);
217
+ parentItem.halfVisible = !parentItem.renderVisible && parentItem.children.some((column2) => column2.renderVisible || column2.halfVisible);
218
+ this.handleOptionCheck(parentItem);
80
219
  }
220
+ }
81
221
  },
82
- data() {
83
- const reactData = {
84
- dragCol: null,
85
- dragGroupField: null,
86
- dragAggFnCol: null,
87
- dragTipText: ''
88
- };
89
- const internalData = {
90
- // prevDragCol: undefined,
91
- // prevDragGroupField: undefined,
92
- // prevDragAggFnColid: undefined,
93
- // prevDragToChild: false,
94
- // prevDragPos: null
95
- };
96
- return {
97
- reactData,
98
- internalData
222
+ changeCheckboxOption(column, evnt) {
223
+ const $xeTableCustomPanel = this;
224
+ const $xeTable = $xeTableCustomPanel.$xeTable;
225
+ const tableReactData = $xeTable;
226
+ const isChecked = !column.renderVisible;
227
+ const customOpts = $xeTable.computeCustomOpts;
228
+ if (customOpts.immediate) {
229
+ XEUtils.eachTree([column], (item) => {
230
+ item.visible = isChecked;
231
+ item.renderVisible = isChecked;
232
+ item.halfVisible = false;
233
+ });
234
+ tableReactData.isCustomStatus = true;
235
+ $xeTable.handleCustom();
236
+ $xeTable.saveCustomStore("update:visible");
237
+ } else {
238
+ XEUtils.eachTree([column], (item) => {
239
+ item.renderVisible = isChecked;
240
+ item.halfVisible = false;
241
+ });
242
+ }
243
+ this.handleOptionCheck(column);
244
+ $xeTable.checkCustomStatus();
245
+ $xeTable.dispatchEvent("custom-visible-change", { column, checked: isChecked }, evnt);
246
+ },
247
+ changeColumnWidth(column) {
248
+ const $xeTableCustomPanel = this;
249
+ const $xeTable = $xeTableCustomPanel.$xeTable;
250
+ const tableReactData = $xeTable;
251
+ const customOpts = $xeTable.computeCustomOpts;
252
+ if (customOpts.immediate) {
253
+ if (column.renderResizeWidth !== column.renderWidth) {
254
+ column.resizeWidth = column.renderResizeWidth;
255
+ column.renderWidth = column.renderResizeWidth;
256
+ tableReactData.isCustomStatus = true;
257
+ $xeTable.handleCustom();
258
+ $xeTable.saveCustomStore("update:width");
259
+ }
260
+ }
261
+ },
262
+ changeFixedOption(column, colFixed, evnt) {
263
+ const $xeTableCustomPanel = this;
264
+ const $xeTable = $xeTableCustomPanel.$xeTable;
265
+ const tableReactData = $xeTable;
266
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
267
+ const customOpts = $xeTable.computeCustomOpts;
268
+ let targetFixed = null;
269
+ if (customOpts.immediate) {
270
+ if (column.renderFixed === colFixed) {
271
+ targetFixed = "";
272
+ XEUtils.eachTree([column], (col) => {
273
+ col.fixed = "";
274
+ col.renderFixed = "";
275
+ });
276
+ } else {
277
+ if (!isMaxFixedColumn || column.renderFixed) {
278
+ targetFixed = colFixed;
279
+ XEUtils.eachTree([column], (col) => {
280
+ col.fixed = colFixed;
281
+ col.renderFixed = colFixed;
282
+ });
283
+ }
284
+ }
285
+ tableReactData.isCustomStatus = true;
286
+ $xeTable.handleCustom();
287
+ $xeTable.saveCustomStore("update:fixed");
288
+ } else {
289
+ if (column.renderFixed === colFixed) {
290
+ targetFixed = "";
291
+ XEUtils.eachTree([column], (col) => {
292
+ col.renderFixed = "";
293
+ });
294
+ } else {
295
+ if (!isMaxFixedColumn || column.renderFixed) {
296
+ targetFixed = colFixed;
297
+ XEUtils.eachTree([column], (col) => {
298
+ col.renderFixed = colFixed;
299
+ });
300
+ }
301
+ }
302
+ }
303
+ if (targetFixed !== null) {
304
+ $xeTable.dispatchEvent("custom-fixed-change", { column, fixed: targetFixed }, evnt);
305
+ }
306
+ },
307
+ changeAlignOption(column, targetAlign, colProperty, renderProperty, eName, evnt) {
308
+ const $xeTableCustomPanel = this;
309
+ const $xeTable = $xeTableCustomPanel.$xeTable;
310
+ const tableReactData = $xeTable;
311
+ const customOpts = $xeTable.computeCustomOpts;
312
+ if (customOpts.immediate) {
313
+ column[colProperty] = targetAlign;
314
+ column[renderProperty] = targetAlign;
315
+ tableReactData.isCustomStatus = true;
316
+ $xeTable.handleCustom();
317
+ $xeTable.saveCustomStore(`update:${colProperty}`);
318
+ } else {
319
+ column[renderProperty] = targetAlign;
320
+ }
321
+ $xeTable.dispatchEvent(eName, { column, [colProperty]: targetAlign }, evnt);
322
+ },
323
+ allOptionEvent(evnt) {
324
+ const $xeTableCustomPanel = this;
325
+ const $xeTable = $xeTableCustomPanel.$xeTable;
326
+ const tableReactData = $xeTable;
327
+ const { customStore } = tableReactData;
328
+ const isAll = !customStore.isAll;
329
+ $xeTable.toggleCustomAllCheckbox();
330
+ $xeTable.dispatchEvent("custom-visible-all", { checked: isAll }, evnt);
331
+ },
332
+ updateColDropTipContent() {
333
+ const $xeTableCustomPanel = this;
334
+ const $xeTable = $xeTableCustomPanel.$xeTable;
335
+ const customPanelReactData = $xeTableCustomPanel.reactData;
336
+ const { dragCol } = customPanelReactData;
337
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
338
+ const { tooltipMethod } = columnDragOpts;
339
+ let tipContent = "";
340
+ if (tooltipMethod) {
341
+ const dtParams = {
342
+ $table: $xeTable,
343
+ column: dragCol
99
344
  };
345
+ tipContent = `${tooltipMethod(dtParams) || ""}`;
346
+ } else {
347
+ tipContent = getI18n("vxe.custom.cstmDragTarget", [dragCol && dragCol.type !== "html" ? dragCol.getTitle() : ""]);
348
+ }
349
+ customPanelReactData.dragTipText = tipContent;
100
350
  },
101
- computed: Object.assign({}, {}),
102
- created() {
103
- const $xeTableCustomPanel = this;
104
- const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
105
- const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer');
106
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
107
- const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput');
108
- const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
109
- $xeTableCustomPanel.$nextTick(() => {
110
- const $xeTable = $xeTableCustomPanel.$xeTable;
111
- const { customOpts } = $xeTable;
112
- const { mode } = customOpts;
113
- if (!VxeUIModalComponent && (mode === 'modal')) {
114
- errLog('vxe.error.reqComp', ['vxe-modal']);
115
- }
116
- if (!VxeUIDrawerComponent && (mode === 'drawer')) {
117
- errLog('vxe.error.reqComp', ['vxe-drawer']);
118
- }
119
- if (!VxeUIButtonComponent) {
120
- errLog('vxe.error.reqComp', ['vxe-button']);
121
- }
122
- if (!VxeUINumberInputComponent) {
123
- errLog('vxe.error.reqComp', ['vxe-number-input']);
124
- }
125
- if (!VxeUIRadioGroupComponent) {
126
- errLog('vxe.error.reqComp', ['vxe-radio-group']);
127
- }
128
- });
351
+ sortMousedownEvent(evnt) {
352
+ const $xeTableCustomPanel = this;
353
+ const $xeTable = $xeTableCustomPanel.$xeTable;
354
+ const customPanelReactData = $xeTableCustomPanel.reactData;
355
+ const btnEl = evnt.currentTarget;
356
+ const cellEl = btnEl.parentElement;
357
+ const tdEl = cellEl.parentElement;
358
+ const trEl = tdEl.parentElement;
359
+ const colid = trEl.getAttribute("colid");
360
+ const column = $xeTable.getColumnById(colid);
361
+ trEl.draggable = true;
362
+ customPanelReactData.dragCol = column;
363
+ customPanelReactData.dragGroupField = null;
364
+ customPanelReactData.dragAggFnCol = null;
365
+ this.updateColDropTipContent();
366
+ addClass(trEl, "active--drag-origin");
129
367
  },
130
- methods: {
131
- handleWrapperMouseenterEvent(evnt) {
132
- const $xeTableCustomPanel = this;
133
- const props = $xeTableCustomPanel;
134
- const $xeTable = $xeTableCustomPanel.$xeTable;
135
- const { customStore } = props;
136
- customStore.activeWrapper = true;
137
- $xeTable.customOpenEvent(evnt);
138
- },
139
- handleWrapperMouseleaveEvent(evnt) {
140
- const $xeTableCustomPanel = this;
141
- const $xeTable = $xeTableCustomPanel.$xeTable;
142
- const props = $xeTableCustomPanel;
143
- const { customStore } = props;
144
- customStore.activeWrapper = false;
145
- setTimeout(() => {
146
- if (!customStore.activeBtn && !customStore.activeWrapper) {
147
- $xeTable.customCloseEvent(evnt);
148
- }
149
- }, 300);
150
- },
151
- getStoreData() {
152
- return {};
153
- },
154
- confirmCustomEvent({ $event }) {
155
- const $xeTableCustomPanel = this;
156
- const $xeTable = $xeTableCustomPanel.$xeTable;
157
- const tableReactData = $xeTable;
158
- tableReactData.isCustomStatus = true;
159
- $xeTable.saveCustom();
160
- $xeTable.closeCustom();
161
- $xeTable.emitCustomEvent('confirm', $event);
162
- $xeTable.dispatchEvent('custom-confirm', {}, $event);
163
- $xeTable.emitCustomEvent('close', $event);
164
- $xeTable.dispatchEvent('custom-close', {}, $event);
165
- },
166
- cancelCloseEvent({ $event }) {
167
- const $xeTableCustomPanel = this;
168
- const $xeTable = $xeTableCustomPanel.$xeTable;
169
- $xeTable.closeCustom();
170
- $xeTable.emitCustomEvent('close', $event);
171
- $xeTable.dispatchEvent('custom-close', {}, $event);
172
- },
173
- cancelCustomEvent({ $event }) {
174
- const $xeTableCustomPanel = this;
175
- const $xeTable = $xeTableCustomPanel.$xeTable;
176
- $xeTable.cancelCustom();
177
- $xeTable.closeCustom();
178
- $xeTable.emitCustomEvent('cancel', $event);
179
- $xeTable.dispatchEvent('custom-cancel', {}, $event);
180
- $xeTable.emitCustomEvent('close', $event);
181
- $xeTable.dispatchEvent('custom-close', {}, $event);
182
- },
183
- handleResetCustomEvent(evnt) {
184
- const $xeTableCustomPanel = this;
185
- const $xeTable = $xeTableCustomPanel.$xeTable;
186
- $xeTable.resetCustom(true);
187
- $xeTable.closeCustom();
188
- $xeTable.emitCustomEvent('reset', evnt);
189
- $xeTable.dispatchEvent('custom-reset', {}, evnt);
190
- $xeTable.emitCustomEvent('close', evnt);
191
- $xeTable.dispatchEvent('custom-close', {}, evnt);
192
- },
193
- resetCustomEvent(evnt) {
194
- if (VxeUI.modal) {
195
- VxeUI.modal.confirm({
196
- content: getI18n('vxe.custom.cstmConfirmRestore'),
197
- className: 'vxe-table--ignore-clear',
198
- escClosable: true
199
- }).then(type => {
200
- if (type === 'confirm') {
201
- this.handleResetCustomEvent(evnt);
202
- }
203
- });
204
- }
205
- else {
206
- this.handleResetCustomEvent(evnt);
368
+ sortMouseupEvent(evnt) {
369
+ const $xeTableCustomPanel = this;
370
+ const customPanelReactData = $xeTableCustomPanel.reactData;
371
+ const btnEl = evnt.currentTarget;
372
+ const cellEl = btnEl.parentElement;
373
+ const tdEl = cellEl.parentElement;
374
+ const trEl = tdEl.parentElement;
375
+ hideDropTip($xeTableCustomPanel);
376
+ trEl.draggable = false;
377
+ customPanelReactData.dragCol = null;
378
+ customPanelReactData.dragGroupField = null;
379
+ customPanelReactData.dragAggFnCol = null;
380
+ removeClass(trEl, "active--drag-origin");
381
+ },
382
+ sortDragstartEvent(evnt) {
383
+ const $xeTableCustomPanel = this;
384
+ const $xeTable = $xeTableCustomPanel.$xeTable;
385
+ const tableReactData = $xeTable;
386
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
387
+ const { customDragTime } = customPanelInternalData;
388
+ if (evnt.dataTransfer) {
389
+ evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
390
+ }
391
+ if (customDragTime) {
392
+ clearTimeout(customDragTime);
393
+ }
394
+ tableReactData.isCustomDragStatus = true;
395
+ customPanelInternalData.prevDragGroupField = null;
396
+ customPanelInternalData.prevDragAggFnColid = null;
397
+ },
398
+ sortDragendEvent(evnt) {
399
+ const $xeTableCustomPanel = this;
400
+ const $xeTable = $xeTableCustomPanel.$xeTable;
401
+ const tableProps = $xeTable;
402
+ const tableReactData = $xeTable;
403
+ const tableInternalData = $xeTable;
404
+ const customPanelReactData = $xeTableCustomPanel.reactData;
405
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
406
+ const { mouseConfig } = tableProps;
407
+ const { customColumnList } = tableReactData;
408
+ const { collectColumn } = tableInternalData;
409
+ const customOpts = $xeTable.computeCustomOpts;
410
+ const mouseOpts = $xeTable.computeMouseOpts;
411
+ const { immediate } = customOpts;
412
+ const trEl = evnt.currentTarget;
413
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
414
+ const { isCrossDrag, isPeerDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
415
+ const { dragCol } = customPanelReactData;
416
+ const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
417
+ const dragOffsetIndex = prevDragPos === "bottom" ? 1 : 0;
418
+ if (prevDragGroupField || prevDragAggFnColid) {
419
+ if ($xeTable.handlePivotTableAggPanelDragendEvent) {
420
+ $xeTable.handlePivotTableAggPanelDragendEvent(evnt);
421
+ }
422
+ } else if (prevDragCol && dragCol) {
423
+ if (prevDragCol !== dragCol) {
424
+ const dragColumn = dragCol;
425
+ const newColumn = prevDragCol;
426
+ Promise.resolve(
427
+ dragEndMethod ? dragEndMethod({
428
+ oldColumn: dragColumn,
429
+ newColumn,
430
+ dragColumn,
431
+ dragPos: prevDragPos,
432
+ dragToChild: !!prevDragToChild,
433
+ offsetIndex: dragOffsetIndex
434
+ }) : true
435
+ ).then((status) => {
436
+ if (!status) {
437
+ return;
207
438
  }
208
- },
209
- handleOptionCheck(column) {
210
- const $xeTableCustomPanel = this;
211
- const $xeTable = $xeTableCustomPanel.$xeTable;
212
- const tableReactData = $xeTable;
213
- const { customColumnList } = tableReactData;
214
- const matchObj = XEUtils.findTree(customColumnList, item => item === column);
215
- if (matchObj && matchObj.parent) {
216
- const { parent: parentItem } = matchObj;
217
- if (parentItem.children && parentItem.children.length) {
218
- parentItem.renderVisible = parentItem.children.every((column) => column.renderVisible);
219
- parentItem.halfVisible = !parentItem.renderVisible && parentItem.children.some((column) => column.renderVisible || column.halfVisible);
220
- this.handleOptionCheck(parentItem);
439
+ let oafIndex = -1;
440
+ let nafIndex = -1;
441
+ const oldAllMaps = {};
442
+ XEUtils.eachTree([dragColumn], (column) => {
443
+ oldAllMaps[column.id] = column;
444
+ });
445
+ let isSelfToChildStatus = false;
446
+ if (immediate) {
447
+ if (dragColumn.parentId && newColumn.parentId) {
448
+ if (isPeerDrag && !isCrossDrag) {
449
+ if (dragColumn.parentId !== newColumn.parentId) {
450
+ return;
451
+ }
452
+ } else {
453
+ if (!isCrossDrag) {
454
+ return;
455
+ }
456
+ if (oldAllMaps[newColumn.id]) {
457
+ isSelfToChildStatus = true;
458
+ if (!(isCrossDrag && isSelfToChildDrag)) {
459
+ if (VxeUI.modal) {
460
+ VxeUI.modal.message({
461
+ status: "error",
462
+ content: getI18n("vxe.error.treeDragChild")
463
+ });
464
+ }
465
+ return;
466
+ }
467
+ }
221
468
  }
222
- }
223
- },
224
- changeCheckboxOption(column, evnt) {
225
- const $xeTableCustomPanel = this;
226
- const $xeTable = $xeTableCustomPanel.$xeTable;
227
- const tableReactData = $xeTable;
228
- const isChecked = !column.renderVisible;
229
- const customOpts = $xeTable.computeCustomOpts;
230
- if (customOpts.immediate) {
231
- XEUtils.eachTree([column], (item) => {
232
- item.visible = isChecked;
233
- item.renderVisible = isChecked;
234
- item.halfVisible = false;
235
- });
236
- tableReactData.isCustomStatus = true;
237
- $xeTable.handleCustom();
238
- $xeTable.saveCustomStore('update:visible');
239
- }
240
- else {
241
- XEUtils.eachTree([column], (item) => {
242
- item.renderVisible = isChecked;
243
- item.halfVisible = false;
244
- });
245
- }
246
- this.handleOptionCheck(column);
247
- $xeTable.checkCustomStatus();
248
- $xeTable.dispatchEvent('custom-visible-change', { column, checked: isChecked }, evnt);
249
- },
250
- changeColumnWidth(column) {
251
- const $xeTableCustomPanel = this;
252
- const $xeTable = $xeTableCustomPanel.$xeTable;
253
- const tableReactData = $xeTable;
254
- const customOpts = $xeTable.computeCustomOpts;
255
- if (customOpts.immediate) {
256
- if (column.renderResizeWidth !== column.renderWidth) {
257
- column.resizeWidth = column.renderResizeWidth;
258
- column.renderWidth = column.renderResizeWidth;
259
- tableReactData.isCustomStatus = true;
260
- $xeTable.handleCustom();
261
- $xeTable.saveCustomStore('update:width');
469
+ } else if (dragColumn.parentId) {
470
+ if (!isCrossDrag) {
471
+ return;
262
472
  }
263
- }
264
- },
265
- changeFixedOption(column, colFixed, evnt) {
266
- const $xeTableCustomPanel = this;
267
- const $xeTable = $xeTableCustomPanel.$xeTable;
268
- const tableReactData = $xeTable;
269
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
270
- const customOpts = $xeTable.computeCustomOpts;
271
- let targetFixed = null;
272
- if (customOpts.immediate) {
273
- if (column.renderFixed === colFixed) {
274
- targetFixed = '';
275
- XEUtils.eachTree([column], col => {
276
- col.fixed = '';
277
- col.renderFixed = '';
278
- });
473
+ } else if (newColumn.parentId) {
474
+ if (!isCrossDrag) {
475
+ return;
279
476
  }
280
- else {
281
- if (!isMaxFixedColumn || column.renderFixed) {
282
- targetFixed = colFixed;
283
- XEUtils.eachTree([column], col => {
284
- col.fixed = colFixed;
285
- col.renderFixed = colFixed;
286
- });
477
+ if (oldAllMaps[newColumn.id]) {
478
+ isSelfToChildStatus = true;
479
+ if (!(isCrossDrag && isSelfToChildDrag)) {
480
+ if (VxeUI.modal) {
481
+ VxeUI.modal.message({
482
+ status: "error",
483
+ content: getI18n("vxe.error.treeDragChild")
484
+ });
287
485
  }
486
+ return;
487
+ }
288
488
  }
289
- tableReactData.isCustomStatus = true;
290
- $xeTable.handleCustom();
291
- $xeTable.saveCustomStore('update:fixed');
292
- }
293
- else {
294
- if (column.renderFixed === colFixed) {
295
- targetFixed = '';
296
- XEUtils.eachTree([column], col => {
297
- col.renderFixed = '';
298
- });
489
+ } else {
490
+ }
491
+ const oldewMatchRest = XEUtils.findTree(collectColumn, (item) => item.id === dragColumn.id);
492
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
493
+ if (oldewMatchRest) {
494
+ const { items: oCols, index: oIndex } = oldewMatchRest;
495
+ const childList = dragColumn.children || [];
496
+ childList.forEach((column) => {
497
+ column.parentId = dragColumn.parentId;
498
+ });
499
+ oCols.splice(oIndex, 1, ...childList);
500
+ dragColumn.children = [];
299
501
  }
300
- else {
301
- if (!isMaxFixedColumn || column.renderFixed) {
302
- targetFixed = colFixed;
303
- XEUtils.eachTree([column], col => {
304
- col.renderFixed = colFixed;
305
- });
306
- }
502
+ } else {
503
+ if (oldewMatchRest) {
504
+ const { items: oCols, index: oIndex, parent: oParent } = oldewMatchRest;
505
+ oCols.splice(oIndex, 1);
506
+ if (!oParent) {
507
+ oafIndex = oIndex;
508
+ }
307
509
  }
510
+ }
511
+ const newMatchRest = XEUtils.findTree(collectColumn, (item) => item.id === newColumn.id);
512
+ if (newMatchRest) {
513
+ const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
514
+ if (isCrossDrag && isToChildDrag && prevDragToChild) {
515
+ dragColumn.parentId = newColumn.id;
516
+ newColumn.children = (newColumn.children || []).concat([dragColumn]);
517
+ } else {
518
+ dragColumn.parentId = newColumn.parentId;
519
+ nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
520
+ }
521
+ if (!nParent) {
522
+ nafIndex = nIndex;
523
+ }
524
+ }
525
+ XEUtils.eachTree(collectColumn, (column, index, items, path, parentItem) => {
526
+ if (!parentItem) {
527
+ const sortIndex = index + 1;
528
+ column.renderSortNumber = sortIndex;
529
+ }
530
+ });
531
+ } else {
532
+ oafIndex = XEUtils.findIndexOf(customColumnList, (item) => item.id === dragColumn.id);
533
+ customColumnList.splice(oafIndex, 1);
534
+ nafIndex = XEUtils.findIndexOf(customColumnList, (item) => item.id === newColumn.id);
535
+ customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
308
536
  }
309
- if (targetFixed !== null) {
310
- $xeTable.dispatchEvent('custom-fixed-change', { column, fixed: targetFixed }, evnt);
311
- }
312
- },
313
- changeAlignOption(column, targetAlign, colProperty, renderProperty, eName, evnt) {
314
- const $xeTableCustomPanel = this;
315
- const $xeTable = $xeTableCustomPanel.$xeTable;
316
- const tableReactData = $xeTable;
317
- const customOpts = $xeTable.computeCustomOpts;
318
- if (customOpts.immediate) {
319
- column[colProperty] = targetAlign;
320
- column[renderProperty] = targetAlign;
321
- tableReactData.isCustomStatus = true;
322
- $xeTable.handleCustom();
323
- $xeTable.saveCustomStore(`update:${colProperty}`);
324
- }
325
- else {
326
- column[renderProperty] = targetAlign;
327
- }
328
- $xeTable.dispatchEvent(eName, { column, [colProperty]: targetAlign }, evnt);
329
- },
330
- allOptionEvent(evnt) {
331
- const $xeTableCustomPanel = this;
332
- const $xeTable = $xeTableCustomPanel.$xeTable;
333
- const tableReactData = $xeTable;
334
- const { customStore } = tableReactData;
335
- const isAll = !customStore.isAll;
336
- $xeTable.toggleCustomAllCheckbox();
337
- $xeTable.dispatchEvent('custom-visible-all', { checked: isAll }, evnt);
338
- },
339
- updateColDropTipContent() {
340
- const $xeTableCustomPanel = this;
341
- const $xeTable = $xeTableCustomPanel.$xeTable;
342
- const customPanelReactData = $xeTableCustomPanel.reactData;
343
- const { dragCol } = customPanelReactData;
344
- const columnDragOpts = $xeTable.computeColumnDragOpts;
345
- const { tooltipMethod } = columnDragOpts;
346
- let tipContent = '';
347
- if (tooltipMethod) {
348
- const dtParams = {
349
- $table: $xeTable,
350
- column: dragCol
351
- };
352
- tipContent = `${tooltipMethod(dtParams) || ''}`;
353
- }
354
- else {
355
- tipContent = getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']);
537
+ if (hasEnableConf(mouseConfig, mouseOpts)) {
538
+ if ($xeTable.clearSelected) {
539
+ $xeTable.clearSelected();
540
+ }
541
+ if ($xeTable.clearCellAreas) {
542
+ $xeTable.clearCellAreas();
543
+ $xeTable.clearCopyCellArea();
544
+ }
356
545
  }
357
- customPanelReactData.dragTipText = tipContent;
358
- },
359
- sortMousedownEvent(evnt) {
360
- const $xeTableCustomPanel = this;
361
- const $xeTable = $xeTableCustomPanel.$xeTable;
362
- const customPanelReactData = $xeTableCustomPanel.reactData;
363
- const btnEl = evnt.currentTarget;
364
- const cellEl = btnEl.parentElement;
365
- const tdEl = cellEl.parentElement;
366
- const trEl = tdEl.parentElement;
367
- const colid = trEl.getAttribute('colid');
368
- const column = $xeTable.getColumnById(colid);
369
- trEl.draggable = true;
370
- customPanelReactData.dragCol = column;
371
- customPanelReactData.dragGroupField = null;
372
- customPanelReactData.dragAggFnCol = null;
373
- this.updateColDropTipContent();
374
- addClass(trEl, 'active--drag-origin');
375
- },
376
- sortMouseupEvent(evnt) {
377
- const $xeTableCustomPanel = this;
378
- const customPanelReactData = $xeTableCustomPanel.reactData;
379
- const btnEl = evnt.currentTarget;
380
- const cellEl = btnEl.parentElement;
381
- const tdEl = cellEl.parentElement;
382
- const trEl = tdEl.parentElement;
383
- hideDropTip($xeTableCustomPanel);
384
- trEl.draggable = false;
385
- customPanelReactData.dragCol = null;
386
- customPanelReactData.dragGroupField = null;
387
- customPanelReactData.dragAggFnCol = null;
388
- removeClass(trEl, 'active--drag-origin');
389
- },
390
- sortDragstartEvent(evnt) {
391
- const $xeTableCustomPanel = this;
392
- const $xeTable = $xeTableCustomPanel.$xeTable;
393
- const tableReactData = $xeTable;
394
- const customPanelInternalData = $xeTableCustomPanel.internalData;
395
- const { customDragTime } = customPanelInternalData;
396
- if (evnt.dataTransfer) {
397
- evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
546
+ const csParams = {
547
+ oldColumn: dragColumn,
548
+ newColumn,
549
+ dragColumn,
550
+ dragPos: prevDragPos,
551
+ offsetIndex: dragOffsetIndex,
552
+ _index: {
553
+ newIndex: nafIndex,
554
+ oldIndex: oafIndex
555
+ }
556
+ };
557
+ $xeTable.dispatchEvent("custom-sort-change", csParams, evnt);
558
+ $xeTable.dispatchEvent("column-dragend", csParams, evnt);
559
+ if (immediate) {
560
+ tableReactData.customColumnList = collectColumn.slice(0);
561
+ $xeTable.handleColDragSwapColumn();
398
562
  }
399
- if (customDragTime) {
400
- clearTimeout(customDragTime);
563
+ $xeTableCustomPanel.clearDragAnimateStatus();
564
+ }).catch(() => {
565
+ });
566
+ }
567
+ }
568
+ hideDropTip($xeTableCustomPanel);
569
+ customPanelReactData.dragCol = null;
570
+ customPanelReactData.dragGroupField = null;
571
+ customPanelReactData.dragAggFnCol = null;
572
+ customPanelInternalData.prevDragGroupField = null;
573
+ customPanelInternalData.prevDragAggFnColid = null;
574
+ trEl.draggable = false;
575
+ trEl.removeAttribute("drag-pos");
576
+ removeClass(trEl, "active--drag-target");
577
+ removeClass(trEl, "active--drag-origin");
578
+ },
579
+ sortDragoverEvent(evnt) {
580
+ const $xeTableCustomPanel = this;
581
+ const $xeTable = $xeTableCustomPanel.$xeTable;
582
+ const customPanelReactData = $xeTableCustomPanel.reactData;
583
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
584
+ const { dragCol } = customPanelReactData;
585
+ const customOpts = $xeTable.computeCustomOpts;
586
+ const { showSortDragButton, allowSort, immediate } = customOpts;
587
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
588
+ const { isCrossDrag, isPeerDrag, isToChildDrag } = columnDragOpts;
589
+ const optEl = evnt.currentTarget;
590
+ const isControlKey = hasControlKey(evnt);
591
+ const colid = optEl.getAttribute("colid");
592
+ const column = $xeTable.getColumnById(colid);
593
+ customPanelInternalData.prevDragGroupField = null;
594
+ customPanelInternalData.prevDragAggFnColid = null;
595
+ if (column && (isCrossDrag || isPeerDrag || column.level === 1)) {
596
+ evnt.preventDefault();
597
+ const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
598
+ const dragPos = offsetY < optEl.clientHeight / 2 ? "top" : "bottom";
599
+ if (!dragCol || !(showSortDragButton && allowSort) || dragCol && dragCol.id === column.id || !isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.level > 1) || !immediate && column.level > 1 || !isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : dragCol.level > 1) || !immediate && dragCol.level > 1) {
600
+ showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
601
+ return;
602
+ }
603
+ customPanelInternalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
604
+ customPanelInternalData.prevDragCol = column;
605
+ customPanelInternalData.prevDragPos = dragPos;
606
+ showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos);
607
+ }
608
+ },
609
+ clearDragAnimateStatus() {
610
+ const $xeTableCustomPanel = this;
611
+ const $xeTable = $xeTableCustomPanel.$xeTable;
612
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
613
+ const tableReactData = $xeTable;
614
+ customPanelInternalData.customDragTime = setTimeout(() => {
615
+ tableReactData.isCustomDragStatus = false;
616
+ customPanelInternalData.customDragTime = void 0;
617
+ }, 350);
618
+ },
619
+ sortMoveUpEvent(evntParame, column) {
620
+ const $xeTableCustomPanel = this;
621
+ const $xeTable = $xeTableCustomPanel.$xeTable;
622
+ const tableReactData = $xeTable;
623
+ const { customColumnList } = tableReactData;
624
+ const matchObj = XEUtils.findTree(customColumnList, (item) => item === column);
625
+ if (matchObj) {
626
+ const { item, items, index } = matchObj;
627
+ if (index > 0) {
628
+ tableReactData.isCustomDragStatus = true;
629
+ $xeTableCustomPanel.$nextTick(() => {
630
+ items.splice(index, 1);
631
+ items.splice(index - 1, 0, item);
632
+ $xeTableCustomPanel.clearDragAnimateStatus();
633
+ });
634
+ }
635
+ }
636
+ },
637
+ sortMoveDnEvent(evntParame, column) {
638
+ const $xeTableCustomPanel = this;
639
+ const $xeTable = $xeTableCustomPanel.$xeTable;
640
+ const tableReactData = $xeTable;
641
+ const { customColumnList } = tableReactData;
642
+ const matchObj = XEUtils.findTree(customColumnList, (item) => item === column);
643
+ if (matchObj) {
644
+ const { item, items, index } = matchObj;
645
+ if (index < items.length - 1) {
646
+ tableReactData.isCustomDragStatus = true;
647
+ $xeTableCustomPanel.$nextTick(() => {
648
+ items.splice(index, 1);
649
+ items.splice(index + 1, 0, item);
650
+ $xeTableCustomPanel.clearDragAnimateStatus();
651
+ });
652
+ }
653
+ }
654
+ },
655
+ sortMoveTopEvent(evntParame, column) {
656
+ const $xeTableCustomPanel = this;
657
+ const $xeTable = $xeTableCustomPanel.$xeTable;
658
+ const tableReactData = $xeTable;
659
+ const { customColumnList } = tableReactData;
660
+ const matchObj = XEUtils.findTree(customColumnList, (item) => item === column);
661
+ if (matchObj) {
662
+ const { item, items, index, parent: parentItem } = matchObj;
663
+ if (parentItem || index > 0) {
664
+ tableReactData.isCustomDragStatus = true;
665
+ $xeTableCustomPanel.$nextTick(() => {
666
+ item.parentId = null;
667
+ items.splice(index, 1);
668
+ customColumnList.unshift(item);
669
+ $xeTableCustomPanel.clearDragAnimateStatus();
670
+ });
671
+ }
672
+ }
673
+ },
674
+ sortMoveBottomEvent(evntParame, column) {
675
+ const $xeTableCustomPanel = this;
676
+ const $xeTable = $xeTableCustomPanel.$xeTable;
677
+ const tableReactData = $xeTable;
678
+ const { customColumnList } = tableReactData;
679
+ const matchObj = XEUtils.findTree(customColumnList, (item) => item === column);
680
+ if (matchObj) {
681
+ const { item, items, index, parent: parentItem } = matchObj;
682
+ if (parentItem || index < items.length - 1) {
683
+ tableReactData.isCustomDragStatus = true;
684
+ $xeTableCustomPanel.$nextTick(() => {
685
+ item.parentId = null;
686
+ items.splice(index, 1);
687
+ customColumnList.push(item);
688
+ $xeTableCustomPanel.clearDragAnimateStatus();
689
+ });
690
+ }
691
+ }
692
+ },
693
+ renderDragTip(h) {
694
+ const $xeTableCustomPanel = this;
695
+ const $xeTable = $xeTableCustomPanel.$xeTable;
696
+ const customPanelReactData = $xeTableCustomPanel.reactData;
697
+ const { dragTipText } = customPanelReactData;
698
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
699
+ return h("div", {}, [
700
+ h("div", {
701
+ ref: "refDragLineElem",
702
+ class: [
703
+ "vxe-table-custom-popup--drag-line",
704
+ {
705
+ "is--guides": columnDragOpts.showGuidesStatus
401
706
  }
402
- tableReactData.isCustomDragStatus = true;
403
- customPanelInternalData.prevDragGroupField = null;
404
- customPanelInternalData.prevDragAggFnColid = null;
405
- },
406
- sortDragendEvent(evnt) {
407
- const $xeTableCustomPanel = this;
408
- const $xeTable = $xeTableCustomPanel.$xeTable;
409
- const tableProps = $xeTable;
410
- const tableReactData = $xeTable;
411
- const tableInternalData = $xeTable;
412
- const customPanelReactData = $xeTableCustomPanel.reactData;
413
- const customPanelInternalData = $xeTableCustomPanel.internalData;
414
- const { mouseConfig } = tableProps;
415
- const { customColumnList } = tableReactData;
416
- const { collectColumn } = tableInternalData;
417
- const customOpts = $xeTable.computeCustomOpts;
418
- const mouseOpts = $xeTable.computeMouseOpts;
419
- const { immediate } = customOpts;
420
- const trEl = evnt.currentTarget;
421
- const columnDragOpts = $xeTable.computeColumnDragOpts;
422
- const { isCrossDrag, isPeerDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
423
- const { dragCol } = customPanelReactData;
424
- const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
425
- const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
426
- if (prevDragGroupField || prevDragAggFnColid) {
427
- if ($xeTable.handlePivotTableAggPanelDragendEvent) {
428
- $xeTable.handlePivotTableAggPanelDragendEvent(evnt);
707
+ ]
708
+ }),
709
+ h(
710
+ "div",
711
+ {
712
+ ref: "refDragTipElem",
713
+ class: "vxe-table-custom-popup--drag-tip"
714
+ },
715
+ [
716
+ h(
717
+ "div",
718
+ {
719
+ class: "vxe-table-custom-popup--drag-tip-wrapper"
720
+ },
721
+ [
722
+ h(
723
+ "div",
724
+ {
725
+ class: "vxe-table-custom-popup--drag-tip-status"
726
+ },
727
+ [
728
+ h("span", {
729
+ class: ["vxe-table-custom-popup--drag-tip-normal-status", getIcon().TABLE_DRAG_STATUS_ROW]
730
+ }),
731
+ h("span", {
732
+ class: ["vxe-table-custom-popup--drag-tip-sub-status", getIcon().TABLE_DRAG_STATUS_SUB_ROW]
733
+ }),
734
+ h("span", {
735
+ class: ["vxe-table-custom-popup--drag-tip-group-status", getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
736
+ }),
737
+ h("span", {
738
+ class: ["vxe-table-custom-popup--drag-tip-values-status", getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
739
+ }),
740
+ h("span", {
741
+ class: ["vxe-table-custom-popup--drag-tip-disabled-status", getIcon().TABLE_DRAG_DISABLED]
742
+ })
743
+ ]
744
+ ),
745
+ h(
746
+ "div",
747
+ {
748
+ class: "vxe-table-custom-popup--drag-tip-content"
749
+ },
750
+ `${dragTipText || ""}`
751
+ )
752
+ ]
753
+ )
754
+ ]
755
+ )
756
+ ]);
757
+ },
758
+ renderSimplePanel(h) {
759
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
760
+ const $xeTableCustomPanel = this;
761
+ const props = $xeTableCustomPanel;
762
+ const $xeTable = $xeTableCustomPanel.$xeTable;
763
+ const tableProps = $xeTable;
764
+ const tableReactData = $xeTable;
765
+ const $xeGrid = $xeTable.$xeGrid;
766
+ const $xeGantt = $xeTable.$xeGantt;
767
+ const { customStore } = props;
768
+ const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
769
+ const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
770
+ const customOpts = $xeTable.computeCustomOpts;
771
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
772
+ const { defPopupStyle } = customStore;
773
+ const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
774
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
775
+ const vSize = $xeTable.computeSize;
776
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
777
+ const slots = customOpts.slots || {};
778
+ const headerSlot = slots.header;
779
+ const topSlot = slots.top;
780
+ const bottomSlot = slots.bottom;
781
+ const defaultSlot = slots.default;
782
+ const footerSlot = slots.footer;
783
+ const colVNs = [];
784
+ const customWrapperOns = {};
785
+ const isAllChecked = customStore.isAll;
786
+ const isAllIndeterminate = customStore.isIndeterminate;
787
+ if (trigger === "hover") {
788
+ customWrapperOns.mouseenter = $xeTableCustomPanel.handleWrapperMouseenterEvent;
789
+ customWrapperOns.mouseleave = $xeTableCustomPanel.handleWrapperMouseleaveEvent;
790
+ }
791
+ const params = {
792
+ $table: $xeTable,
793
+ $grid: $xeGrid,
794
+ $gantt: $xeGantt,
795
+ columns: customColumnList,
796
+ isAllChecked,
797
+ isAllIndeterminate,
798
+ isCustomStatus
799
+ };
800
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parentItem) => {
801
+ const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
802
+ if (isVisible) {
803
+ const isChecked = column.renderVisible;
804
+ const isIndeterminate = column.halfVisible;
805
+ const isColGroup = column.children && column.children.length;
806
+ const colTitle = formatText(column.getTitle(), 1);
807
+ const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
808
+ const isHidden = !isChecked;
809
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
810
+ colVNs.push(
811
+ h(
812
+ "li",
813
+ {
814
+ key: column.id,
815
+ attrs: {
816
+ colid: column.id
817
+ },
818
+ class: [
819
+ "vxe-table-custom--option",
820
+ `level--${column.level}`,
821
+ {
822
+ "is--hidden": isDisabled || isHidden,
823
+ "is--group": isColGroup
824
+ }
825
+ ],
826
+ on: {
827
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
828
+ dragend: $xeTableCustomPanel.sortDragendEvent,
829
+ dragover: $xeTableCustomPanel.sortDragoverEvent
429
830
  }
430
- }
431
- else if (prevDragCol && dragCol) {
432
- // 判断是否有拖动
433
- if (prevDragCol !== dragCol) {
434
- const dragColumn = dragCol;
435
- const newColumn = prevDragCol;
436
- Promise.resolve(dragEndMethod
437
- ? dragEndMethod({
438
- oldColumn: dragColumn,
439
- newColumn,
440
- dragColumn,
441
- dragPos: prevDragPos,
442
- dragToChild: !!prevDragToChild,
443
- offsetIndex: dragOffsetIndex
444
- })
445
- : true).then((status) => {
446
- if (!status) {
447
- return;
831
+ },
832
+ [
833
+ allowVisible ? h(
834
+ "div",
835
+ {
836
+ class: [
837
+ "vxe-table-custom--checkbox-option",
838
+ {
839
+ "is--checked": isChecked,
840
+ "is--indeterminate": isIndeterminate,
841
+ "is--disabled": isDisabled
842
+ }
843
+ ],
844
+ attrs: {
845
+ title: getI18n("vxe.custom.setting.colVisible")
846
+ },
847
+ on: {
848
+ click: (evnt) => {
849
+ if (!isDisabled) {
850
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt);
448
851
  }
449
- let oafIndex = -1;
450
- let nafIndex = -1;
451
- const oldAllMaps = {};
452
- XEUtils.eachTree([dragColumn], column => {
453
- oldAllMaps[column.id] = column;
454
- });
455
- let isSelfToChildStatus = false;
456
- // 只有实时拖拽支持跨层级
457
- if (immediate) {
458
- if (dragColumn.parentId && newColumn.parentId) {
459
- // 子到子
460
- if (isPeerDrag && !isCrossDrag) {
461
- if (dragColumn.parentId !== newColumn.parentId) {
462
- // 非同级
463
- return;
464
- }
465
- }
466
- else {
467
- if (!isCrossDrag) {
468
- return;
469
- }
470
- if (oldAllMaps[newColumn.id]) {
471
- isSelfToChildStatus = true;
472
- if (!(isCrossDrag && isSelfToChildDrag)) {
473
- if (VxeUI.modal) {
474
- VxeUI.modal.message({
475
- status: 'error',
476
- content: getI18n('vxe.error.treeDragChild')
477
- });
478
- }
479
- return;
480
- }
481
- }
482
- }
483
- }
484
- else if (dragColumn.parentId) {
485
- // 子到根
486
- if (!isCrossDrag) {
487
- return;
488
- }
489
- }
490
- else if (newColumn.parentId) {
491
- // 根到子
492
- if (!isCrossDrag) {
493
- return;
494
- }
495
- if (oldAllMaps[newColumn.id]) {
496
- isSelfToChildStatus = true;
497
- if (!(isCrossDrag && isSelfToChildDrag)) {
498
- if (VxeUI.modal) {
499
- VxeUI.modal.message({
500
- status: 'error',
501
- content: getI18n('vxe.error.treeDragChild')
502
- });
503
- }
504
- return;
505
- }
506
- }
507
- }
508
- else {
509
- // 根到根
510
- }
511
- const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
512
- // 改变层级
513
- if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
514
- if (oldewMatchRest) {
515
- const { items: oCols, index: oIndex } = oldewMatchRest;
516
- const childList = dragColumn.children || [];
517
- childList.forEach(column => {
518
- column.parentId = dragColumn.parentId;
519
- });
520
- oCols.splice(oIndex, 1, ...childList);
521
- dragColumn.children = [];
522
- }
523
- }
524
- else {
525
- if (oldewMatchRest) {
526
- const { items: oCols, index: oIndex, parent: oParent } = oldewMatchRest;
527
- oCols.splice(oIndex, 1);
528
- if (!oParent) {
529
- oafIndex = oIndex;
530
- }
531
- }
532
- }
533
- const newMatchRest = XEUtils.findTree(collectColumn, item => item.id === newColumn.id);
534
- if (newMatchRest) {
535
- const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
536
- // 转子级
537
- if ((isCrossDrag && isToChildDrag) && prevDragToChild) {
538
- dragColumn.parentId = newColumn.id;
539
- newColumn.children = (newColumn.children || []).concat([dragColumn]);
540
- }
541
- else {
542
- dragColumn.parentId = newColumn.parentId;
543
- nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
544
- }
545
- if (!nParent) {
546
- nafIndex = nIndex;
547
- }
852
+ }
853
+ }
854
+ },
855
+ [
856
+ h("span", {
857
+ class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
858
+ })
859
+ ]
860
+ ) : renderEmptyElement($xeTable),
861
+ h(
862
+ "div",
863
+ {
864
+ class: "vxe-table-custom--name-option"
865
+ },
866
+ [
867
+ allowSort && showSortDragButton || allowGroup || allowValues ? showSortBtn || (allowGroup || allowValues) && !isColGroup ? h(
868
+ "div",
869
+ {
870
+ class: "vxe-table-custom--sort-option"
871
+ },
872
+ [
873
+ h(
874
+ "span",
875
+ {
876
+ class: [
877
+ "vxe-table-custom--sort-btn",
878
+ {
879
+ "is--disabled": isHidden
880
+ }
881
+ ],
882
+ attrs: {
883
+ title: getI18n("vxe.custom.setting.sortHelpTip")
884
+ },
885
+ on: isHidden ? {} : {
886
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
887
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
548
888
  }
549
- XEUtils.eachTree(collectColumn, (column, index, items, path, parentItem) => {
550
- if (!parentItem) {
551
- const sortIndex = index + 1;
552
- column.renderSortNumber = sortIndex;
553
- }
554
- });
889
+ },
890
+ [
891
+ h("i", {
892
+ class: getIcon().TABLE_CUSTOM_SORT
893
+ })
894
+ ]
895
+ )
896
+ ]
897
+ ) : renderEmptyElement($xeTable) : renderEmptyElement($xeTable),
898
+ column.type === "html" ? h("div", {
899
+ key: "1",
900
+ class: "vxe-table-custom--checkbox-label",
901
+ domProps: {
902
+ innerHTML: colTitle
903
+ }
904
+ }) : h(
905
+ "div",
906
+ {
907
+ key: "0",
908
+ class: "vxe-table-custom--checkbox-label",
909
+ attrs: {
910
+ title: colTitle
555
911
  }
556
- else {
557
- oafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === dragColumn.id);
558
- customColumnList.splice(oafIndex, 1);
559
- nafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === newColumn.id);
560
- customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
912
+ },
913
+ colTitle
914
+ )
915
+ ]
916
+ ),
917
+ showSortBtn && (showSortMoveButton || showSortPutButton) ? h(
918
+ "div",
919
+ {
920
+ class: "vxe-table-custom--move-btn-option"
921
+ },
922
+ VxeUIButtonComponent ? [
923
+ showSortMoveButton ? h(VxeUIButtonComponent, {
924
+ props: {
925
+ mode: "text",
926
+ icon: "vxe-icon-arrows-up",
927
+ title: getI18n("vxe.custom.setting.moveUpTitle"),
928
+ disabled: index <= 0
929
+ },
930
+ on: {
931
+ click(evntParame) {
932
+ $xeTableCustomPanel.sortMoveUpEvent(evntParame, column);
561
933
  }
562
- if (hasEnableConf(mouseConfig, mouseOpts)) {
563
- if ($xeTable.clearSelected) {
564
- $xeTable.clearSelected();
565
- }
566
- if ($xeTable.clearCellAreas) {
567
- $xeTable.clearCellAreas();
568
- $xeTable.clearCopyCellArea();
569
- }
934
+ }
935
+ }) : renderEmptyElement($xeTable),
936
+ showSortMoveButton ? h(VxeUIButtonComponent, {
937
+ props: {
938
+ mode: "text",
939
+ icon: "vxe-icon-arrows-down",
940
+ title: getI18n("vxe.custom.setting.moveDnTitle"),
941
+ disabled: index >= items.length - 1
942
+ },
943
+ on: {
944
+ click(evntParame) {
945
+ $xeTableCustomPanel.sortMoveDnEvent(evntParame, column);
570
946
  }
571
- const csParams = {
572
- oldColumn: dragColumn,
573
- newColumn,
574
- dragColumn,
575
- dragPos: prevDragPos,
576
- offsetIndex: dragOffsetIndex,
577
- _index: {
578
- newIndex: nafIndex,
579
- oldIndex: oafIndex
580
- }
581
- };
582
- $xeTable.dispatchEvent('custom-sort-change', csParams, evnt);
583
- $xeTable.dispatchEvent('column-dragend', csParams, evnt);
584
- if (immediate) {
585
- tableReactData.customColumnList = collectColumn.slice(0);
586
- $xeTable.handleColDragSwapColumn();
947
+ }
948
+ }) : renderEmptyElement($xeTable),
949
+ showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
950
+ props: {
951
+ mode: "text",
952
+ icon: "vxe-icon-top",
953
+ title: getI18n("vxe.custom.setting.putTopTitle"),
954
+ disabled: index <= 0
955
+ },
956
+ on: {
957
+ click(evntParame) {
958
+ $xeTableCustomPanel.sortMoveTopEvent(evntParame, column);
587
959
  }
588
- $xeTableCustomPanel.clearDragAnimateStatus();
589
- }).catch(() => {
590
- });
591
- }
592
- }
593
- hideDropTip($xeTableCustomPanel);
594
- customPanelReactData.dragCol = null;
595
- customPanelReactData.dragGroupField = null;
596
- customPanelReactData.dragAggFnCol = null;
597
- customPanelInternalData.prevDragGroupField = null;
598
- customPanelInternalData.prevDragAggFnColid = null;
599
- trEl.draggable = false;
600
- trEl.removeAttribute('drag-pos');
601
- removeClass(trEl, 'active--drag-target');
602
- removeClass(trEl, 'active--drag-origin');
603
- },
604
- sortDragoverEvent(evnt) {
605
- const $xeTableCustomPanel = this;
606
- const $xeTable = $xeTableCustomPanel.$xeTable;
607
- const customPanelReactData = $xeTableCustomPanel.reactData;
608
- const customPanelInternalData = $xeTableCustomPanel.internalData;
609
- const { dragCol } = customPanelReactData;
610
- const customOpts = $xeTable.computeCustomOpts;
611
- const { showSortDragButton, allowSort, immediate } = customOpts;
612
- const columnDragOpts = $xeTable.computeColumnDragOpts;
613
- const { isCrossDrag, isPeerDrag, isToChildDrag } = columnDragOpts;
614
- const optEl = evnt.currentTarget;
615
- const isControlKey = hasControlKey(evnt);
616
- const colid = optEl.getAttribute('colid');
617
- const column = $xeTable.getColumnById(colid);
618
- customPanelInternalData.prevDragGroupField = null;
619
- customPanelInternalData.prevDragAggFnColid = null;
620
- // 是否移入有效列
621
- if (column && (isCrossDrag || isPeerDrag || column.level === 1)) {
622
- evnt.preventDefault();
623
- const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
624
- const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
625
- if (!dragCol ||
626
- !(showSortDragButton && allowSort) ||
627
- (dragCol && dragCol.id === column.id) ||
628
- (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.level > 1)) ||
629
- (!immediate && column.level > 1) ||
630
- (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : dragCol.level > 1)) ||
631
- (!immediate && dragCol.level > 1)) {
632
- showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
633
- return;
634
- }
635
- customPanelInternalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate);
636
- customPanelInternalData.prevDragCol = column;
637
- customPanelInternalData.prevDragPos = dragPos;
638
- showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos);
639
- }
640
- },
641
- clearDragAnimateStatus() {
642
- const $xeTableCustomPanel = this;
643
- const $xeTable = $xeTableCustomPanel.$xeTable;
644
- const customPanelInternalData = $xeTableCustomPanel.internalData;
645
- const tableReactData = $xeTable;
646
- customPanelInternalData.customDragTime = setTimeout(() => {
647
- tableReactData.isCustomDragStatus = false;
648
- customPanelInternalData.customDragTime = undefined;
649
- }, 350);
650
- },
651
- sortMoveUpEvent(evntParame, column) {
652
- const $xeTableCustomPanel = this;
653
- const $xeTable = $xeTableCustomPanel.$xeTable;
654
- const tableReactData = $xeTable;
655
- const { customColumnList } = tableReactData;
656
- const matchObj = XEUtils.findTree(customColumnList, item => item === column);
657
- if (matchObj) {
658
- const { item, items, index } = matchObj;
659
- if (index > 0) {
660
- tableReactData.isCustomDragStatus = true;
661
- $xeTableCustomPanel.$nextTick(() => {
662
- items.splice(index, 1);
663
- items.splice(index - 1, 0, item);
664
- $xeTableCustomPanel.clearDragAnimateStatus();
665
- });
666
- }
667
- }
668
- },
669
- sortMoveDnEvent(evntParame, column) {
670
- const $xeTableCustomPanel = this;
671
- const $xeTable = $xeTableCustomPanel.$xeTable;
672
- const tableReactData = $xeTable;
673
- const { customColumnList } = tableReactData;
674
- const matchObj = XEUtils.findTree(customColumnList, item => item === column);
675
- if (matchObj) {
676
- const { item, items, index } = matchObj;
677
- if (index < items.length - 1) {
678
- tableReactData.isCustomDragStatus = true;
679
- $xeTableCustomPanel.$nextTick(() => {
680
- items.splice(index, 1);
681
- items.splice(index + 1, 0, item);
682
- $xeTableCustomPanel.clearDragAnimateStatus();
683
- });
684
- }
685
- }
686
- },
687
- sortMoveTopEvent(evntParame, column) {
688
- const $xeTableCustomPanel = this;
689
- const $xeTable = $xeTableCustomPanel.$xeTable;
690
- const tableReactData = $xeTable;
691
- const { customColumnList } = tableReactData;
692
- const matchObj = XEUtils.findTree(customColumnList, item => item === column);
693
- if (matchObj) {
694
- const { item, items, index, parent: parentItem } = matchObj;
695
- if (parentItem || index > 0) {
696
- tableReactData.isCustomDragStatus = true;
697
- $xeTableCustomPanel.$nextTick(() => {
698
- item.parentId = null;
699
- items.splice(index, 1);
700
- customColumnList.unshift(item);
701
- $xeTableCustomPanel.clearDragAnimateStatus();
702
- });
703
- }
960
+ }
961
+ }) : renderEmptyElement($xeTable),
962
+ showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
963
+ props: {
964
+ mode: "text",
965
+ icon: "vxe-icon-bottom",
966
+ title: getI18n("vxe.custom.setting.putBottomTitle"),
967
+ disabled: index >= items.length - 1
968
+ },
969
+ on: {
970
+ click(evntParame) {
971
+ $xeTableCustomPanel.sortMoveBottomEvent(evntParame, column);
972
+ }
973
+ }
974
+ }) : renderEmptyElement($xeTable)
975
+ ] : []
976
+ ) : renderEmptyElement($xeTable),
977
+ !parentItem && allowFixed ? h(
978
+ "div",
979
+ {
980
+ class: "vxe-table-custom--fixed-option"
981
+ },
982
+ VxeUIButtonComponent ? [
983
+ h(VxeUIButtonComponent, {
984
+ props: {
985
+ mode: "text",
986
+ icon: column.renderFixed === "left" ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
987
+ status: column.renderFixed === "left" ? "primary" : "",
988
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
989
+ title: getI18n(column.renderFixed === "left" ? "vxe.toolbar.cancelFixed" : "vxe.toolbar.fixedLeft")
990
+ },
991
+ on: {
992
+ click: ({ $event }) => {
993
+ $xeTableCustomPanel.changeFixedOption(column, "left", $event);
994
+ }
995
+ }
996
+ }),
997
+ h(VxeUIButtonComponent, {
998
+ props: {
999
+ mode: "text",
1000
+ icon: column.renderFixed === "right" ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
1001
+ status: column.renderFixed === "right" ? "primary" : "",
1002
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
1003
+ title: getI18n(column.renderFixed === "right" ? "vxe.toolbar.cancelFixed" : "vxe.toolbar.fixedRight")
1004
+ },
1005
+ on: {
1006
+ click: ({ $event }) => {
1007
+ $xeTableCustomPanel.changeFixedOption(column, "right", $event);
1008
+ }
1009
+ }
1010
+ })
1011
+ ] : []
1012
+ ) : renderEmptyElement($xeTable)
1013
+ ]
1014
+ )
1015
+ );
1016
+ }
1017
+ });
1018
+ return h(
1019
+ "div",
1020
+ {
1021
+ ref: "refElem",
1022
+ key: "simple",
1023
+ class: [
1024
+ "vxe-table-custom-wrapper",
1025
+ `placement--${placement}`,
1026
+ {
1027
+ [`size--${vSize}`]: vSize,
1028
+ "is--active": customStore.visible
704
1029
  }
1030
+ ],
1031
+ style: defPopupStyle
705
1032
  },
706
- sortMoveBottomEvent(evntParame, column) {
707
- const $xeTableCustomPanel = this;
708
- const $xeTable = $xeTableCustomPanel.$xeTable;
709
- const tableReactData = $xeTable;
710
- const { customColumnList } = tableReactData;
711
- const matchObj = XEUtils.findTree(customColumnList, item => item === column);
712
- if (matchObj) {
713
- const { item, items, index, parent: parentItem } = matchObj;
714
- if (parentItem || index < items.length - 1) {
715
- tableReactData.isCustomDragStatus = true;
716
- $xeTableCustomPanel.$nextTick(() => {
717
- item.parentId = null;
718
- items.splice(index, 1);
719
- customColumnList.push(item);
720
- $xeTableCustomPanel.clearDragAnimateStatus();
721
- });
1033
+ customStore.visible ? [
1034
+ h(
1035
+ "div",
1036
+ {
1037
+ ref: "refBodyWrapperElem",
1038
+ class: "vxe-table-custom-simple--body-wrapper"
1039
+ },
1040
+ [
1041
+ !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
1042
+ props: {
1043
+ customStore
722
1044
  }
723
- }
724
- },
725
- renderDragTip(h) {
726
- const $xeTableCustomPanel = this;
727
- const $xeTable = $xeTableCustomPanel.$xeTable;
728
- const customPanelReactData = $xeTableCustomPanel.reactData;
729
- const { dragTipText } = customPanelReactData;
730
- const columnDragOpts = $xeTable.computeColumnDragOpts;
731
- return h('div', {}, [
732
- h('div', {
733
- ref: 'refDragLineElem',
734
- class: ['vxe-table-custom-popup--drag-line', {
735
- 'is--guides': columnDragOpts.showGuidesStatus
736
- }]
737
- }),
738
- h('div', {
739
- ref: 'refDragTipElem',
740
- class: 'vxe-table-custom-popup--drag-tip'
741
- }, [
742
- h('div', {
743
- class: 'vxe-table-custom-popup--drag-tip-wrapper'
744
- }, [
745
- h('div', {
746
- class: 'vxe-table-custom-popup--drag-tip-status'
747
- }, [
748
- h('span', {
749
- class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
750
- }),
751
- h('span', {
752
- class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
753
- }),
754
- h('span', {
755
- class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
756
- }),
757
- h('span', {
758
- class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
759
- }),
760
- h('span', {
761
- class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
762
- })
763
- ]),
764
- h('div', {
765
- class: 'vxe-table-custom-popup--drag-tip-content'
766
- }, `${dragTipText || ''}`)
767
- ])
768
- ])
769
- ]);
770
- },
771
- renderSimplePanel(h) {
772
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
773
- const $xeTableCustomPanel = this;
774
- const props = $xeTableCustomPanel;
775
- const $xeTable = $xeTableCustomPanel.$xeTable;
776
- const tableProps = $xeTable;
777
- const tableReactData = $xeTable;
778
- const $xeGrid = $xeTable.$xeGrid;
779
- const $xeGantt = $xeTable.$xeGantt;
780
- const { customStore } = props;
781
- const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
782
- const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
783
- const customOpts = $xeTable.computeCustomOpts;
784
- const columnDragOpts = $xeTable.computeColumnDragOpts;
785
- const { defPopupStyle } = customStore;
786
- const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
787
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
788
- const vSize = $xeTable.computeSize;
789
- const { isCrossDrag, isPeerDrag } = columnDragOpts;
790
- const slots = customOpts.slots || {};
791
- const headerSlot = slots.header;
792
- const topSlot = slots.top;
793
- const bottomSlot = slots.bottom;
794
- const defaultSlot = slots.default;
795
- const footerSlot = slots.footer;
796
- const colVNs = [];
797
- const customWrapperOns = {};
798
- const isAllChecked = customStore.isAll;
799
- const isAllIndeterminate = customStore.isIndeterminate;
800
- // hover 触发
801
- if (trigger === 'hover') {
802
- customWrapperOns.mouseenter = $xeTableCustomPanel.handleWrapperMouseenterEvent;
803
- customWrapperOns.mouseleave = $xeTableCustomPanel.handleWrapperMouseleaveEvent;
804
- }
805
- const params = {
806
- $table: $xeTable,
807
- $grid: $xeGrid,
808
- $gantt: $xeGantt,
809
- columns: customColumnList,
810
- isAllChecked,
811
- isAllIndeterminate,
812
- isCustomStatus
813
- };
814
- XEUtils.eachTree(customColumnList, (column, index, items, path, parentItem) => {
815
- const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
816
- if (isVisible) {
817
- const isChecked = column.renderVisible;
818
- const isIndeterminate = column.halfVisible;
819
- const isColGroup = column.children && column.children.length;
820
- const colTitle = formatText(column.getTitle(), 1);
821
- const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
822
- const isHidden = !isChecked;
823
- const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
824
- colVNs.push(h('li', {
825
- key: column.id,
826
- attrs: {
827
- colid: column.id
1045
+ }) : renderEmptyElement($xeTable),
1046
+ h(
1047
+ "div",
1048
+ {
1049
+ ref: "refCustomBodyElem",
1050
+ class: "vxe-table-custom--handle-wrapper"
1051
+ },
1052
+ [
1053
+ h(
1054
+ "div",
1055
+ {
1056
+ class: "vxe-table-custom--header"
1057
+ },
1058
+ headerSlot ? $xeTable.callSlot(headerSlot, params, h) : [
1059
+ h(
1060
+ "ul",
1061
+ {
1062
+ class: "vxe-table-custom--panel-list"
828
1063
  },
829
- class: ['vxe-table-custom--option', `level--${column.level}`, {
830
- 'is--hidden': isDisabled || isHidden,
831
- 'is--group': isColGroup
832
- }],
833
- on: {
834
- dragstart: $xeTableCustomPanel.sortDragstartEvent,
835
- dragend: $xeTableCustomPanel.sortDragendEvent,
836
- dragover: $xeTableCustomPanel.sortDragoverEvent
837
- }
838
- }, [
839
- allowVisible
840
- ? h('div', {
841
- class: ['vxe-table-custom--checkbox-option', {
842
- 'is--checked': isChecked,
843
- 'is--indeterminate': isIndeterminate,
844
- 'is--disabled': isDisabled
845
- }],
846
- attrs: {
847
- title: getI18n('vxe.custom.setting.colVisible')
848
- },
849
- on: {
850
- click: (evnt) => {
851
- if (!isDisabled) {
852
- $xeTableCustomPanel.changeCheckboxOption(column, evnt);
853
- }
854
- }
855
- }
856
- }, [
857
- h('span', {
858
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
859
- })
860
- ])
861
- : renderEmptyElement($xeTable),
862
- h('div', {
863
- class: 'vxe-table-custom--name-option'
864
- }, [
865
- (allowSort && showSortDragButton) || (allowGroup || allowValues)
866
- ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
867
- ? h('div', {
868
- class: 'vxe-table-custom--sort-option'
869
- }, [
870
- h('span', {
871
- class: ['vxe-table-custom--sort-btn', {
872
- 'is--disabled': isHidden
873
- }],
874
- attrs: {
875
- title: getI18n('vxe.custom.setting.sortHelpTip')
876
- },
877
- on: isHidden
878
- ? {}
879
- : {
880
- mousedown: $xeTableCustomPanel.sortMousedownEvent,
881
- mouseup: $xeTableCustomPanel.sortMouseupEvent
882
- }
883
- }, [
884
- h('i', {
885
- class: getIcon().TABLE_CUSTOM_SORT
886
- })
887
- ])
888
- ])
889
- : renderEmptyElement($xeTable))
890
- : renderEmptyElement($xeTable),
891
- column.type === 'html'
892
- ? h('div', {
893
- key: '1',
894
- class: 'vxe-table-custom--checkbox-label',
895
- domProps: {
896
- innerHTML: colTitle
897
- }
898
- })
899
- : h('div', {
900
- key: '0',
901
- class: 'vxe-table-custom--checkbox-label',
902
- attrs: {
903
- title: colTitle
1064
+ [
1065
+ h(
1066
+ "li",
1067
+ {
1068
+ class: "vxe-table-custom--option"
1069
+ },
1070
+ [
1071
+ allowVisible ? h(
1072
+ "div",
1073
+ {
1074
+ class: [
1075
+ "vxe-table-custom--checkbox-option",
1076
+ {
1077
+ "is--checked": isAllChecked,
1078
+ "is--indeterminate": isAllIndeterminate
904
1079
  }
905
- }, colTitle)
906
- ]),
907
- showSortBtn && (showSortMoveButton || showSortPutButton)
908
- ? h('div', {
909
- class: 'vxe-table-custom--move-btn-option'
910
- }, VxeUIButtonComponent
911
- ? [
912
- showSortMoveButton
913
- ? h(VxeUIButtonComponent, {
914
- props: {
915
- mode: 'text',
916
- icon: 'vxe-icon-arrows-up',
917
- title: getI18n('vxe.custom.setting.moveUpTitle'),
918
- disabled: index <= 0
919
- },
920
- on: {
921
- click(evntParame) {
922
- $xeTableCustomPanel.sortMoveUpEvent(evntParame, column);
923
- }
924
- }
925
- })
926
- : renderEmptyElement($xeTable),
927
- showSortMoveButton
928
- ? h(VxeUIButtonComponent, {
929
- props: {
930
- mode: 'text',
931
- icon: 'vxe-icon-arrows-down',
932
- title: getI18n('vxe.custom.setting.moveDnTitle'),
933
- disabled: index >= items.length - 1
934
- },
935
- on: {
936
- click(evntParame) {
937
- $xeTableCustomPanel.sortMoveDnEvent(evntParame, column);
938
- }
939
- }
940
- })
941
- : renderEmptyElement($xeTable),
942
- showSortPutButton && !parentItem
943
- ? h(VxeUIButtonComponent, {
944
- props: {
945
- mode: 'text',
946
- icon: 'vxe-icon-top',
947
- title: getI18n('vxe.custom.setting.putTopTitle'),
948
- disabled: index <= 0
949
- },
950
- on: {
951
- click(evntParame) {
952
- $xeTableCustomPanel.sortMoveTopEvent(evntParame, column);
953
- }
954
- }
955
- })
956
- : renderEmptyElement($xeTable),
957
- showSortPutButton && !parentItem
958
- ? h(VxeUIButtonComponent, {
959
- props: {
960
- mode: 'text',
961
- icon: 'vxe-icon-bottom',
962
- title: getI18n('vxe.custom.setting.putBottomTitle'),
963
- disabled: index >= items.length - 1
964
- },
965
- on: {
966
- click(evntParame) {
967
- $xeTableCustomPanel.sortMoveBottomEvent(evntParame, column);
968
- }
969
- }
970
- })
971
- : renderEmptyElement($xeTable)
972
- ]
973
- : [])
974
- : renderEmptyElement($xeTable),
975
- !parentItem && allowFixed
976
- ? h('div', {
977
- class: 'vxe-table-custom--fixed-option'
978
- }, VxeUIButtonComponent
979
- ? [
980
- h(VxeUIButtonComponent, {
981
- props: {
982
- mode: 'text',
983
- icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
984
- status: column.renderFixed === 'left' ? 'primary' : '',
985
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
986
- title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
987
- },
988
- on: {
989
- click: ({ $event }) => {
990
- $xeTableCustomPanel.changeFixedOption(column, 'left', $event);
991
- }
992
- }
993
- }),
994
- h(VxeUIButtonComponent, {
995
- props: {
996
- mode: 'text',
997
- icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
998
- status: column.renderFixed === 'right' ? 'primary' : '',
999
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
1000
- title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
1001
- },
1002
- on: {
1003
- click: ({ $event }) => {
1004
- $xeTableCustomPanel.changeFixedOption(column, 'right', $event);
1005
- }
1006
- }
1007
- })
1008
- ]
1009
- : [])
1010
- : renderEmptyElement($xeTable)
1011
- ]));
1012
- }
1013
- });
1014
- return h('div', {
1015
- ref: 'refElem',
1016
- key: 'simple',
1017
- class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
1018
- [`size--${vSize}`]: vSize,
1019
- 'is--active': customStore.visible
1020
- }],
1021
- style: defPopupStyle
1022
- }, customStore.visible
1023
- ? [
1024
- h('div', {
1025
- ref: 'refBodyWrapperElem',
1026
- class: 'vxe-table-custom-simple--body-wrapper'
1027
- }, [
1028
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
1029
- ? h($xeTable.getPivotTableAggregateSimplePanel(), {
1030
- props: {
1031
- customStore
1032
- }
1033
- })
1034
- : renderEmptyElement($xeTable),
1035
- h('div', {
1036
- ref: 'refCustomBodyElem',
1037
- class: 'vxe-table-custom--handle-wrapper'
1038
- }, [
1039
- h('div', {
1040
- class: 'vxe-table-custom--header'
1041
- }, headerSlot
1042
- ? $xeTable.callSlot(headerSlot, params, h)
1043
- : [
1044
- h('ul', {
1045
- class: 'vxe-table-custom--panel-list'
1046
- }, [
1047
- h('li', {
1048
- class: 'vxe-table-custom--option'
1049
- }, [
1050
- allowVisible
1051
- ? h('div', {
1052
- class: ['vxe-table-custom--checkbox-option', {
1053
- 'is--checked': isAllChecked,
1054
- 'is--indeterminate': isAllIndeterminate
1055
- }],
1056
- attrs: {
1057
- title: getI18n('vxe.table.allTitle')
1058
- },
1059
- on: {
1060
- click: $xeTableCustomPanel.allOptionEvent
1061
- }
1062
- }, [
1063
- h('span', {
1064
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
1065
- }),
1066
- h('span', {
1067
- class: 'vxe-checkbox--label'
1068
- }, getI18n('vxe.toolbar.customAll'))
1069
- ])
1070
- : h('span', {
1071
- class: 'vxe-checkbox--label'
1072
- }, getI18n('vxe.table.customTitle'))
1073
- ])
1074
- ])
1075
- ]),
1076
- h('div', {
1077
- class: 'vxe-table-custom--body'
1078
- }, [
1079
- topSlot
1080
- ? h('div', {
1081
- class: 'vxe-table-custom--panel-top'
1082
- }, $xeTable.callSlot(topSlot, params, h))
1083
- : renderEmptyElement($xeTable),
1084
- defaultSlot
1085
- ? h('div', {
1086
- class: 'vxe-table-custom--panel-body'
1087
- }, $xeTable.callSlot(defaultSlot, params, h))
1088
- : h('transition-group', {
1089
- class: 'vxe-table-custom--panel-list',
1090
- props: {
1091
- name: isCustomDragStatus ? 'vxe-table-custom--list' : '',
1092
- tag: 'ul'
1093
- },
1094
- on: customWrapperOns
1095
- }, colVNs),
1096
- bottomSlot
1097
- ? h('div', {
1098
- class: 'vxe-table-custom--panel-bottom'
1099
- }, $xeTable.callSlot(bottomSlot, params, h))
1100
- : renderEmptyElement($xeTable)
1101
- ]),
1102
- customOpts.showFooter
1103
- ? h('div', {
1104
- class: 'vxe-table-custom--footer'
1105
- }, footerSlot
1106
- ? $xeTable.callSlot(footerSlot, params, h)
1107
- : [
1108
- h('div', {
1109
- class: 'vxe-table-custom--footer-buttons'
1110
- }, [
1111
- h(VxeUIButtonComponent, {
1112
- props: {
1113
- mode: 'text',
1114
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
1115
- disabled: !isCustomStatus
1116
- },
1117
- on: {
1118
- click: $xeTableCustomPanel.resetCustomEvent
1119
- }
1120
- }),
1121
- immediate
1122
- ? h(VxeUIButtonComponent, {
1123
- props: {
1124
- mode: 'text',
1125
- content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
1126
- },
1127
- on: {
1128
- click: $xeTableCustomPanel.cancelCloseEvent
1129
- }
1130
- })
1131
- : h(VxeUIButtonComponent, {
1132
- props: {
1133
- mode: 'text',
1134
- content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
1135
- },
1136
- on: {
1137
- click: $xeTableCustomPanel.cancelCustomEvent
1138
- }
1139
- }),
1140
- immediate
1141
- ? renderEmptyElement($xeTable)
1142
- : h(VxeUIButtonComponent, {
1143
- props: {
1144
- mode: 'text',
1145
- status: 'primary',
1146
- content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
1147
- },
1148
- on: {
1149
- click: $xeTableCustomPanel.confirmCustomEvent
1150
- }
1151
- })
1152
- ])
1153
- ])
1154
- : null
1155
- ]),
1156
- $xeTableCustomPanel.renderDragTip(h)
1157
- ])
1158
- ]
1159
- : []);
1160
- },
1161
- renderPopupBodys(h) {
1162
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
1163
- const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput');
1164
- const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
1165
- const $xeTableCustomPanel = this;
1166
- const $xeTable = $xeTableCustomPanel.$xeTable;
1167
- const tableProps = $xeTable;
1168
- const tableReactData = $xeTable;
1169
- const { resizable: allResizable } = tableProps;
1170
- const { customColumnList } = tableReactData;
1171
- const customOpts = $xeTable.computeCustomOpts;
1172
- const columnDragOpts = $xeTable.computeColumnDragOpts;
1173
- const { immediate, showSortDragButton, showSortMoveButton, showSortPutButton, allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues, checkMethod, visibleMethod } = customOpts;
1174
- const columnOpts = $xeTable.computeColumnOpts;
1175
- const resizableOpts = $xeTable.computeResizableOpts;
1176
- const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts;
1177
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
1178
- const { isCrossDrag, isPeerDrag } = columnDragOpts;
1179
- const trVNs = [];
1180
- XEUtils.eachTree(customColumnList, (column, index, items, path, parentItem) => {
1181
- const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
1182
- if (isVisible) {
1183
- // 默认继承调整宽度
1184
- let customMinWidth = 0;
1185
- let customMaxWidth = 0;
1186
- if (allowResizable) {
1187
- const resizeParams = {
1188
- $table: $xeTable,
1189
- column,
1190
- columnIndex: $xeTable.getColumnIndex(column),
1191
- $columnIndex: $xeTable.getVMColumnIndex(column),
1192
- _columnIndex: $xeTable.getVTColumnIndex(column),
1193
- rowIndex: -1,
1194
- _rowIndex: -1,
1195
- $rowIndex: -1
1196
- };
1197
- if (reMinWidth) {
1198
- customMinWidth = XEUtils.toNumber(XEUtils.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth);
1199
- }
1200
- if (reMaxWidth) {
1201
- customMaxWidth = XEUtils.toNumber(XEUtils.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth);
1202
- }
1203
- }
1204
- const isChecked = column.renderVisible;
1205
- const isIndeterminate = column.halfVisible;
1206
- const colTitle = formatText(column.getTitle(), 1);
1207
- const isColGroup = column.children && column.children.length;
1208
- const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
1209
- const isHidden = !isChecked;
1210
- const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
1211
- const alignList = [
1212
- { icon: getIcon().TABLE_CUSTOM_ALIGN_LEFT, value: 'left', title: getI18n('vxe.custom.setting.anLeftTitle'), disabled: isHidden },
1213
- { icon: getIcon().TABLE_CUSTOM_ALIGN_CENTER, value: 'center', title: getI18n('vxe.custom.setting.anCenterTitle'), disabled: isHidden },
1214
- { icon: getIcon().TABLE_CUSTOM_ALIGN_RIGHT, value: 'right', title: getI18n('vxe.custom.setting.anRightTitle'), disabled: isHidden }
1215
- ];
1216
- const tdVNs = [];
1217
- if (allowVisible) {
1218
- tdVNs.push(h('td', {
1219
- key: 'av',
1220
- class: 'vxe-table-custom-popup--column-td col--visible'
1221
- }, [
1222
- h('div', {
1223
- class: ['vxe-table-custom--checkbox-option', {
1224
- 'is--checked': isChecked,
1225
- 'is--indeterminate': isIndeterminate,
1226
- 'is--disabled': isDisabled
1227
- }],
1228
- attrs: {
1229
- title: getI18n('vxe.custom.setting.colVisible')
1080
+ ],
1081
+ attrs: {
1082
+ title: getI18n("vxe.table.allTitle")
1083
+ },
1084
+ on: {
1085
+ click: $xeTableCustomPanel.allOptionEvent
1086
+ }
1230
1087
  },
1231
- on: {
1232
- click: (evnt) => {
1233
- if (!isDisabled) {
1234
- $xeTableCustomPanel.changeCheckboxOption(column, evnt);
1235
- }
1236
- }
1237
- }
1238
- }, [
1239
- h('span', {
1240
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
1241
- })
1242
- ])
1243
- ]));
1244
- }
1245
- tdVNs.push(h('td', {
1246
- key: 'at',
1247
- class: 'vxe-table-custom-popup--column-td col--name'
1248
- }, [
1249
- h('div', {
1250
- class: 'vxe-table-custom-popup--name'
1251
- }, [
1252
- (allowSort && showSortDragButton) || (allowGroup || allowValues)
1253
- ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
1254
- ? h('div', {
1255
- class: ['vxe-table-custom-popup--column-sort-btn', {
1256
- 'is--disabled': isHidden
1257
- }],
1258
- attrs: {
1259
- title: getI18n('vxe.custom.setting.sortHelpTip')
1260
- },
1261
- on: (isHidden
1262
- ? {}
1263
- : {
1264
- mousedown: $xeTableCustomPanel.sortMousedownEvent,
1265
- mouseup: $xeTableCustomPanel.sortMouseupEvent
1266
- })
1267
- }, [
1268
- h('i', {
1269
- class: getIcon().TABLE_CUSTOM_SORT
1270
- })
1271
- ])
1272
- : h('div', {
1273
- class: 'vxe-table-custom-popup--column-sort-placeholder'
1274
- }))
1275
- : renderEmptyElement($xeTable),
1276
- column.type === 'html'
1277
- ? h('div', {
1278
- key: '1',
1279
- class: 'vxe-table-custom-popup--title',
1280
- domProps: {
1281
- innerHTML: colTitle
1282
- }
1283
- })
1284
- : h('div', {
1285
- key: '0',
1286
- class: 'vxe-table-custom-popup--title',
1287
- attrs: {
1288
- title: colTitle
1289
- }
1290
- }, colTitle),
1291
- showSortBtn && (showSortMoveButton || showSortPutButton)
1292
- ? h('div', {
1293
- class: 'vxe-table-custom-popup--move-btn'
1294
- }, VxeUIButtonComponent
1295
- ? [
1296
- showSortMoveButton
1297
- ? h(VxeUIButtonComponent, {
1298
- props: {
1299
- mode: 'text',
1300
- icon: 'vxe-icon-arrows-up',
1301
- title: getI18n('vxe.custom.setting.moveUpTitle'),
1302
- disabled: index <= 0
1303
- },
1304
- on: {
1305
- click(evntParame) {
1306
- $xeTableCustomPanel.sortMoveUpEvent(evntParame, column);
1307
- }
1308
- }
1309
- })
1310
- : renderEmptyElement($xeTable),
1311
- showSortMoveButton
1312
- ? h(VxeUIButtonComponent, {
1313
- props: {
1314
- mode: 'text',
1315
- icon: 'vxe-icon-arrows-down',
1316
- title: getI18n('vxe.custom.setting.moveDnTitle'),
1317
- disabled: index >= items.length - 1
1318
- },
1319
- on: {
1320
- click(evntParame) {
1321
- $xeTableCustomPanel.sortMoveDnEvent(evntParame, column);
1322
- }
1323
- }
1324
- })
1325
- : renderEmptyElement($xeTable),
1326
- showSortPutButton && !parentItem
1327
- ? h(VxeUIButtonComponent, {
1328
- props: {
1329
- mode: 'text',
1330
- icon: 'vxe-icon-top',
1331
- title: getI18n('vxe.custom.setting.putTopTitle'),
1332
- disabled: index <= 0
1333
- },
1334
- on: {
1335
- click(evntParame) {
1336
- $xeTableCustomPanel.sortMoveTopEvent(evntParame, column);
1337
- }
1338
- }
1339
- })
1340
- : renderEmptyElement($xeTable),
1341
- showSortPutButton && !parentItem
1342
- ? h(VxeUIButtonComponent, {
1343
- props: {
1344
- mode: 'text',
1345
- icon: 'vxe-icon-bottom',
1346
- title: getI18n('vxe.custom.setting.putBottomTitle'),
1347
- disabled: index >= items.length - 1
1348
- },
1349
- on: {
1350
- click(evntParame) {
1351
- $xeTableCustomPanel.sortMoveBottomEvent(evntParame, column);
1352
- }
1353
- }
1354
- })
1355
- : renderEmptyElement($xeTable)
1356
- ]
1357
- : [])
1358
- : renderEmptyElement($xeTable)
1359
- ])
1360
- ]));
1361
- if (allowResizable) {
1362
- tdVNs.push(h('td', {
1363
- key: 'aw',
1364
- class: 'vxe-table-custom-popup--column-td col--resizable'
1365
- }, [
1366
- ((column.children && column.children.length) ||
1367
- !(XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable)))
1368
- ? h('span', '-')
1369
- : (VxeUINumberInputComponent
1370
- ? h(VxeUINumberInputComponent, {
1371
- props: {
1372
- type: 'integer',
1373
- immediate: false,
1374
- disabled: isHidden,
1375
- value: column.renderResizeWidth,
1376
- min: customMinWidth || 0,
1377
- max: customMaxWidth || 9999
1378
- },
1379
- on: {
1380
- modelValue(value) {
1381
- const width = Math.max(0, Number(value));
1382
- column.renderResizeWidth = width;
1383
- },
1384
- change() {
1385
- $xeTableCustomPanel.changeColumnWidth(column);
1386
- }
1387
- }
1388
- })
1389
- : renderEmptyElement($xeTable))
1390
- ]));
1391
- }
1392
- if (allowFixed) {
1393
- tdVNs.push(h('td', {
1394
- key: 'af',
1395
- class: 'vxe-table-custom-popup--column-td col--fixed'
1396
- }, parentItem
1397
- ? [h('span', '-')]
1398
- : (VxeUIRadioGroupComponent
1399
- ? [
1400
- h(VxeUIButtonComponent, {
1401
- props: {
1402
- icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
1403
- status: column.renderFixed === 'left' ? 'primary' : '',
1404
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
1405
- title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
1406
- },
1407
- on: {
1408
- click: ({ $event }) => {
1409
- $xeTableCustomPanel.changeFixedOption(column, 'left', $event);
1410
- }
1411
- }
1412
- }),
1413
- h(VxeUIButtonComponent, {
1414
- props: {
1415
- icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
1416
- status: column.renderFixed === 'right' ? 'primary' : '',
1417
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
1418
- title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
1419
- },
1420
- on: {
1421
- click: ({ $event }) => {
1422
- $xeTableCustomPanel.changeFixedOption(column, 'right', $event);
1423
- }
1424
- }
1425
- })
1426
- ]
1427
- : [])));
1428
- }
1429
- if (allowAlign) {
1430
- tdVNs.push(h('td', {
1431
- key: 'aa',
1432
- class: 'vxe-table-custom-popup--column-td col--align'
1433
- }, VxeUIRadioGroupComponent
1434
- ? [
1435
- h(VxeUIRadioGroupComponent, {
1436
- props: {
1437
- value: column.renderAlign || 'left',
1438
- type: 'button',
1439
- strict: false,
1440
- disabled: isHidden,
1441
- options: alignList
1088
+ [
1089
+ h("span", {
1090
+ class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
1091
+ }),
1092
+ h(
1093
+ "span",
1094
+ {
1095
+ class: "vxe-checkbox--label"
1442
1096
  },
1443
- on: {
1444
- change({ value, $event }) {
1445
- $xeTableCustomPanel.changeAlignOption(column, value, 'align', 'renderAlign', 'custom-align-change', $event);
1446
- }
1447
- }
1448
- })
1449
- ]
1450
- : []));
1451
- }
1452
- if (allowHeaderAlign) {
1453
- tdVNs.push(h('td', {
1454
- key: 'aha',
1455
- class: 'vxe-table-custom-popup--column-td col--header-align'
1456
- }, isColGroup
1457
- ? [h('span', '-')]
1458
- : (VxeUIRadioGroupComponent
1459
- ? [
1460
- h(VxeUIRadioGroupComponent, {
1461
- props: {
1462
- value: column.renderHeaderAlign || 'left',
1463
- type: 'button',
1464
- strict: false,
1465
- disabled: isHidden,
1466
- options: alignList
1467
- },
1468
- on: {
1469
- change({ value, $event }) {
1470
- $xeTableCustomPanel.changeAlignOption(column, value, 'headerAlign', 'renderHeaderAlign', 'custom-header-align-change', $event);
1471
- }
1472
- }
1473
- })
1097
+ getI18n("vxe.toolbar.customAll")
1098
+ )
1474
1099
  ]
1475
- : [])));
1476
- }
1477
- if (allowFooterAlign) {
1478
- tdVNs.push(h('td', {
1479
- key: 'afa',
1480
- class: 'vxe-table-custom-popup--column-td col--footer-align'
1481
- }, isColGroup
1482
- ? [h('span', '-')]
1483
- : (VxeUIRadioGroupComponent
1484
- ? [
1485
- h(VxeUIRadioGroupComponent, {
1486
- props: {
1487
- value: column.renderFooterAlign || 'left',
1488
- type: 'button',
1489
- strict: false,
1490
- disabled: isHidden,
1491
- options: alignList
1492
- },
1493
- on: {
1494
- change({ value, $event }) {
1495
- $xeTableCustomPanel.changeAlignOption(column, value, 'footerAlign', 'renderFooterAlign', 'custom-footer-align-change', $event);
1496
- }
1497
- }
1498
- })
1499
- ]
1500
- : [])));
1501
- }
1502
- trVNs.push(h('tr', {
1503
- key: column.id,
1504
- attrs: {
1505
- colid: column.id
1100
+ ) : h(
1101
+ "span",
1102
+ {
1103
+ class: "vxe-checkbox--label"
1104
+ },
1105
+ getI18n("vxe.table.customTitle")
1106
+ )
1107
+ ]
1108
+ )
1109
+ ]
1110
+ )
1111
+ ]
1112
+ ),
1113
+ h(
1114
+ "div",
1115
+ {
1116
+ class: "vxe-table-custom--body"
1117
+ },
1118
+ [
1119
+ topSlot ? h(
1120
+ "div",
1121
+ {
1122
+ class: "vxe-table-custom--panel-top"
1506
1123
  },
1507
- class: [`vxe-table-custom-popup--row level--${column.level}`, {
1508
- 'is--group': isColGroup
1509
- }],
1510
- on: {
1511
- dragstart: $xeTableCustomPanel.sortDragstartEvent,
1512
- dragend: $xeTableCustomPanel.sortDragendEvent,
1513
- dragover: $xeTableCustomPanel.sortDragoverEvent
1514
- }
1515
- }, tdVNs));
1516
- }
1517
- });
1518
- return trVNs;
1519
- },
1520
- renderPopupPanel(h) {
1521
- const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
1522
- const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer');
1523
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
1524
- const $xeTableCustomPanel = this;
1525
- const props = $xeTableCustomPanel;
1526
- const $xeTable = $xeTableCustomPanel.$xeTable;
1527
- const tableProps = $xeTable;
1528
- const tableReactData = $xeTable;
1529
- const $xeGrid = $xeTable.$xeGrid;
1530
- const $xeGantt = $xeTable.$xeGantt;
1531
- const { customStore } = props;
1532
- const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
1533
- const { isCustomStatus, customColumnList } = tableReactData;
1534
- const vSize = $xeTable.computeSize;
1535
- const customOpts = $xeTable.computeCustomOpts;
1536
- const aggregateOpts = $xeTable.computeAggregateOpts;
1537
- const { panePopupStyle } = customStore;
1538
- const { placement: aggPlacement } = aggregateOpts;
1539
- const { mode, immediate, modalOptions, drawerOptions, allowVisible, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable } = customOpts;
1540
- const columnOpts = $xeTable.computeColumnOpts;
1541
- const { maxFixedSize } = columnOpts;
1542
- const modalOpts = Object.assign({}, modalOptions);
1543
- const drawerOpts = Object.assign({}, drawerOptions);
1544
- const slots = customOpts.slots || {};
1545
- const headerSlot = slots.header;
1546
- const topSlot = slots.top;
1547
- const bottomSlot = slots.bottom;
1548
- const defaultSlot = slots.default;
1549
- const footerSlot = slots.footer;
1550
- const isAllChecked = customStore.isAll;
1551
- const isAllIndeterminate = customStore.isIndeterminate;
1552
- const isAggRtBmLayout = aggPlacement === 'right' || aggPlacement === 'bottom';
1553
- const params = {
1554
- $table: $xeTable,
1555
- $grid: $xeGrid,
1556
- $gantt: $xeGantt,
1557
- columns: customColumnList,
1558
- isAllChecked,
1559
- isAllIndeterminate,
1560
- isCustomStatus
1561
- };
1562
- const colVNs = [];
1563
- const headVNs = [];
1564
- if (allowVisible) {
1565
- colVNs.push(h('col', {
1566
- key: 'av',
1567
- class: 'vxe-table-custom-popup--column-col col--checkbox'
1568
- }));
1569
- headVNs.push(h('th', {
1570
- key: 'av',
1571
- class: 'vxe-table-custom-popup--column-th col--checkbox'
1572
- }, [
1573
- h('div', {
1574
- class: ['vxe-table-custom--checkbox-option', {
1575
- 'is--checked': isAllChecked,
1576
- 'is--indeterminate': isAllIndeterminate
1577
- }],
1578
- attrs: {
1579
- title: getI18n('vxe.table.allTitle')
1124
+ $xeTable.callSlot(topSlot, params, h)
1125
+ ) : renderEmptyElement($xeTable),
1126
+ defaultSlot ? h(
1127
+ "div",
1128
+ {
1129
+ class: "vxe-table-custom--panel-body"
1580
1130
  },
1581
- on: {
1582
- click: $xeTableCustomPanel.allOptionEvent
1583
- }
1584
- }, [
1585
- h('span', {
1586
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
1587
- })
1588
- // h('span', {
1589
- // class: 'vxe-checkbox--label'
1590
- // }, getI18n('vxe.toolbar.customAll'))
1591
- ])
1592
- ]));
1593
- }
1594
- colVNs.push(h('col', {
1595
- key: 'at',
1596
- class: 'vxe-table-custom-popup--column-col col--title'
1597
- }));
1598
- headVNs.push(h('th', {
1599
- key: 'at',
1600
- class: 'vxe-table-custom-popup--column-th col--title'
1601
- }, getI18n('vxe.custom.setting.colTitle')));
1602
- if (allowResizable) {
1603
- colVNs.push(h('col', {
1604
- key: 'aw',
1605
- class: 'vxe-table-custom-popup--column-col col--width'
1606
- }));
1607
- headVNs.push(h('th', {
1608
- key: 'aw',
1609
- class: 'vxe-table-custom-popup--column-th col--width'
1610
- }, getI18n('vxe.custom.setting.colResizable')));
1611
- }
1612
- if (allowFixed) {
1613
- colVNs.push(h('col', {
1614
- key: 'af',
1615
- class: 'vxe-table-custom-popup--column-col col--fixed'
1616
- }));
1617
- headVNs.push(h('th', {
1618
- key: 'af',
1619
- class: 'vxe-table-custom-popup--column-th col--fixed'
1620
- }, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])));
1621
- }
1622
- if (allowAlign) {
1623
- colVNs.push(h('col', {
1624
- key: 'aa',
1625
- class: 'vxe-table-custom-popup--column-col col--align'
1626
- }));
1627
- headVNs.push(h('th', {
1628
- key: 'aa',
1629
- class: 'vxe-table-custom-popup--column-th col--align'
1630
- }, getI18n('vxe.custom.setting.colAlign')));
1631
- }
1632
- if (allowHeaderAlign) {
1633
- colVNs.push(h('col', {
1634
- key: 'aha',
1635
- class: 'vxe-table-custom-popup--column-col col--header-align'
1636
- }));
1637
- headVNs.push(h('th', {
1638
- key: 'aha',
1639
- class: 'vxe-table-custom-popup--column-th col--header-align'
1640
- }, getI18n('vxe.custom.setting.colHeadAlign')));
1641
- }
1642
- if (allowFooterAlign) {
1643
- colVNs.push(h('col', {
1644
- key: 'afa',
1645
- class: 'vxe-table-custom-popup--column-col col--footer-align'
1646
- }));
1647
- headVNs.push(h('th', {
1648
- key: 'afa',
1649
- class: 'vxe-table-custom-popup--column-th col--footer-align'
1650
- }, getI18n('vxe.custom.setting.colFootAlign')));
1651
- }
1652
- const scopedSlots = {
1653
- default: () => {
1654
- return h('div', {
1655
- ref: 'refBodyWrapperElem',
1656
- class: ['vxe-table-custom-popup--body-wrapper', `agg-layout--${aggPlacement}`, {
1657
- [`size--${vSize}`]: vSize
1658
- }],
1659
- style: panePopupStyle
1660
- }, defaultSlot
1661
- ? $xeTable.callSlot(defaultSlot, params, h)
1662
- : [
1663
- !isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1664
- ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1665
- props: {
1666
- customStore
1667
- }
1668
- })
1669
- : renderEmptyElement($xeTable),
1670
- h('div', {
1671
- ref: 'refCustomBodyElem',
1672
- class: 'vxe-table-custom-popup--handle-wrapper'
1673
- }, [
1674
- topSlot
1675
- ? h('div', {
1676
- class: 'vxe-table-custom-popup--table-top'
1677
- }, $xeTable.callSlot(topSlot, params, h))
1678
- : renderEmptyElement($xeTable),
1679
- h('div', {
1680
- class: 'vxe-table-custom-popup--table-wrapper'
1681
- }, [
1682
- h('table', {}, [
1683
- h('colgroup', {}, colVNs),
1684
- h('thead', {}, [
1685
- h('tr', {}, headVNs)
1686
- ]),
1687
- h('transition-group', {
1688
- class: 'vxe-table-custom--panel-list',
1689
- props: {
1690
- tag: 'tbody',
1691
- name: 'vxe-table-custom--list'
1692
- }
1693
- }, $xeTableCustomPanel.renderPopupBodys(h))
1694
- ])
1695
- ]),
1696
- bottomSlot
1697
- ? h('div', {
1698
- class: 'vxe-table-custom-popup--table-bottom'
1699
- }, $xeTable.callSlot(bottomSlot, params, h))
1700
- : renderEmptyElement($xeTable),
1701
- $xeTableCustomPanel.renderDragTip(h)
1702
- ]),
1703
- isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1704
- ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1705
- props: {
1706
- customStore
1707
- }
1708
- })
1709
- : renderEmptyElement($xeTable)
1710
- ]);
1711
- },
1712
- footer: () => {
1713
- if (footerSlot) {
1714
- return $xeTable.callSlot(footerSlot, params, h);
1715
- }
1716
- return h('div', {
1717
- class: 'vxe-table-custom-popup--footer'
1718
- }, [
1719
- h(VxeUIButtonComponent, {
1131
+ $xeTable.callSlot(defaultSlot, params, h)
1132
+ ) : h(
1133
+ "transition-group",
1134
+ {
1135
+ class: "vxe-table-custom--panel-list",
1136
+ props: {
1137
+ name: isCustomDragStatus ? "vxe-table-custom--list" : "",
1138
+ tag: "ul"
1139
+ },
1140
+ on: customWrapperOns
1141
+ },
1142
+ colVNs
1143
+ ),
1144
+ bottomSlot ? h(
1145
+ "div",
1146
+ {
1147
+ class: "vxe-table-custom--panel-bottom"
1148
+ },
1149
+ $xeTable.callSlot(bottomSlot, params, h)
1150
+ ) : renderEmptyElement($xeTable)
1151
+ ]
1152
+ ),
1153
+ customOpts.showFooter ? h(
1154
+ "div",
1155
+ {
1156
+ class: "vxe-table-custom--footer"
1157
+ },
1158
+ footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [
1159
+ h(
1160
+ "div",
1161
+ {
1162
+ class: "vxe-table-custom--footer-buttons"
1163
+ },
1164
+ [
1165
+ h(VxeUIButtonComponent, {
1720
1166
  props: {
1721
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
1722
- disabled: !isCustomStatus
1167
+ mode: "text",
1168
+ content: customOpts.resetButtonText || getI18n("vxe.table.customRestore"),
1169
+ disabled: !isCustomStatus
1723
1170
  },
1724
1171
  on: {
1725
- click: $xeTableCustomPanel.resetCustomEvent
1172
+ click: $xeTableCustomPanel.resetCustomEvent
1726
1173
  }
1727
- }),
1728
- immediate
1729
- ? h(VxeUIButtonComponent, {
1730
- props: {
1731
- status: 'primary',
1732
- content: customOpts.resetButtonText || getI18n('vxe.table.customClose')
1733
- },
1734
- on: {
1735
- click: $xeTableCustomPanel.cancelCloseEvent
1736
- }
1737
- })
1738
- : h(VxeUIButtonComponent, {
1739
- props: {
1740
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
1741
- },
1742
- on: {
1743
- click: $xeTableCustomPanel.cancelCustomEvent
1744
- }
1745
- }),
1746
- immediate
1747
- ? renderEmptyElement($xeTable)
1748
- : h(VxeUIButtonComponent, {
1749
- props: {
1750
- status: 'primary',
1751
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
1752
- },
1753
- on: {
1754
- click: $xeTableCustomPanel.confirmCustomEvent
1755
- }
1756
- })
1757
- ]);
1758
- }
1174
+ }),
1175
+ immediate ? h(VxeUIButtonComponent, {
1176
+ props: {
1177
+ mode: "text",
1178
+ content: customOpts.closeButtonText || getI18n("vxe.table.customClose")
1179
+ },
1180
+ on: {
1181
+ click: $xeTableCustomPanel.cancelCloseEvent
1182
+ }
1183
+ }) : h(VxeUIButtonComponent, {
1184
+ props: {
1185
+ mode: "text",
1186
+ content: customOpts.resetButtonText || getI18n("vxe.table.customCancel")
1187
+ },
1188
+ on: {
1189
+ click: $xeTableCustomPanel.cancelCustomEvent
1190
+ }
1191
+ }),
1192
+ immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
1193
+ props: {
1194
+ mode: "text",
1195
+ status: "primary",
1196
+ content: customOpts.confirmButtonText || getI18n("vxe.table.customConfirm")
1197
+ },
1198
+ on: {
1199
+ click: $xeTableCustomPanel.confirmCustomEvent
1200
+ }
1201
+ })
1202
+ ]
1203
+ )
1204
+ ]
1205
+ ) : null
1206
+ ]
1207
+ ),
1208
+ $xeTableCustomPanel.renderDragTip(h)
1209
+ ]
1210
+ )
1211
+ ] : []
1212
+ );
1213
+ },
1214
+ renderPopupBodys(h) {
1215
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
1216
+ const VxeUINumberInputComponent = VxeUI.getComponent("VxeNumberInput");
1217
+ const VxeUIRadioGroupComponent = VxeUI.getComponent("VxeRadioGroup");
1218
+ const $xeTableCustomPanel = this;
1219
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1220
+ const tableProps = $xeTable;
1221
+ const tableReactData = $xeTable;
1222
+ const { resizable: allResizable } = tableProps;
1223
+ const { customColumnList } = tableReactData;
1224
+ const customOpts = $xeTable.computeCustomOpts;
1225
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
1226
+ const { immediate, showSortDragButton, showSortMoveButton, showSortPutButton, allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues, checkMethod, visibleMethod } = customOpts;
1227
+ const columnOpts = $xeTable.computeColumnOpts;
1228
+ const resizableOpts = $xeTable.computeResizableOpts;
1229
+ const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts;
1230
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
1231
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
1232
+ const trVNs = [];
1233
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parentItem) => {
1234
+ const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
1235
+ if (isVisible) {
1236
+ let customMinWidth = 0;
1237
+ let customMaxWidth = 0;
1238
+ if (allowResizable) {
1239
+ const resizeParams = {
1240
+ $table: $xeTable,
1241
+ column,
1242
+ columnIndex: $xeTable.getColumnIndex(column),
1243
+ $columnIndex: $xeTable.getVMColumnIndex(column),
1244
+ _columnIndex: $xeTable.getVTColumnIndex(column),
1245
+ rowIndex: -1,
1246
+ _rowIndex: -1,
1247
+ $rowIndex: -1
1759
1248
  };
1760
- if (headerSlot) {
1761
- scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
1249
+ if (reMinWidth) {
1250
+ customMinWidth = XEUtils.toNumber(XEUtils.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth);
1251
+ }
1252
+ if (reMaxWidth) {
1253
+ customMaxWidth = XEUtils.toNumber(XEUtils.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth);
1762
1254
  }
1763
- if (mode === 'drawer') {
1764
- return VxeUIDrawerComponent
1765
- ? h(VxeUIDrawerComponent, {
1766
- key: 'drawer',
1767
- props: {
1768
- className: ['vxe-table-custom-drawer-wrapper', 'vxe-table--ignore-clear', drawerOpts.className || ''].join(' '),
1769
- value: customStore.visible,
1770
- title: drawerOpts.title || getI18n('vxe.custom.cstmTitle'),
1771
- width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
1772
- position: drawerOpts.position,
1773
- resize: !!drawerOpts.resize,
1774
- escClosable: !!drawerOpts.escClosable,
1775
- maskClosable: !!drawerOpts.maskClosable,
1776
- destroyOnClose: true,
1777
- showFooter: true
1255
+ }
1256
+ const isChecked = column.renderVisible;
1257
+ const isIndeterminate = column.halfVisible;
1258
+ const colTitle = formatText(column.getTitle(), 1);
1259
+ const isColGroup = column.children && column.children.length;
1260
+ const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
1261
+ const isHidden = !isChecked;
1262
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
1263
+ const alignList = [
1264
+ { icon: getIcon().TABLE_CUSTOM_ALIGN_LEFT, value: "left", title: getI18n("vxe.custom.setting.anLeftTitle"), disabled: isHidden },
1265
+ { icon: getIcon().TABLE_CUSTOM_ALIGN_CENTER, value: "center", title: getI18n("vxe.custom.setting.anCenterTitle"), disabled: isHidden },
1266
+ { icon: getIcon().TABLE_CUSTOM_ALIGN_RIGHT, value: "right", title: getI18n("vxe.custom.setting.anRightTitle"), disabled: isHidden }
1267
+ ];
1268
+ const tdVNs = [];
1269
+ if (allowVisible) {
1270
+ tdVNs.push(
1271
+ h(
1272
+ "td",
1273
+ {
1274
+ key: "av",
1275
+ class: "vxe-table-custom-popup--column-td col--visible"
1276
+ },
1277
+ [
1278
+ h(
1279
+ "div",
1280
+ {
1281
+ class: [
1282
+ "vxe-table-custom--checkbox-option",
1283
+ {
1284
+ "is--checked": isChecked,
1285
+ "is--indeterminate": isIndeterminate,
1286
+ "is--disabled": isDisabled
1287
+ }
1288
+ ],
1289
+ attrs: {
1290
+ title: getI18n("vxe.custom.setting.colVisible")
1291
+ },
1292
+ on: {
1293
+ click: (evnt) => {
1294
+ if (!isDisabled) {
1295
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt);
1296
+ }
1297
+ }
1298
+ }
1299
+ },
1300
+ [
1301
+ h("span", {
1302
+ class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
1303
+ })
1304
+ ]
1305
+ )
1306
+ ]
1307
+ )
1308
+ );
1309
+ }
1310
+ tdVNs.push(
1311
+ h(
1312
+ "td",
1313
+ {
1314
+ key: "at",
1315
+ class: "vxe-table-custom-popup--column-td col--name"
1316
+ },
1317
+ [
1318
+ h(
1319
+ "div",
1320
+ {
1321
+ class: "vxe-table-custom-popup--name"
1322
+ },
1323
+ [
1324
+ allowSort && showSortDragButton || allowGroup || allowValues ? showSortBtn || (allowGroup || allowValues) && !isColGroup ? h(
1325
+ "div",
1326
+ {
1327
+ class: [
1328
+ "vxe-table-custom-popup--column-sort-btn",
1329
+ {
1330
+ "is--disabled": isHidden
1331
+ }
1332
+ ],
1333
+ attrs: {
1334
+ title: getI18n("vxe.custom.setting.sortHelpTip")
1778
1335
  },
1779
- on: {
1780
- input(value) {
1781
- customStore.visible = value;
1336
+ on: isHidden ? {} : {
1337
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
1338
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
1339
+ }
1340
+ },
1341
+ [
1342
+ h("i", {
1343
+ class: getIcon().TABLE_CUSTOM_SORT
1344
+ })
1345
+ ]
1346
+ ) : h("div", {
1347
+ class: "vxe-table-custom-popup--column-sort-placeholder"
1348
+ }) : renderEmptyElement($xeTable),
1349
+ column.type === "html" ? h("div", {
1350
+ key: "1",
1351
+ class: "vxe-table-custom-popup--title",
1352
+ domProps: {
1353
+ innerHTML: colTitle
1354
+ }
1355
+ }) : h(
1356
+ "div",
1357
+ {
1358
+ key: "0",
1359
+ class: "vxe-table-custom-popup--title",
1360
+ attrs: {
1361
+ title: colTitle
1362
+ }
1363
+ },
1364
+ colTitle
1365
+ ),
1366
+ showSortBtn && (showSortMoveButton || showSortPutButton) ? h(
1367
+ "div",
1368
+ {
1369
+ class: "vxe-table-custom-popup--move-btn"
1370
+ },
1371
+ VxeUIButtonComponent ? [
1372
+ showSortMoveButton ? h(VxeUIButtonComponent, {
1373
+ props: {
1374
+ mode: "text",
1375
+ icon: "vxe-icon-arrows-up",
1376
+ title: getI18n("vxe.custom.setting.moveUpTitle"),
1377
+ disabled: index <= 0
1378
+ },
1379
+ on: {
1380
+ click(evntParame) {
1381
+ $xeTableCustomPanel.sortMoveUpEvent(evntParame, column);
1782
1382
  }
1783
- },
1784
- scopedSlots
1785
- })
1786
- : renderEmptyElement($xeTableCustomPanel);
1787
- }
1788
- return VxeUIModalComponent
1789
- ? h(VxeUIModalComponent, {
1790
- key: 'modal',
1383
+ }
1384
+ }) : renderEmptyElement($xeTable),
1385
+ showSortMoveButton ? h(VxeUIButtonComponent, {
1386
+ props: {
1387
+ mode: "text",
1388
+ icon: "vxe-icon-arrows-down",
1389
+ title: getI18n("vxe.custom.setting.moveDnTitle"),
1390
+ disabled: index >= items.length - 1
1391
+ },
1392
+ on: {
1393
+ click(evntParame) {
1394
+ $xeTableCustomPanel.sortMoveDnEvent(evntParame, column);
1395
+ }
1396
+ }
1397
+ }) : renderEmptyElement($xeTable),
1398
+ showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
1399
+ props: {
1400
+ mode: "text",
1401
+ icon: "vxe-icon-top",
1402
+ title: getI18n("vxe.custom.setting.putTopTitle"),
1403
+ disabled: index <= 0
1404
+ },
1405
+ on: {
1406
+ click(evntParame) {
1407
+ $xeTableCustomPanel.sortMoveTopEvent(evntParame, column);
1408
+ }
1409
+ }
1410
+ }) : renderEmptyElement($xeTable),
1411
+ showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
1412
+ props: {
1413
+ mode: "text",
1414
+ icon: "vxe-icon-bottom",
1415
+ title: getI18n("vxe.custom.setting.putBottomTitle"),
1416
+ disabled: index >= items.length - 1
1417
+ },
1418
+ on: {
1419
+ click(evntParame) {
1420
+ $xeTableCustomPanel.sortMoveBottomEvent(evntParame, column);
1421
+ }
1422
+ }
1423
+ }) : renderEmptyElement($xeTable)
1424
+ ] : []
1425
+ ) : renderEmptyElement($xeTable)
1426
+ ]
1427
+ )
1428
+ ]
1429
+ )
1430
+ );
1431
+ if (allowResizable) {
1432
+ tdVNs.push(
1433
+ h(
1434
+ "td",
1435
+ {
1436
+ key: "aw",
1437
+ class: "vxe-table-custom-popup--column-td col--resizable"
1438
+ },
1439
+ [
1440
+ column.children && column.children.length || !(XEUtils.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h("span", "-") : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
1791
1441
  props: {
1792
- className: ['vxe-table-custom-modal-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
1793
- value: customStore.visible,
1794
- title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
1795
- width: modalOpts.width || Math.min(1000, document.documentElement.clientWidth),
1796
- minWidth: modalOpts.minWidth || 800,
1797
- height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
1798
- minHeight: modalOpts.minHeight || 400,
1799
- showZoom: modalOpts.showZoom,
1800
- showMaximize: modalOpts.showMaximize,
1801
- showMinimize: modalOpts.showMinimize,
1802
- mask: modalOpts.mask,
1803
- lockView: modalOpts.lockView,
1804
- resize: modalOpts.resize,
1805
- transfer: modalOpts.transfer,
1806
- escClosable: !!modalOpts.escClosable,
1807
- maskClosable: !!modalOpts.maskClosable,
1808
- destroyOnClose: true,
1809
- showFooter: true
1442
+ type: "integer",
1443
+ immediate: false,
1444
+ disabled: isHidden,
1445
+ value: column.renderResizeWidth,
1446
+ min: customMinWidth || 0,
1447
+ max: customMaxWidth || 9999
1810
1448
  },
1811
1449
  on: {
1812
- input(value) {
1813
- customStore.visible = value;
1814
- }
1450
+ modelValue(value) {
1451
+ const width = Math.max(0, Number(value));
1452
+ column.renderResizeWidth = width;
1453
+ },
1454
+ change() {
1455
+ $xeTableCustomPanel.changeColumnWidth(column);
1456
+ }
1457
+ }
1458
+ }) : renderEmptyElement($xeTable)
1459
+ ]
1460
+ )
1461
+ );
1462
+ }
1463
+ if (allowFixed) {
1464
+ tdVNs.push(
1465
+ h(
1466
+ "td",
1467
+ {
1468
+ key: "af",
1469
+ class: "vxe-table-custom-popup--column-td col--fixed"
1470
+ },
1471
+ parentItem ? [h("span", "-")] : VxeUIRadioGroupComponent ? [
1472
+ h(VxeUIButtonComponent, {
1473
+ props: {
1474
+ icon: column.renderFixed === "left" ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
1475
+ status: column.renderFixed === "left" ? "primary" : "",
1476
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
1477
+ title: getI18n(column.renderFixed === "left" ? "vxe.toolbar.cancelFixed" : "vxe.toolbar.fixedLeft")
1478
+ },
1479
+ on: {
1480
+ click: ({ $event }) => {
1481
+ $xeTableCustomPanel.changeFixedOption(column, "left", $event);
1482
+ }
1483
+ }
1484
+ }),
1485
+ h(VxeUIButtonComponent, {
1486
+ props: {
1487
+ icon: column.renderFixed === "right" ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
1488
+ status: column.renderFixed === "right" ? "primary" : "",
1489
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
1490
+ title: getI18n(column.renderFixed === "right" ? "vxe.toolbar.cancelFixed" : "vxe.toolbar.fixedRight")
1491
+ },
1492
+ on: {
1493
+ click: ({ $event }) => {
1494
+ $xeTableCustomPanel.changeFixedOption(column, "right", $event);
1495
+ }
1496
+ }
1497
+ })
1498
+ ] : []
1499
+ )
1500
+ );
1501
+ }
1502
+ if (allowAlign) {
1503
+ tdVNs.push(
1504
+ h(
1505
+ "td",
1506
+ {
1507
+ key: "aa",
1508
+ class: "vxe-table-custom-popup--column-td col--align"
1509
+ },
1510
+ VxeUIRadioGroupComponent ? [
1511
+ h(VxeUIRadioGroupComponent, {
1512
+ props: {
1513
+ value: column.renderAlign || "left",
1514
+ type: "button",
1515
+ strict: false,
1516
+ disabled: isHidden,
1517
+ options: alignList
1518
+ },
1519
+ on: {
1520
+ change({ value, $event }) {
1521
+ $xeTableCustomPanel.changeAlignOption(column, value, "align", "renderAlign", "custom-align-change", $event);
1522
+ }
1523
+ }
1524
+ })
1525
+ ] : []
1526
+ )
1527
+ );
1528
+ }
1529
+ if (allowHeaderAlign) {
1530
+ tdVNs.push(
1531
+ h(
1532
+ "td",
1533
+ {
1534
+ key: "aha",
1535
+ class: "vxe-table-custom-popup--column-td col--header-align"
1536
+ },
1537
+ isColGroup ? [h("span", "-")] : VxeUIRadioGroupComponent ? [
1538
+ h(VxeUIRadioGroupComponent, {
1539
+ props: {
1540
+ value: column.renderHeaderAlign || "left",
1541
+ type: "button",
1542
+ strict: false,
1543
+ disabled: isHidden,
1544
+ options: alignList
1815
1545
  },
1816
- scopedSlots
1817
- })
1818
- : renderEmptyElement($xeTableCustomPanel);
1546
+ on: {
1547
+ change({ value, $event }) {
1548
+ $xeTableCustomPanel.changeAlignOption(column, value, "headerAlign", "renderHeaderAlign", "custom-header-align-change", $event);
1549
+ }
1550
+ }
1551
+ })
1552
+ ] : []
1553
+ )
1554
+ );
1555
+ }
1556
+ if (allowFooterAlign) {
1557
+ tdVNs.push(
1558
+ h(
1559
+ "td",
1560
+ {
1561
+ key: "afa",
1562
+ class: "vxe-table-custom-popup--column-td col--footer-align"
1563
+ },
1564
+ isColGroup ? [h("span", "-")] : VxeUIRadioGroupComponent ? [
1565
+ h(VxeUIRadioGroupComponent, {
1566
+ props: {
1567
+ value: column.renderFooterAlign || "left",
1568
+ type: "button",
1569
+ strict: false,
1570
+ disabled: isHidden,
1571
+ options: alignList
1572
+ },
1573
+ on: {
1574
+ change({ value, $event }) {
1575
+ $xeTableCustomPanel.changeAlignOption(column, value, "footerAlign", "renderFooterAlign", "custom-footer-align-change", $event);
1576
+ }
1577
+ }
1578
+ })
1579
+ ] : []
1580
+ )
1581
+ );
1582
+ }
1583
+ trVNs.push(
1584
+ h(
1585
+ "tr",
1586
+ {
1587
+ key: column.id,
1588
+ attrs: {
1589
+ colid: column.id
1590
+ },
1591
+ class: [
1592
+ `vxe-table-custom-popup--row level--${column.level}`,
1593
+ {
1594
+ "is--group": isColGroup
1595
+ }
1596
+ ],
1597
+ on: {
1598
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
1599
+ dragend: $xeTableCustomPanel.sortDragendEvent,
1600
+ dragover: $xeTableCustomPanel.sortDragoverEvent
1601
+ }
1602
+ },
1603
+ tdVNs
1604
+ )
1605
+ );
1606
+ }
1607
+ });
1608
+ return trVNs;
1609
+ },
1610
+ renderPopupPanel(h) {
1611
+ const VxeUIModalComponent = VxeUI.getComponent("VxeModal");
1612
+ const VxeUIDrawerComponent = VxeUI.getComponent("VxeDrawer");
1613
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
1614
+ const $xeTableCustomPanel = this;
1615
+ const props = $xeTableCustomPanel;
1616
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1617
+ const tableProps = $xeTable;
1618
+ const tableReactData = $xeTable;
1619
+ const $xeGrid = $xeTable.$xeGrid;
1620
+ const $xeGantt = $xeTable.$xeGantt;
1621
+ const { customStore } = props;
1622
+ const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
1623
+ const { isCustomStatus, customColumnList } = tableReactData;
1624
+ const vSize = $xeTable.computeSize;
1625
+ const customOpts = $xeTable.computeCustomOpts;
1626
+ const aggregateOpts = $xeTable.computeAggregateOpts;
1627
+ const { panePopupStyle } = customStore;
1628
+ const { placement: aggPlacement } = aggregateOpts;
1629
+ const { mode, immediate, modalOptions, drawerOptions, allowVisible, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable } = customOpts;
1630
+ const columnOpts = $xeTable.computeColumnOpts;
1631
+ const { maxFixedSize } = columnOpts;
1632
+ const modalOpts = Object.assign({}, modalOptions);
1633
+ const drawerOpts = Object.assign({}, drawerOptions);
1634
+ const slots = customOpts.slots || {};
1635
+ const headerSlot = slots.header;
1636
+ const topSlot = slots.top;
1637
+ const bottomSlot = slots.bottom;
1638
+ const defaultSlot = slots.default;
1639
+ const footerSlot = slots.footer;
1640
+ const isAllChecked = customStore.isAll;
1641
+ const isAllIndeterminate = customStore.isIndeterminate;
1642
+ const isAggRtBmLayout = aggPlacement === "right" || aggPlacement === "bottom";
1643
+ const params = {
1644
+ $table: $xeTable,
1645
+ $grid: $xeGrid,
1646
+ $gantt: $xeGantt,
1647
+ columns: customColumnList,
1648
+ isAllChecked,
1649
+ isAllIndeterminate,
1650
+ isCustomStatus
1651
+ };
1652
+ const colVNs = [];
1653
+ const headVNs = [];
1654
+ if (allowVisible) {
1655
+ colVNs.push(
1656
+ h("col", {
1657
+ key: "av",
1658
+ class: "vxe-table-custom-popup--column-col col--checkbox"
1659
+ })
1660
+ );
1661
+ headVNs.push(
1662
+ h(
1663
+ "th",
1664
+ {
1665
+ key: "av",
1666
+ class: "vxe-table-custom-popup--column-th col--checkbox"
1667
+ },
1668
+ [
1669
+ h(
1670
+ "div",
1671
+ {
1672
+ class: [
1673
+ "vxe-table-custom--checkbox-option",
1674
+ {
1675
+ "is--checked": isAllChecked,
1676
+ "is--indeterminate": isAllIndeterminate
1677
+ }
1678
+ ],
1679
+ attrs: {
1680
+ title: getI18n("vxe.table.allTitle")
1681
+ },
1682
+ on: {
1683
+ click: $xeTableCustomPanel.allOptionEvent
1684
+ }
1685
+ },
1686
+ [
1687
+ h("span", {
1688
+ class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
1689
+ })
1690
+ // h('span', {
1691
+ // class: 'vxe-checkbox--label'
1692
+ // }, getI18n('vxe.toolbar.customAll'))
1693
+ ]
1694
+ )
1695
+ ]
1696
+ )
1697
+ );
1698
+ }
1699
+ colVNs.push(
1700
+ h("col", {
1701
+ key: "at",
1702
+ class: "vxe-table-custom-popup--column-col col--title"
1703
+ })
1704
+ );
1705
+ headVNs.push(
1706
+ h(
1707
+ "th",
1708
+ {
1709
+ key: "at",
1710
+ class: "vxe-table-custom-popup--column-th col--title"
1711
+ },
1712
+ getI18n("vxe.custom.setting.colTitle")
1713
+ )
1714
+ );
1715
+ if (allowResizable) {
1716
+ colVNs.push(
1717
+ h("col", {
1718
+ key: "aw",
1719
+ class: "vxe-table-custom-popup--column-col col--width"
1720
+ })
1721
+ );
1722
+ headVNs.push(
1723
+ h(
1724
+ "th",
1725
+ {
1726
+ key: "aw",
1727
+ class: "vxe-table-custom-popup--column-th col--width"
1728
+ },
1729
+ getI18n("vxe.custom.setting.colResizable")
1730
+ )
1731
+ );
1732
+ }
1733
+ if (allowFixed) {
1734
+ colVNs.push(
1735
+ h("col", {
1736
+ key: "af",
1737
+ class: "vxe-table-custom-popup--column-col col--fixed"
1738
+ })
1739
+ );
1740
+ headVNs.push(
1741
+ h(
1742
+ "th",
1743
+ {
1744
+ key: "af",
1745
+ class: "vxe-table-custom-popup--column-th col--fixed"
1746
+ },
1747
+ getI18n(`vxe.custom.setting.${maxFixedSize ? "colFixedMax" : "colFixed"}`, [maxFixedSize])
1748
+ )
1749
+ );
1750
+ }
1751
+ if (allowAlign) {
1752
+ colVNs.push(
1753
+ h("col", {
1754
+ key: "aa",
1755
+ class: "vxe-table-custom-popup--column-col col--align"
1756
+ })
1757
+ );
1758
+ headVNs.push(
1759
+ h(
1760
+ "th",
1761
+ {
1762
+ key: "aa",
1763
+ class: "vxe-table-custom-popup--column-th col--align"
1764
+ },
1765
+ getI18n("vxe.custom.setting.colAlign")
1766
+ )
1767
+ );
1768
+ }
1769
+ if (allowHeaderAlign) {
1770
+ colVNs.push(
1771
+ h("col", {
1772
+ key: "aha",
1773
+ class: "vxe-table-custom-popup--column-col col--header-align"
1774
+ })
1775
+ );
1776
+ headVNs.push(
1777
+ h(
1778
+ "th",
1779
+ {
1780
+ key: "aha",
1781
+ class: "vxe-table-custom-popup--column-th col--header-align"
1782
+ },
1783
+ getI18n("vxe.custom.setting.colHeadAlign")
1784
+ )
1785
+ );
1786
+ }
1787
+ if (allowFooterAlign) {
1788
+ colVNs.push(
1789
+ h("col", {
1790
+ key: "afa",
1791
+ class: "vxe-table-custom-popup--column-col col--footer-align"
1792
+ })
1793
+ );
1794
+ headVNs.push(
1795
+ h(
1796
+ "th",
1797
+ {
1798
+ key: "afa",
1799
+ class: "vxe-table-custom-popup--column-th col--footer-align"
1800
+ },
1801
+ getI18n("vxe.custom.setting.colFootAlign")
1802
+ )
1803
+ );
1804
+ }
1805
+ const scopedSlots = {
1806
+ default: () => {
1807
+ return h(
1808
+ "div",
1809
+ {
1810
+ ref: "refBodyWrapperElem",
1811
+ class: [
1812
+ "vxe-table-custom-popup--body-wrapper",
1813
+ `agg-layout--${aggPlacement}`,
1814
+ {
1815
+ [`size--${vSize}`]: vSize
1816
+ }
1817
+ ],
1818
+ style: panePopupStyle
1819
+ },
1820
+ defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [
1821
+ !isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1822
+ props: {
1823
+ customStore
1824
+ }
1825
+ }) : renderEmptyElement($xeTable),
1826
+ h(
1827
+ "div",
1828
+ {
1829
+ ref: "refCustomBodyElem",
1830
+ class: "vxe-table-custom-popup--handle-wrapper"
1831
+ },
1832
+ [
1833
+ topSlot ? h(
1834
+ "div",
1835
+ {
1836
+ class: "vxe-table-custom-popup--table-top"
1837
+ },
1838
+ $xeTable.callSlot(topSlot, params, h)
1839
+ ) : renderEmptyElement($xeTable),
1840
+ h(
1841
+ "div",
1842
+ {
1843
+ class: "vxe-table-custom-popup--table-wrapper"
1844
+ },
1845
+ [
1846
+ h("table", {}, [
1847
+ h("colgroup", {}, colVNs),
1848
+ h("thead", {}, [h("tr", {}, headVNs)]),
1849
+ h(
1850
+ "transition-group",
1851
+ {
1852
+ class: "vxe-table-custom--panel-list",
1853
+ props: {
1854
+ tag: "tbody",
1855
+ name: "vxe-table-custom--list"
1856
+ }
1857
+ },
1858
+ $xeTableCustomPanel.renderPopupBodys(h)
1859
+ )
1860
+ ])
1861
+ ]
1862
+ ),
1863
+ bottomSlot ? h(
1864
+ "div",
1865
+ {
1866
+ class: "vxe-table-custom-popup--table-bottom"
1867
+ },
1868
+ $xeTable.callSlot(bottomSlot, params, h)
1869
+ ) : renderEmptyElement($xeTable),
1870
+ $xeTableCustomPanel.renderDragTip(h)
1871
+ ]
1872
+ ),
1873
+ isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1874
+ props: {
1875
+ customStore
1876
+ }
1877
+ }) : renderEmptyElement($xeTable)
1878
+ ]
1879
+ );
1819
1880
  },
1820
- renderVN(h) {
1821
- const $xeTableCustomPanel = this;
1822
- const $xeTable = $xeTableCustomPanel.$xeTable;
1823
- const customOpts = $xeTable.computeCustomOpts;
1824
- if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
1825
- return $xeTableCustomPanel.renderPopupPanel(h);
1826
- }
1827
- return $xeTableCustomPanel.renderSimplePanel(h);
1881
+ footer: () => {
1882
+ if (footerSlot) {
1883
+ return $xeTable.callSlot(footerSlot, params, h);
1884
+ }
1885
+ return h(
1886
+ "div",
1887
+ {
1888
+ class: "vxe-table-custom-popup--footer"
1889
+ },
1890
+ [
1891
+ h(VxeUIButtonComponent, {
1892
+ props: {
1893
+ content: customOpts.resetButtonText || getI18n("vxe.custom.cstmRestore"),
1894
+ disabled: !isCustomStatus
1895
+ },
1896
+ on: {
1897
+ click: $xeTableCustomPanel.resetCustomEvent
1898
+ }
1899
+ }),
1900
+ immediate ? h(VxeUIButtonComponent, {
1901
+ props: {
1902
+ status: "primary",
1903
+ content: customOpts.resetButtonText || getI18n("vxe.table.customClose")
1904
+ },
1905
+ on: {
1906
+ click: $xeTableCustomPanel.cancelCloseEvent
1907
+ }
1908
+ }) : h(VxeUIButtonComponent, {
1909
+ props: {
1910
+ content: customOpts.resetButtonText || getI18n("vxe.custom.cstmCancel")
1911
+ },
1912
+ on: {
1913
+ click: $xeTableCustomPanel.cancelCustomEvent
1914
+ }
1915
+ }),
1916
+ immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
1917
+ props: {
1918
+ status: "primary",
1919
+ content: customOpts.confirmButtonText || getI18n("vxe.custom.cstmConfirm")
1920
+ },
1921
+ on: {
1922
+ click: $xeTableCustomPanel.confirmCustomEvent
1923
+ }
1924
+ })
1925
+ ]
1926
+ );
1828
1927
  }
1928
+ };
1929
+ if (headerSlot) {
1930
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
1931
+ }
1932
+ if (mode === "drawer") {
1933
+ return VxeUIDrawerComponent ? h(VxeUIDrawerComponent, {
1934
+ key: "drawer",
1935
+ props: {
1936
+ className: ["vxe-table-custom-drawer-wrapper", "vxe-table--ignore-clear", drawerOpts.className || ""].join(" "),
1937
+ value: customStore.visible,
1938
+ title: drawerOpts.title || getI18n("vxe.custom.cstmTitle"),
1939
+ width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
1940
+ position: drawerOpts.position,
1941
+ resize: !!drawerOpts.resize,
1942
+ escClosable: !!drawerOpts.escClosable,
1943
+ maskClosable: !!drawerOpts.maskClosable,
1944
+ destroyOnClose: true,
1945
+ showFooter: true
1946
+ },
1947
+ on: {
1948
+ input(value) {
1949
+ customStore.visible = value;
1950
+ }
1951
+ },
1952
+ scopedSlots
1953
+ }) : renderEmptyElement($xeTableCustomPanel);
1954
+ }
1955
+ return VxeUIModalComponent ? h(VxeUIModalComponent, {
1956
+ key: "modal",
1957
+ props: {
1958
+ className: ["vxe-table-custom-modal-wrapper", "vxe-table--ignore-clear", modalOpts.className || ""].join(" "),
1959
+ value: customStore.visible,
1960
+ title: modalOpts.title || getI18n("vxe.custom.cstmTitle"),
1961
+ width: modalOpts.width || Math.min(1e3, document.documentElement.clientWidth),
1962
+ minWidth: modalOpts.minWidth || 800,
1963
+ height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
1964
+ minHeight: modalOpts.minHeight || 400,
1965
+ showZoom: modalOpts.showZoom,
1966
+ showMaximize: modalOpts.showMaximize,
1967
+ showMinimize: modalOpts.showMinimize,
1968
+ mask: modalOpts.mask,
1969
+ lockView: modalOpts.lockView,
1970
+ resize: modalOpts.resize,
1971
+ transfer: modalOpts.transfer,
1972
+ escClosable: !!modalOpts.escClosable,
1973
+ maskClosable: !!modalOpts.maskClosable,
1974
+ destroyOnClose: true,
1975
+ showFooter: true
1976
+ },
1977
+ on: {
1978
+ input(value) {
1979
+ customStore.visible = value;
1980
+ }
1981
+ },
1982
+ scopedSlots
1983
+ }) : renderEmptyElement($xeTableCustomPanel);
1829
1984
  },
1830
- render(h) {
1831
- return this.renderVN(h);
1985
+ renderVN(h) {
1986
+ const $xeTableCustomPanel = this;
1987
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1988
+ const customOpts = $xeTable.computeCustomOpts;
1989
+ if (["modal", "drawer", "popup"].includes(`${customOpts.mode}`)) {
1990
+ return $xeTableCustomPanel.renderPopupPanel(h);
1991
+ }
1992
+ return $xeTableCustomPanel.renderSimplePanel(h);
1832
1993
  }
1994
+ },
1995
+ render(h) {
1996
+ return this.renderVN(h);
1997
+ }
1998
+ };
1999
+ export {
2000
+ panel_default as default
1833
2001
  };