vxe-table 3.13.23 → 3.13.24

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.
@@ -200,7 +200,7 @@ function cacheColumnMap($xeTable) {
200
200
  }
201
201
  else {
202
202
  if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
203
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
203
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
204
204
  }
205
205
  }
206
206
  if (!hasFixed && fixed) {
@@ -3960,8 +3960,19 @@ const Methods = {
3960
3960
  }
3961
3961
  },
3962
3962
  getCustomStoreData() {
3963
- const { id, customOpts, collectColumn } = this;
3964
- const { checkMethod } = customOpts;
3963
+ const $xeTable = this;
3964
+ const props = $xeTable;
3965
+ const internalData = $xeTable;
3966
+ const { id } = props;
3967
+ const customOpts = $xeTable.computeCustomOpts;
3968
+ const { collectColumn } = internalData;
3969
+ const { storage, checkMethod } = customOpts;
3970
+ const isAllCustom = storage === true;
3971
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
3972
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
3973
+ const isCustomVisible = isAllCustom || storageOpts.visible;
3974
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
3975
+ const isCustomSort = isAllCustom || storageOpts.sort;
3965
3976
  const resizableData = {};
3966
3977
  const sortData = {};
3967
3978
  const visibleData = {};
@@ -3978,47 +3989,37 @@ const Methods = {
3978
3989
  }
3979
3990
  let hasResizable = 0;
3980
3991
  let hasSort = 0;
3981
- let hasFixedt = 0;
3992
+ let hasFixed = 0;
3982
3993
  let hasVisible = 0;
3983
3994
  XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
3995
+ const colKey = column.getKey();
3996
+ if (!colKey) {
3997
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
3998
+ return;
3999
+ }
3984
4000
  // 只支持一级
3985
4001
  if (!parentColumn) {
3986
- collectColumn.forEach((column) => {
3987
- const colKey = column.getKey();
3988
- if (colKey) {
3989
- hasSort = 1;
3990
- sortData[colKey] = column.renderSortNumber;
3991
- }
3992
- });
3993
- if (column.fixed !== column.defaultFixed) {
3994
- const colKey = column.getKey();
3995
- if (colKey) {
3996
- hasFixedt = 1;
3997
- fixedData[colKey] = column.fixed;
3998
- }
4002
+ if (isCustomSort) {
4003
+ hasSort = 1;
4004
+ sortData[colKey] = column.renderSortNumber;
3999
4005
  }
4000
- }
4001
- if (column.resizeWidth) {
4002
- const colKey = column.getKey();
4003
- if (colKey) {
4004
- hasResizable = 1;
4005
- resizableData[colKey] = column.renderWidth;
4006
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
4007
+ hasFixed = 1;
4008
+ fixedData[colKey] = column.fixed;
4006
4009
  }
4007
4010
  }
4008
- if (!checkMethod || checkMethod({ column })) {
4011
+ if (isCustomResizable && column.resizeWidth) {
4012
+ hasResizable = 1;
4013
+ resizableData[colKey] = column.renderWidth;
4014
+ }
4015
+ if (isCustomVisible && (!checkMethod || checkMethod({ column }))) {
4009
4016
  if (!column.visible && column.defaultVisible) {
4010
- const colKey = column.getKey();
4011
- if (colKey) {
4012
- hasVisible = 1;
4013
- visibleData[colKey] = false;
4014
- }
4017
+ hasVisible = 1;
4018
+ visibleData[colKey] = false;
4015
4019
  }
4016
4020
  else if (column.visible && !column.defaultVisible) {
4017
- const colKey = column.getKey();
4018
- if (colKey) {
4019
- hasVisible = 1;
4020
- visibleData[colKey] = true;
4021
- }
4021
+ hasVisible = 1;
4022
+ visibleData[colKey] = true;
4022
4023
  }
4023
4024
  }
4024
4025
  });
@@ -4028,7 +4029,7 @@ const Methods = {
4028
4029
  if (hasSort) {
4029
4030
  storeData.sortData = sortData;
4030
4031
  }
4031
- if (hasFixedt) {
4032
+ if (hasFixed) {
4032
4033
  storeData.fixedData = fixedData;
4033
4034
  }
4034
4035
  if (hasVisible) {
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 = "3.13.23";
3
+ export const version = "3.13.24";
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${"3.13.23"}`;
3
+ const version = `table v${"3.13.24"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3201,7 +3201,7 @@ function getClass(property, params) {
3201
3201
  ;// ./packages/ui/index.ts
3202
3202
 
3203
3203
 
3204
- const version = "3.13.23";
3204
+ const version = "3.13.24";
3205
3205
  core_.VxeUI.version = version;
3206
3206
  core_.VxeUI.tableVersion = version;
3207
3207
  core_.VxeUI.setConfig({
@@ -3828,7 +3828,7 @@ var es_iterator_map = __webpack_require__(1701);
3828
3828
  const {
3829
3829
  log: log_log
3830
3830
  } = core_.VxeUI;
3831
- const log_version = `table v${"3.13.23"}`;
3831
+ const log_version = `table v${"3.13.24"}`;
3832
3832
  const warnLog = log_log.create('warn', log_version);
3833
3833
  const errLog = log_log.create('error', log_version);
3834
3834
  ;// ./packages/table/src/columnInfo.ts
@@ -6358,7 +6358,7 @@ function cacheColumnMap($xeTable) {
6358
6358
  fullColumnFieldData[field] = rest;
6359
6359
  } else {
6360
6360
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
6361
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
6361
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
6362
6362
  }
6363
6363
  }
6364
6364
  if (!hasFixed && fixed) {
@@ -10712,14 +10712,26 @@ const Methods = {
10712
10712
  }
10713
10713
  },
10714
10714
  getCustomStoreData() {
10715
+ const $xeTable = this;
10716
+ const props = $xeTable;
10717
+ const internalData = $xeTable;
10718
+ const {
10719
+ id
10720
+ } = props;
10721
+ const customOpts = $xeTable.computeCustomOpts;
10715
10722
  const {
10716
- id,
10717
- customOpts,
10718
10723
  collectColumn
10719
- } = this;
10724
+ } = internalData;
10720
10725
  const {
10726
+ storage,
10721
10727
  checkMethod
10722
10728
  } = customOpts;
10729
+ const isAllCustom = storage === true;
10730
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
10731
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
10732
+ const isCustomVisible = isAllCustom || storageOpts.visible;
10733
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
10734
+ const isCustomSort = isAllCustom || storageOpts.sort;
10723
10735
  const resizableData = {};
10724
10736
  const sortData = {};
10725
10737
  const visibleData = {};
@@ -10736,48 +10748,38 @@ const Methods = {
10736
10748
  }
10737
10749
  let hasResizable = 0;
10738
10750
  let hasSort = 0;
10739
- let hasFixedt = 0;
10751
+ let hasFixed = 0;
10740
10752
  let hasVisible = 0;
10741
10753
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
10754
+ const colKey = column.getKey();
10755
+ if (!colKey) {
10756
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
10757
+ return;
10758
+ }
10742
10759
  // 只支持一级
10743
10760
  if (!parentColumn) {
10744
- collectColumn.forEach(column => {
10745
- const colKey = column.getKey();
10746
- if (colKey) {
10747
- hasSort = 1;
10748
- sortData[colKey] = column.renderSortNumber;
10749
- }
10750
- });
10751
- if (column.fixed !== column.defaultFixed) {
10752
- const colKey = column.getKey();
10753
- if (colKey) {
10754
- hasFixedt = 1;
10755
- fixedData[colKey] = column.fixed;
10756
- }
10761
+ if (isCustomSort) {
10762
+ hasSort = 1;
10763
+ sortData[colKey] = column.renderSortNumber;
10757
10764
  }
10758
- }
10759
- if (column.resizeWidth) {
10760
- const colKey = column.getKey();
10761
- if (colKey) {
10762
- hasResizable = 1;
10763
- resizableData[colKey] = column.renderWidth;
10765
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
10766
+ hasFixed = 1;
10767
+ fixedData[colKey] = column.fixed;
10764
10768
  }
10765
10769
  }
10766
- if (!checkMethod || checkMethod({
10770
+ if (isCustomResizable && column.resizeWidth) {
10771
+ hasResizable = 1;
10772
+ resizableData[colKey] = column.renderWidth;
10773
+ }
10774
+ if (isCustomVisible && (!checkMethod || checkMethod({
10767
10775
  column
10768
- })) {
10776
+ }))) {
10769
10777
  if (!column.visible && column.defaultVisible) {
10770
- const colKey = column.getKey();
10771
- if (colKey) {
10772
- hasVisible = 1;
10773
- visibleData[colKey] = false;
10774
- }
10778
+ hasVisible = 1;
10779
+ visibleData[colKey] = false;
10775
10780
  } else if (column.visible && !column.defaultVisible) {
10776
- const colKey = column.getKey();
10777
- if (colKey) {
10778
- hasVisible = 1;
10779
- visibleData[colKey] = true;
10780
- }
10781
+ hasVisible = 1;
10782
+ visibleData[colKey] = true;
10781
10783
  }
10782
10784
  }
10783
10785
  });
@@ -10787,7 +10789,7 @@ const Methods = {
10787
10789
  if (hasSort) {
10788
10790
  storeData.sortData = sortData;
10789
10791
  }
10790
- if (hasFixedt) {
10792
+ if (hasFixed) {
10791
10793
  storeData.fixedData = fixedData;
10792
10794
  }
10793
10795
  if (hasVisible) {