vxe-table 3.15.43 → 3.15.45

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 (66) hide show
  1. package/es/{iconfont.1750301122777.ttf → iconfont.1750641764687.ttf} +0 -0
  2. package/es/iconfont.1750641764687.woff +0 -0
  3. package/es/iconfont.1750641764687.woff2 +0 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/module/custom/mixin.js +9 -0
  9. package/es/table/module/custom/panel.js +395 -300
  10. package/es/table/module/edit/mixin.js +27 -10
  11. package/es/table/module/export/mixin.js +19 -6
  12. package/es/table/src/cell.js +4 -4
  13. package/es/table/src/methods.js +23 -7
  14. package/es/table/style.css +37 -9
  15. package/es/table/style.min.css +1 -1
  16. package/es/ui/index.js +7 -3
  17. package/es/ui/src/log.js +1 -1
  18. package/es/vxe-table/style.css +37 -9
  19. package/es/vxe-table/style.min.css +1 -1
  20. package/lib/{iconfont.1750301122777.ttf → iconfont.1750641764687.ttf} +0 -0
  21. package/lib/iconfont.1750641764687.woff +0 -0
  22. package/lib/iconfont.1750641764687.woff2 +0 -0
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +355 -151
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/module/custom/mixin.js +11 -0
  30. package/lib/table/module/custom/mixin.min.js +1 -1
  31. package/lib/table/module/custom/panel.js +234 -122
  32. package/lib/table/module/custom/panel.min.js +1 -1
  33. package/lib/table/module/edit/mixin.js +49 -10
  34. package/lib/table/module/edit/mixin.min.js +1 -1
  35. package/lib/table/module/export/mixin.js +19 -4
  36. package/lib/table/module/export/mixin.min.js +1 -1
  37. package/lib/table/src/cell.js +4 -4
  38. package/lib/table/src/cell.min.js +1 -1
  39. package/lib/table/src/methods.js +30 -7
  40. package/lib/table/src/methods.min.js +1 -1
  41. package/lib/table/style/style.css +37 -9
  42. package/lib/table/style/style.min.css +1 -1
  43. package/lib/ui/index.js +7 -3
  44. package/lib/ui/index.min.js +1 -1
  45. package/lib/ui/src/log.js +1 -1
  46. package/lib/ui/src/log.min.js +1 -1
  47. package/lib/vxe-table/style/style.css +37 -9
  48. package/lib/vxe-table/style/style.min.css +1 -1
  49. package/package.json +1 -1
  50. package/packages/table/module/custom/mixin.ts +10 -0
  51. package/packages/table/module/custom/panel.ts +413 -313
  52. package/packages/table/module/edit/mixin.ts +28 -10
  53. package/packages/table/module/export/mixin.ts +18 -6
  54. package/packages/table/src/cell.ts +4 -4
  55. package/packages/table/src/methods.ts +26 -7
  56. package/packages/ui/index.ts +6 -2
  57. package/styles/components/icon.scss +9 -1
  58. package/styles/components/table-module/custom.scss +26 -3
  59. package/styles/helpers/baseMixin.scss +16 -2
  60. package/styles/icon/iconfont.ttf +0 -0
  61. package/styles/icon/iconfont.woff +0 -0
  62. package/styles/icon/iconfont.woff2 +0 -0
  63. package/es/iconfont.1750301122777.woff +0 -0
  64. package/es/iconfont.1750301122777.woff2 +0 -0
  65. package/lib/iconfont.1750301122777.woff +0 -0
  66. package/lib/iconfont.1750301122777.woff2 +0 -0
@@ -15,22 +15,29 @@ const {
15
15
  getIcon,
16
16
  renderEmptyElement
17
17
  } = _ui.VxeUI;
18
- function showDropTip(_vm, evnt, optEl, showLine, dragPos) {
19
- const {
20
- prevDragToChild
21
- } = _vm;
22
- const el = _vm.$refs.bodyElemRef;
23
- if (!el) {
18
+ function showDropTip($xeTableCustomPanel, evnt, optEl, showLine, dragPos) {
19
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
20
+ const bodyWrapperElem = $xeTableCustomPanel.$refs.refBodyWrapperElem;
21
+ if (!bodyWrapperElem) {
22
+ return;
23
+ }
24
+ const customBodyElem = $xeTableCustomPanel.$refs.refCustomBodyElem;
25
+ if (!customBodyElem) {
24
26
  return;
25
27
  }
26
- const wrapperRect = el.getBoundingClientRect();
28
+ const {
29
+ prevDragToChild
30
+ } = customPanelInternalData;
31
+ const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
32
+ const customBodyRect = customBodyElem.getBoundingClientRect();
27
33
  if (optEl) {
28
- const dragLineEl = _vm.$refs.refDragLineElem;
34
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
29
35
  if (dragLineEl) {
30
36
  if (showLine) {
31
37
  const optRect = optEl.getBoundingClientRect();
32
38
  dragLineEl.style.display = 'block';
33
- dragLineEl.style.top = `${Math.max(1, optRect.y + el.scrollTop - wrapperRect.y)}px`;
39
+ dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`;
40
+ dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
34
41
  dragLineEl.style.height = `${optRect.height}px`;
35
42
  dragLineEl.style.width = `${optRect.width}px`;
36
43
  dragLineEl.setAttribute('drag-pos', dragPos);
@@ -40,17 +47,17 @@ function showDropTip(_vm, evnt, optEl, showLine, dragPos) {
40
47
  }
41
48
  }
42
49
  }
43
- const dragTipEl = _vm.$refs.refDragTipElem;
50
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
44
51
  if (dragTipEl) {
45
52
  dragTipEl.style.display = 'block';
46
- dragTipEl.style.top = `${Math.min(el.clientHeight + el.scrollTop - dragTipEl.clientHeight, evnt.clientY + el.scrollTop - wrapperRect.y)}px`;
47
- dragTipEl.style.left = `${Math.min(el.clientWidth + el.scrollLeft - dragTipEl.clientWidth, evnt.clientX + el.scrollLeft - wrapperRect.x)}px`;
53
+ dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
54
+ dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`;
48
55
  dragTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
49
56
  }
50
57
  }
51
- function hideDropTip(_vm) {
52
- const dragTipEl = _vm.$refs.refDragTipElem;
53
- const dragLineEl = _vm.$refs.refDragLineElem;
58
+ function hideDropTip($xeTableCustomPanel) {
59
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
60
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
54
61
  if (dragTipEl) {
55
62
  dragTipEl.style.display = '';
56
63
  }
@@ -58,9 +65,12 @@ function hideDropTip(_vm) {
58
65
  dragLineEl.style.display = '';
59
66
  }
60
67
  }
61
- const renderDragTip = (h, _vm) => {
62
- const $xeTable = _vm.$xeTable;
63
- const dragCol = $xeTable.dragColumnRef;
68
+ const renderDragTip = (h, $xeTableCustomPanel) => {
69
+ const $xeTable = $xeTableCustomPanel.$xeTable;
70
+ const customPanelReactData = $xeTableCustomPanel.reactData;
71
+ const {
72
+ dragTipText
73
+ } = customPanelReactData;
64
74
  const columnDragOpts = $xeTable.computeColumnDragOpts;
65
75
  return h('div', {}, [h('div', {
66
76
  ref: 'refDragLineElem',
@@ -78,18 +88,22 @@ const renderDragTip = (h, _vm) => {
78
88
  class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
79
89
  }), h('span', {
80
90
  class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
91
+ }), h('span', {
92
+ class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
93
+ }), h('span', {
94
+ class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
81
95
  }), h('span', {
82
96
  class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
83
97
  })]), h('div', {
84
98
  class: 'vxe-table-custom-popup--drag-tip-content'
85
- }, getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']))])])]);
99
+ }, `${dragTipText || ''}`)])])]);
86
100
  };
87
101
  const renderSimplePanel = (h, _vm) => {
88
102
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
89
103
  const props = _vm;
90
104
  const $xeTable = _vm.$xeTable;
91
105
  const tableProps = $xeTable;
92
- const reactData = $xeTable;
106
+ const tableReactData = $xeTable;
93
107
  const $xeGrid = $xeTable.$xeGrid;
94
108
  const {
95
109
  customStore
@@ -102,7 +116,7 @@ const renderSimplePanel = (h, _vm) => {
102
116
  const {
103
117
  isCustomStatus,
104
118
  customColumnList
105
- } = reactData;
119
+ } = tableReactData;
106
120
  const customOpts = $xeTable.computeCustomOpts;
107
121
  const {
108
122
  immediate
@@ -186,9 +200,9 @@ const renderSimplePanel = (h, _vm) => {
186
200
  title: getI18n('vxe.custom.setting.colVisible')
187
201
  },
188
202
  on: {
189
- click: () => {
203
+ click: evnt => {
190
204
  if (!isDisabled) {
191
- _vm.changeCheckboxOption(column);
205
+ _vm.changeCheckboxOption(column, evnt);
192
206
  }
193
207
  }
194
208
  }
@@ -234,8 +248,10 @@ const renderSimplePanel = (h, _vm) => {
234
248
  title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
235
249
  },
236
250
  on: {
237
- click: () => {
238
- _vm.changeFixedOption(column, 'left');
251
+ click: ({
252
+ $event
253
+ }) => {
254
+ _vm.changeFixedOption(column, 'left', $event);
239
255
  }
240
256
  }
241
257
  }), h(VxeUIButtonComponent, {
@@ -247,8 +263,10 @@ const renderSimplePanel = (h, _vm) => {
247
263
  title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
248
264
  },
249
265
  on: {
250
- click: () => {
251
- _vm.changeFixedOption(column, 'right');
266
+ click: ({
267
+ $event
268
+ }) => {
269
+ _vm.changeFixedOption(column, 'right', $event);
252
270
  }
253
271
  }
254
272
  })]) : renderEmptyElement($xeTable)]));
@@ -262,11 +280,15 @@ const renderSimplePanel = (h, _vm) => {
262
280
  style: maxHeight && !['left', 'right'].includes(placement || '') ? {
263
281
  maxHeight: `${maxHeight}px`
264
282
  } : {}
265
- }, customStore.visible ? [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
283
+ }, customStore.visible ? [h('div', {
284
+ ref: 'refBodyWrapperElem',
285
+ class: 'vxe-table-custom-body-wrapper'
286
+ }, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
266
287
  props: {
267
288
  customStore
268
289
  }
269
290
  }) : renderEmptyElement($xeTable), h('div', {
291
+ ref: 'refCustomBodyElem',
270
292
  class: 'vxe-table-custom--handle-wrapper'
271
293
  }, [h('div', {
272
294
  class: 'vxe-table-custom--header'
@@ -292,7 +314,6 @@ const renderSimplePanel = (h, _vm) => {
292
314
  }, getI18n('vxe.toolbar.customAll'))]) : h('span', {
293
315
  class: 'vxe-checkbox--label'
294
316
  }, getI18n('vxe.table.customTitle'))])])]), h('div', {
295
- ref: 'bodyElemRef',
296
317
  class: 'vxe-table-custom--body'
297
318
  }, [topSlot ? h('div', {
298
319
  class: 'vxe-table-custom--panel-top'
@@ -307,7 +328,7 @@ const renderSimplePanel = (h, _vm) => {
307
328
  on: customWrapperOns
308
329
  }, colVNs), bottomSlot ? h('div', {
309
330
  class: 'vxe-table-custom--panel-bottom'
310
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)]), customOpts.showFooter ? h('div', {
331
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable)]), customOpts.showFooter ? h('div', {
311
332
  class: 'vxe-table-custom--footer'
312
333
  }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
313
334
  class: 'vxe-table-custom--footer-buttons'
@@ -345,18 +366,18 @@ const renderSimplePanel = (h, _vm) => {
345
366
  on: {
346
367
  click: _vm.confirmCustomEvent
347
368
  }
348
- })])]) : null])] : []);
369
+ })])]) : null]), renderDragTip(h, _vm)])] : []);
349
370
  };
350
- const renderPopupPanel = (h, _vm) => {
371
+ const renderPopupPanel = (h, $xeTableCustomPanel) => {
351
372
  const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
352
373
  const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
353
374
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
354
375
  const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeInput');
355
- const $xeTableCustomPanel = _vm;
356
- const props = _vm;
357
- const $xeTable = _vm.$xeTable;
376
+ const _vm = $xeTableCustomPanel;
377
+ const props = $xeTableCustomPanel;
378
+ const $xeTable = $xeTableCustomPanel.$xeTable;
358
379
  const tableProps = $xeTable;
359
- const reactData = $xeTable;
380
+ const tableReactData = $xeTable;
360
381
  const $xeGrid = $xeTable.$xeGrid;
361
382
  const {
362
383
  customStore
@@ -367,7 +388,7 @@ const renderPopupPanel = (h, _vm) => {
367
388
  const {
368
389
  isCustomStatus,
369
390
  customColumnList
370
- } = reactData;
391
+ } = tableReactData;
371
392
  const customOpts = $xeTable.computeCustomOpts;
372
393
  const {
373
394
  immediate
@@ -474,9 +495,9 @@ const renderPopupPanel = (h, _vm) => {
474
495
  title: getI18n('vxe.custom.setting.colVisible')
475
496
  },
476
497
  on: {
477
- click: () => {
498
+ click: evnt => {
478
499
  if (!isDisabled) {
479
- _vm.changeCheckboxOption(column);
500
+ _vm.changeCheckboxOption(column, evnt);
480
501
  }
481
502
  }
482
503
  }
@@ -555,8 +576,11 @@ const renderPopupPanel = (h, _vm) => {
555
576
  }]
556
577
  },
557
578
  on: {
558
- input(value) {
559
- _vm.changeFixedOption(column, value);
579
+ change({
580
+ label,
581
+ $event
582
+ }) {
583
+ _vm.changeFixedOption(column, label, $event);
560
584
  }
561
585
  }
562
586
  })]) : renderEmptyElement($xeTable)]));
@@ -564,12 +588,12 @@ const renderPopupPanel = (h, _vm) => {
564
588
  });
565
589
  const scopedSlots = {
566
590
  default: () => {
567
- if (defaultSlot) {
568
- return $xeTable.callSlot(defaultSlot, params, h);
569
- }
570
591
  return h('div', {
571
- ref: 'bodyElemRef',
572
- class: 'vxe-table-custom-popup--body'
592
+ ref: 'refBodyWrapperElem',
593
+ class: 'vxe-table-custom-popup--body-wrapper'
594
+ }, defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [h('div', {
595
+ ref: 'refCustomBodyElem',
596
+ class: 'vxe-table-custom-popup--handle-wrapper'
573
597
  }, [topSlot ? h('div', {
574
598
  class: 'vxe-table-custom-popup--table-top'
575
599
  }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
@@ -605,7 +629,7 @@ const renderPopupPanel = (h, _vm) => {
605
629
  }
606
630
  }, trVNs)])]), bottomSlot ? h('div', {
607
631
  class: 'vxe-table-custom-popup--table-bottom'
608
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)]);
632
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)])]);
609
633
  },
610
634
  footer: () => {
611
635
  if (footerSlot) {
@@ -709,27 +733,44 @@ var _default = exports.default = {
709
733
  default: () => ({})
710
734
  }
711
735
  },
736
+ provide() {
737
+ const $xeTableCustomPanel = this;
738
+ return {
739
+ $xeTableCustomPanel
740
+ };
741
+ },
712
742
  inject: {
713
743
  $xeTable: {
714
744
  default: null
715
745
  }
716
746
  },
717
747
  data() {
748
+ const reactData = {
749
+ dragCol: null,
750
+ dragGroup: null,
751
+ dragValues: null,
752
+ dragTipText: ''
753
+ };
754
+ const internalData = {
755
+ // prevDragCol: undefined,
756
+ // prevDragToChild: false,
757
+ // prevDragPos: null
758
+ };
718
759
  return {
719
- prevDragCol: undefined,
720
- prevDragToChild: false,
721
- prevDragPos: null
760
+ reactData,
761
+ internalData
722
762
  };
723
763
  },
724
764
  computed: {},
725
765
  created() {
766
+ const $xeTableCustomPanel = this;
726
767
  const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
727
768
  const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
728
769
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
729
770
  const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeNumberInput');
730
771
  const VxeUIRadioGroupComponent = _ui.VxeUI.getComponent('VxeRadioGroup');
731
- this.$nextTick(() => {
732
- const $xeTable = this.$xeTable;
772
+ $xeTableCustomPanel.$nextTick(() => {
773
+ const $xeTable = $xeTableCustomPanel.$xeTable;
733
774
  const {
734
775
  customOpts
735
776
  } = $xeTable;
@@ -754,16 +795,18 @@ var _default = exports.default = {
754
795
  });
755
796
  },
756
797
  render(h) {
757
- const $xeTable = this.$xeTable;
798
+ const $xeTableCustomPanel = this;
799
+ const $xeTable = $xeTableCustomPanel.$xeTable;
758
800
  const customOpts = $xeTable.computeCustomOpts;
759
801
  if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
760
- return renderPopupPanel(h, this);
802
+ return renderPopupPanel(h, $xeTableCustomPanel);
761
803
  }
762
- return renderSimplePanel(h, this);
804
+ return renderSimplePanel(h, $xeTableCustomPanel);
763
805
  },
764
806
  methods: {
765
807
  handleWrapperMouseenterEvent(evnt) {
766
- const $xeTable = this.$xeTable;
808
+ const $xeTableCustomPanel = this;
809
+ const $xeTable = $xeTableCustomPanel.$xeTable;
767
810
  const {
768
811
  customStore
769
812
  } = this;
@@ -771,10 +814,12 @@ var _default = exports.default = {
771
814
  $xeTable.customOpenEvent(evnt);
772
815
  },
773
816
  handleWrapperMouseleaveEvent(evnt) {
774
- const $xeTable = this.$xeTable;
817
+ const $xeTableCustomPanel = this;
818
+ const $xeTable = $xeTableCustomPanel.$xeTable;
819
+ const props = $xeTableCustomPanel;
775
820
  const {
776
821
  customStore
777
- } = this;
822
+ } = props;
778
823
  customStore.activeWrapper = false;
779
824
  setTimeout(() => {
780
825
  if (!customStore.activeBtn && !customStore.activeWrapper) {
@@ -788,9 +833,10 @@ var _default = exports.default = {
788
833
  confirmCustomEvent({
789
834
  $event
790
835
  }) {
791
- const $xeTable = this.$xeTable;
792
- const reactData = $xeTable;
793
- reactData.isCustomStatus = true;
836
+ const $xeTableCustomPanel = this;
837
+ const $xeTable = $xeTableCustomPanel.$xeTable;
838
+ const tableReactData = $xeTable;
839
+ tableReactData.isCustomStatus = true;
794
840
  $xeTable.saveCustom();
795
841
  $xeTable.closeCustom();
796
842
  $xeTable.emitCustomEvent('confirm', $event);
@@ -798,20 +844,23 @@ var _default = exports.default = {
798
844
  cancelCloseEvent({
799
845
  $event
800
846
  }) {
801
- const $xeTable = this.$xeTable;
847
+ const $xeTableCustomPanel = this;
848
+ const $xeTable = $xeTableCustomPanel.$xeTable;
802
849
  $xeTable.closeCustom();
803
850
  $xeTable.emitCustomEvent('close', $event);
804
851
  },
805
852
  cancelCustomEvent({
806
853
  $event
807
854
  }) {
808
- const $xeTable = this.$xeTable;
855
+ const $xeTableCustomPanel = this;
856
+ const $xeTable = $xeTableCustomPanel.$xeTable;
809
857
  $xeTable.cancelCustom();
810
858
  $xeTable.closeCustom();
811
859
  $xeTable.emitCustomEvent('cancel', $event);
812
860
  },
813
861
  handleResetCustomEvent(evnt) {
814
- const $xeTable = this.$xeTable;
862
+ const $xeTableCustomPanel = this;
863
+ const $xeTable = $xeTableCustomPanel.$xeTable;
815
864
  $xeTable.resetCustom(true);
816
865
  $xeTable.closeCustom();
817
866
  $xeTable.emitCustomEvent('reset', evnt);
@@ -831,27 +880,13 @@ var _default = exports.default = {
831
880
  this.handleResetCustomEvent(evnt);
832
881
  }
833
882
  },
834
- resetPopupCustomEvent(evnt) {
835
- if (_ui.VxeUI.modal) {
836
- _ui.VxeUI.modal.confirm({
837
- content: getI18n('vxe.custom.cstmConfirmRestore'),
838
- className: 'vxe-table--ignore-clear',
839
- escClosable: true
840
- }).then(type => {
841
- if (type === 'confirm') {
842
- this.resetCustomEvent(evnt);
843
- }
844
- });
845
- } else {
846
- this.resetCustomEvent(evnt);
847
- }
848
- },
849
883
  handleOptionCheck(column) {
850
- const $xeTable = this.$xeTable;
851
- const reactData = $xeTable;
884
+ const $xeTableCustomPanel = this;
885
+ const $xeTable = $xeTableCustomPanel.$xeTable;
886
+ const tableReactData = $xeTable;
852
887
  const {
853
888
  customColumnList
854
- } = reactData;
889
+ } = tableReactData;
855
890
  const matchObj = _xeUtils.default.findTree(customColumnList, item => item === column);
856
891
  if (matchObj && matchObj.parent) {
857
892
  const {
@@ -864,9 +899,10 @@ var _default = exports.default = {
864
899
  }
865
900
  }
866
901
  },
867
- changeCheckboxOption(column) {
868
- const $xeTable = this.$xeTable;
869
- const reactData = $xeTable;
902
+ changeCheckboxOption(column, evnt) {
903
+ const $xeTableCustomPanel = this;
904
+ const $xeTable = $xeTableCustomPanel.$xeTable;
905
+ const tableReactData = $xeTable;
870
906
  const customOpts = $xeTable.computeCustomOpts;
871
907
  const isChecked = !column.renderVisible;
872
908
  if (customOpts.immediate) {
@@ -875,7 +911,7 @@ var _default = exports.default = {
875
911
  item.renderVisible = isChecked;
876
912
  item.halfVisible = false;
877
913
  });
878
- reactData.isCustomStatus = true;
914
+ tableReactData.isCustomStatus = true;
879
915
  $xeTable.handleCustom();
880
916
  $xeTable.saveCustomStore('update:visible');
881
917
  } else {
@@ -886,63 +922,114 @@ var _default = exports.default = {
886
922
  }
887
923
  this.handleOptionCheck(column);
888
924
  $xeTable.checkCustomStatus();
925
+ $xeTable.dispatchEvent('custom-visible-change', {
926
+ column,
927
+ checked: isChecked
928
+ }, evnt);
889
929
  },
890
930
  changeColumnWidth(column) {
891
- const $xeTable = this.$xeTable;
892
- const reactData = $xeTable;
931
+ const $xeTableCustomPanel = this;
932
+ const $xeTable = $xeTableCustomPanel.$xeTable;
933
+ const tableReactData = $xeTable;
893
934
  const customOpts = $xeTable.computeCustomOpts;
894
935
  if (customOpts.immediate) {
895
936
  if (column.renderResizeWidth !== column.renderWidth) {
896
937
  column.resizeWidth = column.renderResizeWidth;
897
938
  column.renderWidth = column.renderResizeWidth;
898
- reactData.isCustomStatus = true;
939
+ tableReactData.isCustomStatus = true;
899
940
  $xeTable.handleCustom();
900
941
  $xeTable.saveCustomStore('update:width');
901
942
  }
902
943
  }
903
944
  },
904
- changeFixedOption(column, colFixed) {
905
- const $xeTable = this.$xeTable;
906
- const reactData = $xeTable;
945
+ changeFixedOption(column, colFixed, evnt) {
946
+ const $xeTableCustomPanel = this;
947
+ const $xeTable = $xeTableCustomPanel.$xeTable;
948
+ const tableReactData = $xeTable;
907
949
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
908
950
  const customOpts = $xeTable.computeCustomOpts;
951
+ let targetFixed = null;
909
952
  if (customOpts.immediate) {
910
953
  if (column.renderFixed === colFixed) {
954
+ targetFixed = '';
911
955
  _xeUtils.default.eachTree([column], col => {
912
956
  col.fixed = '';
913
957
  col.renderFixed = '';
914
958
  });
915
959
  } else {
916
960
  if (!isMaxFixedColumn || column.renderFixed) {
961
+ targetFixed = colFixed;
917
962
  _xeUtils.default.eachTree([column], col => {
918
963
  col.fixed = colFixed;
919
964
  col.renderFixed = colFixed;
920
965
  });
921
966
  }
922
967
  }
923
- reactData.isCustomStatus = true;
968
+ tableReactData.isCustomStatus = true;
924
969
  $xeTable.handleCustom();
925
970
  $xeTable.saveCustomStore('update:fixed');
926
971
  } else {
927
972
  if (column.renderFixed === colFixed) {
973
+ targetFixed = '';
928
974
  _xeUtils.default.eachTree([column], col => {
929
975
  col.renderFixed = '';
930
976
  });
931
977
  } else {
932
978
  if (!isMaxFixedColumn || column.renderFixed) {
979
+ targetFixed = colFixed;
933
980
  _xeUtils.default.eachTree([column], col => {
934
981
  col.renderFixed = colFixed;
935
982
  });
936
983
  }
937
984
  }
938
985
  }
986
+ if (!targetFixed !== null) {
987
+ $xeTable.dispatchEvent('custom-fixed-change', {
988
+ column,
989
+ fixed: targetFixed
990
+ }, evnt);
991
+ }
939
992
  },
940
- allOptionEvent() {
941
- const $xeTable = this.$xeTable;
993
+ allOptionEvent(evnt) {
994
+ const $xeTableCustomPanel = this;
995
+ const $xeTable = $xeTableCustomPanel.$xeTable;
996
+ const tableReactData = $xeTable;
997
+ const {
998
+ customStore
999
+ } = tableReactData;
1000
+ const isAll = !customStore.isAll;
942
1001
  $xeTable.toggleCustomAllCheckbox();
1002
+ $xeTable.dispatchEvent('custom-visible-all', {
1003
+ checked: isAll
1004
+ }, evnt);
1005
+ },
1006
+ updateColDropTipContent() {
1007
+ const $xeTableCustomPanel = this;
1008
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1009
+ const customPanelReactData = $xeTableCustomPanel.reactData;
1010
+ const {
1011
+ dragCol
1012
+ } = customPanelReactData;
1013
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
1014
+ const {
1015
+ tooltipMethod
1016
+ } = columnDragOpts;
1017
+ let tipContent = '';
1018
+ if (tooltipMethod) {
1019
+ const dtParams = {
1020
+ $table: $xeTable,
1021
+ column: dragCol
1022
+ };
1023
+ tipContent = `${tooltipMethod(dtParams) || ''}`;
1024
+ } else {
1025
+ tipContent = getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']);
1026
+ }
1027
+ customPanelReactData.dragTipText = tipContent;
943
1028
  },
944
1029
  sortMousedownEvent(evnt) {
945
- const $xeTable = this.$xeTable;
1030
+ const $xeTableCustomPanel = this;
1031
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1032
+ const customPanelReactData = $xeTableCustomPanel.reactData;
946
1033
  const btnEl = evnt.currentTarget;
947
1034
  const cellEl = btnEl.parentElement;
948
1035
  const tdEl = cellEl.parentElement;
@@ -950,44 +1037,48 @@ var _default = exports.default = {
950
1037
  const colid = trEl.getAttribute('colid');
951
1038
  const column = $xeTable.getColumnById(colid);
952
1039
  trEl.draggable = true;
953
- this.dragCol = column;
1040
+ customPanelReactData.dragCol = column;
1041
+ this.updateColDropTipContent();
954
1042
  (0, _dom.addClass)(trEl, 'active--drag-origin');
955
1043
  },
956
1044
  sortMouseupEvent(evnt) {
1045
+ const $xeTableCustomPanel = this;
1046
+ const customPanelReactData = $xeTableCustomPanel.reactData;
957
1047
  const btnEl = evnt.currentTarget;
958
1048
  const cellEl = btnEl.parentElement;
959
1049
  const tdEl = cellEl.parentElement;
960
1050
  const trEl = tdEl.parentElement;
961
- hideDropTip(this);
1051
+ hideDropTip($xeTableCustomPanel);
962
1052
  trEl.draggable = false;
963
- this.dragCol = null;
1053
+ customPanelReactData.dragCol = null;
964
1054
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
965
1055
  },
966
1056
  sortDragstartEvent(evnt) {
1057
+ const $xeTableCustomPanel = this;
1058
+ const customPanelReactData = $xeTableCustomPanel.reactData;
967
1059
  if (evnt.dataTransfer) {
968
1060
  evnt.dataTransfer.setDragImage((0, _dom.getTpImg)(), 0, 0);
969
1061
  }
1062
+ customPanelReactData.dragGroup = null;
1063
+ customPanelReactData.dragValues = null;
970
1064
  },
971
1065
  sortDragendEvent(evnt) {
972
- const $xeTable = this.$xeTable;
1066
+ const $xeTableCustomPanel = this;
1067
+ const $xeTable = $xeTableCustomPanel.$xeTable;
973
1068
  const tableProps = $xeTable;
974
- const reactData = $xeTable;
975
- const internalData = $xeTable;
976
- const {
977
- dragCol,
978
- prevDragPos,
979
- prevDragCol,
980
- prevDragToChild
981
- } = this;
1069
+ const tableReactData = $xeTable;
1070
+ const tableInternalData = $xeTable;
1071
+ const customPanelReactData = $xeTableCustomPanel.reactData;
1072
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
982
1073
  const {
983
1074
  mouseConfig
984
1075
  } = tableProps;
985
1076
  const {
986
1077
  customColumnList
987
- } = reactData;
1078
+ } = tableReactData;
988
1079
  const {
989
1080
  collectColumn
990
- } = internalData;
1081
+ } = tableInternalData;
991
1082
  const customOpts = $xeTable.computeCustomOpts;
992
1083
  const {
993
1084
  immediate
@@ -1000,8 +1091,22 @@ var _default = exports.default = {
1000
1091
  isToChildDrag,
1001
1092
  dragEndMethod
1002
1093
  } = columnDragOpts;
1094
+ const {
1095
+ dragCol,
1096
+ dragGroup,
1097
+ dragValues
1098
+ } = customPanelReactData;
1099
+ const {
1100
+ prevDragCol,
1101
+ prevDragPos,
1102
+ prevDragToChild
1103
+ } = customPanelInternalData;
1003
1104
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
1004
- if (prevDragCol && dragCol) {
1105
+ if (dragGroup || dragValues) {
1106
+ if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
1107
+ $xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
1108
+ }
1109
+ } else if (prevDragCol && dragCol) {
1005
1110
  // 判断是否有拖动
1006
1111
  if (prevDragCol !== dragCol) {
1007
1112
  const dragColumn = dragCol;
@@ -1127,7 +1232,7 @@ var _default = exports.default = {
1127
1232
  nafIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === newColumn.id);
1128
1233
  customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
1129
1234
  }
1130
- reactData.isDragColMove = true;
1235
+ tableReactData.isDragColMove = true;
1131
1236
  if (mouseConfig) {
1132
1237
  if ($xeTable.clearSelected) {
1133
1238
  $xeTable.clearSelected();
@@ -1149,24 +1254,29 @@ var _default = exports.default = {
1149
1254
  }
1150
1255
  }, evnt);
1151
1256
  if (immediate) {
1152
- reactData.customColumnList = collectColumn.slice(0);
1257
+ tableReactData.customColumnList = collectColumn.slice(0);
1153
1258
  $xeTable.handleColDragSwapColumn();
1154
1259
  }
1155
1260
  }).catch(() => {});
1156
1261
  }
1157
1262
  }
1158
- hideDropTip(this);
1159
- this.dragCol.value = null;
1263
+ hideDropTip($xeTableCustomPanel);
1264
+ customPanelReactData.dragCol = null;
1265
+ customPanelReactData.dragGroup = null;
1266
+ customPanelReactData.dragValues = null;
1160
1267
  trEl.draggable = false;
1161
1268
  trEl.removeAttribute('drag-pos');
1162
1269
  (0, _dom.removeClass)(trEl, 'active--drag-target');
1163
1270
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
1164
1271
  },
1165
1272
  sortDragoverEvent(evnt) {
1166
- const $xeTable = this.$xeTable;
1273
+ const $xeTableCustomPanel = this;
1274
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1275
+ const customPanelReactData = $xeTableCustomPanel.reactData;
1276
+ const customPanelInternalData = $xeTableCustomPanel.internalData;
1167
1277
  const {
1168
1278
  dragCol
1169
- } = this;
1279
+ } = customPanelReactData;
1170
1280
  const customOpts = $xeTable.computeCustomOpts;
1171
1281
  const {
1172
1282
  immediate
@@ -1180,19 +1290,21 @@ var _default = exports.default = {
1180
1290
  const isControlKey = (0, _dom.hasControlKey)(evnt);
1181
1291
  const colid = optEl.getAttribute('colid');
1182
1292
  const column = $xeTable.getColumnById(colid);
1293
+ customPanelReactData.dragGroup = null;
1294
+ customPanelReactData.dragValues = null;
1183
1295
  // 是否移入有效列
1184
1296
  if (column && (isCrossDrag || column.level === 1)) {
1185
1297
  evnt.preventDefault();
1186
1298
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
1187
1299
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
1188
1300
  if (dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
1189
- showDropTip(this, evnt, optEl, false, dragPos);
1301
+ showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
1190
1302
  return;
1191
1303
  }
1192
- this.prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
1193
- this.prevDragCol = column;
1194
- this.prevDragPos = dragPos;
1195
- showDropTip(this, evnt, optEl, true, dragPos);
1304
+ customPanelInternalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
1305
+ customPanelInternalData.prevDragCol = column;
1306
+ customPanelInternalData.prevDragPos = dragPos;
1307
+ showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos);
1196
1308
  }
1197
1309
  }
1198
1310
  }