vxe-table 4.23.11 → 4.23.13

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