vxe-table 4.23.5 → 4.23.7

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