vxe-table 3.10.4 → 3.10.6

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 (48) hide show
  1. package/es/grid/src/grid.js +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/custom/mixin.js +130 -2
  5. package/es/table/module/custom/panel.js +327 -338
  6. package/es/table/module/export/export-panel.js +2 -2
  7. package/es/table/src/methods.js +25 -38
  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 +387 -306
  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/mixin.js +176 -2
  21. package/lib/table/module/custom/mixin.min.js +1 -1
  22. package/lib/table/module/custom/panel.js +182 -255
  23. package/lib/table/module/custom/panel.min.js +1 -1
  24. package/lib/table/module/export/export-panel.js +2 -2
  25. package/lib/table/module/export/export-panel.min.js +1 -1
  26. package/lib/table/src/methods.js +24 -44
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/style/style.css +42 -37
  29. package/lib/table/style/style.min.css +1 -1
  30. package/lib/ui/index.js +1 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +42 -37
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/grid/src/grid.ts +1 -1
  38. package/packages/table/module/custom/mixin.ts +131 -2
  39. package/packages/table/module/custom/panel.ts +332 -337
  40. package/packages/table/module/export/export-panel.ts +2 -2
  41. package/packages/table/src/methods.ts +24 -37
  42. package/styles/components/table-module/custom.scss +21 -5
  43. /package/es/{iconfont.1730945625063.ttf → iconfont.1730978752470.ttf} +0 -0
  44. /package/es/{iconfont.1730945625063.woff → iconfont.1730978752470.woff} +0 -0
  45. /package/es/{iconfont.1730945625063.woff2 → iconfont.1730978752470.woff2} +0 -0
  46. /package/lib/{iconfont.1730945625063.ttf → iconfont.1730978752470.ttf} +0 -0
  47. /package/lib/{iconfont.1730945625063.woff → iconfont.1730978752470.woff} +0 -0
  48. /package/lib/{iconfont.1730945625063.woff2 → iconfont.1730978752470.woff2} +0 -0
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default={methods:{_openCustom(){var{initStore:e,customStore:t,collectColumn:i}=this;let s={},o={},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,o[t]=e.fixed,l[t]=e.visible},{children:"children"}),t.oldSortMaps=s,t.oldFixedMaps=o,t.oldVisibleMaps=l,this.customColumnList=i.slice(0),t.visible=!0,e.custom=!0,this.checkCustomStatus(),this.calcMaxHeight(),this.$nextTick().then(()=>this.calcMaxHeight())},_closeCustom(){var{customStore:e,customOpts:t}=this;return e.visible&&(e.visible=!1,t.immediate||this.handleCustom()),this.$nextTick()},calcMaxHeight(){var{$el:e,customStore:t}=this;let i=0;e&&(i=e.clientHeight-28),t.maxHeight=Math.max(4,i)},checkCustomStatus(){var{customStore:e,collectColumn:t,customOpts:i}=this;let s=i.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))},emitCustomEvent(e,t){(this.$xegrid||this).$emit("custom",{type:e,$table:this,$grid:this.$xegrid,$event:t})},triggerCustomEvent(e){var t=this.customStore;t.visible?(this.closeCustom(),this.emitCustomEvent("close",e)):(t.btnEl=e.target,this.openCustom(),this.emitCustomEvent("open",e))},customOpenEvent(e){var t=this.customStore;t.visible||(t.activeBtn=!0,t.btnEl=e.target,this.openCustom(),this.emitCustomEvent("open",e))},customColseEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!1,this.closeCustom(),this.emitCustomEvent("close",e))}}};
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default={methods:{_openCustom(){var{initStore:e,customStore:t,collectColumn:i}=this;let s={},l={},r={};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,l[t]=e.fixed,r[t]=e.visible},{children:"children"}),t.oldSortMaps=s,t.oldFixedMaps=l,t.oldVisibleMaps=r,this.customColumnList=i.slice(0),t.visible=!0,e.custom=!0,this.checkCustomStatus(),this.calcMaxHeight(),this.$nextTick().then(()=>this.calcMaxHeight())},_closeCustom(){var{customStore:e,customOpts:t}=this;return e.visible&&(e.visible=!1,t.immediate||this.handleCustom()),this.$nextTick()},_saveCustom(){var{customOpts:e,customColumnList:t}=this;let{allowVisible:r,allowSort:o,allowFixed:u,allowResizable:d}=e;return _xeUtils.default.eachTree(t,(e,t,i,s,l)=>{l?e.fixed=l.fixed:(o&&(e.renderSortNumber=t+1),u&&(e.fixed=e.renderFixed)),d&&e.renderVisible&&(!e.children||e.children.length)&&e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),r&&(e.visible=e.renderVisible)}),this.closeCustom(),this.saveCustomStore("confirm")},_cancelCustom(){var{customStore:e,customOpts:t,customColumnList:i}=this;let{oldSortMaps:l,oldFixedMaps:r,oldVisibleMaps:o}=e,{allowVisible:u,allowSort:d,allowFixed:h,allowResizable:n}=t;return _xeUtils.default.eachTree(i,e=>{var t=e.getKey(),i=!!o[t],s=r[t]||"";u&&(e.renderVisible=i,e.visible=i),h&&(e.renderFixed=s,e.fixed=s),d&&(e.renderSortNumber=l[t]||0),n&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),this.$nextTick()},_resetCustom(e){var{collectColumn:t,customOpts:i}=this;let s=i.checkMethod,l=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e},e);return _xeUtils.default.eachTree(t,e=>{l.resizable&&(e.resizeWidth=0),l.fixed&&(e.fixed=e.defaultFixed),l.sort&&(e.renderSortNumber=e.sortNumber),s&&!s({column:e})||(e.visible=e.defaultVisible),e.renderResizeWidth=e.renderWidth}),this.saveCustomStore("reset"),this.handleCustom()},_toggleCustomAllCheckbox(){var e=this.customStore,e=!e.isAll;return this.setCustomAllCheckbox(e)},_setCustomAllCheckbox(e){var t=this,i=this.customStore,{customColumnList:s,customOpts:l}=this;let{checkMethod:r,visibleMethod:o}=l,u=!!e;l.immediate?(_xeUtils.default.eachTree(s,e=>{o&&!o({column:e})||r&&!r({column:e})||(e.visible=u,e.renderVisible=u,e.halfVisible=!1)}),i.isAll=u,t.handleCustom(),t.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(s,e=>{o&&!o({column:e})||r&&!r({column:e})||(e.renderVisible=u,e.halfVisible=!1)}),i.isAll=u),t.checkCustomStatus()},calcMaxHeight(){var{$el:e,customStore:t}=this;let i=0;e&&(i=e.clientHeight-28),t.maxHeight=Math.max(88,i)},checkCustomStatus(){var{customStore:e,collectColumn:t,customOpts:i}=this;let s=i.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))},emitCustomEvent(e,t){(this.$xegrid||this).$emit("custom",{type:e,$table:this,$grid:this.$xegrid,$event:t})},triggerCustomEvent(e){var t=this.customStore;t.visible?(this.closeCustom(),this.emitCustomEvent("close",e)):(t.btnEl=e.target,this.openCustom(),this.emitCustomEvent("open",e))},customOpenEvent(e){var t=this.customStore;t.visible||(t.activeBtn=!0,t.btnEl=e.target,this.openCustom(),this.emitCustomEvent("open",e))},customCloseEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!1,this.closeCustom(),this.emitCustomEvent("close",e))}}};
@@ -34,9 +34,9 @@ function updateDropHint(_vm, evnt) {
34
34
  }
35
35
  const renderSimplePanel = (h, _vm) => {
36
36
  const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
37
+ const $xeTable = _vm.$xeTable;
37
38
  const {
38
39
  _e,
39
- $xetable,
40
40
  customStore,
41
41
  dragColumn
42
42
  } = _vm;
@@ -44,7 +44,7 @@ const renderSimplePanel = (h, _vm) => {
44
44
  customColumnList,
45
45
  customOpts,
46
46
  isMaxFixedColumn
47
- } = $xetable;
47
+ } = $xeTable;
48
48
  const {
49
49
  maxHeight
50
50
  } = customStore;
@@ -57,6 +57,12 @@ const renderSimplePanel = (h, _vm) => {
57
57
  trigger,
58
58
  placement
59
59
  } = customOpts;
60
+ const slots = customOpts.slots || {};
61
+ const headerSlot = slots.header;
62
+ const topSlot = slots.top;
63
+ const bottomSlot = slots.bottom;
64
+ const defaultSlot = slots.default;
65
+ const footerSlot = slots.footer;
60
66
  const colVNs = [];
61
67
  const customWrapperOns = {};
62
68
  // hover 触发
@@ -64,6 +70,15 @@ const renderSimplePanel = (h, _vm) => {
64
70
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
65
71
  customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
66
72
  }
73
+ const isAllChecked = customStore.isAll;
74
+ const isAllIndeterminate = customStore.isIndeterminate;
75
+ const params = {
76
+ $table: $xeTable,
77
+ $grid: $xeTable.xegrid,
78
+ columns: customColumnList,
79
+ isAllChecked,
80
+ isAllIndeterminate
81
+ };
67
82
  _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
68
83
  const isVisible = visibleMethod ? visibleMethod({
69
84
  column
@@ -167,8 +182,6 @@ const renderSimplePanel = (h, _vm) => {
167
182
  })]) : _e()]));
168
183
  }
169
184
  });
170
- const isAllChecked = customStore.isAll;
171
- const isAllIndeterminate = customStore.isIndeterminate;
172
185
  return h('div', {
173
186
  key: 'simple',
174
187
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
@@ -177,8 +190,10 @@ const renderSimplePanel = (h, _vm) => {
177
190
  style: maxHeight && !['left', 'right'].includes(placement) ? {
178
191
  maxHeight: `${maxHeight}px`
179
192
  } : {}
180
- }, customStore.visible ? [h('ul', {
193
+ }, customStore.visible ? [h('div', {
181
194
  class: 'vxe-table-custom--header'
195
+ }, headerSlot ? $xeTable.callSlot(headerSlot, params, h) : [h('ul', {
196
+ class: 'vxe-table-custom--panel-list'
182
197
  }, [h('li', {
183
198
  class: 'vxe-table-custom--option'
184
199
  }, [allowVisible ? h('div', {
@@ -198,21 +213,29 @@ const renderSimplePanel = (h, _vm) => {
198
213
  class: 'vxe-checkbox--label'
199
214
  }, getI18n('vxe.toolbar.customAll'))]) : h('span', {
200
215
  class: 'vxe-checkbox--label'
201
- }, getI18n('vxe.table.customTitle'))])]), h('div', {
216
+ }, getI18n('vxe.table.customTitle'))])])]), h('div', {
202
217
  ref: 'bodyElemRef',
203
- class: 'vxe-table-custom--list-wrapper'
204
- }, [h('transition-group', {
205
- class: 'vxe-table-custom--body',
218
+ class: 'vxe-table-custom--body'
219
+ }, [topSlot ? h('div', {
220
+ class: 'vxe-table-custom--panel-top'
221
+ }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), defaultSlot ? h('div', {
222
+ class: 'vxe-table-custom--panel-body'
223
+ }, $xeTable.callSlot(defaultSlot, params, h)) : h('transition-group', {
224
+ class: 'vxe-table-custom--panel-list',
206
225
  props: {
207
226
  name: 'vxe-table-custom--list',
208
227
  tag: 'ul'
209
228
  },
210
229
  on: customWrapperOns
211
- }, colVNs), h('div', {
230
+ }, colVNs), bottomSlot ? h('div', {
231
+ class: 'vxe-table-custom--panel-bottom'
232
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
212
233
  ref: 'dragHintElemRef',
213
234
  class: 'vxe-table-custom-popup--drag-hint'
214
235
  }, getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? h('div', {
215
236
  class: 'vxe-table-custom--footer'
237
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
238
+ class: 'vxe-table-custom--footer-buttons'
216
239
  }, [h(VxeUIButtonComponent, {
217
240
  props: {
218
241
  mode: 'text',
@@ -246,7 +269,7 @@ const renderSimplePanel = (h, _vm) => {
246
269
  on: {
247
270
  click: _vm.confirmCustomEvent
248
271
  }
249
- })]) : null] : []);
272
+ })])]) : null] : []);
250
273
  };
251
274
  const renderPopupPanel = (h, _vm) => {
252
275
  const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
@@ -254,9 +277,9 @@ const renderPopupPanel = (h, _vm) => {
254
277
  const VxeUIInputComponent = _ui.VxeUI.getComponent('VxeInput');
255
278
  const VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
256
279
  const $xeTableCustomPanel = _vm;
280
+ const $xeTable = _vm.$xeTable;
257
281
  const {
258
282
  _e,
259
- $xetable,
260
283
  customStore
261
284
  } = _vm;
262
285
  const {
@@ -264,7 +287,7 @@ const renderPopupPanel = (h, _vm) => {
264
287
  customColumnList,
265
288
  columnOpts,
266
289
  isMaxFixedColumn
267
- } = $xetable;
290
+ } = $xeTable;
268
291
  const {
269
292
  modalOptions,
270
293
  allowVisible,
@@ -278,7 +301,22 @@ const renderPopupPanel = (h, _vm) => {
278
301
  maxFixedSize
279
302
  } = columnOpts;
280
303
  const modalOpts = Object.assign({}, modalOptions);
304
+ const slots = customOpts.slots || {};
305
+ const headerSlot = slots.header;
306
+ const topSlot = slots.top;
307
+ const bottomSlot = slots.bottom;
308
+ const defaultSlot = slots.default;
309
+ const footerSlot = slots.footer;
281
310
  const trVNs = [];
311
+ const isAllChecked = customStore.isAll;
312
+ const isAllIndeterminate = customStore.isIndeterminate;
313
+ const params = {
314
+ $table: $xeTable,
315
+ $grid: $xeTable.xegrid,
316
+ columns: customColumnList,
317
+ isAllChecked,
318
+ isAllIndeterminate
319
+ };
282
320
  _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
283
321
  const isVisible = visibleMethod ? visibleMethod({
284
322
  column
@@ -397,8 +435,105 @@ const renderPopupPanel = (h, _vm) => {
397
435
  })]) : _e()]));
398
436
  }
399
437
  });
400
- const isAllChecked = customStore.isAll;
401
- const isAllIndeterminate = customStore.isIndeterminate;
438
+ const scopedSlots = {
439
+ default: () => {
440
+ if (defaultSlot) {
441
+ return $xeTable.callSlot(defaultSlot, params, h);
442
+ }
443
+ return h('div', {
444
+ ref: 'bodyElemRef',
445
+ class: 'vxe-table-custom-popup--body'
446
+ }, [topSlot ? h('div', {
447
+ class: 'vxe-table-custom-popup--table-top'
448
+ }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
449
+ class: 'vxe-table-custom-popup--table-wrapper'
450
+ }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
451
+ class: 'vxe-table-custom-popup--table-col-seq'
452
+ }) : _e(), allowSort ? h('col', {
453
+ class: 'vxe-table-custom-popup--table-col-sort'
454
+ }) : _e(), h('col', {
455
+ class: 'vxe-table-custom-popup--table-col-title'
456
+ }), allowResizable ? h('col', {
457
+ class: 'vxe-table-custom-popup--table-col-width'
458
+ }) : _e(), allowFixed ? h('col', {
459
+ class: 'vxe-table-custom-popup--table-col-fixed'
460
+ }) : _e()]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
461
+ class: ['vxe-table-custom--checkbox-option', {
462
+ 'is--checked': isAllChecked,
463
+ 'is--indeterminate': isAllIndeterminate
464
+ }],
465
+ attrs: {
466
+ title: getI18n('vxe.table.allTitle')
467
+ },
468
+ on: {
469
+ click: _vm.allOptionEvent
470
+ }
471
+ }, [h('span', {
472
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
473
+ }), h('span', {
474
+ class: 'vxe-checkbox--label'
475
+ }, getI18n('vxe.toolbar.customAll'))])]) : _e(), allowSort ? h('th', {}, [h('span', {
476
+ class: 'vxe-table-custom-popup--table-sort-help-title'
477
+ }, getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
478
+ props: {
479
+ enterable: true,
480
+ content: getI18n('vxe.custom.setting.sortHelpTip'),
481
+ popupClassName: 'vxe-table--ignore-clear'
482
+ },
483
+ scopedSlots: {
484
+ default: () => {
485
+ return h('i', {
486
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
487
+ });
488
+ }
489
+ }
490
+ }) : renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
491
+ class: 'vxe-table-custom--panel-list',
492
+ props: {
493
+ tag: 'tbody',
494
+ name: 'vxe-table-custom--list'
495
+ }
496
+ }, trVNs)])]), bottomSlot ? h('div', {
497
+ class: 'vxe-table-custom-popup--table-bottom'
498
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
499
+ ref: 'dragHintElemRef',
500
+ class: 'vxe-table-custom-popup--drag-hint'
501
+ }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
502
+ },
503
+ footer: () => {
504
+ if (footerSlot) {
505
+ return $xeTable.callSlot(footerSlot, params, h);
506
+ }
507
+ return h('div', {
508
+ class: 'vxe-table-custom-popup--footer'
509
+ }, [h(VxeUIButtonComponent, {
510
+ props: {
511
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
512
+ },
513
+ on: {
514
+ click: _vm.resetCustomEvent
515
+ }
516
+ }), h(VxeUIButtonComponent, {
517
+ props: {
518
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
519
+ },
520
+ on: {
521
+ click: _vm.cancelCustomEvent
522
+ }
523
+ }), h(VxeUIButtonComponent, {
524
+ props: {
525
+ status: 'primary',
526
+ content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
527
+ },
528
+ on: {
529
+ click: _vm.confirmCustomEvent
530
+ }
531
+ })]);
532
+ }
533
+ };
534
+ if (headerSlot) {
535
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
536
+ }
402
537
  return VxeUIModalComponent ? h(VxeUIModalComponent, {
403
538
  key: 'modal',
404
539
  props: {
@@ -409,10 +544,12 @@ const renderPopupPanel = (h, _vm) => {
409
544
  minWidth: modalOpts.minWidth || 700,
410
545
  height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
411
546
  minHeight: modalOpts.minHeight || 400,
412
- showZoom: !!modalOpts.showZoom,
413
- mask: !!modalOpts.mask,
414
- lockView: !!modalOpts.lockView,
415
- resize: !!modalOpts.resize,
547
+ showZoom: modalOpts.showZoom,
548
+ showMaximize: modalOpts.showMaximize,
549
+ showMinimize: modalOpts.showMinimize,
550
+ mask: modalOpts.mask,
551
+ lockView: modalOpts.lockView,
552
+ resize: modalOpts.resize,
416
553
  escClosable: !!modalOpts.escClosable,
417
554
  destroyOnClose: true,
418
555
  showFooter: true
@@ -422,102 +559,7 @@ const renderPopupPanel = (h, _vm) => {
422
559
  customStore.visible = value;
423
560
  }
424
561
  },
425
- scopedSlots: {
426
- default: () => {
427
- return h('div', {
428
- ref: 'bodyElemRef',
429
- class: 'vxe-table-custom-popup--body'
430
- }, [h('div', {
431
- class: 'vxe-table-custom-popup--table-wrapper'
432
- }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
433
- style: {
434
- width: '80px'
435
- }
436
- }) : _e(), allowSort ? h('col', {
437
- style: {
438
- width: '80px'
439
- }
440
- }) : _e(), h('col', {
441
- style: {
442
- minWidth: '120px'
443
- }
444
- }), allowResizable ? h('col', {
445
- style: {
446
- width: '140px'
447
- }
448
- }) : _e(), allowFixed ? h('col', {
449
- style: {
450
- width: '200px'
451
- }
452
- }) : _e()]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
453
- class: ['vxe-table-custom--checkbox-option', {
454
- 'is--checked': isAllChecked,
455
- 'is--indeterminate': isAllIndeterminate
456
- }],
457
- attrs: {
458
- title: getI18n('vxe.table.allTitle')
459
- },
460
- on: {
461
- click: _vm.allOptionEvent
462
- }
463
- }, [h('span', {
464
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
465
- }), h('span', {
466
- class: 'vxe-checkbox--label'
467
- }, getI18n('vxe.toolbar.customAll'))])]) : _e(), allowSort ? h('th', {}, [h('span', {
468
- class: 'vxe-table-custom-popup--table-sort-help-title'
469
- }, getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
470
- props: {
471
- enterable: true,
472
- content: getI18n('vxe.custom.setting.sortHelpTip'),
473
- popupClassName: 'vxe-table--ignore-clear'
474
- },
475
- scopedSlots: {
476
- default: () => {
477
- return h('i', {
478
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
479
- });
480
- }
481
- }
482
- }) : renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
483
- class: 'vxe-table-custom--body',
484
- props: {
485
- tag: 'tbody',
486
- name: 'vxe-table-custom--list'
487
- }
488
- }, trVNs)])]), h('div', {
489
- ref: 'dragHintElemRef',
490
- class: 'vxe-table-custom-popup--drag-hint'
491
- }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
492
- },
493
- footer: () => {
494
- return h('div', {
495
- class: 'vxe-table-custom-popup--footer'
496
- }, [h(VxeUIButtonComponent, {
497
- props: {
498
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
499
- },
500
- on: {
501
- click: _vm.resetCustomEvent
502
- }
503
- }), h(VxeUIButtonComponent, {
504
- props: {
505
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
506
- },
507
- on: {
508
- click: _vm.cancelCustomEvent
509
- }
510
- }), h(VxeUIButtonComponent, {
511
- props: {
512
- status: 'primary',
513
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
514
- },
515
- on: {
516
- click: _vm.confirmCustomEvent
517
- }
518
- })]);
519
- }
520
- }
562
+ scopedSlots
521
563
  }) : renderEmptyElement($xeTableCustomPanel);
522
564
  };
523
565
  var _default = exports.default = {
@@ -529,6 +571,9 @@ var _default = exports.default = {
529
571
  }
530
572
  },
531
573
  inject: {
574
+ $xeTable: {
575
+ default: null
576
+ },
532
577
  $xetable: {
533
578
  default: null
534
579
  }
@@ -607,114 +652,41 @@ var _default = exports.default = {
607
652
  customStore.activeWrapper = false;
608
653
  setTimeout(() => {
609
654
  if (!customStore.activeBtn && !customStore.activeWrapper) {
610
- $xetable.customColseEvent(evnt);
655
+ $xetable.customCloseEvent(evnt);
611
656
  }
612
657
  }, 300);
613
658
  },
614
659
  getStoreData() {
615
660
  return {};
616
661
  },
617
- confirmCustomEvent(evnt) {
618
- const {
619
- $xetable
620
- } = this;
621
- const {
622
- customOpts,
623
- customColumnList
624
- } = $xetable;
625
- const {
626
- allowVisible,
627
- allowSort,
628
- allowFixed,
629
- allowResizable
630
- } = customOpts;
631
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
632
- if (parent) {
633
- // 更新子列信息
634
- column.fixed = parent.fixed;
635
- } else {
636
- if (allowSort) {
637
- const sortIndex = index + 1;
638
- column.renderSortNumber = sortIndex;
639
- }
640
- if (allowFixed) {
641
- column.fixed = column.renderFixed;
642
- }
643
- }
644
- if (allowResizable) {
645
- if (column.renderVisible && (!column.children || column.children.length)) {
646
- if (column.renderResizeWidth !== column.renderWidth) {
647
- column.resizeWidth = column.renderResizeWidth;
648
- column.renderWidth = column.renderResizeWidth;
649
- }
650
- }
651
- }
652
- if (allowVisible) {
653
- column.visible = column.renderVisible;
654
- }
655
- });
656
- $xetable.closeCustom();
657
- $xetable.emitCustomEvent('confirm', evnt);
658
- $xetable.saveCustomStore('confirm');
662
+ confirmCustomEvent({
663
+ $event
664
+ }) {
665
+ const $xeTable = this.$xeTable;
666
+ $xeTable.saveCustom();
667
+ $xeTable.closeCustom();
668
+ $xeTable.emitCustomEvent('confirm', $event);
659
669
  },
660
670
  cancelCloseEvent({
661
671
  $event
662
672
  }) {
663
- const {
664
- $xetable
665
- } = this;
666
- $xetable.closeCustom();
667
- $xetable.emitCustomEvent('cancel', $event);
673
+ const $xeTable = this.$xeTable;
674
+ $xeTable.closeCustom();
675
+ $xeTable.emitCustomEvent('close', $event);
668
676
  },
669
- cancelCustomEvent(evnt) {
670
- const {
671
- $xetable
672
- } = this;
673
- const {
674
- customStore,
675
- customOpts,
676
- customColumnList
677
- } = $xetable;
678
- const {
679
- oldSortMaps,
680
- oldFixedMaps,
681
- oldVisibleMaps
682
- } = customStore;
683
- const {
684
- allowVisible,
685
- allowSort,
686
- allowFixed,
687
- allowResizable
688
- } = customOpts;
689
- _xeUtils.default.eachTree(customColumnList, column => {
690
- const colid = column.getKey();
691
- const visible = !!oldVisibleMaps[colid];
692
- const fixed = oldFixedMaps[colid] || '';
693
- if (allowVisible) {
694
- column.renderVisible = visible;
695
- column.visible = visible;
696
- }
697
- if (allowFixed) {
698
- column.renderFixed = fixed;
699
- column.fixed = fixed;
700
- }
701
- if (allowSort) {
702
- column.renderSortNumber = oldSortMaps[colid] || 0;
703
- }
704
- if (allowResizable) {
705
- column.renderResizeWidth = column.renderWidth;
706
- }
707
- }, {
708
- children: 'children'
709
- });
710
- $xetable.closeCustom();
711
- $xetable.emitCustomEvent('cancel', evnt);
677
+ cancelCustomEvent({
678
+ $event
679
+ }) {
680
+ const $xeTable = this.$xeTable;
681
+ $xeTable.cancelCustom();
682
+ $xeTable.closeCustom();
683
+ $xeTable.emitCustomEvent('cancel', $event);
712
684
  },
713
685
  handleResetCustomEvent(evnt) {
714
686
  const {
715
687
  $xetable
716
688
  } = this;
717
- $xetable.resetColumn(true);
689
+ $xetable.resetCustom(true);
718
690
  $xetable.closeCustom();
719
691
  $xetable.emitCustomEvent('reset', evnt);
720
692
  },
@@ -832,55 +804,9 @@ var _default = exports.default = {
832
804
  },
833
805
  allOptionEvent() {
834
806
  const {
835
- $xetable,
836
- customStore
807
+ $xetable
837
808
  } = this;
838
- const {
839
- customColumnList,
840
- customOpts
841
- } = $xetable;
842
- const {
843
- checkMethod,
844
- visibleMethod
845
- } = customOpts;
846
- const isAll = !customStore.isAll;
847
- if (customOpts.immediate) {
848
- _xeUtils.default.eachTree(customColumnList, column => {
849
- if (visibleMethod && !visibleMethod({
850
- column
851
- })) {
852
- return;
853
- }
854
- if (checkMethod && !checkMethod({
855
- column
856
- })) {
857
- return;
858
- }
859
- column.visible = isAll;
860
- column.renderVisible = isAll;
861
- column.halfVisible = false;
862
- });
863
- customStore.isAll = isAll;
864
- $xetable.handleCustom();
865
- $xetable.saveCustomStore('update:visible');
866
- } else {
867
- _xeUtils.default.eachTree(customColumnList, column => {
868
- if (visibleMethod && !visibleMethod({
869
- column
870
- })) {
871
- return;
872
- }
873
- if (checkMethod && !checkMethod({
874
- column
875
- })) {
876
- return;
877
- }
878
- column.renderVisible = isAll;
879
- column.halfVisible = false;
880
- });
881
- customStore.isAll = isAll;
882
- }
883
- $xetable.checkCustomStatus();
809
+ $xetable.toggleCustomAllCheckbox();
884
810
  },
885
811
  sortMousedownEvent(evnt) {
886
812
  const {
@@ -894,6 +820,7 @@ var _default = exports.default = {
894
820
  trEl.draggable = true;
895
821
  this.dragColumn = column;
896
822
  (0, _dom.addClass)(trEl, 'active--drag-origin');
823
+ updateDropHint(this, evnt);
897
824
  },
898
825
  sortMouseupEvent(evnt) {
899
826
  const btnEl = evnt.currentTarget;