vxe-table 4.13.44 → 4.13.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 (71) hide show
  1. package/README.md +4 -4
  2. package/es/{iconfont.1750301328949.ttf → iconfont.1750641793236.ttf} +0 -0
  3. package/es/iconfont.1750641793236.woff +0 -0
  4. package/es/iconfont.1750641793236.woff2 +0 -0
  5. package/es/index.css +1 -1
  6. package/es/index.min.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/module/custom/hook.js +9 -1
  10. package/es/table/module/custom/panel.js +320 -224
  11. package/es/table/module/edit/hook.js +24 -10
  12. package/es/table/module/export/hook.js +19 -6
  13. package/es/table/src/cell.js +4 -4
  14. package/es/table/src/emits.js +3 -0
  15. package/es/table/src/table.js +16 -4
  16. package/es/table/style.css +37 -9
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +5 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +37 -9
  21. package/es/vxe-table/style.min.css +1 -1
  22. package/lib/{iconfont.1750301328949.ttf → iconfont.1750641793236.ttf} +0 -0
  23. package/lib/iconfont.1750641793236.woff +0 -0
  24. package/lib/iconfont.1750641793236.woff2 +0 -0
  25. package/lib/index.css +1 -1
  26. package/lib/index.min.css +1 -1
  27. package/lib/index.umd.js +273 -87
  28. package/lib/index.umd.min.js +1 -1
  29. package/lib/style.css +1 -1
  30. package/lib/style.min.css +1 -1
  31. package/lib/table/module/custom/hook.js +11 -1
  32. package/lib/table/module/custom/hook.min.js +1 -1
  33. package/lib/table/module/custom/panel.js +181 -60
  34. package/lib/table/module/custom/panel.min.js +1 -1
  35. package/lib/table/module/edit/hook.js +46 -10
  36. package/lib/table/module/edit/hook.min.js +1 -1
  37. package/lib/table/module/export/hook.js +19 -4
  38. package/lib/table/module/export/hook.min.js +1 -1
  39. package/lib/table/src/cell.js +4 -4
  40. package/lib/table/src/cell.min.js +1 -1
  41. package/lib/table/src/emits.js +1 -1
  42. package/lib/table/src/emits.min.js +1 -1
  43. package/lib/table/src/table.js +5 -5
  44. package/lib/table/src/table.min.js +1 -1
  45. package/lib/table/style/style.css +37 -9
  46. package/lib/table/style/style.min.css +1 -1
  47. package/lib/ui/index.js +5 -1
  48. package/lib/ui/index.min.js +1 -1
  49. package/lib/ui/src/log.js +1 -1
  50. package/lib/ui/src/log.min.js +1 -1
  51. package/lib/vxe-table/style/style.css +37 -9
  52. package/lib/vxe-table/style/style.min.css +1 -1
  53. package/package.json +1 -1
  54. package/packages/table/module/custom/hook.ts +10 -1
  55. package/packages/table/module/custom/panel.ts +338 -236
  56. package/packages/table/module/edit/hook.ts +24 -10
  57. package/packages/table/module/export/hook.ts +18 -7
  58. package/packages/table/src/cell.ts +4 -4
  59. package/packages/table/src/emits.ts +3 -0
  60. package/packages/table/src/table.ts +1 -1
  61. package/packages/ui/index.ts +4 -0
  62. package/styles/components/icon.scss +9 -1
  63. package/styles/components/table-module/custom.scss +26 -3
  64. package/styles/helpers/baseMixin.scss +16 -2
  65. package/styles/icon/iconfont.ttf +0 -0
  66. package/styles/icon/iconfont.woff +0 -0
  67. package/styles/icon/iconfont.woff2 +0 -0
  68. package/es/iconfont.1750301328949.woff +0 -0
  69. package/es/iconfont.1750301328949.woff2 +0 -0
  70. package/lib/iconfont.1750301328949.woff +0 -0
  71. package/lib/iconfont.1750301328949.woff2 +0 -0
@@ -4,7 +4,7 @@ var _vue = require("vue");
4
4
  var _ui = require("../../../ui");
5
5
  var _xeUtils = _interopRequireDefault(require("xe-utils"));
6
6
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
- const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
7
+ const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
8
8
  _ui.VxeUI.hooks.add('tableCustomModule', {
9
9
  setupTable($xeTable) {
10
10
  const {
@@ -82,6 +82,15 @@ _ui.VxeUI.hooks.add('tableCustomModule', {
82
82
  }
83
83
  return (0, _vue.nextTick)();
84
84
  };
85
+ const toggleCustom = () => {
86
+ const {
87
+ customStore
88
+ } = reactData;
89
+ if (customStore.visible) {
90
+ return closeCustom();
91
+ }
92
+ return openCustom();
93
+ };
85
94
  const saveCustom = () => {
86
95
  const {
87
96
  customColumnList,
@@ -238,6 +247,7 @@ _ui.VxeUI.hooks.add('tableCustomModule', {
238
247
  const customMethods = {
239
248
  openCustom,
240
249
  closeCustom,
250
+ toggleCustom,
241
251
  saveCustom,
242
252
  cancelCustom,
243
253
  resetCustom(options) {
@@ -1 +1 @@
1
- var _vue=require("vue"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tableCustomMethodKeys=["openCustom","closeCustom","saveCustom","cancelCustom","resetCustom","toggleCustomAllCheckbox","setCustomAllCheckbox"];_ui.VxeUI.hooks.add("tableCustomModule",{setupTable(n){let{reactData:m,internalData:r}=n,{computeCustomOpts:c,computeRowGroupFields:o}=n.getComputeMaps(),s=n.getRefMaps().refElem,l=n.xeGrid,i=()=>{var e=m.customStore,t=s.value;let l=0;t&&(l=t.clientHeight-28),e.maxHeight=Math.max(88,l)},a=()=>{var{initStore:e,customStore:t}=m;return t.visible=!0,e.custom=!0,u(),v(),i(),(0,_vue.nextTick)().then(()=>i())},u=()=>{var e=m.customStore,t=r.collectColumn;if(e.visible){let l={},s={},i={};_xeUtils.default.eachTree(t,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,l[t]=e.renderSortNumber,s[t]=e.fixed,i[t]=e.visible}),e.oldSortMaps=l,e.oldFixedMaps=s,e.oldVisibleMaps=i,m.customColumnList=t.slice(0)}},d=()=>{var e=m.customStore,t=c.value;return e.visible&&(e.visible=!1,t.immediate||n.handleCustom()),(0,_vue.nextTick)()};let t=e=>{var t=m.customStore,l=m.customColumnList,s=c.value;let{checkMethod:i,visibleMethod:r}=s,o=!!e;return s.immediate?(_xeUtils.default.eachTree(l,e=>{r&&!r({$table:n,column:e})||i&&!i({$table:n,column:e})||(e.visible=o,e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o,m.isCustomStatus=!0,n.handleCustom(),n.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(l,e=>{r&&!r({$table:n,column:e})||i&&!i({$table:n,column:e})||(e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o),n.checkCustomStatus(),(0,_vue.nextTick)()};var e={openCustom:a,closeCustom:d,saveCustom:()=>{let{customColumnList:e,aggHandleFields:l,rowGroupList:t}=m;let{allowVisible:r,allowSort:o,allowFixed:a,allowResizable:u}=c.value;return _xeUtils.default.eachTree(e,(e,t,l,s,i)=>{i?e.fixed=i.fixed:(o&&(e.renderSortNumber=t+1),a&&(e.fixed=e.renderFixed)),u&&e.renderVisible&&(!e.children||e.children.length)&&e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),r&&(e.visible=e.renderVisible)}),m.isCustomStatus=!0,m.isDragColMove=!0,setTimeout(()=>{m.isDragColMove=!1},1e3),n.saveCustomStore("confirm").then(()=>{!n.handlePivotTableAggregateData||t.length===l.length&&!t.some((e,t)=>e.field!==l[t])||(l.length?n.setRowGroups(l):n.clearRowGroups())})},cancelCustom:()=>{var{customColumnList:e,customStore:t}=m;let{oldSortMaps:i,oldFixedMaps:r,oldVisibleMaps:o}=t,{allowVisible:a,allowSort:u,allowFixed:n,allowResizable:d}=c.value;return _xeUtils.default.eachTree(e,e=>{var t=e.getKey(),l=!!o[t],s=r[t]||"";a&&(e.renderVisible=l,e.visible=l),n&&(e.renderFixed=s,e.fixed=s),u&&(e.renderSortNumber=i[t]||0),d&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),(0,_vue.nextTick)()},resetCustom(e){let t=m.rowGroupList;var l=r.collectColumn;let s=c.value.checkMethod,i=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e},e);return _xeUtils.default.eachTree(l,e=>{i.resizable&&(e.resizeWidth=0),i.fixed&&(e.fixed=e.defaultFixed),i.sort&&(e.renderSortNumber=e.sortNumber),s&&!s({$table:n,column:e})||(e.visible=e.defaultVisible),e.renderResizeWidth=e.renderWidth}),m.isCustomStatus=!1,n.saveCustomStore("reset"),n.handleCustom().then(()=>{var e;n.handlePivotTableAggregateData&&((e=o.value)||t).length&&(e&&e.length?n.setRowGroups(e):n.clearRowGroups())})},toggleCustomAllCheckbox(){var e=m.customStore,e=!e.isAll;return t(e)},setCustomAllCheckbox:t};let v=()=>{var e=m.customStore,t=r.collectColumn;let l=c.value.checkMethod;e.isAll=t.every(e=>!!l&&!l({$table:n,column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&t.some(e=>(!l||l({$table:n,column:e}))&&(e.renderVisible||e.halfVisible))},b=(e,t)=>{(l||n).dispatchEvent("custom",{type:e},t)};var h={checkCustomStatus:v,emitCustomEvent:b,triggerCustomEvent(e){var t=n.reactData.customStore;t.visible?(d(),b("close",e)):(t.btnEl=e.target,a(),b("open",e))},customOpenEvent(e){var t=n.reactData.customStore;t.visible||(t.activeBtn=!0,t.btnEl=e.target,n.openCustom(),n.emitCustomEvent("open",e))},customCloseEvent(e){var t=n.reactData.customStore;t.visible&&(t.activeBtn=!1,n.closeCustom(),n.emitCustomEvent("close",e))},handleUpdateCustomColumn:u};return Object.assign(Object.assign({},e),h)},setupGrid(e){return e.extendTableMethods(tableCustomMethodKeys)}});
1
+ var _vue=require("vue"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tableCustomMethodKeys=["openCustom","closeCustom","toggleCustom","saveCustom","cancelCustom","resetCustom","toggleCustomAllCheckbox","setCustomAllCheckbox"];_ui.VxeUI.hooks.add("tableCustomModule",{setupTable(n){let{reactData:m,internalData:r}=n,{computeCustomOpts:c,computeRowGroupFields:o}=n.getComputeMaps(),s=n.getRefMaps().refElem,l=n.xeGrid,i=()=>{var e=m.customStore,t=s.value;let l=0;t&&(l=t.clientHeight-28),e.maxHeight=Math.max(88,l)},u=()=>{var{initStore:e,customStore:t}=m;return t.visible=!0,e.custom=!0,a(),v(),i(),(0,_vue.nextTick)().then(()=>i())},a=()=>{var e=m.customStore,t=r.collectColumn;if(e.visible){let l={},s={},i={};_xeUtils.default.eachTree(t,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,l[t]=e.renderSortNumber,s[t]=e.fixed,i[t]=e.visible}),e.oldSortMaps=l,e.oldFixedMaps=s,e.oldVisibleMaps=i,m.customColumnList=t.slice(0)}},d=()=>{var e=m.customStore,t=c.value;return e.visible&&(e.visible=!1,t.immediate||n.handleCustom()),(0,_vue.nextTick)()};let t=e=>{var t=m.customStore,l=m.customColumnList,s=c.value;let{checkMethod:i,visibleMethod:r}=s,o=!!e;return s.immediate?(_xeUtils.default.eachTree(l,e=>{r&&!r({$table:n,column:e})||i&&!i({$table:n,column:e})||(e.visible=o,e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o,m.isCustomStatus=!0,n.handleCustom(),n.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(l,e=>{r&&!r({$table:n,column:e})||i&&!i({$table:n,column:e})||(e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o),n.checkCustomStatus(),(0,_vue.nextTick)()};var e={openCustom:u,closeCustom:d,toggleCustom:()=>{var e=m.customStore;return(e.visible?d:u)()},saveCustom:()=>{let{customColumnList:e,aggHandleFields:l,rowGroupList:t}=m;let{allowVisible:r,allowSort:o,allowFixed:u,allowResizable:a}=c.value;return _xeUtils.default.eachTree(e,(e,t,l,s,i)=>{i?e.fixed=i.fixed:(o&&(e.renderSortNumber=t+1),u&&(e.fixed=e.renderFixed)),a&&e.renderVisible&&(!e.children||e.children.length)&&e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),r&&(e.visible=e.renderVisible)}),m.isCustomStatus=!0,m.isDragColMove=!0,setTimeout(()=>{m.isDragColMove=!1},1e3),n.saveCustomStore("confirm").then(()=>{!n.handlePivotTableAggregateData||t.length===l.length&&!t.some((e,t)=>e.field!==l[t])||(l.length?n.setRowGroups(l):n.clearRowGroups())})},cancelCustom:()=>{var{customColumnList:e,customStore:t}=m;let{oldSortMaps:i,oldFixedMaps:r,oldVisibleMaps:o}=t,{allowVisible:u,allowSort:a,allowFixed:n,allowResizable:d}=c.value;return _xeUtils.default.eachTree(e,e=>{var t=e.getKey(),l=!!o[t],s=r[t]||"";u&&(e.renderVisible=l,e.visible=l),n&&(e.renderFixed=s,e.fixed=s),a&&(e.renderSortNumber=i[t]||0),d&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),(0,_vue.nextTick)()},resetCustom(e){let t=m.rowGroupList;var l=r.collectColumn;let s=c.value.checkMethod,i=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e},e);return _xeUtils.default.eachTree(l,e=>{i.resizable&&(e.resizeWidth=0),i.fixed&&(e.fixed=e.defaultFixed),i.sort&&(e.renderSortNumber=e.sortNumber),s&&!s({$table:n,column:e})||(e.visible=e.defaultVisible),e.renderResizeWidth=e.renderWidth}),m.isCustomStatus=!1,n.saveCustomStore("reset"),n.handleCustom().then(()=>{var e;n.handlePivotTableAggregateData&&((e=o.value)||t).length&&(e&&e.length?n.setRowGroups(e):n.clearRowGroups())})},toggleCustomAllCheckbox(){var e=m.customStore,e=!e.isAll;return t(e)},setCustomAllCheckbox:t};let v=()=>{var e=m.customStore,t=r.collectColumn;let l=c.value.checkMethod;e.isAll=t.every(e=>!!l&&!l({$table:n,column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&t.some(e=>(!l||l({$table:n,column:e}))&&(e.renderVisible||e.halfVisible))},b=(e,t)=>{(l||n).dispatchEvent("custom",{type:e},t)};var h={checkCustomStatus:v,emitCustomEvent:b,triggerCustomEvent(e){var t=n.reactData.customStore;t.visible?(d(),b("close",e)):(t.btnEl=e.target,u(),b("open",e))},customOpenEvent(e){var t=n.reactData.customStore;t.visible||(t.activeBtn=!0,t.btnEl=e.target,n.openCustom(),n.emitCustomEvent("open",e))},customCloseEvent(e){var t=n.reactData.customStore;t.visible&&(t.activeBtn=!1,n.closeCustom(),n.emitCustomEvent("close",e))},handleUpdateCustomColumn:a};return Object.assign(Object.assign({},e),h)},setupGrid(e){return e.extendTableMethods(tableCustomMethodKeys)}});
@@ -25,7 +25,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
25
25
  default: () => ({})
26
26
  }
27
27
  },
28
- setup(props) {
28
+ setup(props, context) {
29
+ const xID = _xeUtils.default.uniqueId();
29
30
  const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
30
31
  const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
31
32
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
@@ -34,8 +35,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
34
35
  const $xeTable = (0, _vue.inject)('$xeTable', {});
35
36
  const {
36
37
  props: tableProps,
37
- reactData,
38
- internalData
38
+ reactData: tableReactData,
39
+ internalData: tableInternalData
39
40
  } = $xeTable;
40
41
  const {
41
42
  computeCustomOpts,
@@ -45,13 +46,29 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
45
46
  computeResizableOpts
46
47
  } = $xeTable.getComputeMaps();
47
48
  const refElem = (0, _vue.ref)();
48
- const bodyElemRef = (0, _vue.ref)();
49
+ const refBodyWrapperElem = (0, _vue.ref)();
50
+ const refCustomBodyElem = (0, _vue.ref)();
49
51
  const refDragLineElem = (0, _vue.ref)();
50
52
  const refDragTipElem = (0, _vue.ref)();
51
- const dragColumnRef = (0, _vue.ref)();
52
- let prevDragCol;
53
- let prevDragToChild = false;
54
- let prevDragPos;
53
+ const customPanelReactData = (0, _vue.reactive)({
54
+ dragCol: null,
55
+ dragGroup: null,
56
+ dragValues: null,
57
+ dragTipText: ''
58
+ });
59
+ const customPanelInternalData = {
60
+ // prevDragCol: undefined,
61
+ // prevDragToChild: false,
62
+ // prevDragPos: null
63
+ };
64
+ const refMaps = {
65
+ refElem,
66
+ refBodyWrapperElem,
67
+ refCustomBodyElem,
68
+ refDragLineElem,
69
+ refDragTipElem
70
+ };
71
+ const computeMaps = {};
55
72
  const handleWrapperMouseenterEvent = evnt => {
56
73
  const {
57
74
  customStore
@@ -73,7 +90,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
73
90
  const confirmCustomEvent = ({
74
91
  $event
75
92
  }) => {
76
- reactData.isCustomStatus = true;
93
+ tableReactData.isCustomStatus = true;
77
94
  $xeTable.saveCustom();
78
95
  $xeTable.closeCustom();
79
96
  $xeTable.emitCustomEvent('confirm', $event);
@@ -116,7 +133,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
116
133
  const handleOptionCheck = column => {
117
134
  const {
118
135
  customColumnList
119
- } = reactData;
136
+ } = tableReactData;
120
137
  const matchObj = _xeUtils.default.findTree(customColumnList, item => item === column);
121
138
  if (matchObj && matchObj.parent) {
122
139
  const {
@@ -129,7 +146,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
129
146
  }
130
147
  }
131
148
  };
132
- const changeCheckboxOption = column => {
149
+ const changeCheckboxOption = (column, evnt) => {
133
150
  const isChecked = !column.renderVisible;
134
151
  const customOpts = computeCustomOpts.value;
135
152
  if (customOpts.immediate) {
@@ -138,7 +155,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
138
155
  item.renderVisible = isChecked;
139
156
  item.halfVisible = false;
140
157
  });
141
- reactData.isCustomStatus = true;
158
+ tableReactData.isCustomStatus = true;
142
159
  $xeTable.handleCustom();
143
160
  $xeTable.saveCustomStore('update:visible');
144
161
  } else {
@@ -149,6 +166,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
149
166
  }
150
167
  handleOptionCheck(column);
151
168
  $xeTable.checkCustomStatus();
169
+ $xeTable.dispatchEvent('custom-visible-change', {
170
+ column,
171
+ checked: isChecked
172
+ }, evnt);
152
173
  };
153
174
  const changeColumnWidth = column => {
154
175
  const customOpts = computeCustomOpts.value;
@@ -156,62 +177,89 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
156
177
  if (column.renderResizeWidth !== column.renderWidth) {
157
178
  column.resizeWidth = column.renderResizeWidth;
158
179
  column.renderWidth = column.renderResizeWidth;
159
- reactData.isCustomStatus = true;
180
+ tableReactData.isCustomStatus = true;
160
181
  $xeTable.handleCustom();
161
182
  $xeTable.saveCustomStore('update:width');
162
183
  }
163
184
  }
164
185
  };
165
- const changeFixedOption = (column, colFixed) => {
186
+ const changeFixedOption = (column, colFixed, evnt) => {
166
187
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
167
188
  const customOpts = computeCustomOpts.value;
189
+ let targetFixed = null;
168
190
  if (customOpts.immediate) {
169
191
  if (column.renderFixed === colFixed) {
192
+ targetFixed = '';
170
193
  _xeUtils.default.eachTree([column], col => {
171
194
  col.fixed = '';
172
195
  col.renderFixed = '';
173
196
  });
174
197
  } else {
175
198
  if (!isMaxFixedColumn || column.renderFixed) {
199
+ targetFixed = colFixed;
176
200
  _xeUtils.default.eachTree([column], col => {
177
201
  col.fixed = colFixed;
178
202
  col.renderFixed = colFixed;
179
203
  });
180
204
  }
181
205
  }
182
- reactData.isCustomStatus = true;
206
+ tableReactData.isCustomStatus = true;
183
207
  $xeTable.handleCustom();
184
208
  $xeTable.saveCustomStore('update:fixed');
185
209
  } else {
186
210
  if (column.renderFixed === colFixed) {
211
+ targetFixed = '';
187
212
  _xeUtils.default.eachTree([column], col => {
188
213
  col.renderFixed = '';
189
214
  });
190
215
  } else {
191
216
  if (!isMaxFixedColumn || column.renderFixed) {
217
+ targetFixed = colFixed;
192
218
  _xeUtils.default.eachTree([column], col => {
193
219
  col.renderFixed = colFixed;
194
220
  });
195
221
  }
196
222
  }
197
223
  }
224
+ if (!targetFixed !== null) {
225
+ $xeTable.dispatchEvent('custom-fixed-change', {
226
+ column,
227
+ fixed: targetFixed
228
+ }, evnt);
229
+ }
198
230
  };
199
- const allOptionEvent = () => {
231
+ const allOptionEvent = evnt => {
232
+ const {
233
+ customStore
234
+ } = tableReactData;
235
+ const isAll = !customStore.isAll;
200
236
  $xeTable.toggleCustomAllCheckbox();
237
+ $xeTable.dispatchEvent('custom-visible-all', {
238
+ checked: isAll
239
+ }, evnt);
201
240
  };
202
241
  const showDropTip = (evnt, optEl, showLine, dragPos) => {
203
- const el = bodyElemRef.value;
204
- if (!el) {
242
+ const bodyWrapperElem = refBodyWrapperElem.value;
243
+ if (!bodyWrapperElem) {
244
+ return;
245
+ }
246
+ const customBodyElem = refCustomBodyElem.value;
247
+ if (!customBodyElem) {
205
248
  return;
206
249
  }
207
- const wrapperRect = el.getBoundingClientRect();
250
+ const {
251
+ prevDragToChild
252
+ } = customPanelInternalData;
253
+ const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
254
+ const customBodyRect = customBodyElem.getBoundingClientRect();
208
255
  if (optEl) {
209
256
  const dragLineEl = refDragLineElem.value;
210
257
  if (dragLineEl) {
211
258
  if (showLine) {
212
259
  const optRect = optEl.getBoundingClientRect();
213
260
  dragLineEl.style.display = 'block';
214
- dragLineEl.style.top = `${Math.max(1, optRect.y + el.scrollTop - wrapperRect.y)}px`;
261
+ dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`;
262
+ dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
215
263
  dragLineEl.style.height = `${optRect.height}px`;
216
264
  dragLineEl.style.width = `${optRect.width}px`;
217
265
  dragLineEl.setAttribute('drag-pos', dragPos);
@@ -224,11 +272,31 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
224
272
  const dragTipEl = refDragTipElem.value;
225
273
  if (dragTipEl) {
226
274
  dragTipEl.style.display = 'block';
227
- dragTipEl.style.top = `${Math.min(el.clientHeight + el.scrollTop - dragTipEl.clientHeight, evnt.clientY + el.scrollTop - wrapperRect.y)}px`;
228
- dragTipEl.style.left = `${Math.min(el.clientWidth + el.scrollLeft - dragTipEl.clientWidth, evnt.clientX + el.scrollLeft - wrapperRect.x)}px`;
275
+ dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
276
+ dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`;
229
277
  dragTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
230
278
  }
231
279
  };
280
+ const updateColDropTipContent = () => {
281
+ const {
282
+ dragCol
283
+ } = customPanelReactData;
284
+ const columnDragOpts = computeColumnDragOpts.value;
285
+ const {
286
+ tooltipMethod
287
+ } = columnDragOpts;
288
+ let tipContent = '';
289
+ if (tooltipMethod) {
290
+ const dtParams = {
291
+ $table: $xeTable,
292
+ column: dragCol
293
+ };
294
+ tipContent = `${tooltipMethod(dtParams) || ''}`;
295
+ } else {
296
+ tipContent = getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']);
297
+ }
298
+ customPanelReactData.dragTipText = tipContent;
299
+ };
232
300
  const hideDropTip = () => {
233
301
  const dragTipEl = refDragTipElem.value;
234
302
  const dragLineEl = refDragLineElem.value;
@@ -247,7 +315,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
247
315
  const colid = trEl.getAttribute('colid');
248
316
  const column = $xeTable.getColumnById(colid);
249
317
  trEl.draggable = true;
250
- dragColumnRef.value = column;
318
+ customPanelReactData.dragCol = column;
319
+ updateColDropTipContent();
251
320
  (0, _dom.addClass)(trEl, 'active--drag-origin');
252
321
  };
253
322
  const sortMouseupEvent = evnt => {
@@ -257,13 +326,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
257
326
  const trEl = tdEl.parentElement;
258
327
  hideDropTip();
259
328
  trEl.draggable = false;
260
- dragColumnRef.value = null;
329
+ customPanelReactData.dragCol = null;
261
330
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
262
331
  };
263
332
  const sortDragstartEvent = evnt => {
264
333
  if (evnt.dataTransfer) {
265
334
  evnt.dataTransfer.setDragImage((0, _dom.getTpImg)(), 0, 0);
266
335
  }
336
+ customPanelReactData.dragGroup = null;
337
+ customPanelReactData.dragValues = null;
267
338
  };
268
339
  const sortDragendEvent = evnt => {
269
340
  const {
@@ -271,16 +342,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
271
342
  } = tableProps;
272
343
  const {
273
344
  customColumnList
274
- } = reactData;
345
+ } = tableReactData;
275
346
  const {
276
347
  collectColumn
277
- } = internalData;
348
+ } = tableInternalData;
278
349
  const customOpts = computeCustomOpts.value;
279
350
  const {
280
351
  immediate
281
352
  } = customOpts;
282
353
  const trEl = evnt.currentTarget;
283
- const dragCol = dragColumnRef.value;
284
354
  const columnDragOpts = computeColumnDragOpts.value;
285
355
  const {
286
356
  isCrossDrag,
@@ -288,8 +358,22 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
288
358
  isToChildDrag,
289
359
  dragEndMethod
290
360
  } = columnDragOpts;
361
+ const {
362
+ dragCol,
363
+ dragGroup,
364
+ dragValues
365
+ } = customPanelReactData;
366
+ const {
367
+ prevDragCol,
368
+ prevDragPos,
369
+ prevDragToChild
370
+ } = customPanelInternalData;
291
371
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
292
- if (prevDragCol && dragCol) {
372
+ if (dragGroup || dragValues) {
373
+ if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
374
+ $xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
375
+ }
376
+ } else if (prevDragCol && dragCol) {
293
377
  // 判断是否有拖动
294
378
  if (prevDragCol !== dragCol) {
295
379
  const dragColumn = dragCol;
@@ -415,7 +499,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
415
499
  nafIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === newColumn.id);
416
500
  customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
417
501
  }
418
- reactData.isDragColMove = true;
502
+ tableReactData.isDragColMove = true;
419
503
  if (mouseConfig) {
420
504
  if ($xeTable.clearSelected) {
421
505
  $xeTable.clearSelected();
@@ -437,14 +521,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
437
521
  }
438
522
  }, evnt);
439
523
  if (immediate) {
440
- reactData.customColumnList = collectColumn.slice(0);
524
+ tableReactData.customColumnList = collectColumn.slice(0);
441
525
  $xeTable.handleColDragSwapColumn();
442
526
  }
443
527
  }).catch(() => {});
444
528
  }
445
529
  }
446
530
  hideDropTip();
447
- dragColumnRef.value = null;
531
+ customPanelReactData.dragCol = null;
532
+ customPanelReactData.dragGroup = null;
533
+ customPanelReactData.dragValues = null;
448
534
  trEl.draggable = false;
449
535
  trEl.removeAttribute('drag-pos');
450
536
  (0, _dom.removeClass)(trEl, 'active--drag-target');
@@ -464,7 +550,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
464
550
  const isControlKey = (0, _dom.hasControlKey)(evnt);
465
551
  const colid = optEl.getAttribute('colid');
466
552
  const column = $xeTable.getColumnById(colid);
467
- const dragCol = dragColumnRef.value;
553
+ const {
554
+ dragCol
555
+ } = customPanelReactData;
556
+ customPanelReactData.dragGroup = null;
557
+ customPanelReactData.dragValues = null;
468
558
  // 是否移入有效列
469
559
  if (column && (isCrossDrag || column.level === 1)) {
470
560
  evnt.preventDefault();
@@ -474,14 +564,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
474
564
  showDropTip(evnt, optEl, false, dragPos);
475
565
  return;
476
566
  }
477
- prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
478
- prevDragCol = column;
479
- prevDragPos = dragPos;
567
+ customPanelInternalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
568
+ customPanelInternalData.prevDragCol = column;
569
+ customPanelInternalData.prevDragPos = dragPos;
480
570
  showDropTip(evnt, optEl, true, dragPos);
481
571
  }
482
572
  };
483
573
  const renderDragTip = () => {
484
- const dragCol = dragColumnRef.value;
574
+ const {
575
+ dragTipText
576
+ } = customPanelReactData;
485
577
  const columnDragOpts = computeColumnDragOpts.value;
486
578
  return (0, _vue.h)('div', {}, [(0, _vue.h)('div', {
487
579
  ref: refDragLineElem,
@@ -499,11 +591,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
499
591
  class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
500
592
  }), (0, _vue.h)('span', {
501
593
  class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
594
+ }), (0, _vue.h)('span', {
595
+ class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
596
+ }), (0, _vue.h)('span', {
597
+ class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
502
598
  }), (0, _vue.h)('span', {
503
599
  class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
504
600
  })]), (0, _vue.h)('div', {
505
601
  class: 'vxe-table-custom-popup--drag-tip-content'
506
- }, getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']))])])]);
602
+ }, `${dragTipText || ''}`)])])]);
507
603
  };
508
604
  const renderSimplePanel = () => {
509
605
  const $xeGrid = $xeTable.xeGrid;
@@ -519,7 +615,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
519
615
  const {
520
616
  isCustomStatus,
521
617
  customColumnList
522
- } = reactData;
618
+ } = tableReactData;
523
619
  const customOpts = computeCustomOpts.value;
524
620
  const {
525
621
  immediate
@@ -596,9 +692,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
596
692
  'is--disabled': isDisabled
597
693
  }],
598
694
  title: getI18n('vxe.custom.setting.colVisible'),
599
- onClick: () => {
695
+ onClick: evnt => {
600
696
  if (!isDisabled) {
601
- changeCheckboxOption(column);
697
+ changeCheckboxOption(column, evnt);
602
698
  }
603
699
  }
604
700
  }, [(0, _vue.h)('span', {
@@ -632,8 +728,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
632
728
  status: column.renderFixed === 'left' ? 'primary' : '',
633
729
  disabled: isDisabled || isHidden || isMaxFixedColumn && !column.renderFixed,
634
730
  title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
635
- onClick: () => {
636
- changeFixedOption(column, 'left');
731
+ onClick: ({
732
+ $event
733
+ }) => {
734
+ changeFixedOption(column, 'left', $event);
637
735
  }
638
736
  }) : (0, _vue.createCommentVNode)(), VxeUIButtonComponent ? (0, _vue.h)(VxeUIButtonComponent, {
639
737
  mode: 'text',
@@ -641,8 +739,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
641
739
  status: column.renderFixed === 'right' ? 'primary' : '',
642
740
  disabled: isDisabled || isHidden || isMaxFixedColumn && !column.renderFixed,
643
741
  title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
644
- onClick: () => {
645
- changeFixedOption(column, 'right');
742
+ onClick: ({
743
+ $event
744
+ }) => {
745
+ changeFixedOption(column, 'right', $event);
646
746
  }
647
747
  }) : (0, _vue.createCommentVNode)()]) : (0, _vue.createCommentVNode)()]));
648
748
  }
@@ -656,9 +756,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
656
756
  style: maxHeight && !['left', 'right'].includes(placement) ? {
657
757
  maxHeight: `${maxHeight}px`
658
758
  } : {}
659
- }, customStore.visible ? [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? (0, _vue.h)($xeTable.getPivotTableAggregateSimplePanel(), {
759
+ }, customStore.visible ? [(0, _vue.h)('div', {
760
+ ref: refBodyWrapperElem,
761
+ class: 'vxe-table-custom-simple--body-wrapper'
762
+ }, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? (0, _vue.h)($xeTable.getPivotTableAggregateSimplePanel(), {
660
763
  customStore
661
764
  }) : renderEmptyElement($xeTable), (0, _vue.h)('div', {
765
+ ref: refCustomBodyElem,
662
766
  class: 'vxe-table-custom--handle-wrapper'
663
767
  }, [(0, _vue.h)('div', {
664
768
  class: 'vxe-table-custom--header'
@@ -680,7 +784,6 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
680
784
  }, getI18n('vxe.toolbar.customAll'))]) : (0, _vue.h)('span', {
681
785
  class: 'vxe-checkbox--label'
682
786
  }, getI18n('vxe.table.customTitle'))])])]), (0, _vue.h)('div', {
683
- ref: bodyElemRef,
684
787
  class: 'vxe-table-custom--body'
685
788
  }, [topSlot ? (0, _vue.h)('div', {
686
789
  class: 'vxe-table-custom--panel-top'
@@ -694,7 +797,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
694
797
  default: () => colVNs
695
798
  }), bottomSlot ? (0, _vue.h)('div', {
696
799
  class: 'vxe-table-custom--panel-bottom'
697
- }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable), renderDragTip()]), customOpts.showFooter ? (0, _vue.h)('div', {
800
+ }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable)]), customOpts.showFooter ? (0, _vue.h)('div', {
698
801
  class: 'vxe-table-custom--footer'
699
802
  }, footerSlot ? $xeTable.callSlot(footerSlot, params) : [(0, _vue.h)('div', {
700
803
  class: 'vxe-table-custom--footer-buttons'
@@ -716,7 +819,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
716
819
  status: 'primary',
717
820
  content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm'),
718
821
  onClick: confirmCustomEvent
719
- }) : (0, _vue.createCommentVNode)()])]) : null])] : []);
822
+ }) : (0, _vue.createCommentVNode)()])]) : null]), renderDragTip()])] : []);
720
823
  };
721
824
  const renderPopupPanel = () => {
722
825
  const $xeGrid = $xeTable.xeGrid;
@@ -729,7 +832,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
729
832
  const {
730
833
  isCustomStatus,
731
834
  customColumnList
732
- } = reactData;
835
+ } = tableReactData;
733
836
  const customOpts = computeCustomOpts.value;
734
837
  const {
735
838
  immediate
@@ -829,9 +932,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
829
932
  'is--disabled': isDisabled
830
933
  }],
831
934
  title: getI18n('vxe.custom.setting.colVisible'),
832
- onClick: () => {
935
+ onClick: evnt => {
833
936
  if (!isDisabled) {
834
- changeCheckboxOption(column);
937
+ changeCheckboxOption(column, evnt);
835
938
  }
836
939
  }
837
940
  }, [(0, _vue.h)('span', {
@@ -896,20 +999,23 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
896
999
  value: 'right',
897
1000
  disabled: isDisabled || isHidden || isMaxFixedColumn
898
1001
  }],
899
- 'onUpdate:modelValue'(value) {
900
- changeFixedOption(column, value);
1002
+ onChange({
1003
+ label,
1004
+ $event
1005
+ }) {
1006
+ changeFixedOption(column, label, $event);
901
1007
  }
902
1008
  }) : (0, _vue.createCommentVNode)()]) : (0, _vue.createCommentVNode)()]));
903
1009
  }
904
1010
  });
905
1011
  const scopedSlots = {
906
1012
  default: () => {
907
- if (defaultSlot) {
908
- return $xeTable.callSlot(defaultSlot, params);
909
- }
910
1013
  return (0, _vue.h)('div', {
911
- ref: bodyElemRef,
912
- class: 'vxe-table-custom-popup--body'
1014
+ ref: refBodyWrapperElem,
1015
+ class: 'vxe-table-custom-popup--body-wrapper'
1016
+ }, defaultSlot ? $xeTable.callSlot(defaultSlot, params) : [(0, _vue.h)('div', {
1017
+ ref: refCustomBodyElem,
1018
+ class: 'vxe-table-custom-popup--handle-wrapper'
913
1019
  }, [topSlot ? (0, _vue.h)('div', {
914
1020
  class: 'vxe-table-custom-popup--table-top'
915
1021
  }, $xeTable.callSlot(topSlot, params)) : renderEmptyElement($xeTable), (0, _vue.h)('div', {
@@ -941,7 +1047,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
941
1047
  default: () => trVNs
942
1048
  })])]), bottomSlot ? (0, _vue.h)('div', {
943
1049
  class: 'vxe-table-custom-popup--table-bottom'
944
- }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable), renderDragTip()]);
1050
+ }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable), renderDragTip()])]);
945
1051
  },
946
1052
  footer: () => {
947
1053
  if (footerSlot) {
@@ -1039,6 +1145,21 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1039
1145
  (0, _log.errLog)('vxe.error.reqComp', ['vxe-radio-group']);
1040
1146
  }
1041
1147
  });
1042
- return renderVN;
1148
+ const $xeTableCustomPanel = {
1149
+ xID,
1150
+ props,
1151
+ context,
1152
+ reactData: customPanelReactData,
1153
+ internalData: customPanelInternalData,
1154
+ xeTable: $xeTable,
1155
+ getRefMaps: () => refMaps,
1156
+ getComputeMaps: () => computeMaps,
1157
+ renderVN
1158
+ };
1159
+ (0, _vue.provide)('$xeTableCustomPanel', $xeTableCustomPanel);
1160
+ return $xeTableCustomPanel;
1161
+ },
1162
+ render() {
1163
+ return this.renderVN();
1043
1164
  }
1044
1165
  });