vxe-table 4.11.20 → 4.11.22

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.
@@ -1174,7 +1174,7 @@ export default defineComponent({
1174
1174
  }
1175
1175
  else {
1176
1176
  if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
1177
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
1177
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
1178
1178
  }
1179
1179
  }
1180
1180
  if (!hasFixed && fixed) {
@@ -5758,7 +5758,13 @@ export default defineComponent({
5758
5758
  const { id } = props;
5759
5759
  const customOpts = computeCustomOpts.value;
5760
5760
  const { collectColumn } = internalData;
5761
- const { checkMethod } = customOpts;
5761
+ const { storage, checkMethod } = customOpts;
5762
+ const isAllCustom = storage === true;
5763
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
5764
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
5765
+ const isCustomVisible = isAllCustom || storageOpts.visible;
5766
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
5767
+ const isCustomSort = isAllCustom || storageOpts.sort;
5762
5768
  const resizableData = {};
5763
5769
  const sortData = {};
5764
5770
  const visibleData = {};
@@ -5778,44 +5784,34 @@ export default defineComponent({
5778
5784
  let hasFixed = 0;
5779
5785
  let hasVisible = 0;
5780
5786
  XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
5787
+ const colKey = column.getKey();
5788
+ if (!colKey) {
5789
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
5790
+ return;
5791
+ }
5781
5792
  // 只支持一级
5782
5793
  if (!parentColumn) {
5783
- collectColumn.forEach((column) => {
5784
- const colKey = column.getKey();
5785
- if (colKey) {
5786
- hasSort = 1;
5787
- sortData[colKey] = column.renderSortNumber;
5788
- }
5789
- });
5790
- if (column.fixed !== column.defaultFixed) {
5791
- const colKey = column.getKey();
5792
- if (colKey) {
5793
- hasFixed = 1;
5794
- fixedData[colKey] = column.fixed;
5795
- }
5794
+ if (isCustomSort) {
5795
+ hasSort = 1;
5796
+ sortData[colKey] = column.renderSortNumber;
5796
5797
  }
5797
- }
5798
- if (column.resizeWidth) {
5799
- const colKey = column.getKey();
5800
- if (colKey) {
5801
- hasResizable = 1;
5802
- resizableData[colKey] = column.renderWidth;
5798
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
5799
+ hasFixed = 1;
5800
+ fixedData[colKey] = column.fixed;
5803
5801
  }
5804
5802
  }
5805
- if (!checkMethod || checkMethod({ column })) {
5803
+ if (isCustomResizable && column.resizeWidth) {
5804
+ hasResizable = 1;
5805
+ resizableData[colKey] = column.renderWidth;
5806
+ }
5807
+ if (isCustomVisible && (!checkMethod || checkMethod({ column }))) {
5806
5808
  if (!column.visible && column.defaultVisible) {
5807
- const colKey = column.getKey();
5808
- if (colKey) {
5809
- hasVisible = 1;
5810
- visibleData[colKey] = false;
5811
- }
5809
+ hasVisible = 1;
5810
+ visibleData[colKey] = false;
5812
5811
  }
5813
5812
  else if (column.visible && !column.defaultVisible) {
5814
- const colKey = column.getKey();
5815
- if (colKey) {
5816
- hasVisible = 1;
5817
- visibleData[colKey] = true;
5818
- }
5813
+ hasVisible = 1;
5814
+ visibleData[colKey] = true;
5819
5815
  }
5820
5816
  }
5821
5817
  });
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.11.20";
3
+ export const version = "4.11.22";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.11.20"}`;
3
+ const version = `table v${"4.11.22"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3051,7 +3051,7 @@ function eqEmptyValue(cellValue) {
3051
3051
  ;// ./packages/ui/index.ts
3052
3052
 
3053
3053
 
3054
- const version = "4.11.20";
3054
+ const version = "4.11.22";
3055
3055
  core_.VxeUI.version = version;
3056
3056
  core_.VxeUI.tableVersion = version;
3057
3057
  core_.VxeUI.setConfig({
@@ -3499,7 +3499,7 @@ var es_iterator_some = __webpack_require__(3579);
3499
3499
  const {
3500
3500
  log: log_log
3501
3501
  } = core_.VxeUI;
3502
- const log_version = `table v${"4.11.20"}`;
3502
+ const log_version = `table v${"4.11.22"}`;
3503
3503
  const warnLog = log_log.create('warn', log_version);
3504
3504
  const errLog = log_log.create('error', log_version);
3505
3505
  ;// ./packages/table/src/columnInfo.ts
@@ -9319,11 +9319,17 @@ const {
9319
9319
  const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
9320
9320
  if (filterSlot) {
9321
9321
  return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
9322
- class: 'vxe-table--filter-template'
9322
+ class: 'vxe-table--filter-template',
9323
+ style: maxHeight ? {
9324
+ maxHeight: `${maxHeight}px`
9325
+ } : {}
9323
9326
  }, $xeTable.callSlot(filterSlot, params))];
9324
9327
  } else if (rtFilter) {
9325
9328
  return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
9326
- class: 'vxe-table--filter-template'
9329
+ class: 'vxe-table--filter-template',
9330
+ style: maxHeight ? {
9331
+ maxHeight: `${maxHeight}px`
9332
+ } : {}
9327
9333
  }, getSlotVNs(rtFilter(filterRender, params)))];
9328
9334
  }
9329
9335
  const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some(item => item._checked);
@@ -11585,7 +11591,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11585
11591
  fullColumnFieldData[field] = rest;
11586
11592
  } else {
11587
11593
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
11588
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
11594
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
11589
11595
  }
11590
11596
  }
11591
11597
  if (!hasFixed && fixed) {
@@ -16936,8 +16942,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16936
16942
  collectColumn
16937
16943
  } = internalData;
16938
16944
  const {
16945
+ storage,
16939
16946
  checkMethod
16940
16947
  } = customOpts;
16948
+ const isAllCustom = storage === true;
16949
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
16950
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
16951
+ const isCustomVisible = isAllCustom || storageOpts.visible;
16952
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
16953
+ const isCustomSort = isAllCustom || storageOpts.sort;
16941
16954
  const resizableData = {};
16942
16955
  const sortData = {};
16943
16956
  const visibleData = {};
@@ -16957,45 +16970,35 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16957
16970
  let hasFixed = 0;
16958
16971
  let hasVisible = 0;
16959
16972
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
16973
+ const colKey = column.getKey();
16974
+ if (!colKey) {
16975
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
16976
+ return;
16977
+ }
16960
16978
  // 只支持一级
16961
16979
  if (!parentColumn) {
16962
- collectColumn.forEach(column => {
16963
- const colKey = column.getKey();
16964
- if (colKey) {
16965
- hasSort = 1;
16966
- sortData[colKey] = column.renderSortNumber;
16967
- }
16968
- });
16969
- if (column.fixed !== column.defaultFixed) {
16970
- const colKey = column.getKey();
16971
- if (colKey) {
16972
- hasFixed = 1;
16973
- fixedData[colKey] = column.fixed;
16974
- }
16980
+ if (isCustomSort) {
16981
+ hasSort = 1;
16982
+ sortData[colKey] = column.renderSortNumber;
16975
16983
  }
16976
- }
16977
- if (column.resizeWidth) {
16978
- const colKey = column.getKey();
16979
- if (colKey) {
16980
- hasResizable = 1;
16981
- resizableData[colKey] = column.renderWidth;
16984
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
16985
+ hasFixed = 1;
16986
+ fixedData[colKey] = column.fixed;
16982
16987
  }
16983
16988
  }
16984
- if (!checkMethod || checkMethod({
16989
+ if (isCustomResizable && column.resizeWidth) {
16990
+ hasResizable = 1;
16991
+ resizableData[colKey] = column.renderWidth;
16992
+ }
16993
+ if (isCustomVisible && (!checkMethod || checkMethod({
16985
16994
  column
16986
- })) {
16995
+ }))) {
16987
16996
  if (!column.visible && column.defaultVisible) {
16988
- const colKey = column.getKey();
16989
- if (colKey) {
16990
- hasVisible = 1;
16991
- visibleData[colKey] = false;
16992
- }
16997
+ hasVisible = 1;
16998
+ visibleData[colKey] = false;
16993
16999
  } else if (column.visible && !column.defaultVisible) {
16994
- const colKey = column.getKey();
16995
- if (colKey) {
16996
- hasVisible = 1;
16997
- visibleData[colKey] = true;
16998
- }
17000
+ hasVisible = 1;
17001
+ visibleData[colKey] = true;
16999
17002
  }
17000
17003
  }
17001
17004
  });