vxe-table 4.8.2 → 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 (50) 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/cell.js +2 -2
  8. package/es/table/src/table.js +8 -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 +268 -198
  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/hook.js +177 -3
  22. package/lib/table/module/custom/hook.min.js +1 -1
  23. package/lib/table/module/custom/panel.js +77 -157
  24. package/lib/table/module/custom/panel.min.js +1 -1
  25. package/lib/table/src/cell.js +2 -1
  26. package/lib/table/src/cell.min.js +1 -1
  27. package/lib/table/src/table.js +8 -34
  28. package/lib/table/src/table.min.js +1 -1
  29. package/lib/table/style/style.css +42 -37
  30. package/lib/table/style/style.min.css +1 -1
  31. package/lib/ui/index.js +2 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/vxe-table/style/style.css +42 -37
  36. package/lib/vxe-table/style/style.min.css +1 -1
  37. package/package.json +2 -2
  38. package/packages/grid/src/grid.ts +1 -1
  39. package/packages/table/module/custom/hook.ts +136 -3
  40. package/packages/table/module/custom/panel.ts +157 -179
  41. package/packages/table/src/cell.ts +2 -2
  42. package/packages/table/src/table.ts +8 -28
  43. package/packages/ui/index.ts +1 -0
  44. package/styles/components/table-module/custom.scss +21 -5
  45. /package/es/{iconfont.1730898232530.ttf → iconfont.1730971754265.ttf} +0 -0
  46. /package/es/{iconfont.1730898232530.woff → iconfont.1730971754265.woff} +0 -0
  47. /package/es/{iconfont.1730898232530.woff2 → iconfont.1730971754265.woff2} +0 -0
  48. /package/lib/{iconfont.1730898232530.ttf → iconfont.1730971754265.ttf} +0 -0
  49. /package/lib/{iconfont.1730898232530.woff → iconfont.1730971754265.woff} +0 -0
  50. /package/lib/{iconfont.1730898232530.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.2";
2001
+ const version = "4.8.5";
2002
2002
  core_.VxeUI.version = version;
2003
2003
  core_.VxeUI.tableVersion = version;
2004
2004
  core_.VxeUI.setConfig({
@@ -2228,6 +2228,7 @@ core_.VxeUI.setIcon({
2228
2228
  TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
2229
2229
  TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
2230
2230
  TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
2231
+ TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
2231
2232
  // toolbar
2232
2233
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
2233
2234
  TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
@@ -2387,7 +2388,7 @@ var es_array_push = __webpack_require__(4114);
2387
2388
  const {
2388
2389
  log: log_log
2389
2390
  } = core_.VxeUI;
2390
- const log_version = `table v${"4.8.2"}`;
2391
+ const log_version = `table v${"4.8.5"}`;
2391
2392
  const warnLog = log_log.create('warn', log_version);
2392
2393
  const errLog = log_log.create('error', log_version);
2393
2394
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3364,6 +3365,7 @@ function renderCellDragIcon(params) {
3364
3365
  } = $table.getComputeMaps();
3365
3366
  const dragOpts = computeDragOpts.value;
3366
3367
  const {
3368
+ rowIcon,
3367
3369
  rowDisabledMethod
3368
3370
  } = dragOpts;
3369
3371
  const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
@@ -3379,7 +3381,7 @@ function renderCellDragIcon(params) {
3379
3381
  },
3380
3382
  onMouseup: $table.handleCellDragMouseupEvent
3381
3383
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3382
- class: 'vxe-table-icon-drag-handle'
3384
+ class: rowIcon || cell_getIcon().TABLE_DRAG_ROW
3383
3385
  })]);
3384
3386
  }
3385
3387
  function renderCellBaseVNs(params, content) {
@@ -6703,7 +6705,8 @@ const {
6703
6705
 
6704
6706
  const {
6705
6707
  getI18n: panel_getI18n,
6706
- getIcon: panel_getIcon
6708
+ getIcon: panel_getIcon,
6709
+ renderEmptyElement: panel_renderEmptyElement
6707
6710
  } = core_.VxeUI;
6708
6711
  /* harmony default export */ var panel = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
6709
6712
  name: 'TableCustomPanel',
@@ -6755,44 +6758,9 @@ const {
6755
6758
  const confirmCustomEvent = ({
6756
6759
  $event
6757
6760
  }) => {
6758
- const {
6759
- customColumnList
6760
- } = reactData;
6761
- const customOpts = computeCustomOpts.value;
6762
- const {
6763
- allowVisible,
6764
- allowSort,
6765
- allowFixed,
6766
- allowResizable
6767
- } = customOpts;
6768
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
6769
- if (parent) {
6770
- // 更新子列信息
6771
- column.fixed = parent.fixed;
6772
- } else {
6773
- if (allowSort) {
6774
- const sortIndex = index + 1;
6775
- column.renderSortNumber = sortIndex;
6776
- }
6777
- if (allowFixed) {
6778
- column.fixed = column.renderFixed;
6779
- }
6780
- }
6781
- if (allowResizable) {
6782
- if (column.renderVisible && (!column.children || column.children.length)) {
6783
- if (column.renderResizeWidth !== column.renderWidth) {
6784
- column.resizeWidth = column.renderResizeWidth;
6785
- column.renderWidth = column.renderResizeWidth;
6786
- }
6787
- }
6788
- }
6789
- if (allowVisible) {
6790
- column.visible = column.renderVisible;
6791
- }
6792
- });
6761
+ $xeTable.saveCustom();
6793
6762
  $xeTable.closeCustom();
6794
6763
  $xeTable.emitCustomEvent('confirm', $event);
6795
- $xeTable.saveCustomStore('confirm');
6796
6764
  };
6797
6765
  const cancelCloseEvent = ({
6798
6766
  $event
@@ -6803,50 +6771,12 @@ const {
6803
6771
  const cancelCustomEvent = ({
6804
6772
  $event
6805
6773
  }) => {
6806
- const {
6807
- customStore
6808
- } = props;
6809
- const {
6810
- customColumnList
6811
- } = reactData;
6812
- const {
6813
- oldSortMaps,
6814
- oldFixedMaps,
6815
- oldVisibleMaps
6816
- } = customStore;
6817
- const customOpts = computeCustomOpts.value;
6818
- const {
6819
- allowVisible,
6820
- allowSort,
6821
- allowFixed,
6822
- allowResizable
6823
- } = customOpts;
6824
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6825
- const colid = column.getKey();
6826
- const visible = !!oldVisibleMaps[colid];
6827
- const fixed = oldFixedMaps[colid] || '';
6828
- if (allowVisible) {
6829
- column.renderVisible = visible;
6830
- column.visible = visible;
6831
- }
6832
- if (allowFixed) {
6833
- column.renderFixed = fixed;
6834
- column.fixed = fixed;
6835
- }
6836
- if (allowSort) {
6837
- column.renderSortNumber = oldSortMaps[colid] || 0;
6838
- }
6839
- if (allowResizable) {
6840
- column.renderResizeWidth = column.renderWidth;
6841
- }
6842
- }, {
6843
- children: 'children'
6844
- });
6774
+ $xeTable.cancelCustom();
6845
6775
  $xeTable.closeCustom();
6846
6776
  $xeTable.emitCustomEvent('cancel', $event);
6847
6777
  };
6848
6778
  const handleResetCustomEvent = evnt => {
6849
- $xeTable.resetColumn(true);
6779
+ $xeTable.resetCustom(true);
6850
6780
  $xeTable.closeCustom();
6851
6781
  $xeTable.emitCustomEvent('reset', evnt);
6852
6782
  };
@@ -6937,55 +6867,7 @@ const {
6937
6867
  }
6938
6868
  };
6939
6869
  const allOptionEvent = () => {
6940
- const {
6941
- customStore
6942
- } = props;
6943
- const {
6944
- customColumnList
6945
- } = reactData;
6946
- const customOpts = computeCustomOpts.value;
6947
- const {
6948
- checkMethod,
6949
- visibleMethod
6950
- } = customOpts;
6951
- const isAll = !customStore.isAll;
6952
- if (customOpts.immediate) {
6953
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6954
- if (visibleMethod && !visibleMethod({
6955
- column
6956
- })) {
6957
- return;
6958
- }
6959
- if (checkMethod && !checkMethod({
6960
- column
6961
- })) {
6962
- return;
6963
- }
6964
- column.visible = isAll;
6965
- column.renderVisible = isAll;
6966
- column.halfVisible = false;
6967
- });
6968
- customStore.isAll = isAll;
6969
- $xeTable.handleCustom();
6970
- $xeTable.saveCustomStore('update:visible');
6971
- } else {
6972
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6973
- if (visibleMethod && !visibleMethod({
6974
- column
6975
- })) {
6976
- return;
6977
- }
6978
- if (checkMethod && !checkMethod({
6979
- column
6980
- })) {
6981
- return;
6982
- }
6983
- column.renderVisible = isAll;
6984
- column.halfVisible = false;
6985
- });
6986
- customStore.isAll = isAll;
6987
- }
6988
- $xeTable.checkCustomStatus();
6870
+ $xeTable.toggleCustomAllCheckbox();
6989
6871
  };
6990
6872
  const sortMousedownEvent = evnt => {
6991
6873
  const btnEl = evnt.currentTarget;
@@ -6996,6 +6878,7 @@ const {
6996
6878
  trEl.draggable = true;
6997
6879
  dragColumnRef.value = column;
6998
6880
  addClass(trEl, 'active--drag-origin');
6881
+ updateDropHint(evnt);
6999
6882
  };
7000
6883
  const sortMouseupEvent = evnt => {
7001
6884
  const btnEl = evnt.currentTarget;
@@ -7119,13 +7002,29 @@ const {
7119
7002
  placement
7120
7003
  } = customOpts;
7121
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;
7122
7011
  const colVNs = [];
7123
7012
  const customWrapperOns = {};
7013
+ const isAllChecked = customStore.isAll;
7014
+ const isAllIndeterminate = customStore.isIndeterminate;
7015
+ const dragColumn = dragColumnRef.value;
7124
7016
  // hover 触发
7125
7017
  if (trigger === 'hover') {
7126
7018
  customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
7127
7019
  customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
7128
7020
  }
7021
+ const params = {
7022
+ $table: $xeTable,
7023
+ $grid: $xeTable.xegrid,
7024
+ columns: customColumnList,
7025
+ isAllChecked,
7026
+ isAllIndeterminate
7027
+ };
7129
7028
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
7130
7029
  const isVisible = visibleMethod ? visibleMethod({
7131
7030
  column
@@ -7206,9 +7105,6 @@ const {
7206
7105
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
7207
7106
  }
7208
7107
  });
7209
- const isAllChecked = customStore.isAll;
7210
- const isAllIndeterminate = customStore.isIndeterminate;
7211
- const dragColumn = dragColumnRef.value;
7212
7108
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7213
7109
  ref: refElem,
7214
7110
  key: 'simple',
@@ -7218,8 +7114,10 @@ const {
7218
7114
  style: maxHeight && !['left', 'right'].includes(placement) ? {
7219
7115
  maxHeight: `${maxHeight}px`
7220
7116
  } : {}
7221
- }, 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', {
7222
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'
7223
7121
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
7224
7122
  class: 'vxe-table-custom--option'
7225
7123
  }, [allowVisible ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -7235,21 +7133,29 @@ const {
7235
7133
  class: 'vxe-checkbox--label'
7236
7134
  }, panel_getI18n('vxe.toolbar.customAll'))]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7237
7135
  class: 'vxe-checkbox--label'
7238
- }, 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', {
7239
7137
  ref: bodyElemRef,
7240
- class: 'vxe-table-custom--list-wrapper'
7241
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
7242
- 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',
7243
7145
  name: 'vxe-table-custom--list',
7244
7146
  tag: 'ul',
7245
7147
  ...customWrapperOns
7246
7148
  }, {
7247
7149
  default: () => colVNs
7248
- }), (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', {
7249
7153
  ref: dragHintElemRef,
7250
7154
  class: 'vxe-table-custom-popup--drag-hint'
7251
7155
  }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))]), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7252
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'
7253
7159
  }, [VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
7254
7160
  mode: 'text',
7255
7161
  content: customOpts.resetButtonText || panel_getI18n('vxe.table.customRestore'),
@@ -7267,7 +7173,7 @@ const {
7267
7173
  status: 'primary',
7268
7174
  content: customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'),
7269
7175
  onClick: confirmCustomEvent
7270
- }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : null] : []);
7176
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null] : []);
7271
7177
  };
7272
7178
  const renderPopupPanel = () => {
7273
7179
  const {
@@ -7297,7 +7203,23 @@ const {
7297
7203
  const modalOpts = Object.assign({}, modalOptions);
7298
7204
  const drawerOpts = Object.assign({}, drawerOptions);
7299
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;
7300
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
+ };
7301
7223
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
7302
7224
  const isVisible = visibleMethod ? visibleMethod({
7303
7225
  column
@@ -7394,36 +7316,28 @@ const {
7394
7316
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
7395
7317
  }
7396
7318
  });
7397
- const isAllChecked = customStore.isAll;
7398
- const isAllIndeterminate = customStore.isIndeterminate;
7399
- const dragColumn = dragColumnRef.value;
7400
7319
  const scopedSlots = {
7401
7320
  default: () => {
7321
+ if (defaultSlot) {
7322
+ return $xeTable.callSlot(defaultSlot, params);
7323
+ }
7402
7324
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7403
7325
  ref: bodyElemRef,
7404
7326
  class: 'vxe-table-custom-popup--body'
7405
- }, [(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', {
7406
7330
  class: 'vxe-table-custom-popup--table-wrapper'
7407
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', {
7408
- style: {
7409
- width: '80px'
7410
- }
7332
+ class: 'vxe-table-custom-popup--table-col-seq'
7411
7333
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), allowSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7412
- style: {
7413
- width: '80px'
7414
- }
7334
+ class: 'vxe-table-custom-popup--table-col-sort'
7415
7335
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7416
- style: {
7417
- minWidth: '120px'
7418
- }
7336
+ class: 'vxe-table-custom-popup--table-col-title'
7419
7337
  }), allowResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7420
- style: {
7421
- width: '140px'
7422
- }
7338
+ class: 'vxe-table-custom-popup--table-col-width'
7423
7339
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
7424
- style: {
7425
- width: '200px'
7426
- }
7340
+ class: 'vxe-table-custom-popup--table-col-fixed'
7427
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', {
7428
7342
  class: ['vxe-table-custom--checkbox-option', {
7429
7343
  'is--checked': isAllChecked,
@@ -7448,17 +7362,22 @@ const {
7448
7362
  });
7449
7363
  }
7450
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, {
7451
- class: 'vxe-table-custom--body',
7365
+ class: 'vxe-table-custom--panel-list',
7452
7366
  tag: 'tbody',
7453
7367
  name: 'vxe-table-custom--list'
7454
7368
  }, {
7455
7369
  default: () => trVNs
7456
- })])]), (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', {
7457
7373
  ref: dragHintElemRef,
7458
7374
  class: 'vxe-table-custom-popup--drag-hint'
7459
7375
  }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))]);
7460
7376
  },
7461
7377
  footer: () => {
7378
+ if (footerSlot) {
7379
+ return $xeTable.callSlot(footerSlot, params);
7380
+ }
7462
7381
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7463
7382
  class: 'vxe-table-custom-popup--footer'
7464
7383
  }, [VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
@@ -7474,6 +7393,9 @@ const {
7474
7393
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
7475
7394
  }
7476
7395
  };
7396
+ if (headerSlot) {
7397
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params);
7398
+ }
7477
7399
  if (mode === 'drawer') {
7478
7400
  return VxeUIDrawerComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIDrawerComponent, {
7479
7401
  key: 'drawer',
@@ -11105,7 +11027,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11105
11027
  $table: $xeTable,
11106
11028
  row
11107
11029
  })).then(childRecords => {
11108
- rowRest.treeLoaded = true;
11030
+ if (rowRest) {
11031
+ rowRest.treeLoaded = true;
11032
+ }
11109
11033
  if (treeExpandLazyLoadedMaps[rowid]) {
11110
11034
  delete treeExpandLazyLoadedMaps[rowid];
11111
11035
  }
@@ -11135,7 +11059,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11135
11059
  const {
11136
11060
  treeExpandLazyLoadedMaps
11137
11061
  } = reactData;
11138
- rowRest.treeLoaded = false;
11062
+ if (rowRest) {
11063
+ rowRest.treeLoaded = false;
11064
+ }
11139
11065
  if (treeExpandLazyLoadedMaps[rowid]) {
11140
11066
  delete treeExpandLazyLoadedMaps[rowid];
11141
11067
  }
@@ -12774,38 +12700,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12774
12700
  * 如果已关联工具栏,则会同步更新
12775
12701
  */
12776
12702
  resetColumn(options) {
12777
- const {
12778
- collectColumn
12779
- } = internalData;
12780
- const customOpts = computeCustomOpts.value;
12781
- const {
12782
- checkMethod
12783
- } = customOpts;
12784
- const opts = Object.assign({
12785
- visible: true,
12786
- resizable: options === true,
12787
- fixed: options === true,
12788
- sort: options === true
12789
- }, options);
12790
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
12791
- if (opts.resizable) {
12792
- column.resizeWidth = 0;
12793
- }
12794
- if (opts.fixed) {
12795
- column.fixed = column.defaultFixed;
12796
- }
12797
- if (opts.sort) {
12798
- column.renderSortNumber = column.sortNumber;
12799
- }
12800
- if (!checkMethod || checkMethod({
12801
- column
12802
- })) {
12803
- column.visible = column.defaultVisible;
12804
- }
12805
- column.renderResizeWidth = column.renderWidth;
12806
- });
12807
- $xeTable.saveCustomStore('reset');
12808
- return tablePrivateMethods.handleCustom();
12703
+ warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
12704
+ return $xeTable.resetCustom(options);
12809
12705
  },
12810
12706
  /**
12811
12707
  * 刷新列信息
@@ -22126,7 +22022,7 @@ validator_hook_hooks.add('tableValidatorModule', {
22126
22022
 
22127
22023
 
22128
22024
 
22129
- const tableCustomMethodKeys = ['openCustom', 'closeCustom'];
22025
+ const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
22130
22026
  core_.VxeUI.hooks.add('tableCustomModule', {
22131
22027
  setupTable($xeTable) {
22132
22028
  const {
@@ -22150,7 +22046,7 @@ core_.VxeUI.hooks.add('tableCustomModule', {
22150
22046
  if (el) {
22151
22047
  tableHeight = el.clientHeight - 28;
22152
22048
  }
22153
- customStore.maxHeight = Math.max(4, tableHeight);
22049
+ customStore.maxHeight = Math.max(88, tableHeight);
22154
22050
  };
22155
22051
  const openCustom = () => {
22156
22052
  const {
@@ -22197,9 +22093,183 @@ core_.VxeUI.hooks.add('tableCustomModule', {
22197
22093
  }
22198
22094
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
22199
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
+ };
22200
22226
  const customMethods = {
22201
22227
  openCustom,
22202
- 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
22203
22273
  };
22204
22274
  const checkCustomStatus = () => {
22205
22275
  const {
@@ -24815,7 +24885,7 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
24815
24885
  $xeTable.openExport(btnParams);
24816
24886
  break;
24817
24887
  case 'reset_custom':
24818
- return $xeTable.resetColumn(true);
24888
+ return $xeTable.resetCustom(true);
24819
24889
  case '_init':
24820
24890
  case 'reload':
24821
24891
  case 'query':