vxe-table 4.8.4 → 4.8.5

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 (45) hide show
  1. package/README.md +12 -12
  2. package/es/grid/src/grid.js +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/custom/hook.js +135 -3
  6. package/es/table/module/custom/panel.js +151 -175
  7. package/es/table/src/table.js +8 -28
  8. package/es/table/style.css +42 -37
  9. package/es/table/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +42 -37
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/grid/src/grid.js +1 -1
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/index.umd.js +265 -197
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/module/custom/hook.js +177 -3
  21. package/lib/table/module/custom/hook.min.js +1 -1
  22. package/lib/table/module/custom/panel.js +77 -157
  23. package/lib/table/module/custom/panel.min.js +1 -1
  24. package/lib/table/src/table.js +8 -34
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/style/style.css +42 -37
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/lib/vxe-table/style/style.css +42 -37
  33. package/lib/vxe-table/style/style.min.css +1 -1
  34. package/package.json +2 -2
  35. package/packages/grid/src/grid.ts +1 -1
  36. package/packages/table/module/custom/hook.ts +136 -3
  37. package/packages/table/module/custom/panel.ts +157 -179
  38. package/packages/table/src/table.ts +8 -28
  39. package/styles/components/table-module/custom.scss +21 -5
  40. /package/es/{iconfont.1730946045701.ttf → iconfont.1730971754265.ttf} +0 -0
  41. /package/es/{iconfont.1730946045701.woff → iconfont.1730971754265.woff} +0 -0
  42. /package/es/{iconfont.1730946045701.woff2 → iconfont.1730971754265.woff2} +0 -0
  43. /package/lib/{iconfont.1730946045701.ttf → iconfont.1730971754265.ttf} +0 -0
  44. /package/lib/{iconfont.1730946045701.woff → iconfont.1730971754265.woff} +0 -0
  45. /package/lib/{iconfont.1730946045701.woff2 → iconfont.1730971754265.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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
- const tableCustomMethodKeys = ['openCustom', 'closeCustom'];
7
+ const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
8
8
  _ui.VxeUI.hooks.add('tableCustomModule', {
9
9
  setupTable($xeTable) {
10
10
  const {
@@ -28,7 +28,7 @@ _ui.VxeUI.hooks.add('tableCustomModule', {
28
28
  if (el) {
29
29
  tableHeight = el.clientHeight - 28;
30
30
  }
31
- customStore.maxHeight = Math.max(4, tableHeight);
31
+ customStore.maxHeight = Math.max(88, tableHeight);
32
32
  };
33
33
  const openCustom = () => {
34
34
  const {
@@ -75,9 +75,183 @@ _ui.VxeUI.hooks.add('tableCustomModule', {
75
75
  }
76
76
  return (0, _vue.nextTick)();
77
77
  };
78
+ const saveCustom = () => {
79
+ const {
80
+ customColumnList
81
+ } = reactData;
82
+ const customOpts = computeCustomOpts.value;
83
+ const {
84
+ allowVisible,
85
+ allowSort,
86
+ allowFixed,
87
+ allowResizable
88
+ } = customOpts;
89
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
90
+ if (parent) {
91
+ // 更新子列信息
92
+ column.fixed = parent.fixed;
93
+ } else {
94
+ if (allowSort) {
95
+ const sortIndex = index + 1;
96
+ column.renderSortNumber = sortIndex;
97
+ }
98
+ if (allowFixed) {
99
+ column.fixed = column.renderFixed;
100
+ }
101
+ }
102
+ if (allowResizable) {
103
+ if (column.renderVisible && (!column.children || column.children.length)) {
104
+ if (column.renderResizeWidth !== column.renderWidth) {
105
+ column.resizeWidth = column.renderResizeWidth;
106
+ column.renderWidth = column.renderResizeWidth;
107
+ }
108
+ }
109
+ }
110
+ if (allowVisible) {
111
+ column.visible = column.renderVisible;
112
+ }
113
+ });
114
+ return $xeTable.saveCustomStore('confirm');
115
+ };
116
+ const cancelCustom = () => {
117
+ const {
118
+ customColumnList,
119
+ customStore
120
+ } = reactData;
121
+ const {
122
+ oldSortMaps,
123
+ oldFixedMaps,
124
+ oldVisibleMaps
125
+ } = customStore;
126
+ const customOpts = computeCustomOpts.value;
127
+ const {
128
+ allowVisible,
129
+ allowSort,
130
+ allowFixed,
131
+ allowResizable
132
+ } = customOpts;
133
+ _xeUtils.default.eachTree(customColumnList, column => {
134
+ const colid = column.getKey();
135
+ const visible = !!oldVisibleMaps[colid];
136
+ const fixed = oldFixedMaps[colid] || '';
137
+ if (allowVisible) {
138
+ column.renderVisible = visible;
139
+ column.visible = visible;
140
+ }
141
+ if (allowFixed) {
142
+ column.renderFixed = fixed;
143
+ column.fixed = fixed;
144
+ }
145
+ if (allowSort) {
146
+ column.renderSortNumber = oldSortMaps[colid] || 0;
147
+ }
148
+ if (allowResizable) {
149
+ column.renderResizeWidth = column.renderWidth;
150
+ }
151
+ }, {
152
+ children: 'children'
153
+ });
154
+ return (0, _vue.nextTick)();
155
+ };
156
+ const setCustomAllCheckbox = checked => {
157
+ const {
158
+ customStore
159
+ } = reactData;
160
+ const {
161
+ customColumnList
162
+ } = reactData;
163
+ const customOpts = computeCustomOpts.value;
164
+ const {
165
+ checkMethod,
166
+ visibleMethod
167
+ } = customOpts;
168
+ const isAll = !!checked;
169
+ if (customOpts.immediate) {
170
+ _xeUtils.default.eachTree(customColumnList, column => {
171
+ if (visibleMethod && !visibleMethod({
172
+ column
173
+ })) {
174
+ return;
175
+ }
176
+ if (checkMethod && !checkMethod({
177
+ column
178
+ })) {
179
+ return;
180
+ }
181
+ column.visible = isAll;
182
+ column.renderVisible = isAll;
183
+ column.halfVisible = false;
184
+ });
185
+ customStore.isAll = isAll;
186
+ $xeTable.handleCustom();
187
+ $xeTable.saveCustomStore('update:visible');
188
+ } else {
189
+ _xeUtils.default.eachTree(customColumnList, column => {
190
+ if (visibleMethod && !visibleMethod({
191
+ column
192
+ })) {
193
+ return;
194
+ }
195
+ if (checkMethod && !checkMethod({
196
+ column
197
+ })) {
198
+ return;
199
+ }
200
+ column.renderVisible = isAll;
201
+ column.halfVisible = false;
202
+ });
203
+ customStore.isAll = isAll;
204
+ }
205
+ $xeTable.checkCustomStatus();
206
+ return (0, _vue.nextTick)();
207
+ };
78
208
  const customMethods = {
79
209
  openCustom,
80
- closeCustom
210
+ closeCustom,
211
+ saveCustom,
212
+ cancelCustom,
213
+ resetCustom(options) {
214
+ const {
215
+ collectColumn
216
+ } = internalData;
217
+ const customOpts = computeCustomOpts.value;
218
+ const {
219
+ checkMethod
220
+ } = customOpts;
221
+ const opts = Object.assign({
222
+ visible: true,
223
+ resizable: options === true,
224
+ fixed: options === true,
225
+ sort: options === true
226
+ }, options);
227
+ _xeUtils.default.eachTree(collectColumn, column => {
228
+ if (opts.resizable) {
229
+ column.resizeWidth = 0;
230
+ }
231
+ if (opts.fixed) {
232
+ column.fixed = column.defaultFixed;
233
+ }
234
+ if (opts.sort) {
235
+ column.renderSortNumber = column.sortNumber;
236
+ }
237
+ if (!checkMethod || checkMethod({
238
+ column
239
+ })) {
240
+ column.visible = column.defaultVisible;
241
+ }
242
+ column.renderResizeWidth = column.renderWidth;
243
+ });
244
+ $xeTable.saveCustomStore('reset');
245
+ return $xeTable.handleCustom();
246
+ },
247
+ toggleCustomAllCheckbox() {
248
+ const {
249
+ customStore
250
+ } = reactData;
251
+ const isAll = !customStore.isAll;
252
+ return setCustomAllCheckbox(isAll);
253
+ },
254
+ setCustomAllCheckbox
81
255
  };
82
256
  const checkCustomStatus = () => {
83
257
  const {
@@ -1 +1 @@
1
- "use strict";var _vue=require("vue"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const tableCustomMethodKeys=["openCustom","closeCustom"];_ui.VxeUI.hooks.add("tableCustomModule",{setupTable(s){const{reactData:u,internalData:l}=s,o=s.getComputeMaps()["computeCustomOpts"],i=s.getRefMaps()["refElem"],r=s.xegrid,n=()=>{var e=u["customStore"],t=i.value;let s=0;t&&(s=t.clientHeight-28),e.maxHeight=Math.max(4,s)},a=()=>{var{initStore:e,customStore:t}=u,s=l["collectColumn"];const o={},i={},r={};return _xeUtils.default.eachTree(s,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,o[t]=e.renderSortNumber,i[t]=e.fixed,r[t]=e.visible},{children:"children"}),t.oldSortMaps=o,t.oldFixedMaps=i,t.oldVisibleMaps=r,u.customColumnList=s.slice(0),t.visible=!0,e.custom=!0,m(),n(),(0,_vue.nextTick)().then(()=>n())},c=()=>{var e=u["customStore"],t=o.value;return e.visible&&(e.visible=!1,t.immediate||s.handleCustom()),(0,_vue.nextTick)()};var e={openCustom:a,closeCustom:c};const m=()=>{var e=u["customStore"],t=l["collectColumn"];const s=o.value["checkMethod"];e.isAll=t.every(e=>!!s&&!s({column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&t.some(e=>(!s||s({column:e}))&&(e.renderVisible||e.halfVisible))},v=(e,t)=>{(r||s).dispatchEvent("custom",{type:e},t)};var t={checkCustomStatus:m,emitCustomEvent:v,triggerCustomEvent(e){var t=s.reactData["customStore"];t.visible?(c(),v("close",e)):(t.btnEl=e.target,a(),v("open",e))},customOpenEvent(e){var t=u["customStore"];t.visible||(t.activeBtn=!0,t.btnEl=e.target,s.openCustom(),s.emitCustomEvent("open",e))},customCloseEvent(e){var t=u["customStore"];t.visible&&(t.activeBtn=!1,s.closeCustom(),s.emitCustomEvent("close",e))}};return Object.assign(Object.assign({},e),t)},setupGrid(e){return e.extendTableMethods(tableCustomMethodKeys)}});
1
+ "use strict";var _vue=require("vue"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const tableCustomMethodKeys=["openCustom","closeCustom","saveCustom","cancelCustom","resetCustom","toggleCustomAllCheckbox","setCustomAllCheckbox"];_ui.VxeUI.hooks.add("tableCustomModule",{setupTable(a){const{reactData:c,internalData:o}=a,m=a.getComputeMaps()["computeCustomOpts"],s=a.getRefMaps()["refElem"],i=a.xegrid,u=()=>{var e=c["customStore"],t=s.value;let i=0;t&&(i=t.clientHeight-28),e.maxHeight=Math.max(88,i)},r=()=>{var{initStore:e,customStore:t}=c,i=o["collectColumn"];const s={},r={},l={};return _xeUtils.default.eachTree(i,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,s[t]=e.renderSortNumber,r[t]=e.fixed,l[t]=e.visible},{children:"children"}),t.oldSortMaps=s,t.oldFixedMaps=r,t.oldVisibleMaps=l,c.customColumnList=i.slice(0),t.visible=!0,e.custom=!0,n(),u(),(0,_vue.nextTick)().then(()=>u())},l=()=>{var e=c["customStore"],t=m.value;return e.visible&&(e.visible=!1,t.immediate||a.handleCustom()),(0,_vue.nextTick)()};const t=e=>{var t=c["customStore"],i=c["customColumnList"],s=m.value;const{checkMethod:r,visibleMethod:l}=s,o=!!e;return s.immediate?(_xeUtils.default.eachTree(i,e=>{l&&!l({column:e})||r&&!r({column:e})||(e.visible=o,e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o,a.handleCustom(),a.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(i,e=>{l&&!l({column:e})||r&&!r({column:e})||(e.renderVisible=o,e.halfVisible=!1)}),t.isAll=o),a.checkCustomStatus(),(0,_vue.nextTick)()};var e={openCustom:r,closeCustom:l,saveCustom:()=>{var e=c["customColumnList"];const{allowVisible:l,allowSort:o,allowFixed:u,allowResizable:n}=m.value;return _xeUtils.default.eachTree(e,(e,t,i,s,r)=>{r?e.fixed=r.fixed:(o&&(e.renderSortNumber=t+1),u&&(e.fixed=e.renderFixed)),n&&e.renderVisible&&(!e.children||e.children.length)&&e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),l&&(e.visible=e.renderVisible)}),a.saveCustomStore("confirm")},cancelCustom:()=>{var{customColumnList:e,customStore:t}=c;const{oldSortMaps:r,oldFixedMaps:l,oldVisibleMaps:o}=t,{allowVisible:u,allowSort:n,allowFixed:a,allowResizable:d}=m.value;return _xeUtils.default.eachTree(e,e=>{var t=e.getKey(),i=!!o[t],s=l[t]||"";u&&(e.renderVisible=i,e.visible=i),a&&(e.renderFixed=s,e.fixed=s),n&&(e.renderSortNumber=r[t]||0),d&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),(0,_vue.nextTick)()},resetCustom(e){var t=o["collectColumn"];const i=m.value["checkMethod"],s=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e},e);return _xeUtils.default.eachTree(t,e=>{s.resizable&&(e.resizeWidth=0),s.fixed&&(e.fixed=e.defaultFixed),s.sort&&(e.renderSortNumber=e.sortNumber),i&&!i({column:e})||(e.visible=e.defaultVisible),e.renderResizeWidth=e.renderWidth}),a.saveCustomStore("reset"),a.handleCustom()},toggleCustomAllCheckbox(){var e=c["customStore"],e=!e.isAll;return t(e)},setCustomAllCheckbox:t};const n=()=>{var e=c["customStore"],t=o["collectColumn"];const i=m.value["checkMethod"];e.isAll=t.every(e=>!!i&&!i({column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&t.some(e=>(!i||i({column:e}))&&(e.renderVisible||e.halfVisible))},d=(e,t)=>{(i||a).dispatchEvent("custom",{type:e},t)};var v={checkCustomStatus:n,emitCustomEvent:d,triggerCustomEvent(e){var t=a.reactData["customStore"];t.visible?(l(),d("close",e)):(t.btnEl=e.target,r(),d("open",e))},customOpenEvent(e){var t=c["customStore"];t.visible||(t.activeBtn=!0,t.btnEl=e.target,a.openCustom(),a.emitCustomEvent("open",e))},customCloseEvent(e){var t=c["customStore"];t.visible&&(t.activeBtn=!1,a.closeCustom(),a.emitCustomEvent("close",e))}};return Object.assign(Object.assign({},e),v)},setupGrid(e){return e.extendTableMethods(tableCustomMethodKeys)}});
@@ -13,7 +13,8 @@ var _xeUtils = _interopRequireDefault(require("xe-utils"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  const {
15
15
  getI18n,
16
- getIcon
16
+ getIcon,
17
+ renderEmptyElement
17
18
  } = _ui.VxeUI;
18
19
  var _default = exports.default = (0, _vue.defineComponent)({
19
20
  name: 'TableCustomPanel',
@@ -65,44 +66,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
65
66
  const confirmCustomEvent = ({
66
67
  $event
67
68
  }) => {
68
- const {
69
- customColumnList
70
- } = reactData;
71
- const customOpts = computeCustomOpts.value;
72
- const {
73
- allowVisible,
74
- allowSort,
75
- allowFixed,
76
- allowResizable
77
- } = customOpts;
78
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
79
- if (parent) {
80
- // 更新子列信息
81
- column.fixed = parent.fixed;
82
- } else {
83
- if (allowSort) {
84
- const sortIndex = index + 1;
85
- column.renderSortNumber = sortIndex;
86
- }
87
- if (allowFixed) {
88
- column.fixed = column.renderFixed;
89
- }
90
- }
91
- if (allowResizable) {
92
- if (column.renderVisible && (!column.children || column.children.length)) {
93
- if (column.renderResizeWidth !== column.renderWidth) {
94
- column.resizeWidth = column.renderResizeWidth;
95
- column.renderWidth = column.renderResizeWidth;
96
- }
97
- }
98
- }
99
- if (allowVisible) {
100
- column.visible = column.renderVisible;
101
- }
102
- });
69
+ $xeTable.saveCustom();
103
70
  $xeTable.closeCustom();
104
71
  $xeTable.emitCustomEvent('confirm', $event);
105
- $xeTable.saveCustomStore('confirm');
106
72
  };
107
73
  const cancelCloseEvent = ({
108
74
  $event
@@ -113,50 +79,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
113
79
  const cancelCustomEvent = ({
114
80
  $event
115
81
  }) => {
116
- const {
117
- customStore
118
- } = props;
119
- const {
120
- customColumnList
121
- } = reactData;
122
- const {
123
- oldSortMaps,
124
- oldFixedMaps,
125
- oldVisibleMaps
126
- } = customStore;
127
- const customOpts = computeCustomOpts.value;
128
- const {
129
- allowVisible,
130
- allowSort,
131
- allowFixed,
132
- allowResizable
133
- } = customOpts;
134
- _xeUtils.default.eachTree(customColumnList, column => {
135
- const colid = column.getKey();
136
- const visible = !!oldVisibleMaps[colid];
137
- const fixed = oldFixedMaps[colid] || '';
138
- if (allowVisible) {
139
- column.renderVisible = visible;
140
- column.visible = visible;
141
- }
142
- if (allowFixed) {
143
- column.renderFixed = fixed;
144
- column.fixed = fixed;
145
- }
146
- if (allowSort) {
147
- column.renderSortNumber = oldSortMaps[colid] || 0;
148
- }
149
- if (allowResizable) {
150
- column.renderResizeWidth = column.renderWidth;
151
- }
152
- }, {
153
- children: 'children'
154
- });
82
+ $xeTable.cancelCustom();
155
83
  $xeTable.closeCustom();
156
84
  $xeTable.emitCustomEvent('cancel', $event);
157
85
  };
158
86
  const handleResetCustomEvent = evnt => {
159
- $xeTable.resetColumn(true);
87
+ $xeTable.resetCustom(true);
160
88
  $xeTable.closeCustom();
161
89
  $xeTable.emitCustomEvent('reset', evnt);
162
90
  };
@@ -247,55 +175,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
247
175
  }
248
176
  };
249
177
  const allOptionEvent = () => {
250
- const {
251
- customStore
252
- } = props;
253
- const {
254
- customColumnList
255
- } = reactData;
256
- const customOpts = computeCustomOpts.value;
257
- const {
258
- checkMethod,
259
- visibleMethod
260
- } = customOpts;
261
- const isAll = !customStore.isAll;
262
- if (customOpts.immediate) {
263
- _xeUtils.default.eachTree(customColumnList, column => {
264
- if (visibleMethod && !visibleMethod({
265
- column
266
- })) {
267
- return;
268
- }
269
- if (checkMethod && !checkMethod({
270
- column
271
- })) {
272
- return;
273
- }
274
- column.visible = isAll;
275
- column.renderVisible = isAll;
276
- column.halfVisible = false;
277
- });
278
- customStore.isAll = isAll;
279
- $xeTable.handleCustom();
280
- $xeTable.saveCustomStore('update:visible');
281
- } else {
282
- _xeUtils.default.eachTree(customColumnList, column => {
283
- if (visibleMethod && !visibleMethod({
284
- column
285
- })) {
286
- return;
287
- }
288
- if (checkMethod && !checkMethod({
289
- column
290
- })) {
291
- return;
292
- }
293
- column.renderVisible = isAll;
294
- column.halfVisible = false;
295
- });
296
- customStore.isAll = isAll;
297
- }
298
- $xeTable.checkCustomStatus();
178
+ $xeTable.toggleCustomAllCheckbox();
299
179
  };
300
180
  const sortMousedownEvent = evnt => {
301
181
  const btnEl = evnt.currentTarget;
@@ -306,6 +186,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
306
186
  trEl.draggable = true;
307
187
  dragColumnRef.value = column;
308
188
  (0, _dom.addClass)(trEl, 'active--drag-origin');
189
+ updateDropHint(evnt);
309
190
  };
310
191
  const sortMouseupEvent = evnt => {
311
192
  const btnEl = evnt.currentTarget;
@@ -429,13 +310,29 @@ var _default = exports.default = (0, _vue.defineComponent)({
429
310
  placement
430
311
  } = customOpts;
431
312
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
313
+ const slots = customOpts.slots || {};
314
+ const headerSlot = slots.header;
315
+ const topSlot = slots.top;
316
+ const bottomSlot = slots.bottom;
317
+ const defaultSlot = slots.default;
318
+ const footerSlot = slots.footer;
432
319
  const colVNs = [];
433
320
  const customWrapperOns = {};
321
+ const isAllChecked = customStore.isAll;
322
+ const isAllIndeterminate = customStore.isIndeterminate;
323
+ const dragColumn = dragColumnRef.value;
434
324
  // hover 触发
435
325
  if (trigger === 'hover') {
436
326
  customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
437
327
  customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
438
328
  }
329
+ const params = {
330
+ $table: $xeTable,
331
+ $grid: $xeTable.xegrid,
332
+ columns: customColumnList,
333
+ isAllChecked,
334
+ isAllIndeterminate
335
+ };
439
336
  _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
440
337
  const isVisible = visibleMethod ? visibleMethod({
441
338
  column
@@ -515,9 +412,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
515
412
  }) : (0, _vue.createCommentVNode)()]) : (0, _vue.createCommentVNode)()]));
516
413
  }
517
414
  });
518
- const isAllChecked = customStore.isAll;
519
- const isAllIndeterminate = customStore.isIndeterminate;
520
- const dragColumn = dragColumnRef.value;
521
415
  return (0, _vue.h)('div', {
522
416
  ref: refElem,
523
417
  key: 'simple',
@@ -527,8 +421,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
527
421
  style: maxHeight && !['left', 'right'].includes(placement) ? {
528
422
  maxHeight: `${maxHeight}px`
529
423
  } : {}
530
- }, customStore.visible ? [(0, _vue.h)('ul', {
424
+ }, customStore.visible ? [(0, _vue.h)('div', {
531
425
  class: 'vxe-table-custom--header'
426
+ }, headerSlot ? $xeTable.callSlot(headerSlot, params) : [(0, _vue.h)('ul', {
427
+ class: 'vxe-table-custom--panel-list'
532
428
  }, [(0, _vue.h)('li', {
533
429
  class: 'vxe-table-custom--option'
534
430
  }, [allowVisible ? (0, _vue.h)('div', {
@@ -544,20 +440,28 @@ var _default = exports.default = (0, _vue.defineComponent)({
544
440
  class: 'vxe-checkbox--label'
545
441
  }, getI18n('vxe.toolbar.customAll'))]) : (0, _vue.h)('span', {
546
442
  class: 'vxe-checkbox--label'
547
- }, getI18n('vxe.table.customTitle'))])]), (0, _vue.h)('div', {
443
+ }, getI18n('vxe.table.customTitle'))])])]), (0, _vue.h)('div', {
548
444
  ref: bodyElemRef,
549
- class: 'vxe-table-custom--list-wrapper'
550
- }, [(0, _vue.h)(_vue.TransitionGroup, Object.assign({
551
- class: 'vxe-table-custom--body',
445
+ class: 'vxe-table-custom--body'
446
+ }, [topSlot ? (0, _vue.h)('div', {
447
+ class: 'vxe-table-custom--panel-top'
448
+ }, $xeTable.callSlot(topSlot, params)) : renderEmptyElement($xeTable), defaultSlot ? (0, _vue.h)('div', {
449
+ class: 'vxe-table-custom--panel-body'
450
+ }, $xeTable.callSlot(defaultSlot, params)) : (0, _vue.h)(_vue.TransitionGroup, Object.assign({
451
+ class: 'vxe-table-custom--panel-list',
552
452
  name: 'vxe-table-custom--list',
553
453
  tag: 'ul'
554
454
  }, customWrapperOns), {
555
455
  default: () => colVNs
556
- }), (0, _vue.h)('div', {
456
+ }), bottomSlot ? (0, _vue.h)('div', {
457
+ class: 'vxe-table-custom--panel-bottom'
458
+ }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable), (0, _vue.h)('div', {
557
459
  ref: dragHintElemRef,
558
460
  class: 'vxe-table-custom-popup--drag-hint'
559
461
  }, getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? (0, _vue.h)('div', {
560
462
  class: 'vxe-table-custom--footer'
463
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params) : [(0, _vue.h)('div', {
464
+ class: 'vxe-table-custom--footer-buttons'
561
465
  }, [VxeUIButtonComponent ? (0, _vue.h)(VxeUIButtonComponent, {
562
466
  mode: 'text',
563
467
  content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
@@ -575,7 +479,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
575
479
  status: 'primary',
576
480
  content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm'),
577
481
  onClick: confirmCustomEvent
578
- }) : (0, _vue.createCommentVNode)()]) : null] : []);
482
+ }) : (0, _vue.createCommentVNode)()])]) : null] : []);
579
483
  };
580
484
  const renderPopupPanel = () => {
581
485
  const {
@@ -605,7 +509,23 @@ var _default = exports.default = (0, _vue.defineComponent)({
605
509
  const modalOpts = Object.assign({}, modalOptions);
606
510
  const drawerOpts = Object.assign({}, drawerOptions);
607
511
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
512
+ const slots = customOpts.slots || {};
513
+ const headerSlot = slots.header;
514
+ const topSlot = slots.top;
515
+ const bottomSlot = slots.bottom;
516
+ const defaultSlot = slots.default;
517
+ const footerSlot = slots.footer;
608
518
  const trVNs = [];
519
+ const isAllChecked = customStore.isAll;
520
+ const isAllIndeterminate = customStore.isIndeterminate;
521
+ const dragColumn = dragColumnRef.value;
522
+ const params = {
523
+ $table: $xeTable,
524
+ $grid: $xeTable.xegrid,
525
+ columns: customColumnList,
526
+ isAllChecked,
527
+ isAllIndeterminate
528
+ };
609
529
  _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
610
530
  const isVisible = visibleMethod ? visibleMethod({
611
531
  column
@@ -701,36 +621,28 @@ var _default = exports.default = (0, _vue.defineComponent)({
701
621
  }) : (0, _vue.createCommentVNode)()]) : (0, _vue.createCommentVNode)()]));
702
622
  }
703
623
  });
704
- const isAllChecked = customStore.isAll;
705
- const isAllIndeterminate = customStore.isIndeterminate;
706
- const dragColumn = dragColumnRef.value;
707
624
  const scopedSlots = {
708
625
  default: () => {
626
+ if (defaultSlot) {
627
+ return $xeTable.callSlot(defaultSlot, params);
628
+ }
709
629
  return (0, _vue.h)('div', {
710
630
  ref: bodyElemRef,
711
631
  class: 'vxe-table-custom-popup--body'
712
- }, [(0, _vue.h)('div', {
632
+ }, [topSlot ? (0, _vue.h)('div', {
633
+ class: 'vxe-table-custom-popup--table-top'
634
+ }, $xeTable.callSlot(topSlot, params)) : renderEmptyElement($xeTable), (0, _vue.h)('div', {
713
635
  class: 'vxe-table-custom-popup--table-wrapper'
714
636
  }, [(0, _vue.h)('table', {}, [(0, _vue.h)('colgroup', {}, [allowVisible ? (0, _vue.h)('col', {
715
- style: {
716
- width: '80px'
717
- }
637
+ class: 'vxe-table-custom-popup--table-col-seq'
718
638
  }) : (0, _vue.createCommentVNode)(), allowSort ? (0, _vue.h)('col', {
719
- style: {
720
- width: '80px'
721
- }
639
+ class: 'vxe-table-custom-popup--table-col-sort'
722
640
  }) : (0, _vue.createCommentVNode)(), (0, _vue.h)('col', {
723
- style: {
724
- minWidth: '120px'
725
- }
641
+ class: 'vxe-table-custom-popup--table-col-title'
726
642
  }), allowResizable ? (0, _vue.h)('col', {
727
- style: {
728
- width: '140px'
729
- }
643
+ class: 'vxe-table-custom-popup--table-col-width'
730
644
  }) : (0, _vue.createCommentVNode)(), allowFixed ? (0, _vue.h)('col', {
731
- style: {
732
- width: '200px'
733
- }
645
+ class: 'vxe-table-custom-popup--table-col-fixed'
734
646
  }) : (0, _vue.createCommentVNode)()]), (0, _vue.h)('thead', {}, [(0, _vue.h)('tr', {}, [allowVisible ? (0, _vue.h)('th', {}, [(0, _vue.h)('div', {
735
647
  class: ['vxe-table-custom--checkbox-option', {
736
648
  'is--checked': isAllChecked,
@@ -755,17 +667,22 @@ var _default = exports.default = (0, _vue.defineComponent)({
755
667
  });
756
668
  }
757
669
  }) : (0, _vue.createCommentVNode)()]) : (0, _vue.createCommentVNode)(), (0, _vue.h)('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? (0, _vue.h)('th', {}, getI18n('vxe.custom.setting.colResizable')) : (0, _vue.createCommentVNode)(), allowFixed ? (0, _vue.h)('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : (0, _vue.createCommentVNode)()])]), (0, _vue.h)(_vue.TransitionGroup, {
758
- class: 'vxe-table-custom--body',
670
+ class: 'vxe-table-custom--panel-list',
759
671
  tag: 'tbody',
760
672
  name: 'vxe-table-custom--list'
761
673
  }, {
762
674
  default: () => trVNs
763
- })])]), (0, _vue.h)('div', {
675
+ })])]), bottomSlot ? (0, _vue.h)('div', {
676
+ class: 'vxe-table-custom-popup--table-bottom'
677
+ }, $xeTable.callSlot(bottomSlot, params)) : renderEmptyElement($xeTable), (0, _vue.h)('div', {
764
678
  ref: dragHintElemRef,
765
679
  class: 'vxe-table-custom-popup--drag-hint'
766
680
  }, getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))]);
767
681
  },
768
682
  footer: () => {
683
+ if (footerSlot) {
684
+ return $xeTable.callSlot(footerSlot, params);
685
+ }
769
686
  return (0, _vue.h)('div', {
770
687
  class: 'vxe-table-custom-popup--footer'
771
688
  }, [VxeUIButtonComponent ? (0, _vue.h)(VxeUIButtonComponent, {
@@ -781,6 +698,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
781
698
  }) : (0, _vue.createCommentVNode)()]);
782
699
  }
783
700
  };
701
+ if (headerSlot) {
702
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params);
703
+ }
784
704
  if (mode === 'drawer') {
785
705
  return VxeUIDrawerComponent ? (0, _vue.h)(VxeUIDrawerComponent, {
786
706
  key: 'drawer',