vxe-table 3.10.3 → 3.10.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 (53) 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/cell.js +2 -2
  8. package/es/table/src/methods.js +9 -28
  9. package/es/table/style.css +42 -37
  10. package/es/table/style.min.css +1 -1
  11. package/es/ui/index.js +2 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-table/style.css +42 -37
  14. package/es/vxe-table/style.min.css +1 -1
  15. package/lib/grid/src/grid.js +1 -1
  16. package/lib/grid/src/grid.min.js +1 -1
  17. package/lib/index.umd.js +375 -298
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/style.min.css +1 -1
  21. package/lib/table/module/custom/mixin.js +176 -2
  22. package/lib/table/module/custom/mixin.min.js +1 -1
  23. package/lib/table/module/custom/panel.js +182 -255
  24. package/lib/table/module/custom/panel.min.js +1 -1
  25. package/lib/table/module/export/export-panel.js +2 -2
  26. package/lib/table/module/export/export-panel.min.js +1 -1
  27. package/lib/table/src/cell.js +2 -1
  28. package/lib/table/src/cell.min.js +1 -1
  29. package/lib/table/src/methods.js +9 -35
  30. package/lib/table/src/methods.min.js +1 -1
  31. package/lib/table/style/style.css +42 -37
  32. package/lib/table/style/style.min.css +1 -1
  33. package/lib/ui/index.js +2 -1
  34. package/lib/ui/index.min.js +1 -1
  35. package/lib/ui/src/log.js +1 -1
  36. package/lib/ui/src/log.min.js +1 -1
  37. package/lib/vxe-table/style/style.css +42 -37
  38. package/lib/vxe-table/style/style.min.css +1 -1
  39. package/package.json +2 -2
  40. package/packages/grid/src/grid.ts +1 -1
  41. package/packages/table/module/custom/mixin.ts +131 -2
  42. package/packages/table/module/custom/panel.ts +332 -337
  43. package/packages/table/module/export/export-panel.ts +2 -2
  44. package/packages/table/src/cell.ts +2 -2
  45. package/packages/table/src/methods.ts +9 -28
  46. package/packages/ui/index.ts +1 -0
  47. package/styles/components/table-module/custom.scss +21 -5
  48. /package/es/{iconfont.1730898131844.ttf → iconfont.1730971767552.ttf} +0 -0
  49. /package/es/{iconfont.1730898131844.woff → iconfont.1730971767552.woff} +0 -0
  50. /package/es/{iconfont.1730898131844.woff2 → iconfont.1730971767552.woff2} +0 -0
  51. /package/lib/{iconfont.1730898131844.ttf → iconfont.1730971767552.ttf} +0 -0
  52. /package/lib/{iconfont.1730898131844.woff → iconfont.1730971767552.woff} +0 -0
  53. /package/lib/{iconfont.1730898131844.woff2 → iconfont.1730971767552.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.10.3";
2223
+ const version = "3.10.5";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2450,6 +2450,7 @@ core_.VxeUI.setIcon({
2450
2450
  TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
2451
2451
  TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
2452
2452
  TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
2453
+ TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
2453
2454
  // toolbar
2454
2455
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
2455
2456
  TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
@@ -2767,7 +2768,7 @@ function isNodeElement(elem) {
2767
2768
  const {
2768
2769
  log: log_log
2769
2770
  } = core_.VxeUI;
2770
- const log_version = `table v${"3.10.3"}`;
2771
+ const log_version = `table v${"3.10.5"}`;
2771
2772
  const warnLog = log_log.create('warn', log_version);
2772
2773
  const errLog = log_log.create('error', log_version);
2773
2774
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3518,6 +3519,7 @@ function renderCellDragIcon(h, params) {
3518
3519
  } = params;
3519
3520
  const dragOpts = $table.computeDragOpts;
3520
3521
  const {
3522
+ rowIcon,
3521
3523
  rowDisabledMethod
3522
3524
  } = dragOpts;
3523
3525
  const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
@@ -3535,7 +3537,7 @@ function renderCellDragIcon(h, params) {
3535
3537
  mouseup: $table.handleCellDragMouseupEvent
3536
3538
  }
3537
3539
  }, [h('i', {
3538
- class: 'vxe-table-icon-drag-handle'
3540
+ class: rowIcon || cell_getIcon().TABLE_DRAG_ROW
3539
3541
  })]);
3540
3542
  }
3541
3543
  function renderCellBaseVNs(h, params, content) {
@@ -6994,38 +6996,8 @@ const Methods = {
6994
6996
  * 如果已关联工具栏,则会同步更新
6995
6997
  */
6996
6998
  resetColumn(options) {
6997
- const {
6998
- collectColumn,
6999
- customOpts
7000
- } = this;
7001
- const {
7002
- checkMethod
7003
- } = customOpts;
7004
- const opts = Object.assign({
7005
- visible: true,
7006
- resizable: options === true,
7007
- fixed: options === true,
7008
- sort: options === true
7009
- }, options);
7010
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
7011
- if (opts.resizable) {
7012
- column.resizeWidth = 0;
7013
- }
7014
- if (opts.fixed) {
7015
- column.fixed = column.defaultFixed;
7016
- }
7017
- if (opts.sort) {
7018
- column.renderSortNumber = column.sortNumber;
7019
- }
7020
- if (!checkMethod || checkMethod({
7021
- column
7022
- })) {
7023
- column.visible = column.defaultVisible;
7024
- }
7025
- column.renderResizeWidth = column.renderWidth;
7026
- });
7027
- this.saveCustomStore('reset');
7028
- return this.handleCustom();
6999
+ warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
7000
+ return this.resetCustom(options);
7029
7001
  },
7030
7002
  handleCustom() {
7031
7003
  const {
@@ -11158,7 +11130,9 @@ const Methods = {
11158
11130
  $table: $xeTable,
11159
11131
  row
11160
11132
  })).then(childRecords => {
11161
- rowRest.treeLoaded = true;
11133
+ if (rowRest) {
11134
+ rowRest.treeLoaded = true;
11135
+ }
11162
11136
  if (treeExpandLazyLoadedMaps[rowid]) {
11163
11137
  delete treeExpandLazyLoadedMaps[rowid];
11164
11138
  }
@@ -11188,7 +11162,9 @@ const Methods = {
11188
11162
  const {
11189
11163
  treeExpandLazyLoadedMaps
11190
11164
  } = this;
11191
- rowRest.treeLoaded = false;
11165
+ if (rowRest) {
11166
+ rowRest.treeLoaded = false;
11167
+ }
11192
11168
  if (treeExpandLazyLoadedMaps[rowid]) {
11193
11169
  delete treeExpandLazyLoadedMaps[rowid];
11194
11170
  }
@@ -12213,7 +12189,7 @@ const Methods = {
12213
12189
  }
12214
12190
  };
12215
12191
  // Module methods
12216
- const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',');
12192
+ const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
12217
12193
  funcs.forEach(name => {
12218
12194
  Methods[name] = function (...args) {
12219
12195
  if (true) {
@@ -14167,9 +14143,9 @@ function updateDropHint(_vm, evnt) {
14167
14143
  }
14168
14144
  const renderSimplePanel = (h, _vm) => {
14169
14145
  const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
14146
+ const $xeTable = _vm.$xeTable;
14170
14147
  const {
14171
14148
  _e,
14172
- $xetable,
14173
14149
  customStore,
14174
14150
  dragColumn
14175
14151
  } = _vm;
@@ -14177,7 +14153,7 @@ const renderSimplePanel = (h, _vm) => {
14177
14153
  customColumnList,
14178
14154
  customOpts,
14179
14155
  isMaxFixedColumn
14180
- } = $xetable;
14156
+ } = $xeTable;
14181
14157
  const {
14182
14158
  maxHeight
14183
14159
  } = customStore;
@@ -14190,6 +14166,12 @@ const renderSimplePanel = (h, _vm) => {
14190
14166
  trigger,
14191
14167
  placement
14192
14168
  } = customOpts;
14169
+ const slots = customOpts.slots || {};
14170
+ const headerSlot = slots.header;
14171
+ const topSlot = slots.top;
14172
+ const bottomSlot = slots.bottom;
14173
+ const defaultSlot = slots.default;
14174
+ const footerSlot = slots.footer;
14193
14175
  const colVNs = [];
14194
14176
  const customWrapperOns = {};
14195
14177
  // hover 触发
@@ -14197,6 +14179,15 @@ const renderSimplePanel = (h, _vm) => {
14197
14179
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
14198
14180
  customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
14199
14181
  }
14182
+ const isAllChecked = customStore.isAll;
14183
+ const isAllIndeterminate = customStore.isIndeterminate;
14184
+ const params = {
14185
+ $table: $xeTable,
14186
+ $grid: $xeTable.xegrid,
14187
+ columns: customColumnList,
14188
+ isAllChecked,
14189
+ isAllIndeterminate
14190
+ };
14200
14191
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
14201
14192
  const isVisible = visibleMethod ? visibleMethod({
14202
14193
  column
@@ -14300,8 +14291,6 @@ const renderSimplePanel = (h, _vm) => {
14300
14291
  })]) : _e()]));
14301
14292
  }
14302
14293
  });
14303
- const isAllChecked = customStore.isAll;
14304
- const isAllIndeterminate = customStore.isIndeterminate;
14305
14294
  return h('div', {
14306
14295
  key: 'simple',
14307
14296
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
@@ -14310,8 +14299,10 @@ const renderSimplePanel = (h, _vm) => {
14310
14299
  style: maxHeight && !['left', 'right'].includes(placement) ? {
14311
14300
  maxHeight: `${maxHeight}px`
14312
14301
  } : {}
14313
- }, customStore.visible ? [h('ul', {
14302
+ }, customStore.visible ? [h('div', {
14314
14303
  class: 'vxe-table-custom--header'
14304
+ }, headerSlot ? $xeTable.callSlot(headerSlot, params, h) : [h('ul', {
14305
+ class: 'vxe-table-custom--panel-list'
14315
14306
  }, [h('li', {
14316
14307
  class: 'vxe-table-custom--option'
14317
14308
  }, [allowVisible ? h('div', {
@@ -14331,21 +14322,29 @@ const renderSimplePanel = (h, _vm) => {
14331
14322
  class: 'vxe-checkbox--label'
14332
14323
  }, panel_getI18n('vxe.toolbar.customAll'))]) : h('span', {
14333
14324
  class: 'vxe-checkbox--label'
14334
- }, panel_getI18n('vxe.table.customTitle'))])]), h('div', {
14325
+ }, panel_getI18n('vxe.table.customTitle'))])])]), h('div', {
14335
14326
  ref: 'bodyElemRef',
14336
- class: 'vxe-table-custom--list-wrapper'
14337
- }, [h('transition-group', {
14338
- class: 'vxe-table-custom--body',
14327
+ class: 'vxe-table-custom--body'
14328
+ }, [topSlot ? h('div', {
14329
+ class: 'vxe-table-custom--panel-top'
14330
+ }, $xeTable.callSlot(topSlot, params, h)) : panel_renderEmptyElement($xeTable), defaultSlot ? h('div', {
14331
+ class: 'vxe-table-custom--panel-body'
14332
+ }, $xeTable.callSlot(defaultSlot, params, h)) : h('transition-group', {
14333
+ class: 'vxe-table-custom--panel-list',
14339
14334
  props: {
14340
14335
  name: 'vxe-table-custom--list',
14341
14336
  tag: 'ul'
14342
14337
  },
14343
14338
  on: customWrapperOns
14344
- }, colVNs), h('div', {
14339
+ }, colVNs), bottomSlot ? h('div', {
14340
+ class: 'vxe-table-custom--panel-bottom'
14341
+ }, $xeTable.callSlot(bottomSlot, params, h)) : panel_renderEmptyElement($xeTable), h('div', {
14345
14342
  ref: 'dragHintElemRef',
14346
14343
  class: 'vxe-table-custom-popup--drag-hint'
14347
14344
  }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? h('div', {
14348
14345
  class: 'vxe-table-custom--footer'
14346
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
14347
+ class: 'vxe-table-custom--footer-buttons'
14349
14348
  }, [h(VxeUIButtonComponent, {
14350
14349
  props: {
14351
14350
  mode: 'text',
@@ -14379,7 +14378,7 @@ const renderSimplePanel = (h, _vm) => {
14379
14378
  on: {
14380
14379
  click: _vm.confirmCustomEvent
14381
14380
  }
14382
- })]) : null] : []);
14381
+ })])]) : null] : []);
14383
14382
  };
14384
14383
  const renderPopupPanel = (h, _vm) => {
14385
14384
  const VxeUIModalComponent = core_.VxeUI.getComponent('VxeModal');
@@ -14387,9 +14386,9 @@ const renderPopupPanel = (h, _vm) => {
14387
14386
  const VxeUIInputComponent = core_.VxeUI.getComponent('VxeInput');
14388
14387
  const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
14389
14388
  const $xeTableCustomPanel = _vm;
14389
+ const $xeTable = _vm.$xeTable;
14390
14390
  const {
14391
14391
  _e,
14392
- $xetable,
14393
14392
  customStore
14394
14393
  } = _vm;
14395
14394
  const {
@@ -14397,7 +14396,7 @@ const renderPopupPanel = (h, _vm) => {
14397
14396
  customColumnList,
14398
14397
  columnOpts,
14399
14398
  isMaxFixedColumn
14400
- } = $xetable;
14399
+ } = $xeTable;
14401
14400
  const {
14402
14401
  modalOptions,
14403
14402
  allowVisible,
@@ -14411,7 +14410,22 @@ const renderPopupPanel = (h, _vm) => {
14411
14410
  maxFixedSize
14412
14411
  } = columnOpts;
14413
14412
  const modalOpts = Object.assign({}, modalOptions);
14413
+ const slots = customOpts.slots || {};
14414
+ const headerSlot = slots.header;
14415
+ const topSlot = slots.top;
14416
+ const bottomSlot = slots.bottom;
14417
+ const defaultSlot = slots.default;
14418
+ const footerSlot = slots.footer;
14414
14419
  const trVNs = [];
14420
+ const isAllChecked = customStore.isAll;
14421
+ const isAllIndeterminate = customStore.isIndeterminate;
14422
+ const params = {
14423
+ $table: $xeTable,
14424
+ $grid: $xeTable.xegrid,
14425
+ columns: customColumnList,
14426
+ isAllChecked,
14427
+ isAllIndeterminate
14428
+ };
14415
14429
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
14416
14430
  const isVisible = visibleMethod ? visibleMethod({
14417
14431
  column
@@ -14530,8 +14544,105 @@ const renderPopupPanel = (h, _vm) => {
14530
14544
  })]) : _e()]));
14531
14545
  }
14532
14546
  });
14533
- const isAllChecked = customStore.isAll;
14534
- const isAllIndeterminate = customStore.isIndeterminate;
14547
+ const scopedSlots = {
14548
+ default: () => {
14549
+ if (defaultSlot) {
14550
+ return $xeTable.callSlot(defaultSlot, params, h);
14551
+ }
14552
+ return h('div', {
14553
+ ref: 'bodyElemRef',
14554
+ class: 'vxe-table-custom-popup--body'
14555
+ }, [topSlot ? h('div', {
14556
+ class: 'vxe-table-custom-popup--table-top'
14557
+ }, $xeTable.callSlot(topSlot, params, h)) : panel_renderEmptyElement($xeTable), h('div', {
14558
+ class: 'vxe-table-custom-popup--table-wrapper'
14559
+ }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
14560
+ class: 'vxe-table-custom-popup--table-col-seq'
14561
+ }) : _e(), allowSort ? h('col', {
14562
+ class: 'vxe-table-custom-popup--table-col-sort'
14563
+ }) : _e(), h('col', {
14564
+ class: 'vxe-table-custom-popup--table-col-title'
14565
+ }), allowResizable ? h('col', {
14566
+ class: 'vxe-table-custom-popup--table-col-width'
14567
+ }) : _e(), allowFixed ? h('col', {
14568
+ class: 'vxe-table-custom-popup--table-col-fixed'
14569
+ }) : _e()]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
14570
+ class: ['vxe-table-custom--checkbox-option', {
14571
+ 'is--checked': isAllChecked,
14572
+ 'is--indeterminate': isAllIndeterminate
14573
+ }],
14574
+ attrs: {
14575
+ title: panel_getI18n('vxe.table.allTitle')
14576
+ },
14577
+ on: {
14578
+ click: _vm.allOptionEvent
14579
+ }
14580
+ }, [h('span', {
14581
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
14582
+ }), h('span', {
14583
+ class: 'vxe-checkbox--label'
14584
+ }, panel_getI18n('vxe.toolbar.customAll'))])]) : _e(), allowSort ? h('th', {}, [h('span', {
14585
+ class: 'vxe-table-custom-popup--table-sort-help-title'
14586
+ }, panel_getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
14587
+ props: {
14588
+ enterable: true,
14589
+ content: panel_getI18n('vxe.custom.setting.sortHelpTip'),
14590
+ popupClassName: 'vxe-table--ignore-clear'
14591
+ },
14592
+ scopedSlots: {
14593
+ default: () => {
14594
+ return h('i', {
14595
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
14596
+ });
14597
+ }
14598
+ }
14599
+ }) : panel_renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, panel_getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
14600
+ class: 'vxe-table-custom--panel-list',
14601
+ props: {
14602
+ tag: 'tbody',
14603
+ name: 'vxe-table-custom--list'
14604
+ }
14605
+ }, trVNs)])]), bottomSlot ? h('div', {
14606
+ class: 'vxe-table-custom-popup--table-bottom'
14607
+ }, $xeTable.callSlot(bottomSlot, params, h)) : panel_renderEmptyElement($xeTable), h('div', {
14608
+ ref: 'dragHintElemRef',
14609
+ class: 'vxe-table-custom-popup--drag-hint'
14610
+ }, panel_getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
14611
+ },
14612
+ footer: () => {
14613
+ if (footerSlot) {
14614
+ return $xeTable.callSlot(footerSlot, params, h);
14615
+ }
14616
+ return h('div', {
14617
+ class: 'vxe-table-custom-popup--footer'
14618
+ }, [h(VxeUIButtonComponent, {
14619
+ props: {
14620
+ content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmRestore')
14621
+ },
14622
+ on: {
14623
+ click: _vm.resetCustomEvent
14624
+ }
14625
+ }), h(VxeUIButtonComponent, {
14626
+ props: {
14627
+ content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmCancel')
14628
+ },
14629
+ on: {
14630
+ click: _vm.cancelCustomEvent
14631
+ }
14632
+ }), h(VxeUIButtonComponent, {
14633
+ props: {
14634
+ status: 'primary',
14635
+ content: customOpts.confirmButtonText || panel_getI18n('vxe.custom.cstmConfirm')
14636
+ },
14637
+ on: {
14638
+ click: _vm.confirmCustomEvent
14639
+ }
14640
+ })]);
14641
+ }
14642
+ };
14643
+ if (headerSlot) {
14644
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
14645
+ }
14535
14646
  return VxeUIModalComponent ? h(VxeUIModalComponent, {
14536
14647
  key: 'modal',
14537
14648
  props: {
@@ -14542,10 +14653,12 @@ const renderPopupPanel = (h, _vm) => {
14542
14653
  minWidth: modalOpts.minWidth || 700,
14543
14654
  height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
14544
14655
  minHeight: modalOpts.minHeight || 400,
14545
- showZoom: !!modalOpts.showZoom,
14546
- mask: !!modalOpts.mask,
14547
- lockView: !!modalOpts.lockView,
14548
- resize: !!modalOpts.resize,
14656
+ showZoom: modalOpts.showZoom,
14657
+ showMaximize: modalOpts.showMaximize,
14658
+ showMinimize: modalOpts.showMinimize,
14659
+ mask: modalOpts.mask,
14660
+ lockView: modalOpts.lockView,
14661
+ resize: modalOpts.resize,
14549
14662
  escClosable: !!modalOpts.escClosable,
14550
14663
  destroyOnClose: true,
14551
14664
  showFooter: true
@@ -14555,102 +14668,7 @@ const renderPopupPanel = (h, _vm) => {
14555
14668
  customStore.visible = value;
14556
14669
  }
14557
14670
  },
14558
- scopedSlots: {
14559
- default: () => {
14560
- return h('div', {
14561
- ref: 'bodyElemRef',
14562
- class: 'vxe-table-custom-popup--body'
14563
- }, [h('div', {
14564
- class: 'vxe-table-custom-popup--table-wrapper'
14565
- }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
14566
- style: {
14567
- width: '80px'
14568
- }
14569
- }) : _e(), allowSort ? h('col', {
14570
- style: {
14571
- width: '80px'
14572
- }
14573
- }) : _e(), h('col', {
14574
- style: {
14575
- minWidth: '120px'
14576
- }
14577
- }), allowResizable ? h('col', {
14578
- style: {
14579
- width: '140px'
14580
- }
14581
- }) : _e(), allowFixed ? h('col', {
14582
- style: {
14583
- width: '200px'
14584
- }
14585
- }) : _e()]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
14586
- class: ['vxe-table-custom--checkbox-option', {
14587
- 'is--checked': isAllChecked,
14588
- 'is--indeterminate': isAllIndeterminate
14589
- }],
14590
- attrs: {
14591
- title: panel_getI18n('vxe.table.allTitle')
14592
- },
14593
- on: {
14594
- click: _vm.allOptionEvent
14595
- }
14596
- }, [h('span', {
14597
- class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
14598
- }), h('span', {
14599
- class: 'vxe-checkbox--label'
14600
- }, panel_getI18n('vxe.toolbar.customAll'))])]) : _e(), allowSort ? h('th', {}, [h('span', {
14601
- class: 'vxe-table-custom-popup--table-sort-help-title'
14602
- }, panel_getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
14603
- props: {
14604
- enterable: true,
14605
- content: panel_getI18n('vxe.custom.setting.sortHelpTip'),
14606
- popupClassName: 'vxe-table--ignore-clear'
14607
- },
14608
- scopedSlots: {
14609
- default: () => {
14610
- return h('i', {
14611
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
14612
- });
14613
- }
14614
- }
14615
- }) : panel_renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, panel_getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
14616
- class: 'vxe-table-custom--body',
14617
- props: {
14618
- tag: 'tbody',
14619
- name: 'vxe-table-custom--list'
14620
- }
14621
- }, trVNs)])]), h('div', {
14622
- ref: 'dragHintElemRef',
14623
- class: 'vxe-table-custom-popup--drag-hint'
14624
- }, panel_getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
14625
- },
14626
- footer: () => {
14627
- return h('div', {
14628
- class: 'vxe-table-custom-popup--footer'
14629
- }, [h(VxeUIButtonComponent, {
14630
- props: {
14631
- content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmRestore')
14632
- },
14633
- on: {
14634
- click: _vm.resetCustomEvent
14635
- }
14636
- }), h(VxeUIButtonComponent, {
14637
- props: {
14638
- content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmCancel')
14639
- },
14640
- on: {
14641
- click: _vm.cancelCustomEvent
14642
- }
14643
- }), h(VxeUIButtonComponent, {
14644
- props: {
14645
- status: 'primary',
14646
- content: customOpts.confirmButtonText || panel_getI18n('vxe.custom.cstmConfirm')
14647
- },
14648
- on: {
14649
- click: _vm.confirmCustomEvent
14650
- }
14651
- })]);
14652
- }
14653
- }
14671
+ scopedSlots
14654
14672
  }) : panel_renderEmptyElement($xeTableCustomPanel);
14655
14673
  };
14656
14674
  /* harmony default export */ var panel = ({
@@ -14662,6 +14680,9 @@ const renderPopupPanel = (h, _vm) => {
14662
14680
  }
14663
14681
  },
14664
14682
  inject: {
14683
+ $xeTable: {
14684
+ default: null
14685
+ },
14665
14686
  $xetable: {
14666
14687
  default: null
14667
14688
  }
@@ -14740,114 +14761,41 @@ const renderPopupPanel = (h, _vm) => {
14740
14761
  customStore.activeWrapper = false;
14741
14762
  setTimeout(() => {
14742
14763
  if (!customStore.activeBtn && !customStore.activeWrapper) {
14743
- $xetable.customColseEvent(evnt);
14764
+ $xetable.customCloseEvent(evnt);
14744
14765
  }
14745
14766
  }, 300);
14746
14767
  },
14747
14768
  getStoreData() {
14748
14769
  return {};
14749
14770
  },
14750
- confirmCustomEvent(evnt) {
14751
- const {
14752
- $xetable
14753
- } = this;
14754
- const {
14755
- customOpts,
14756
- customColumnList
14757
- } = $xetable;
14758
- const {
14759
- allowVisible,
14760
- allowSort,
14761
- allowFixed,
14762
- allowResizable
14763
- } = customOpts;
14764
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
14765
- if (parent) {
14766
- // 更新子列信息
14767
- column.fixed = parent.fixed;
14768
- } else {
14769
- if (allowSort) {
14770
- const sortIndex = index + 1;
14771
- column.renderSortNumber = sortIndex;
14772
- }
14773
- if (allowFixed) {
14774
- column.fixed = column.renderFixed;
14775
- }
14776
- }
14777
- if (allowResizable) {
14778
- if (column.renderVisible && (!column.children || column.children.length)) {
14779
- if (column.renderResizeWidth !== column.renderWidth) {
14780
- column.resizeWidth = column.renderResizeWidth;
14781
- column.renderWidth = column.renderResizeWidth;
14782
- }
14783
- }
14784
- }
14785
- if (allowVisible) {
14786
- column.visible = column.renderVisible;
14787
- }
14788
- });
14789
- $xetable.closeCustom();
14790
- $xetable.emitCustomEvent('confirm', evnt);
14791
- $xetable.saveCustomStore('confirm');
14771
+ confirmCustomEvent({
14772
+ $event
14773
+ }) {
14774
+ const $xeTable = this.$xeTable;
14775
+ $xeTable.saveCustom();
14776
+ $xeTable.closeCustom();
14777
+ $xeTable.emitCustomEvent('confirm', $event);
14792
14778
  },
14793
14779
  cancelCloseEvent({
14794
14780
  $event
14795
14781
  }) {
14796
- const {
14797
- $xetable
14798
- } = this;
14799
- $xetable.closeCustom();
14800
- $xetable.emitCustomEvent('cancel', $event);
14782
+ const $xeTable = this.$xeTable;
14783
+ $xeTable.closeCustom();
14784
+ $xeTable.emitCustomEvent('close', $event);
14801
14785
  },
14802
- cancelCustomEvent(evnt) {
14803
- const {
14804
- $xetable
14805
- } = this;
14806
- const {
14807
- customStore,
14808
- customOpts,
14809
- customColumnList
14810
- } = $xetable;
14811
- const {
14812
- oldSortMaps,
14813
- oldFixedMaps,
14814
- oldVisibleMaps
14815
- } = customStore;
14816
- const {
14817
- allowVisible,
14818
- allowSort,
14819
- allowFixed,
14820
- allowResizable
14821
- } = customOpts;
14822
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
14823
- const colid = column.getKey();
14824
- const visible = !!oldVisibleMaps[colid];
14825
- const fixed = oldFixedMaps[colid] || '';
14826
- if (allowVisible) {
14827
- column.renderVisible = visible;
14828
- column.visible = visible;
14829
- }
14830
- if (allowFixed) {
14831
- column.renderFixed = fixed;
14832
- column.fixed = fixed;
14833
- }
14834
- if (allowSort) {
14835
- column.renderSortNumber = oldSortMaps[colid] || 0;
14836
- }
14837
- if (allowResizable) {
14838
- column.renderResizeWidth = column.renderWidth;
14839
- }
14840
- }, {
14841
- children: 'children'
14842
- });
14843
- $xetable.closeCustom();
14844
- $xetable.emitCustomEvent('cancel', evnt);
14786
+ cancelCustomEvent({
14787
+ $event
14788
+ }) {
14789
+ const $xeTable = this.$xeTable;
14790
+ $xeTable.cancelCustom();
14791
+ $xeTable.closeCustom();
14792
+ $xeTable.emitCustomEvent('cancel', $event);
14845
14793
  },
14846
14794
  handleResetCustomEvent(evnt) {
14847
14795
  const {
14848
14796
  $xetable
14849
14797
  } = this;
14850
- $xetable.resetColumn(true);
14798
+ $xetable.resetCustom(true);
14851
14799
  $xetable.closeCustom();
14852
14800
  $xetable.emitCustomEvent('reset', evnt);
14853
14801
  },
@@ -14965,55 +14913,9 @@ const renderPopupPanel = (h, _vm) => {
14965
14913
  },
14966
14914
  allOptionEvent() {
14967
14915
  const {
14968
- $xetable,
14969
- customStore
14916
+ $xetable
14970
14917
  } = this;
14971
- const {
14972
- customColumnList,
14973
- customOpts
14974
- } = $xetable;
14975
- const {
14976
- checkMethod,
14977
- visibleMethod
14978
- } = customOpts;
14979
- const isAll = !customStore.isAll;
14980
- if (customOpts.immediate) {
14981
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
14982
- if (visibleMethod && !visibleMethod({
14983
- column
14984
- })) {
14985
- return;
14986
- }
14987
- if (checkMethod && !checkMethod({
14988
- column
14989
- })) {
14990
- return;
14991
- }
14992
- column.visible = isAll;
14993
- column.renderVisible = isAll;
14994
- column.halfVisible = false;
14995
- });
14996
- customStore.isAll = isAll;
14997
- $xetable.handleCustom();
14998
- $xetable.saveCustomStore('update:visible');
14999
- } else {
15000
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
15001
- if (visibleMethod && !visibleMethod({
15002
- column
15003
- })) {
15004
- return;
15005
- }
15006
- if (checkMethod && !checkMethod({
15007
- column
15008
- })) {
15009
- return;
15010
- }
15011
- column.renderVisible = isAll;
15012
- column.halfVisible = false;
15013
- });
15014
- customStore.isAll = isAll;
15015
- }
15016
- $xetable.checkCustomStatus();
14918
+ $xetable.toggleCustomAllCheckbox();
15017
14919
  },
15018
14920
  sortMousedownEvent(evnt) {
15019
14921
  const {
@@ -15027,6 +14929,7 @@ const renderPopupPanel = (h, _vm) => {
15027
14929
  trEl.draggable = true;
15028
14930
  this.dragColumn = column;
15029
14931
  addClass(trEl, 'active--drag-origin');
14932
+ updateDropHint(this, evnt);
15030
14933
  },
15031
14934
  sortMouseupEvent(evnt) {
15032
14935
  const btnEl = evnt.currentTarget;
@@ -15859,7 +15762,7 @@ const {
15859
15762
  class: 'vxe-table-export--panel-column-body'
15860
15763
  }, cols)])])]), h('tr', [h('td', export_panel_getI18n('vxe.export.expOpts')), parameterSlot ? h('td', [h('div', {
15861
15764
  class: 'vxe-table-export--panel-option-row'
15862
- }, $xeTable.callSlot(parameterSlot, params))]) : h('td', [h('div', {
15765
+ }, $xeTable.callSlot(parameterSlot, params, h))]) : h('td', [h('div', {
15863
15766
  class: 'vxe-table-export--panel-option-row'
15864
15767
  }, [h('vxe-checkbox', {
15865
15768
  props: {
@@ -15959,7 +15862,7 @@ const {
15959
15862
  };
15960
15863
  return h('div', {
15961
15864
  class: 'vxe-table-export--panel-footer'
15962
- }, footerSlot ? $xeTable.callSlot(footerSlot, params) : [h('div', {
15865
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
15963
15866
  class: 'vxe-table-export--panel-btns'
15964
15867
  }, [h('vxe-button', {
15965
15868
  props: {
@@ -20737,6 +20640,180 @@ function validErrorRuleValue(rule, val) {
20737
20640
  }
20738
20641
  return this.$nextTick();
20739
20642
  },
20643
+ _saveCustom() {
20644
+ const $xeTable = this;
20645
+ const {
20646
+ customOpts,
20647
+ customColumnList
20648
+ } = this;
20649
+ const {
20650
+ allowVisible,
20651
+ allowSort,
20652
+ allowFixed,
20653
+ allowResizable
20654
+ } = customOpts;
20655
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
20656
+ if (parent) {
20657
+ // 更新子列信息
20658
+ column.fixed = parent.fixed;
20659
+ } else {
20660
+ if (allowSort) {
20661
+ const sortIndex = index + 1;
20662
+ column.renderSortNumber = sortIndex;
20663
+ }
20664
+ if (allowFixed) {
20665
+ column.fixed = column.renderFixed;
20666
+ }
20667
+ }
20668
+ if (allowResizable) {
20669
+ if (column.renderVisible && (!column.children || column.children.length)) {
20670
+ if (column.renderResizeWidth !== column.renderWidth) {
20671
+ column.resizeWidth = column.renderResizeWidth;
20672
+ column.renderWidth = column.renderResizeWidth;
20673
+ }
20674
+ }
20675
+ }
20676
+ if (allowVisible) {
20677
+ column.visible = column.renderVisible;
20678
+ }
20679
+ });
20680
+ $xeTable.closeCustom();
20681
+ return $xeTable.saveCustomStore('confirm');
20682
+ },
20683
+ _cancelCustom() {
20684
+ const $xeTable = this;
20685
+ const {
20686
+ customStore,
20687
+ customOpts,
20688
+ customColumnList
20689
+ } = $xeTable;
20690
+ const {
20691
+ oldSortMaps,
20692
+ oldFixedMaps,
20693
+ oldVisibleMaps
20694
+ } = customStore;
20695
+ const {
20696
+ allowVisible,
20697
+ allowSort,
20698
+ allowFixed,
20699
+ allowResizable
20700
+ } = customOpts;
20701
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
20702
+ const colid = column.getKey();
20703
+ const visible = !!oldVisibleMaps[colid];
20704
+ const fixed = oldFixedMaps[colid] || '';
20705
+ if (allowVisible) {
20706
+ column.renderVisible = visible;
20707
+ column.visible = visible;
20708
+ }
20709
+ if (allowFixed) {
20710
+ column.renderFixed = fixed;
20711
+ column.fixed = fixed;
20712
+ }
20713
+ if (allowSort) {
20714
+ column.renderSortNumber = oldSortMaps[colid] || 0;
20715
+ }
20716
+ if (allowResizable) {
20717
+ column.renderResizeWidth = column.renderWidth;
20718
+ }
20719
+ }, {
20720
+ children: 'children'
20721
+ });
20722
+ return $xeTable.$nextTick();
20723
+ },
20724
+ _resetCustom(options) {
20725
+ const {
20726
+ collectColumn,
20727
+ customOpts
20728
+ } = this;
20729
+ const {
20730
+ checkMethod
20731
+ } = customOpts;
20732
+ const opts = Object.assign({
20733
+ visible: true,
20734
+ resizable: options === true,
20735
+ fixed: options === true,
20736
+ sort: options === true
20737
+ }, options);
20738
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
20739
+ if (opts.resizable) {
20740
+ column.resizeWidth = 0;
20741
+ }
20742
+ if (opts.fixed) {
20743
+ column.fixed = column.defaultFixed;
20744
+ }
20745
+ if (opts.sort) {
20746
+ column.renderSortNumber = column.sortNumber;
20747
+ }
20748
+ if (!checkMethod || checkMethod({
20749
+ column
20750
+ })) {
20751
+ column.visible = column.defaultVisible;
20752
+ }
20753
+ column.renderResizeWidth = column.renderWidth;
20754
+ });
20755
+ this.saveCustomStore('reset');
20756
+ return this.handleCustom();
20757
+ },
20758
+ _toggleCustomAllCheckbox() {
20759
+ const {
20760
+ customStore
20761
+ } = this;
20762
+ const isAll = !customStore.isAll;
20763
+ return this.setCustomAllCheckbox(isAll);
20764
+ },
20765
+ _setCustomAllCheckbox(checked) {
20766
+ const $xeTable = this;
20767
+ const {
20768
+ customStore
20769
+ } = this;
20770
+ const {
20771
+ customColumnList,
20772
+ customOpts
20773
+ } = this;
20774
+ const {
20775
+ checkMethod,
20776
+ visibleMethod
20777
+ } = customOpts;
20778
+ const isAll = !!checked;
20779
+ if (customOpts.immediate) {
20780
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
20781
+ if (visibleMethod && !visibleMethod({
20782
+ column
20783
+ })) {
20784
+ return;
20785
+ }
20786
+ if (checkMethod && !checkMethod({
20787
+ column
20788
+ })) {
20789
+ return;
20790
+ }
20791
+ column.visible = isAll;
20792
+ column.renderVisible = isAll;
20793
+ column.halfVisible = false;
20794
+ });
20795
+ customStore.isAll = isAll;
20796
+ $xeTable.handleCustom();
20797
+ $xeTable.saveCustomStore('update:visible');
20798
+ } else {
20799
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
20800
+ if (visibleMethod && !visibleMethod({
20801
+ column
20802
+ })) {
20803
+ return;
20804
+ }
20805
+ if (checkMethod && !checkMethod({
20806
+ column
20807
+ })) {
20808
+ return;
20809
+ }
20810
+ column.renderVisible = isAll;
20811
+ column.halfVisible = false;
20812
+ });
20813
+ customStore.isAll = isAll;
20814
+ }
20815
+ $xeTable.checkCustomStatus();
20816
+ },
20740
20817
  calcMaxHeight() {
20741
20818
  const {
20742
20819
  $el,
@@ -20747,7 +20824,7 @@ function validErrorRuleValue(rule, val) {
20747
20824
  if ($el) {
20748
20825
  tableHeight = $el.clientHeight - 28;
20749
20826
  }
20750
- customStore.maxHeight = Math.max(4, tableHeight);
20827
+ customStore.maxHeight = Math.max(88, tableHeight);
20751
20828
  },
20752
20829
  checkCustomStatus() {
20753
20830
  const {
@@ -20798,7 +20875,7 @@ function validErrorRuleValue(rule, val) {
20798
20875
  this.emitCustomEvent('open', evnt);
20799
20876
  }
20800
20877
  },
20801
- customColseEvent(evnt) {
20878
+ customCloseEvent(evnt) {
20802
20879
  const {
20803
20880
  customStore
20804
20881
  } = this;
@@ -23751,7 +23828,7 @@ Object.keys(table.methods).forEach(name => {
23751
23828
  this.openExport(btnParams);
23752
23829
  break;
23753
23830
  case 'reset_custom':
23754
- this.resetColumn(true);
23831
+ this.resetCustom(true);
23755
23832
  break;
23756
23833
  case '_init':
23757
23834
  case 'reload':