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
package/lib/index.umd.js CHANGED
@@ -1998,7 +1998,7 @@ function eqEmptyValue(cellValue) {
1998
1998
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1999
1999
 
2000
2000
 
2001
- const version = "4.8.4";
2001
+ const version = "4.8.5";
2002
2002
  core_.VxeUI.version = version;
2003
2003
  core_.VxeUI.tableVersion = version;
2004
2004
  core_.VxeUI.setConfig({
@@ -2388,7 +2388,7 @@ var es_array_push = __webpack_require__(4114);
2388
2388
  const {
2389
2389
  log: log_log
2390
2390
  } = core_.VxeUI;
2391
- const log_version = `table v${"4.8.4"}`;
2391
+ const log_version = `table v${"4.8.5"}`;
2392
2392
  const warnLog = log_log.create('warn', log_version);
2393
2393
  const errLog = log_log.create('error', log_version);
2394
2394
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -6705,7 +6705,8 @@ const {
6705
6705
 
6706
6706
  const {
6707
6707
  getI18n: panel_getI18n,
6708
- getIcon: panel_getIcon
6708
+ getIcon: panel_getIcon,
6709
+ renderEmptyElement: panel_renderEmptyElement
6709
6710
  } = core_.VxeUI;
6710
6711
  /* harmony default export */ var panel = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
6711
6712
  name: 'TableCustomPanel',
@@ -6757,44 +6758,9 @@ const {
6757
6758
  const confirmCustomEvent = ({
6758
6759
  $event
6759
6760
  }) => {
6760
- const {
6761
- customColumnList
6762
- } = reactData;
6763
- const customOpts = computeCustomOpts.value;
6764
- const {
6765
- allowVisible,
6766
- allowSort,
6767
- allowFixed,
6768
- allowResizable
6769
- } = customOpts;
6770
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
6771
- if (parent) {
6772
- // 更新子列信息
6773
- column.fixed = parent.fixed;
6774
- } else {
6775
- if (allowSort) {
6776
- const sortIndex = index + 1;
6777
- column.renderSortNumber = sortIndex;
6778
- }
6779
- if (allowFixed) {
6780
- column.fixed = column.renderFixed;
6781
- }
6782
- }
6783
- if (allowResizable) {
6784
- if (column.renderVisible && (!column.children || column.children.length)) {
6785
- if (column.renderResizeWidth !== column.renderWidth) {
6786
- column.resizeWidth = column.renderResizeWidth;
6787
- column.renderWidth = column.renderResizeWidth;
6788
- }
6789
- }
6790
- }
6791
- if (allowVisible) {
6792
- column.visible = column.renderVisible;
6793
- }
6794
- });
6761
+ $xeTable.saveCustom();
6795
6762
  $xeTable.closeCustom();
6796
6763
  $xeTable.emitCustomEvent('confirm', $event);
6797
- $xeTable.saveCustomStore('confirm');
6798
6764
  };
6799
6765
  const cancelCloseEvent = ({
6800
6766
  $event
@@ -6805,50 +6771,12 @@ const {
6805
6771
  const cancelCustomEvent = ({
6806
6772
  $event
6807
6773
  }) => {
6808
- const {
6809
- customStore
6810
- } = props;
6811
- const {
6812
- customColumnList
6813
- } = reactData;
6814
- const {
6815
- oldSortMaps,
6816
- oldFixedMaps,
6817
- oldVisibleMaps
6818
- } = customStore;
6819
- const customOpts = computeCustomOpts.value;
6820
- const {
6821
- allowVisible,
6822
- allowSort,
6823
- allowFixed,
6824
- allowResizable
6825
- } = customOpts;
6826
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6827
- const colid = column.getKey();
6828
- const visible = !!oldVisibleMaps[colid];
6829
- const fixed = oldFixedMaps[colid] || '';
6830
- if (allowVisible) {
6831
- column.renderVisible = visible;
6832
- column.visible = visible;
6833
- }
6834
- if (allowFixed) {
6835
- column.renderFixed = fixed;
6836
- column.fixed = fixed;
6837
- }
6838
- if (allowSort) {
6839
- column.renderSortNumber = oldSortMaps[colid] || 0;
6840
- }
6841
- if (allowResizable) {
6842
- column.renderResizeWidth = column.renderWidth;
6843
- }
6844
- }, {
6845
- children: 'children'
6846
- });
6774
+ $xeTable.cancelCustom();
6847
6775
  $xeTable.closeCustom();
6848
6776
  $xeTable.emitCustomEvent('cancel', $event);
6849
6777
  };
6850
6778
  const handleResetCustomEvent = evnt => {
6851
- $xeTable.resetColumn(true);
6779
+ $xeTable.resetCustom(true);
6852
6780
  $xeTable.closeCustom();
6853
6781
  $xeTable.emitCustomEvent('reset', evnt);
6854
6782
  };
@@ -6939,55 +6867,7 @@ const {
6939
6867
  }
6940
6868
  };
6941
6869
  const allOptionEvent = () => {
6942
- const {
6943
- customStore
6944
- } = props;
6945
- const {
6946
- customColumnList
6947
- } = reactData;
6948
- const customOpts = computeCustomOpts.value;
6949
- const {
6950
- checkMethod,
6951
- visibleMethod
6952
- } = customOpts;
6953
- const isAll = !customStore.isAll;
6954
- if (customOpts.immediate) {
6955
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6956
- if (visibleMethod && !visibleMethod({
6957
- column
6958
- })) {
6959
- return;
6960
- }
6961
- if (checkMethod && !checkMethod({
6962
- column
6963
- })) {
6964
- return;
6965
- }
6966
- column.visible = isAll;
6967
- column.renderVisible = isAll;
6968
- column.halfVisible = false;
6969
- });
6970
- customStore.isAll = isAll;
6971
- $xeTable.handleCustom();
6972
- $xeTable.saveCustomStore('update:visible');
6973
- } else {
6974
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6975
- if (visibleMethod && !visibleMethod({
6976
- column
6977
- })) {
6978
- return;
6979
- }
6980
- if (checkMethod && !checkMethod({
6981
- column
6982
- })) {
6983
- return;
6984
- }
6985
- column.renderVisible = isAll;
6986
- column.halfVisible = false;
6987
- });
6988
- customStore.isAll = isAll;
6989
- }
6990
- $xeTable.checkCustomStatus();
6870
+ $xeTable.toggleCustomAllCheckbox();
6991
6871
  };
6992
6872
  const sortMousedownEvent = evnt => {
6993
6873
  const btnEl = evnt.currentTarget;
@@ -6998,6 +6878,7 @@ const {
6998
6878
  trEl.draggable = true;
6999
6879
  dragColumnRef.value = column;
7000
6880
  addClass(trEl, 'active--drag-origin');
6881
+ updateDropHint(evnt);
7001
6882
  };
7002
6883
  const sortMouseupEvent = evnt => {
7003
6884
  const btnEl = evnt.currentTarget;
@@ -7121,13 +7002,29 @@ const {
7121
7002
  placement
7122
7003
  } = customOpts;
7123
7004
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
7005
+ const slots = customOpts.slots || {};
7006
+ const headerSlot = slots.header;
7007
+ const topSlot = slots.top;
7008
+ const bottomSlot = slots.bottom;
7009
+ const defaultSlot = slots.default;
7010
+ const footerSlot = slots.footer;
7124
7011
  const colVNs = [];
7125
7012
  const customWrapperOns = {};
7013
+ const isAllChecked = customStore.isAll;
7014
+ const isAllIndeterminate = customStore.isIndeterminate;
7015
+ const dragColumn = dragColumnRef.value;
7126
7016
  // hover 触发
7127
7017
  if (trigger === 'hover') {
7128
7018
  customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
7129
7019
  customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
7130
7020
  }
7021
+ const params = {
7022
+ $table: $xeTable,
7023
+ $grid: $xeTable.xegrid,
7024
+ columns: customColumnList,
7025
+ isAllChecked,
7026
+ isAllIndeterminate
7027
+ };
7131
7028
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
7132
7029
  const isVisible = visibleMethod ? visibleMethod({
7133
7030
  column
@@ -7208,9 +7105,6 @@ const {
7208
7105
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
7209
7106
  }
7210
7107
  });
7211
- const isAllChecked = customStore.isAll;
7212
- const isAllIndeterminate = customStore.isIndeterminate;
7213
- const dragColumn = dragColumnRef.value;
7214
7108
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7215
7109
  ref: refElem,
7216
7110
  key: 'simple',
@@ -7220,8 +7114,10 @@ const {
7220
7114
  style: maxHeight && !['left', 'right'].includes(placement) ? {
7221
7115
  maxHeight: `${maxHeight}px`
7222
7116
  } : {}
7223
- }, customStore.visible ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
7117
+ }, customStore.visible ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7224
7118
  class: 'vxe-table-custom--header'
7119
+ }, headerSlot ? $xeTable.callSlot(headerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
7120
+ class: 'vxe-table-custom--panel-list'
7225
7121
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
7226
7122
  class: 'vxe-table-custom--option'
7227
7123
  }, [allowVisible ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -7237,21 +7133,29 @@ const {
7237
7133
  class: 'vxe-checkbox--label'
7238
7134
  }, panel_getI18n('vxe.toolbar.customAll'))]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7239
7135
  class: 'vxe-checkbox--label'
7240
- }, panel_getI18n('vxe.table.customTitle'))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7136
+ }, panel_getI18n('vxe.table.customTitle'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7241
7137
  ref: bodyElemRef,
7242
- class: 'vxe-table-custom--list-wrapper'
7243
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
7244
- class: 'vxe-table-custom--body',
7138
+ class: 'vxe-table-custom--body'
7139
+ }, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7140
+ class: 'vxe-table-custom--panel-top'
7141
+ }, $xeTable.callSlot(topSlot, params)) : panel_renderEmptyElement($xeTable), defaultSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7142
+ class: 'vxe-table-custom--panel-body'
7143
+ }, $xeTable.callSlot(defaultSlot, params)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
7144
+ class: 'vxe-table-custom--panel-list',
7245
7145
  name: 'vxe-table-custom--list',
7246
7146
  tag: 'ul',
7247
7147
  ...customWrapperOns
7248
7148
  }, {
7249
7149
  default: () => colVNs
7250
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7150
+ }), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7151
+ class: 'vxe-table-custom--panel-bottom'
7152
+ }, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7251
7153
  ref: dragHintElemRef,
7252
7154
  class: 'vxe-table-custom-popup--drag-hint'
7253
7155
  }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7254
7156
  class: 'vxe-table-custom--footer'
7157
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7158
+ class: 'vxe-table-custom--footer-buttons'
7255
7159
  }, [VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
7256
7160
  mode: 'text',
7257
7161
  content: customOpts.resetButtonText || panel_getI18n('vxe.table.customRestore'),
@@ -7269,7 +7173,7 @@ const {
7269
7173
  status: 'primary',
7270
7174
  content: customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'),
7271
7175
  onClick: confirmCustomEvent
7272
- }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : null] : []);
7176
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null] : []);
7273
7177
  };
7274
7178
  const renderPopupPanel = () => {
7275
7179
  const {
@@ -7299,7 +7203,23 @@ const {
7299
7203
  const modalOpts = Object.assign({}, modalOptions);
7300
7204
  const drawerOpts = Object.assign({}, drawerOptions);
7301
7205
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
7206
+ const slots = customOpts.slots || {};
7207
+ const headerSlot = slots.header;
7208
+ const topSlot = slots.top;
7209
+ const bottomSlot = slots.bottom;
7210
+ const defaultSlot = slots.default;
7211
+ const footerSlot = slots.footer;
7302
7212
  const trVNs = [];
7213
+ const isAllChecked = customStore.isAll;
7214
+ const isAllIndeterminate = customStore.isIndeterminate;
7215
+ const dragColumn = dragColumnRef.value;
7216
+ const params = {
7217
+ $table: $xeTable,
7218
+ $grid: $xeTable.xegrid,
7219
+ columns: customColumnList,
7220
+ isAllChecked,
7221
+ isAllIndeterminate
7222
+ };
7303
7223
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
7304
7224
  const isVisible = visibleMethod ? visibleMethod({
7305
7225
  column
@@ -7396,36 +7316,28 @@ const {
7396
7316
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
7397
7317
  }
7398
7318
  });
7399
- const isAllChecked = customStore.isAll;
7400
- const isAllIndeterminate = customStore.isIndeterminate;
7401
- const dragColumn = dragColumnRef.value;
7402
7319
  const scopedSlots = {
7403
7320
  default: () => {
7321
+ if (defaultSlot) {
7322
+ return $xeTable.callSlot(defaultSlot, params);
7323
+ }
7404
7324
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7405
7325
  ref: bodyElemRef,
7406
7326
  class: 'vxe-table-custom-popup--body'
7407
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7327
+ }, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7328
+ class: 'vxe-table-custom-popup--table-top'
7329
+ }, $xeTable.callSlot(topSlot, params)) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7408
7330
  class: 'vxe-table-custom-popup--table-wrapper'
7409
7331
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('colgroup', {}, [allowVisible ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7410
- style: {
7411
- width: '80px'
7412
- }
7332
+ class: 'vxe-table-custom-popup--table-col-seq'
7413
7333
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), allowSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7414
- style: {
7415
- width: '80px'
7416
- }
7334
+ class: 'vxe-table-custom-popup--table-col-sort'
7417
7335
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7418
- style: {
7419
- minWidth: '120px'
7420
- }
7336
+ class: 'vxe-table-custom-popup--table-col-title'
7421
7337
  }), allowResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7422
- style: {
7423
- width: '140px'
7424
- }
7338
+ class: 'vxe-table-custom-popup--table-col-width'
7425
7339
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7426
- style: {
7427
- width: '200px'
7428
- }
7340
+ class: 'vxe-table-custom-popup--table-col-fixed'
7429
7341
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {}, [allowVisible ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7430
7342
  class: ['vxe-table-custom--checkbox-option', {
7431
7343
  'is--checked': isAllChecked,
@@ -7450,17 +7362,22 @@ const {
7450
7362
  });
7451
7363
  }
7452
7364
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colResizable')) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
7453
- class: 'vxe-table-custom--body',
7365
+ class: 'vxe-table-custom--panel-list',
7454
7366
  tag: 'tbody',
7455
7367
  name: 'vxe-table-custom--list'
7456
7368
  }, {
7457
7369
  default: () => trVNs
7458
- })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7370
+ })])]), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7371
+ class: 'vxe-table-custom-popup--table-bottom'
7372
+ }, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7459
7373
  ref: dragHintElemRef,
7460
7374
  class: 'vxe-table-custom-popup--drag-hint'
7461
7375
  }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))]);
7462
7376
  },
7463
7377
  footer: () => {
7378
+ if (footerSlot) {
7379
+ return $xeTable.callSlot(footerSlot, params);
7380
+ }
7464
7381
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7465
7382
  class: 'vxe-table-custom-popup--footer'
7466
7383
  }, [VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
@@ -7476,6 +7393,9 @@ const {
7476
7393
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
7477
7394
  }
7478
7395
  };
7396
+ if (headerSlot) {
7397
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params);
7398
+ }
7479
7399
  if (mode === 'drawer') {
7480
7400
  return VxeUIDrawerComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIDrawerComponent, {
7481
7401
  key: 'drawer',
@@ -11107,7 +11027,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11107
11027
  $table: $xeTable,
11108
11028
  row
11109
11029
  })).then(childRecords => {
11110
- rowRest.treeLoaded = true;
11030
+ if (rowRest) {
11031
+ rowRest.treeLoaded = true;
11032
+ }
11111
11033
  if (treeExpandLazyLoadedMaps[rowid]) {
11112
11034
  delete treeExpandLazyLoadedMaps[rowid];
11113
11035
  }
@@ -11137,7 +11059,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11137
11059
  const {
11138
11060
  treeExpandLazyLoadedMaps
11139
11061
  } = reactData;
11140
- rowRest.treeLoaded = false;
11062
+ if (rowRest) {
11063
+ rowRest.treeLoaded = false;
11064
+ }
11141
11065
  if (treeExpandLazyLoadedMaps[rowid]) {
11142
11066
  delete treeExpandLazyLoadedMaps[rowid];
11143
11067
  }
@@ -12776,38 +12700,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12776
12700
  * 如果已关联工具栏,则会同步更新
12777
12701
  */
12778
12702
  resetColumn(options) {
12779
- const {
12780
- collectColumn
12781
- } = internalData;
12782
- const customOpts = computeCustomOpts.value;
12783
- const {
12784
- checkMethod
12785
- } = customOpts;
12786
- const opts = Object.assign({
12787
- visible: true,
12788
- resizable: options === true,
12789
- fixed: options === true,
12790
- sort: options === true
12791
- }, options);
12792
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
12793
- if (opts.resizable) {
12794
- column.resizeWidth = 0;
12795
- }
12796
- if (opts.fixed) {
12797
- column.fixed = column.defaultFixed;
12798
- }
12799
- if (opts.sort) {
12800
- column.renderSortNumber = column.sortNumber;
12801
- }
12802
- if (!checkMethod || checkMethod({
12803
- column
12804
- })) {
12805
- column.visible = column.defaultVisible;
12806
- }
12807
- column.renderResizeWidth = column.renderWidth;
12808
- });
12809
- $xeTable.saveCustomStore('reset');
12810
- return tablePrivateMethods.handleCustom();
12703
+ warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
12704
+ return $xeTable.resetCustom(options);
12811
12705
  },
12812
12706
  /**
12813
12707
  * 刷新列信息
@@ -22128,7 +22022,7 @@ validator_hook_hooks.add('tableValidatorModule', {
22128
22022
 
22129
22023
 
22130
22024
 
22131
- const tableCustomMethodKeys = ['openCustom', 'closeCustom'];
22025
+ const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
22132
22026
  core_.VxeUI.hooks.add('tableCustomModule', {
22133
22027
  setupTable($xeTable) {
22134
22028
  const {
@@ -22152,7 +22046,7 @@ core_.VxeUI.hooks.add('tableCustomModule', {
22152
22046
  if (el) {
22153
22047
  tableHeight = el.clientHeight - 28;
22154
22048
  }
22155
- customStore.maxHeight = Math.max(4, tableHeight);
22049
+ customStore.maxHeight = Math.max(88, tableHeight);
22156
22050
  };
22157
22051
  const openCustom = () => {
22158
22052
  const {
@@ -22199,9 +22093,183 @@ core_.VxeUI.hooks.add('tableCustomModule', {
22199
22093
  }
22200
22094
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
22201
22095
  };
22096
+ const saveCustom = () => {
22097
+ const {
22098
+ customColumnList
22099
+ } = reactData;
22100
+ const customOpts = computeCustomOpts.value;
22101
+ const {
22102
+ allowVisible,
22103
+ allowSort,
22104
+ allowFixed,
22105
+ allowResizable
22106
+ } = customOpts;
22107
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
22108
+ if (parent) {
22109
+ // 更新子列信息
22110
+ column.fixed = parent.fixed;
22111
+ } else {
22112
+ if (allowSort) {
22113
+ const sortIndex = index + 1;
22114
+ column.renderSortNumber = sortIndex;
22115
+ }
22116
+ if (allowFixed) {
22117
+ column.fixed = column.renderFixed;
22118
+ }
22119
+ }
22120
+ if (allowResizable) {
22121
+ if (column.renderVisible && (!column.children || column.children.length)) {
22122
+ if (column.renderResizeWidth !== column.renderWidth) {
22123
+ column.resizeWidth = column.renderResizeWidth;
22124
+ column.renderWidth = column.renderResizeWidth;
22125
+ }
22126
+ }
22127
+ }
22128
+ if (allowVisible) {
22129
+ column.visible = column.renderVisible;
22130
+ }
22131
+ });
22132
+ return $xeTable.saveCustomStore('confirm');
22133
+ };
22134
+ const cancelCustom = () => {
22135
+ const {
22136
+ customColumnList,
22137
+ customStore
22138
+ } = reactData;
22139
+ const {
22140
+ oldSortMaps,
22141
+ oldFixedMaps,
22142
+ oldVisibleMaps
22143
+ } = customStore;
22144
+ const customOpts = computeCustomOpts.value;
22145
+ const {
22146
+ allowVisible,
22147
+ allowSort,
22148
+ allowFixed,
22149
+ allowResizable
22150
+ } = customOpts;
22151
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
22152
+ const colid = column.getKey();
22153
+ const visible = !!oldVisibleMaps[colid];
22154
+ const fixed = oldFixedMaps[colid] || '';
22155
+ if (allowVisible) {
22156
+ column.renderVisible = visible;
22157
+ column.visible = visible;
22158
+ }
22159
+ if (allowFixed) {
22160
+ column.renderFixed = fixed;
22161
+ column.fixed = fixed;
22162
+ }
22163
+ if (allowSort) {
22164
+ column.renderSortNumber = oldSortMaps[colid] || 0;
22165
+ }
22166
+ if (allowResizable) {
22167
+ column.renderResizeWidth = column.renderWidth;
22168
+ }
22169
+ }, {
22170
+ children: 'children'
22171
+ });
22172
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
22173
+ };
22174
+ const setCustomAllCheckbox = checked => {
22175
+ const {
22176
+ customStore
22177
+ } = reactData;
22178
+ const {
22179
+ customColumnList
22180
+ } = reactData;
22181
+ const customOpts = computeCustomOpts.value;
22182
+ const {
22183
+ checkMethod,
22184
+ visibleMethod
22185
+ } = customOpts;
22186
+ const isAll = !!checked;
22187
+ if (customOpts.immediate) {
22188
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
22189
+ if (visibleMethod && !visibleMethod({
22190
+ column
22191
+ })) {
22192
+ return;
22193
+ }
22194
+ if (checkMethod && !checkMethod({
22195
+ column
22196
+ })) {
22197
+ return;
22198
+ }
22199
+ column.visible = isAll;
22200
+ column.renderVisible = isAll;
22201
+ column.halfVisible = false;
22202
+ });
22203
+ customStore.isAll = isAll;
22204
+ $xeTable.handleCustom();
22205
+ $xeTable.saveCustomStore('update:visible');
22206
+ } else {
22207
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
22208
+ if (visibleMethod && !visibleMethod({
22209
+ column
22210
+ })) {
22211
+ return;
22212
+ }
22213
+ if (checkMethod && !checkMethod({
22214
+ column
22215
+ })) {
22216
+ return;
22217
+ }
22218
+ column.renderVisible = isAll;
22219
+ column.halfVisible = false;
22220
+ });
22221
+ customStore.isAll = isAll;
22222
+ }
22223
+ $xeTable.checkCustomStatus();
22224
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
22225
+ };
22202
22226
  const customMethods = {
22203
22227
  openCustom,
22204
- closeCustom
22228
+ closeCustom,
22229
+ saveCustom,
22230
+ cancelCustom,
22231
+ resetCustom(options) {
22232
+ const {
22233
+ collectColumn
22234
+ } = internalData;
22235
+ const customOpts = computeCustomOpts.value;
22236
+ const {
22237
+ checkMethod
22238
+ } = customOpts;
22239
+ const opts = Object.assign({
22240
+ visible: true,
22241
+ resizable: options === true,
22242
+ fixed: options === true,
22243
+ sort: options === true
22244
+ }, options);
22245
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
22246
+ if (opts.resizable) {
22247
+ column.resizeWidth = 0;
22248
+ }
22249
+ if (opts.fixed) {
22250
+ column.fixed = column.defaultFixed;
22251
+ }
22252
+ if (opts.sort) {
22253
+ column.renderSortNumber = column.sortNumber;
22254
+ }
22255
+ if (!checkMethod || checkMethod({
22256
+ column
22257
+ })) {
22258
+ column.visible = column.defaultVisible;
22259
+ }
22260
+ column.renderResizeWidth = column.renderWidth;
22261
+ });
22262
+ $xeTable.saveCustomStore('reset');
22263
+ return $xeTable.handleCustom();
22264
+ },
22265
+ toggleCustomAllCheckbox() {
22266
+ const {
22267
+ customStore
22268
+ } = reactData;
22269
+ const isAll = !customStore.isAll;
22270
+ return setCustomAllCheckbox(isAll);
22271
+ },
22272
+ setCustomAllCheckbox
22205
22273
  };
22206
22274
  const checkCustomStatus = () => {
22207
22275
  const {
@@ -24817,7 +24885,7 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
24817
24885
  $xeTable.openExport(btnParams);
24818
24886
  break;
24819
24887
  case 'reset_custom':
24820
- return $xeTable.resetColumn(true);
24888
+ return $xeTable.resetCustom(true);
24821
24889
  case '_init':
24822
24890
  case 'reload':
24823
24891
  case 'query':