vxe-table 4.11.21 → 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.21";
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.21"}`;
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.21";
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.21"}`;
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
@@ -11591,7 +11591,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11591
11591
  fullColumnFieldData[field] = rest;
11592
11592
  } else {
11593
11593
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
11594
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
11594
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
11595
11595
  }
11596
11596
  }
11597
11597
  if (!hasFixed && fixed) {
@@ -16942,8 +16942,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16942
16942
  collectColumn
16943
16943
  } = internalData;
16944
16944
  const {
16945
+ storage,
16945
16946
  checkMethod
16946
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;
16947
16954
  const resizableData = {};
16948
16955
  const sortData = {};
16949
16956
  const visibleData = {};
@@ -16963,45 +16970,35 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16963
16970
  let hasFixed = 0;
16964
16971
  let hasVisible = 0;
16965
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
+ }
16966
16978
  // 只支持一级
16967
16979
  if (!parentColumn) {
16968
- collectColumn.forEach(column => {
16969
- const colKey = column.getKey();
16970
- if (colKey) {
16971
- hasSort = 1;
16972
- sortData[colKey] = column.renderSortNumber;
16973
- }
16974
- });
16975
- if (column.fixed !== column.defaultFixed) {
16976
- const colKey = column.getKey();
16977
- if (colKey) {
16978
- hasFixed = 1;
16979
- fixedData[colKey] = column.fixed;
16980
- }
16980
+ if (isCustomSort) {
16981
+ hasSort = 1;
16982
+ sortData[colKey] = column.renderSortNumber;
16981
16983
  }
16982
- }
16983
- if (column.resizeWidth) {
16984
- const colKey = column.getKey();
16985
- if (colKey) {
16986
- hasResizable = 1;
16987
- resizableData[colKey] = column.renderWidth;
16984
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
16985
+ hasFixed = 1;
16986
+ fixedData[colKey] = column.fixed;
16988
16987
  }
16989
16988
  }
16990
- if (!checkMethod || checkMethod({
16989
+ if (isCustomResizable && column.resizeWidth) {
16990
+ hasResizable = 1;
16991
+ resizableData[colKey] = column.renderWidth;
16992
+ }
16993
+ if (isCustomVisible && (!checkMethod || checkMethod({
16991
16994
  column
16992
- })) {
16995
+ }))) {
16993
16996
  if (!column.visible && column.defaultVisible) {
16994
- const colKey = column.getKey();
16995
- if (colKey) {
16996
- hasVisible = 1;
16997
- visibleData[colKey] = false;
16998
- }
16997
+ hasVisible = 1;
16998
+ visibleData[colKey] = false;
16999
16999
  } else if (column.visible && !column.defaultVisible) {
17000
- const colKey = column.getKey();
17001
- if (colKey) {
17002
- hasVisible = 1;
17003
- visibleData[colKey] = true;
17004
- }
17000
+ hasVisible = 1;
17001
+ visibleData[colKey] = true;
17005
17002
  }
17006
17003
  }
17007
17004
  });