vxe-table 3.11.26 → 3.11.27-beta.1

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 (151) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +3 -3
  4. package/es/locale/lang/de-DE.js +3 -3
  5. package/es/locale/lang/en-US.js +3 -3
  6. package/es/locale/lang/es-ES.js +3 -3
  7. package/es/locale/lang/fr-FR.js +3 -3
  8. package/es/locale/lang/hu-HU.js +3 -3
  9. package/es/locale/lang/hy-AM.js +3 -3
  10. package/es/locale/lang/ja-JP.js +3 -3
  11. package/es/locale/lang/ko-KR.js +3 -3
  12. package/es/locale/lang/nb-NO.js +3 -3
  13. package/es/locale/lang/pt-BR.js +3 -3
  14. package/es/locale/lang/ru-RU.js +3 -3
  15. package/es/locale/lang/ug-CN.js +3 -3
  16. package/es/locale/lang/uk-UA.js +3 -3
  17. package/es/locale/lang/vi-VN.js +3 -3
  18. package/es/locale/lang/zh-CHT.js +3 -3
  19. package/es/locale/lang/zh-CN.js +3 -3
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/table/module/custom/mixin.js +2 -0
  23. package/es/table/module/custom/panel.js +433 -231
  24. package/es/table/src/body.js +2 -2
  25. package/es/table/src/cell.js +2 -2
  26. package/es/table/src/column.js +10 -8
  27. package/es/table/src/group.js +37 -6
  28. package/es/table/src/methods.js +167 -73
  29. package/es/table/src/table.js +1 -1
  30. package/es/table/src/util.js +0 -1
  31. package/es/table/style.css +106 -37
  32. package/es/table/style.min.css +1 -1
  33. package/es/ui/index.js +1 -1
  34. package/es/ui/src/dom.js +1 -0
  35. package/es/ui/src/log.js +1 -1
  36. package/es/vxe-table/style.css +106 -37
  37. package/es/vxe-table/style.min.css +1 -1
  38. package/lib/index.css +1 -1
  39. package/lib/index.min.css +1 -1
  40. package/lib/index.umd.js +618 -260
  41. package/lib/index.umd.min.js +1 -1
  42. package/lib/locale/lang/ar-EG.js +3 -3
  43. package/lib/locale/lang/ar-EG.min.js +1 -1
  44. package/lib/locale/lang/de-DE.js +3 -3
  45. package/lib/locale/lang/de-DE.min.js +1 -1
  46. package/lib/locale/lang/en-US.js +3 -3
  47. package/lib/locale/lang/en-US.min.js +1 -1
  48. package/lib/locale/lang/en-US.umd.js +3 -3
  49. package/lib/locale/lang/es-ES.js +3 -3
  50. package/lib/locale/lang/es-ES.min.js +1 -1
  51. package/lib/locale/lang/es-ES.umd.js +3 -3
  52. package/lib/locale/lang/fr-FR.js +3 -3
  53. package/lib/locale/lang/fr-FR.min.js +1 -1
  54. package/lib/locale/lang/hu-HU.js +3 -3
  55. package/lib/locale/lang/hu-HU.min.js +1 -1
  56. package/lib/locale/lang/hu-HU.umd.js +3 -3
  57. package/lib/locale/lang/hy-AM.js +3 -3
  58. package/lib/locale/lang/hy-AM.min.js +1 -1
  59. package/lib/locale/lang/ja-JP.js +3 -3
  60. package/lib/locale/lang/ja-JP.min.js +1 -1
  61. package/lib/locale/lang/ja-JP.umd.js +3 -3
  62. package/lib/locale/lang/ko-KR.js +3 -3
  63. package/lib/locale/lang/ko-KR.min.js +1 -1
  64. package/lib/locale/lang/ko-KR.umd.js +3 -3
  65. package/lib/locale/lang/nb-NO.js +3 -3
  66. package/lib/locale/lang/nb-NO.min.js +1 -1
  67. package/lib/locale/lang/pt-BR.js +3 -3
  68. package/lib/locale/lang/pt-BR.min.js +1 -1
  69. package/lib/locale/lang/pt-BR.umd.js +3 -3
  70. package/lib/locale/lang/ru-RU.js +3 -3
  71. package/lib/locale/lang/ru-RU.min.js +1 -1
  72. package/lib/locale/lang/ru-RU.umd.js +3 -3
  73. package/lib/locale/lang/ug-CN.js +3 -3
  74. package/lib/locale/lang/ug-CN.min.js +1 -1
  75. package/lib/locale/lang/uk-UA.js +3 -3
  76. package/lib/locale/lang/uk-UA.min.js +1 -1
  77. package/lib/locale/lang/uk-UA.umd.js +3 -3
  78. package/lib/locale/lang/vi-VN.js +3 -3
  79. package/lib/locale/lang/vi-VN.min.js +1 -1
  80. package/lib/locale/lang/zh-CHT.js +3 -3
  81. package/lib/locale/lang/zh-CHT.min.js +1 -1
  82. package/lib/locale/lang/zh-CHT.umd.js +3 -3
  83. package/lib/locale/lang/zh-CN.js +3 -3
  84. package/lib/locale/lang/zh-CN.min.js +1 -1
  85. package/lib/locale/lang/zh-CN.umd.js +3 -3
  86. package/lib/style.css +1 -1
  87. package/lib/style.min.css +1 -1
  88. package/lib/table/module/custom/mixin.js +2 -0
  89. package/lib/table/module/custom/mixin.min.js +1 -1
  90. package/lib/table/module/custom/panel.js +369 -156
  91. package/lib/table/module/custom/panel.min.js +1 -1
  92. package/lib/table/src/body.js +2 -2
  93. package/lib/table/src/body.min.js +1 -1
  94. package/lib/table/src/cell.js +2 -1
  95. package/lib/table/src/cell.min.js +1 -1
  96. package/lib/table/src/column.js +11 -9
  97. package/lib/table/src/column.min.js +1 -1
  98. package/lib/table/src/group.js +39 -6
  99. package/lib/table/src/group.min.js +1 -1
  100. package/lib/table/src/methods.js +181 -74
  101. package/lib/table/src/methods.min.js +1 -1
  102. package/lib/table/src/table.js +1 -1
  103. package/lib/table/src/table.min.js +1 -1
  104. package/lib/table/src/util.js +0 -1
  105. package/lib/table/src/util.min.js +1 -1
  106. package/lib/table/style/style.css +106 -37
  107. package/lib/table/style/style.min.css +1 -1
  108. package/lib/ui/index.js +1 -1
  109. package/lib/ui/index.min.js +1 -1
  110. package/lib/ui/src/dom.js +2 -0
  111. package/lib/ui/src/dom.min.js +1 -1
  112. package/lib/ui/src/log.js +1 -1
  113. package/lib/ui/src/log.min.js +1 -1
  114. package/lib/vxe-table/style/style.css +106 -37
  115. package/lib/vxe-table/style/style.min.css +1 -1
  116. package/package.json +2 -2
  117. package/packages/locale/lang/ar-EG.ts +3 -3
  118. package/packages/locale/lang/de-DE.ts +3 -3
  119. package/packages/locale/lang/en-US.ts +3 -3
  120. package/packages/locale/lang/es-ES.ts +3 -3
  121. package/packages/locale/lang/fr-FR.ts +3 -3
  122. package/packages/locale/lang/hu-HU.ts +3 -3
  123. package/packages/locale/lang/hy-AM.ts +3 -3
  124. package/packages/locale/lang/ja-JP.ts +3 -3
  125. package/packages/locale/lang/ko-KR.ts +3 -3
  126. package/packages/locale/lang/nb-NO.ts +3 -3
  127. package/packages/locale/lang/pt-BR.ts +3 -3
  128. package/packages/locale/lang/ru-RU.ts +3 -3
  129. package/packages/locale/lang/ug-CN.ts +3 -3
  130. package/packages/locale/lang/uk-UA.ts +3 -3
  131. package/packages/locale/lang/vi-VN.ts +3 -3
  132. package/packages/locale/lang/zh-CHT.ts +3 -3
  133. package/packages/locale/lang/zh-CN.ts +3 -3
  134. package/packages/table/module/custom/mixin.ts +2 -0
  135. package/packages/table/module/custom/panel.ts +458 -234
  136. package/packages/table/src/body.ts +2 -2
  137. package/packages/table/src/cell.ts +2 -2
  138. package/packages/table/src/column.ts +10 -8
  139. package/packages/table/src/group.ts +40 -6
  140. package/packages/table/src/methods.ts +182 -86
  141. package/packages/table/src/table.ts +1 -1
  142. package/packages/table/src/util.ts +0 -1
  143. package/packages/ui/src/dom.ts +2 -0
  144. package/styles/components/table-module/custom.scss +92 -12
  145. package/styles/components/table.scss +5 -0
  146. /package/es/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  147. /package/es/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  148. /package/es/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
  149. /package/lib/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  150. /package/lib/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  151. /package/lib/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
@@ -15,23 +15,73 @@ const {
15
15
  getIcon,
16
16
  renderEmptyElement
17
17
  } = _ui.VxeUI;
18
- function updateDropHint(_vm, evnt) {
18
+ function showDropTip(_vm, evnt, optEl, showLine, dragPos) {
19
19
  const {
20
- $refs
20
+ prevDragToChild
21
21
  } = _vm;
22
- const dragHintEl = $refs.dragHintElemRef;
23
- const bodyEl = $refs.bodyElemRef;
24
- if (!bodyEl) {
22
+ const el = _vm.$refs.bodyElemRef;
23
+ if (!el) {
25
24
  return;
26
25
  }
27
- if (dragHintEl) {
28
- const wrapperEl = bodyEl.parentNode;
29
- const wrapperRect = wrapperEl.getBoundingClientRect();
30
- dragHintEl.style.display = 'block';
31
- dragHintEl.style.top = `${Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
32
- dragHintEl.style.left = `${Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
26
+ const wrapperRect = el.getBoundingClientRect();
27
+ if (optEl) {
28
+ const dragLineEl = _vm.$refs.refDragLineElem;
29
+ if (dragLineEl) {
30
+ if (showLine) {
31
+ const optRect = optEl.getBoundingClientRect();
32
+ dragLineEl.style.display = 'block';
33
+ dragLineEl.style.top = `${Math.max(1, optRect.y - wrapperRect.y)}px`;
34
+ dragLineEl.style.height = `${optRect.height}px`;
35
+ dragLineEl.style.width = `${optRect.width}px`;
36
+ dragLineEl.setAttribute('drag-pos', dragPos);
37
+ dragLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
38
+ } else {
39
+ dragLineEl.style.display = '';
40
+ }
41
+ }
42
+ }
43
+ const dragTipEl = _vm.$refs.refDragTipElem;
44
+ if (dragTipEl) {
45
+ dragTipEl.style.display = 'block';
46
+ dragTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - dragTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
47
+ dragTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - dragTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
48
+ dragTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
49
+ }
50
+ }
51
+ function hideDropTip(_vm) {
52
+ const dragTipEl = _vm.$refs.refDragTipElem;
53
+ const dragLineEl = _vm.$refs.refDragLineElem;
54
+ if (dragTipEl) {
55
+ dragTipEl.style.display = '';
56
+ }
57
+ if (dragLineEl) {
58
+ dragLineEl.style.display = '';
33
59
  }
34
60
  }
61
+ const renderDragTip = (h, _vm) => {
62
+ const {
63
+ dragCol
64
+ } = _vm;
65
+ return h('div', {}, [h('div', {
66
+ ref: 'refDragLineElem',
67
+ class: 'vxe-table-custom-popup--drag-line'
68
+ }), h('div', {
69
+ ref: 'refDragTipElem',
70
+ class: 'vxe-table-custom-popup--drag-tip'
71
+ }, [h('div', {
72
+ class: 'vxe-table-custom-popup--drag-tip-wrapper'
73
+ }, [h('div', {
74
+ class: 'vxe-table-custom-popup--drag-tip-status'
75
+ }, [h('span', {
76
+ class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
77
+ }), h('span', {
78
+ class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
79
+ }), h('span', {
80
+ class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
81
+ })]), h('div', {
82
+ class: 'vxe-table--drag-tip-content'
83
+ }, getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']))])])]);
84
+ };
35
85
  const renderSimplePanel = (h, _vm) => {
36
86
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
37
87
  const props = _vm;
@@ -45,6 +95,10 @@ const renderSimplePanel = (h, _vm) => {
45
95
  customColumnList
46
96
  } = reactData;
47
97
  const customOpts = $xeTable.computeCustomOpts;
98
+ const {
99
+ immediate
100
+ } = customOpts;
101
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
48
102
  const {
49
103
  maxHeight
50
104
  } = customStore;
@@ -58,6 +112,9 @@ const renderSimplePanel = (h, _vm) => {
58
112
  placement
59
113
  } = customOpts;
60
114
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
115
+ const {
116
+ isCrossDrag
117
+ } = columnDragOpts;
61
118
  const slots = customOpts.slots || {};
62
119
  const headerSlot = slots.header;
63
120
  const topSlot = slots.top;
@@ -68,7 +125,6 @@ const renderSimplePanel = (h, _vm) => {
68
125
  const customWrapperOns = {};
69
126
  const isAllChecked = customStore.isAll;
70
127
  const isAllIndeterminate = customStore.isIndeterminate;
71
- const dragColumn = _vm.dragColumn;
72
128
  // hover 触发
73
129
  if (trigger === 'hover') {
74
130
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
@@ -127,16 +183,18 @@ const renderSimplePanel = (h, _vm) => {
127
183
  }
128
184
  }, [h('span', {
129
185
  class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
130
- })]) : renderEmptyElement($xeTable), allowSort && column.level === 1 ? h('div', {
186
+ })]) : renderEmptyElement($xeTable), h('div', {
187
+ class: 'vxe-table-custom--name-option'
188
+ }, [allowSort && ((isCrossDrag ? immediate : false) || column.level === 1) ? h('div', {
131
189
  class: 'vxe-table-custom--sort-option'
132
190
  }, [h('span', {
133
191
  class: ['vxe-table-custom--sort-btn', {
134
- 'is--disabled': isDisabled || isHidden
192
+ 'is--disabled': isDisabled || isHidden || column.renderFixed
135
193
  }],
136
194
  attrs: {
137
195
  title: getI18n('vxe.custom.setting.sortHelpTip')
138
196
  },
139
- on: isDisabled || isHidden ? {} : {
197
+ on: isDisabled || isHidden || column.renderFixed ? {} : {
140
198
  mousedown: _vm.sortMousedownEvent,
141
199
  mouseup: _vm.sortMouseupEvent
142
200
  }
@@ -154,7 +212,7 @@ const renderSimplePanel = (h, _vm) => {
154
212
  attrs: {
155
213
  title: colTitle
156
214
  }
157
- }, colTitle), !parent && allowFixed ? h('div', {
215
+ }, colTitle)]), !parent && allowFixed ? h('div', {
158
216
  class: 'vxe-table-custom--fixed-option'
159
217
  }, [h(VxeUIButtonComponent, {
160
218
  props: {
@@ -232,10 +290,7 @@ const renderSimplePanel = (h, _vm) => {
232
290
  on: customWrapperOns
233
291
  }, colVNs), bottomSlot ? h('div', {
234
292
  class: 'vxe-table-custom--panel-bottom'
235
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
236
- ref: 'dragHintElemRef',
237
- class: 'vxe-table-custom-popup--drag-hint'
238
- }, getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? h('div', {
293
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)]), customOpts.showFooter ? h('div', {
239
294
  class: 'vxe-table-custom--footer'
240
295
  }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
241
296
  class: 'vxe-table-custom--footer-buttons'
@@ -248,7 +303,7 @@ const renderSimplePanel = (h, _vm) => {
248
303
  on: {
249
304
  click: _vm.resetCustomEvent
250
305
  }
251
- }), customOpts.immediate ? h(VxeUIButtonComponent, {
306
+ }), immediate ? h(VxeUIButtonComponent, {
252
307
  props: {
253
308
  mode: 'text',
254
309
  content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
@@ -264,7 +319,7 @@ const renderSimplePanel = (h, _vm) => {
264
319
  on: {
265
320
  click: _vm.cancelCustomEvent
266
321
  }
267
- }), customOpts.immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
322
+ }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
268
323
  props: {
269
324
  mode: 'text',
270
325
  status: 'primary',
@@ -280,7 +335,6 @@ const renderPopupPanel = (h, _vm) => {
280
335
  const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
281
336
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
282
337
  const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeInput');
283
- const VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
284
338
  const $xeTableCustomPanel = _vm;
285
339
  const props = _vm;
286
340
  const $xeTable = _vm.$xeTable;
@@ -297,6 +351,10 @@ const renderPopupPanel = (h, _vm) => {
297
351
  customColumnList
298
352
  } = reactData;
299
353
  const customOpts = $xeTable.computeCustomOpts;
354
+ const {
355
+ immediate
356
+ } = customOpts;
357
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
300
358
  const {
301
359
  mode,
302
360
  modalOptions,
@@ -320,6 +378,9 @@ const renderPopupPanel = (h, _vm) => {
320
378
  const modalOpts = Object.assign({}, modalOptions);
321
379
  const drawerOpts = Object.assign({}, drawerOptions);
322
380
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
381
+ const {
382
+ isCrossDrag
383
+ } = columnDragOpts;
323
384
  const slots = customOpts.slots || {};
324
385
  const headerSlot = slots.header;
325
386
  const topSlot = slots.top;
@@ -329,7 +390,6 @@ const renderPopupPanel = (h, _vm) => {
329
390
  const trVNs = [];
330
391
  const isAllChecked = customStore.isAll;
331
392
  const isAllIndeterminate = customStore.isIndeterminate;
332
- const dragColumn = _vm.dragColumn;
333
393
  const params = {
334
394
  $table: $xeTable,
335
395
  $grid: $xeTable.xegrid,
@@ -402,40 +462,43 @@ const renderPopupPanel = (h, _vm) => {
402
462
  }
403
463
  }, [h('span', {
404
464
  class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
405
- })])]) : renderEmptyElement($xeTable), allowSort ? h('td', {
406
- class: 'vxe-table-custom-popup--column-item col--sort'
407
- }, [column.level === 1 ? h('span', {
465
+ })])]) : renderEmptyElement($xeTable), h('td', {
466
+ class: 'vxe-table-custom-popup--column-item col--name'
467
+ }, [h('div', {
468
+ class: 'vxe-table-custom-popup--name'
469
+ }, [allowSort ? (isCrossDrag ? immediate : false) || column.level === 1 ? h('div', {
408
470
  class: ['vxe-table-custom-popup--column-sort-btn', {
409
- 'is--disabled': isDisabled || isHidden
471
+ 'is--disabled': isDisabled || isHidden || column.renderFixed
410
472
  }],
411
473
  attrs: {
412
474
  title: getI18n('vxe.custom.setting.sortHelpTip')
413
475
  },
414
- on: isDisabled || isHidden ? {} : {
476
+ on: isDisabled || isHidden || column.renderFixed ? {} : {
415
477
  mousedown: _vm.sortMousedownEvent,
416
478
  mouseup: _vm.sortMouseupEvent
417
479
  }
418
480
  }, [h('i', {
419
481
  class: getIcon().TABLE_CUSTOM_SORT
420
- })]) : h('span', '-')]) : renderEmptyElement($xeTable), h('td', {
421
- class: 'vxe-table-custom-popup--column-item col--name'
422
- }, [column.type === 'html' ? h('div', {
482
+ })]) : h('div', {
483
+ class: 'vxe-table-custom-popup--column-sort-placeholder'
484
+ }) : renderEmptyElement($xeTable), column.type === 'html' ? h('div', {
423
485
  key: '1',
424
- class: 'vxe-table-custom-popup--name',
486
+ class: 'vxe-table-custom-popup--title',
425
487
  domProps: {
426
488
  innerHTML: colTitle
427
489
  }
428
490
  }) : h('div', {
429
491
  key: '0',
430
- class: 'vxe-table-custom-popup--name',
492
+ class: 'vxe-table-custom-popup--title',
431
493
  attrs: {
432
494
  title: colTitle
433
495
  }
434
- }, colTitle)]), allowResizable ? h('td', {
496
+ }, colTitle)])]), allowResizable ? h('td', {
435
497
  class: 'vxe-table-custom-popup--column-item col--resizable'
436
498
  }, [column.children && column.children.length || !(_xeUtils.default.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
437
499
  props: {
438
500
  type: 'integer',
501
+ immediate: false,
439
502
  disabled: isDisabled || isHidden,
440
503
  value: column.renderResizeWidth,
441
504
  min: customMinWidth || undefined,
@@ -444,6 +507,9 @@ const renderPopupPanel = (h, _vm) => {
444
507
  on: {
445
508
  modelValue(value) {
446
509
  column.renderResizeWidth = Math.max(0, Number(value));
510
+ },
511
+ change() {
512
+ _vm.changeColumnWidth(column);
447
513
  }
448
514
  }
449
515
  }) : renderEmptyElement($xeTableCustomPanel)]) : renderEmptyElement($xeTable), allowFixed ? h('td', {
@@ -470,7 +536,7 @@ const renderPopupPanel = (h, _vm) => {
470
536
  },
471
537
  on: {
472
538
  input(value) {
473
- column.renderFixed = value;
539
+ _vm.changeFixedOption(column, value);
474
540
  }
475
541
  }
476
542
  })]) : renderEmptyElement($xeTable)]));
@@ -490,8 +556,6 @@ const renderPopupPanel = (h, _vm) => {
490
556
  class: 'vxe-table-custom-popup--table-wrapper'
491
557
  }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
492
558
  class: 'vxe-table-custom-popup--table-col-seq'
493
- }) : renderEmptyElement($xeTable), allowSort ? h('col', {
494
- class: 'vxe-table-custom-popup--table-col-sort'
495
559
  }) : renderEmptyElement($xeTable), h('col', {
496
560
  class: 'vxe-table-custom-popup--table-col-title'
497
561
  }), allowResizable ? h('col', {
@@ -513,22 +577,7 @@ const renderPopupPanel = (h, _vm) => {
513
577
  class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
514
578
  }), h('span', {
515
579
  class: 'vxe-checkbox--label'
516
- }, getI18n('vxe.toolbar.customAll'))])]) : renderEmptyElement($xeTable), allowSort ? h('th', {}, [h('span', {
517
- class: 'vxe-table-custom-popup--table-sort-help-title'
518
- }, getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
519
- props: {
520
- enterable: true,
521
- content: getI18n('vxe.custom.setting.sortHelpTip'),
522
- popupClassName: 'vxe-table--ignore-clear'
523
- },
524
- scopedSlots: {
525
- default: () => {
526
- return h('i', {
527
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
528
- });
529
- }
530
- }
531
- }) : renderEmptyElement($xeTableCustomPanel)]) : renderEmptyElement($xeTable), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : renderEmptyElement($xeTable), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : renderEmptyElement($xeTable)])]), h('transition-group', {
580
+ }, getI18n('vxe.toolbar.customAll'))])]) : renderEmptyElement($xeTable), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : renderEmptyElement($xeTable), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : renderEmptyElement($xeTable)])]), h('transition-group', {
532
581
  class: 'vxe-table-custom--panel-list',
533
582
  props: {
534
583
  tag: 'tbody',
@@ -536,10 +585,7 @@ const renderPopupPanel = (h, _vm) => {
536
585
  }
537
586
  }, trVNs)])]), bottomSlot ? h('div', {
538
587
  class: 'vxe-table-custom-popup--table-bottom'
539
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
540
- ref: 'dragHintElemRef',
541
- class: 'vxe-table-custom-popup--drag-hint'
542
- }, getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))]);
588
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)]);
543
589
  },
544
590
  footer: () => {
545
591
  if (footerSlot) {
@@ -555,14 +601,21 @@ const renderPopupPanel = (h, _vm) => {
555
601
  on: {
556
602
  click: _vm.resetCustomEvent
557
603
  }
558
- }), h(VxeUIButtonComponent, {
604
+ }), immediate ? h(VxeUIButtonComponent, {
605
+ props: {
606
+ content: customOpts.resetButtonText || getI18n('vxe.custom.customClose')
607
+ },
608
+ on: {
609
+ click: _vm.cancelCloseEvent
610
+ }
611
+ }) : h(VxeUIButtonComponent, {
559
612
  props: {
560
613
  content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
561
614
  },
562
615
  on: {
563
616
  click: _vm.cancelCustomEvent
564
617
  }
565
- }), h(VxeUIButtonComponent, {
618
+ }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
566
619
  props: {
567
620
  status: 'primary',
568
621
  content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
@@ -646,7 +699,9 @@ var _default = exports.default = {
646
699
  },
647
700
  data() {
648
701
  return {
649
- dragColumn: null
702
+ prevDragCol: undefined,
703
+ prevDragToChild: false,
704
+ prevDragPos: null
650
705
  };
651
706
  },
652
707
  computed: {},
@@ -656,7 +711,6 @@ var _default = exports.default = {
656
711
  const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
657
712
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
658
713
  const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeNumberInput');
659
- const VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
660
714
  const VxeUIRadioGroupComponent = _ui.VxeUI.getComponent('VxeRadioGroup');
661
715
  this.$nextTick(() => {
662
716
  const {
@@ -680,9 +734,6 @@ var _default = exports.default = {
680
734
  if (!VxeUINumberInputComponent) {
681
735
  (0, _log.errLog)('vxe.error.reqComp', ['vxe-input']);
682
736
  }
683
- if (!VxeUITooltipComponent) {
684
- (0, _log.errLog)('vxe.error.reqComp', ['vxe-tooltip']);
685
- }
686
737
  if (!VxeUIRadioGroupComponent) {
687
738
  (0, _log.errLog)('vxe.error.reqComp', ['vxe-radio-group']);
688
739
  }
@@ -729,6 +780,8 @@ var _default = exports.default = {
729
780
  $event
730
781
  }) {
731
782
  const $xeTable = this.$xeTable;
783
+ const reactData = $xeTable;
784
+ reactData.isCustomStatus = true;
732
785
  $xeTable.saveCustom();
733
786
  $xeTable.closeCustom();
734
787
  $xeTable.emitCustomEvent('confirm', $event);
@@ -806,12 +859,11 @@ var _default = exports.default = {
806
859
  }
807
860
  },
808
861
  changeCheckboxOption(column) {
809
- const {
810
- $xetable
811
- } = this;
862
+ const $xeTable = this.$xetable;
863
+ const reactData = $xeTable;
812
864
  const {
813
865
  customOpts
814
- } = $xetable;
866
+ } = $xeTable.customOpts;
815
867
  const isChecked = !column.renderVisible;
816
868
  if (customOpts.immediate) {
817
869
  _xeUtils.default.eachTree([column], item => {
@@ -819,8 +871,9 @@ var _default = exports.default = {
819
871
  item.renderVisible = isChecked;
820
872
  item.halfVisible = false;
821
873
  });
822
- $xetable.handleCustom();
823
- $xetable.saveCustomStore('update:visible');
874
+ reactData.isCustomStatus = true;
875
+ $xeTable.handleCustom();
876
+ $xeTable.saveCustomStore('update:visible');
824
877
  } else {
825
878
  _xeUtils.default.eachTree([column], item => {
826
879
  item.renderVisible = isChecked;
@@ -828,16 +881,27 @@ var _default = exports.default = {
828
881
  });
829
882
  }
830
883
  this.handleOptionCheck(column);
831
- $xetable.checkCustomStatus();
884
+ $xeTable.checkCustomStatus();
885
+ },
886
+ changeColumnWidth(column) {
887
+ const $xeTable = this.$xetable;
888
+ const reactData = $xeTable;
889
+ const customOpts = $xeTable.computeCustomOpts;
890
+ if (customOpts.immediate) {
891
+ if (column.renderResizeWidth !== column.renderWidth) {
892
+ column.resizeWidth = column.renderResizeWidth;
893
+ column.renderWidth = column.renderResizeWidth;
894
+ reactData.isCustomStatus = true;
895
+ $xeTable.handleCustom();
896
+ $xeTable.saveCustomStore('update:width');
897
+ }
898
+ }
832
899
  },
833
900
  changeFixedOption(column, colFixed) {
834
- const {
835
- $xetable
836
- } = this;
837
- const {
838
- isMaxFixedColumn,
839
- customOpts
840
- } = $xetable;
901
+ const $xeTable = this.$xetable;
902
+ const reactData = $xeTable;
903
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
904
+ const customOpts = $xeTable.computeCustomOpts;
841
905
  if (customOpts.immediate) {
842
906
  if (column.renderFixed === colFixed) {
843
907
  _xeUtils.default.eachTree([column], col => {
@@ -852,8 +916,9 @@ var _default = exports.default = {
852
916
  });
853
917
  }
854
918
  }
855
- $xetable.handleCustom();
856
- $xetable.saveCustomStore('update:fixed');
919
+ reactData.isCustomStatus = true;
920
+ $xeTable.handleCustom();
921
+ $xeTable.saveCustomStore('update:fixed');
857
922
  } else {
858
923
  if (column.renderFixed === colFixed) {
859
924
  _xeUtils.default.eachTree([column], col => {
@@ -875,113 +940,261 @@ var _default = exports.default = {
875
940
  $xetable.toggleCustomAllCheckbox();
876
941
  },
877
942
  sortMousedownEvent(evnt) {
878
- const {
879
- $xetable
880
- } = this;
943
+ const $xeTable = this.$xetable;
881
944
  const btnEl = evnt.currentTarget;
882
- const tdEl = btnEl.parentNode;
883
- const trEl = tdEl.parentNode;
945
+ const cellEl = btnEl.parentElement;
946
+ const tdEl = cellEl.parentElement;
947
+ const trEl = tdEl.parentElement;
884
948
  const colid = trEl.getAttribute('colid');
885
- const column = $xetable.getColumnById(colid);
949
+ const column = $xeTable.getColumnById(colid);
886
950
  trEl.draggable = true;
887
- this.dragColumn = column;
951
+ this.dragCol = column;
888
952
  (0, _dom.addClass)(trEl, 'active--drag-origin');
889
- updateDropHint(this, evnt);
890
953
  },
891
954
  sortMouseupEvent(evnt) {
892
955
  const btnEl = evnt.currentTarget;
893
- const tdEl = btnEl.parentNode;
894
- const trEl = tdEl.parentNode;
895
- const dragHintEl = this.$refs.dragHintElemRef;
956
+ const cellEl = btnEl.parentElement;
957
+ const tdEl = cellEl.parentElement;
958
+ const trEl = tdEl.parentElement;
959
+ hideDropTip(this);
896
960
  trEl.draggable = false;
897
- this.dragColumn = null;
961
+ this.dragCol = null;
898
962
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
899
- if (dragHintEl) {
900
- dragHintEl.style.display = '';
901
- }
902
963
  },
903
964
  sortDragstartEvent(evnt) {
904
- const img = new Image();
905
965
  if (evnt.dataTransfer) {
966
+ const img = new Image();
967
+ img.src = _dom.tpImg;
906
968
  evnt.dataTransfer.setDragImage(img, 0, 0);
907
969
  }
908
970
  },
909
971
  sortDragendEvent(evnt) {
972
+ const $xeTable = this.$xetable;
973
+ const tableProps = $xeTable;
974
+ const reactData = $xeTable;
975
+ const internalData = $xeTable;
910
976
  const {
911
- $xetable,
912
- prevDropTrEl
977
+ dragCol,
978
+ prevDragPos,
979
+ prevDragCol,
980
+ prevDragToChild
913
981
  } = this;
914
982
  const {
915
- customColumnList,
916
- customOpts
917
- } = $xetable;
983
+ mouseConfig
984
+ } = tableProps;
985
+ const {
986
+ customColumnList
987
+ } = reactData;
988
+ const {
989
+ collectColumn
990
+ } = internalData;
991
+ const customOpts = $xeTable.computeCustomOpts;
992
+ const {
993
+ immediate
994
+ } = customOpts;
918
995
  const trEl = evnt.currentTarget;
919
- const dragHintEl = this.$refs.dragHintElemRef;
920
- if (prevDropTrEl) {
996
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
997
+ const {
998
+ isCrossDrag,
999
+ isSelfToChildDrag,
1000
+ isToChildDrag,
1001
+ dragEndMethod
1002
+ } = columnDragOpts;
1003
+ const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
1004
+ if (prevDragCol && dragCol) {
921
1005
  // 判断是否有拖动
922
- if (prevDropTrEl !== trEl) {
923
- const dragOffset = prevDropTrEl.getAttribute('drag-pos');
924
- const colid = trEl.getAttribute('colid');
925
- const column = $xetable.getColumnById(colid);
926
- if (!column) {
927
- return;
928
- }
929
- const cIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === column.id);
930
- const targetColid = prevDropTrEl.getAttribute('colid');
931
- const targetColumn = $xetable.getColumnById(targetColid);
932
- if (!targetColumn) {
933
- return;
934
- }
935
- // 移出源位置
936
- customColumnList.splice(cIndex, 1);
937
- const tcIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === targetColumn.id);
938
- // 插新位置
939
- customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column);
940
- }
941
- prevDropTrEl.draggable = false;
942
- prevDropTrEl.removeAttribute('drag-pos');
943
- (0, _dom.removeClass)(prevDropTrEl, 'active--drag-target');
1006
+ if (prevDragCol !== dragCol) {
1007
+ const oldColumn = dragCol;
1008
+ const newColumn = prevDragCol;
1009
+ Promise.resolve(dragEndMethod ? dragEndMethod({
1010
+ oldColumn,
1011
+ newColumn,
1012
+ dragPos: prevDragPos,
1013
+ offsetIndex: dragOffsetIndex
1014
+ }) : true).then(status => {
1015
+ if (!status) {
1016
+ return;
1017
+ }
1018
+ let oafIndex = -1;
1019
+ let nafIndex = -1;
1020
+ const oldAllMaps = {};
1021
+ _xeUtils.default.eachTree([oldColumn], column => {
1022
+ oldAllMaps[column.id] = column;
1023
+ });
1024
+ let isSelfToChildStatus = false;
1025
+ // 只有实时拖拽支持跨层级
1026
+ if (immediate) {
1027
+ if (oldColumn.parentId && newColumn.parentId) {
1028
+ // 子到子
1029
+ if (!isCrossDrag) {
1030
+ return;
1031
+ }
1032
+ if (oldAllMaps[newColumn.id]) {
1033
+ isSelfToChildStatus = true;
1034
+ if (!isSelfToChildDrag) {
1035
+ if (_ui.VxeUI.modal) {
1036
+ _ui.VxeUI.modal.message({
1037
+ status: 'error',
1038
+ content: getI18n('vxe.error.treeDragChild')
1039
+ });
1040
+ }
1041
+ return;
1042
+ }
1043
+ }
1044
+ } else if (oldColumn.parentId) {
1045
+ // 子到根
1046
+ if (!isCrossDrag) {
1047
+ return;
1048
+ }
1049
+ } else if (newColumn.parentId) {
1050
+ // 根到子
1051
+ if (!isCrossDrag) {
1052
+ return;
1053
+ }
1054
+ if (oldAllMaps[newColumn.id]) {
1055
+ isSelfToChildStatus = true;
1056
+ if (!isSelfToChildDrag) {
1057
+ if (_ui.VxeUI.modal) {
1058
+ _ui.VxeUI.modal.message({
1059
+ status: 'error',
1060
+ content: getI18n('vxe.error.treeDragChild')
1061
+ });
1062
+ }
1063
+ return;
1064
+ }
1065
+ }
1066
+ } else {
1067
+ // 根到根
1068
+ }
1069
+ const oldewMatchRest = _xeUtils.default.findTree(collectColumn, item => item.id === oldColumn.id);
1070
+ // 改变层级
1071
+ if (isSelfToChildStatus && isSelfToChildDrag) {
1072
+ if (oldewMatchRest) {
1073
+ const {
1074
+ items: oCols,
1075
+ index: oIndex
1076
+ } = oldewMatchRest;
1077
+ const childList = oldColumn.children || [];
1078
+ childList.forEach(column => {
1079
+ column.parentId = oldColumn.parentId;
1080
+ });
1081
+ oCols.splice(oIndex, 1, ...childList);
1082
+ oldColumn.children = [];
1083
+ }
1084
+ } else {
1085
+ if (oldewMatchRest) {
1086
+ const {
1087
+ items: oCols,
1088
+ index: oIndex,
1089
+ parent: oParent
1090
+ } = oldewMatchRest;
1091
+ oCols.splice(oIndex, 1);
1092
+ if (!oParent) {
1093
+ oafIndex = oIndex;
1094
+ }
1095
+ }
1096
+ }
1097
+ const newMatchRest = _xeUtils.default.findTree(collectColumn, item => item.id === newColumn.id);
1098
+ if (newMatchRest) {
1099
+ const {
1100
+ items: nCols,
1101
+ index: nIndex,
1102
+ parent: nParent
1103
+ } = newMatchRest;
1104
+ // 转子级
1105
+ if (isToChildDrag && prevDragToChild) {
1106
+ oldColumn.parentId = newColumn.id;
1107
+ newColumn.children = (newColumn.children || []).concat([oldColumn]);
1108
+ } else {
1109
+ oldColumn.parentId = newColumn.parentId;
1110
+ nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn);
1111
+ }
1112
+ if (!nParent) {
1113
+ nafIndex = nIndex;
1114
+ }
1115
+ }
1116
+ _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parent) => {
1117
+ if (!parent) {
1118
+ const sortIndex = index + 1;
1119
+ column.renderSortNumber = sortIndex;
1120
+ }
1121
+ });
1122
+ } else {
1123
+ oafIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === oldColumn.id);
1124
+ customColumnList.splice(oafIndex, 1);
1125
+ nafIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === newColumn.id);
1126
+ customColumnList.splice(nafIndex + dragOffsetIndex, 0, oldColumn);
1127
+ }
1128
+ reactData.isDragColMove = true;
1129
+ if (mouseConfig) {
1130
+ if ($xeTable.clearSelected) {
1131
+ $xeTable.clearSelected();
1132
+ }
1133
+ if ($xeTable.clearCellAreas) {
1134
+ $xeTable.clearCellAreas();
1135
+ $xeTable.clearCopyCellArea();
1136
+ }
1137
+ }
1138
+ $xeTable.dispatchEvent('column-dragend', {
1139
+ oldColumn,
1140
+ newColumn,
1141
+ dragPos: prevDragPos,
1142
+ offsetIndex: dragOffsetIndex,
1143
+ _index: {
1144
+ newIndex: nafIndex,
1145
+ oldIndex: oafIndex
1146
+ }
1147
+ }, evnt);
1148
+ if (immediate) {
1149
+ reactData.customColumnList = collectColumn.slice(0);
1150
+ $xeTable.refreshColumn(true).then(() => {
1151
+ $xeTable.updateCellAreas();
1152
+ $xeTable.handleCustom();
1153
+ $xeTable.saveCustomStore('update:sort');
1154
+ });
1155
+ }
1156
+ }).catch(() => {});
1157
+ }
944
1158
  }
945
- this.dragColumn = null;
1159
+ hideDropTip(this);
1160
+ this.dragCol.value = null;
946
1161
  trEl.draggable = false;
947
1162
  trEl.removeAttribute('drag-pos');
948
- if (dragHintEl) {
949
- dragHintEl.style.display = '';
950
- }
951
1163
  (0, _dom.removeClass)(trEl, 'active--drag-target');
952
1164
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
953
- if (customOpts.immediate) {
954
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
955
- if (!parent) {
956
- const sortIndex = index + 1;
957
- column.renderSortNumber = sortIndex;
958
- }
959
- });
960
- $xetable.handleCustom();
961
- $xetable.saveCustomStore('update:sort');
962
- }
963
1165
  },
964
1166
  sortDragoverEvent(evnt) {
1167
+ const $xeTable = this.$xetable;
965
1168
  const {
966
- $xetable,
967
- prevDropTrEl
1169
+ dragCol
968
1170
  } = this;
969
- const trEl = evnt.currentTarget;
970
- if (prevDropTrEl !== trEl) {
971
- (0, _dom.removeClass)(prevDropTrEl, 'active--drag-target');
972
- }
973
- const colid = trEl.getAttribute('colid');
974
- const column = $xetable.getColumnById(colid);
975
- // 是否移入有效元行
976
- if (column && column.level === 1) {
1171
+ const customOpts = $xeTable.computeCustomOpts;
1172
+ const {
1173
+ immediate
1174
+ } = customOpts;
1175
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
1176
+ const {
1177
+ isCrossDrag,
1178
+ isToChildDrag
1179
+ } = columnDragOpts;
1180
+ const optEl = evnt.currentTarget;
1181
+ const hasCtrlKey = evnt.ctrlKey;
1182
+ const colid = optEl.getAttribute('colid');
1183
+ const column = $xeTable.getColumnById(colid);
1184
+ // 是否移入有效列
1185
+ if (column && (isCrossDrag || column.level === 1)) {
977
1186
  evnt.preventDefault();
978
- const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
979
- const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
980
- (0, _dom.addClass)(trEl, 'active--drag-target');
981
- trEl.setAttribute('drag-pos', dragOffset);
982
- this.prevDropTrEl = trEl;
1187
+ const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
1188
+ const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
1189
+ if (dragCol && dragCol.id === column.id || !isCrossDrag && column.level === 1 || !immediate && column.level > 1 || column.renderFixed) {
1190
+ showDropTip(this, evnt, optEl, false, dragPos);
1191
+ return;
1192
+ }
1193
+ this.prevDragToChild = !!(isToChildDrag && hasCtrlKey && immediate);
1194
+ this.prevDragCol = column;
1195
+ this.prevDragPos = dragPos;
1196
+ showDropTip(this, evnt, optEl, true, dragPos);
983
1197
  }
984
- updateDropHint(this, evnt);
985
1198
  }
986
1199
  }
987
1200
  };