vxe-table 4.7.76 → 4.7.77

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.
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.7.76"}`;
3
+ const version = `table v${"4.7.77"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -1976,9 +1976,9 @@ function eqEmptyValue(cellValue) {
1976
1976
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1977
1977
 
1978
1978
 
1979
- const version = "4.7.76";
1979
+ const version = "4.7.77";
1980
1980
  core_.VxeUI.version = version;
1981
- core_.VxeUI.tableVersion = "4.7.76";
1981
+ core_.VxeUI.tableVersion = "4.7.77";
1982
1982
  core_.VxeUI.setConfig({
1983
1983
  emptyCell: ' ',
1984
1984
  table: {
@@ -2360,7 +2360,7 @@ var es_array_push = __webpack_require__(4114);
2360
2360
  const {
2361
2361
  log: log_log
2362
2362
  } = core_.VxeUI;
2363
- const log_version = `table v${"4.7.76"}`;
2363
+ const log_version = `table v${"4.7.77"}`;
2364
2364
  const warnLog = log_log.create('warn', log_version);
2365
2365
  const errLog = log_log.create('error', log_version);
2366
2366
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -10468,9 +10468,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10468
10468
  if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
10469
10469
  rows = [rows];
10470
10470
  }
10471
- rows.forEach(row => tablePrivateMethods.handleSelectRow({
10472
- row
10473
- }, !!value, isForce));
10471
+ tablePrivateMethods.handleBatchSelectRows(rows, !!value, isForce);
10472
+ tablePrivateMethods.checkSelectionStatus();
10474
10473
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
10475
10474
  };
10476
10475
  const handleCheckedAllCheckboxRow = (value, isForce) => {
@@ -10482,7 +10481,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10482
10481
  } = reactData;
10483
10482
  const {
10484
10483
  afterFullData,
10485
- afterFullRowMaps,
10486
10484
  checkboxReserveRowMap
10487
10485
  } = internalData;
10488
10486
  const treeOpts = computeTreeOpts.value;
@@ -10496,15 +10494,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10496
10494
  } = checkboxOpts;
10497
10495
  const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
10498
10496
  const selectRowMaps = {};
10499
- // 疑惑!
10500
- if (!treeConfig) {
10501
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
10502
- if (!afterFullRowMaps[rowid]) {
10503
- selectRowMaps[rowid] = row;
10504
- }
10505
- });
10506
- }
10507
- // 疑惑!
10508
10497
  if (checkStrictly) {
10509
10498
  reactData.isAllSelected = value;
10510
10499
  } else {
@@ -11603,7 +11592,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11603
11592
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
11604
11593
  rest = [rows];
11605
11594
  }
11606
- rest.forEach(item => Object.assign(item, record));
11595
+ const rowkey = getRowkey($xeTable);
11596
+ rest.forEach(row => {
11597
+ const rowid = getRowid($xeTable, row);
11598
+ const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({}, record), true);
11599
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord, rowkey, rowid);
11600
+ Object.assign(row, newRecord);
11601
+ });
11607
11602
  }
11608
11603
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
11609
11604
  },
@@ -11629,13 +11624,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11629
11624
  const oRow = tableSourceData[rowIndex];
11630
11625
  if (oRow && row) {
11631
11626
  if (field) {
11632
- const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field);
11627
+ const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field), true);
11633
11628
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, newValue);
11634
11629
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(oRow, field, newValue);
11635
11630
  } else {
11636
- const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone({
11637
- ...record
11638
- }, true);
11631
+ const rowkey = getRowkey($xeTable);
11632
+ const rowid = getRowid($xeTable, row);
11633
+ const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({}, record), true);
11634
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord, rowkey, rowid);
11639
11635
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(oRow, Object.assign(row, newRecord));
11640
11636
  }
11641
11637
  }
@@ -12513,6 +12509,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12513
12509
  * @param {Boolean} value 是否选中
12514
12510
  */
12515
12511
  setCheckboxRow(rows, value) {
12512
+ if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
12513
+ rows = [rows];
12514
+ }
12516
12515
  return handleCheckedCheckboxRow(rows, value, true);
12517
12516
  },
12518
12517
  isCheckedByCheckboxRow(row) {
@@ -12549,6 +12548,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12549
12548
  tablePrivateMethods.handleSelectRow({
12550
12549
  row
12551
12550
  }, value, true);
12551
+ tablePrivateMethods.checkSelectionStatus();
12552
12552
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
12553
12553
  },
12554
12554
  /**
@@ -14891,6 +14891,72 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14891
14891
  }
14892
14892
  },
14893
14893
  /**
14894
+ * 多行
14895
+ * 多选,行选中事件
14896
+ * value 选中true 不选false 半选-1
14897
+ */
14898
+ handleBatchSelectRows(rows, value, isForce) {
14899
+ const {
14900
+ treeConfig
14901
+ } = props;
14902
+ const {
14903
+ selectCheckboxMaps
14904
+ } = reactData;
14905
+ const selectRowMaps = Object.assign({}, selectCheckboxMaps);
14906
+ const checkboxOpts = computeCheckboxOpts.value;
14907
+ const {
14908
+ checkField,
14909
+ checkStrictly,
14910
+ checkMethod
14911
+ } = checkboxOpts;
14912
+ if (checkField) {
14913
+ if (treeConfig && !checkStrictly) {
14914
+ rows.forEach(row => {
14915
+ tablePrivateMethods.handleSelectRow({
14916
+ row
14917
+ }, value, isForce);
14918
+ });
14919
+ } else {
14920
+ rows.forEach(row => {
14921
+ if (isForce || !checkMethod || checkMethod({
14922
+ row
14923
+ })) {
14924
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, value);
14925
+ handleCheckboxReserveRow(row, value);
14926
+ }
14927
+ });
14928
+ }
14929
+ } else {
14930
+ if (treeConfig && !checkStrictly) {
14931
+ rows.forEach(row => {
14932
+ tablePrivateMethods.handleSelectRow({
14933
+ row
14934
+ }, value, isForce);
14935
+ });
14936
+ } else {
14937
+ rows.forEach(row => {
14938
+ const rowid = getRowid($xeTable, row);
14939
+ if (isForce || !checkMethod || checkMethod({
14940
+ row
14941
+ })) {
14942
+ if (value) {
14943
+ if (!selectRowMaps[rowid]) {
14944
+ selectRowMaps[rowid] = row;
14945
+ }
14946
+ } else {
14947
+ if (selectRowMaps[rowid]) {
14948
+ delete selectRowMaps[rowid];
14949
+ }
14950
+ }
14951
+ handleCheckboxReserveRow(row, value);
14952
+ }
14953
+ });
14954
+ }
14955
+ }
14956
+ reactData.selectCheckboxMaps = selectRowMaps;
14957
+ },
14958
+ /**
14959
+ * 单行
14894
14960
  * 多选,行选中事件
14895
14961
  * value 选中true 不选false 半选-1
14896
14962
  */
@@ -14904,9 +14970,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14904
14970
  selectCheckboxMaps,
14905
14971
  treeIndeterminateMaps
14906
14972
  } = reactData;
14907
- const selectRowMaps = {
14908
- ...selectCheckboxMaps
14909
- };
14973
+ const selectRowMaps = Object.assign({}, selectCheckboxMaps);
14910
14974
  const {
14911
14975
  afterFullData
14912
14976
  } = internalData;
@@ -14985,9 +15049,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14985
15049
  parentStatus = selectItems.filter(item => vItemMaps[getRowid($xeTable, item)]).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
14986
15050
  }
14987
15051
  reactData.selectCheckboxMaps = selectRowMaps;
14988
- return tablePrivateMethods.handleSelectRow({
15052
+ tablePrivateMethods.handleSelectRow({
14989
15053
  row: matchObj.parent
14990
15054
  }, parentStatus, isForce);
15055
+ return;
14991
15056
  }
14992
15057
  } else {
14993
15058
  if (isForce || !checkMethod || checkMethod({
@@ -15072,9 +15137,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15072
15137
  parentStatus = selectItems.filter(item => vItemMaps[getRowid($xeTable, item)]).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
15073
15138
  }
15074
15139
  reactData.selectCheckboxMaps = selectRowMaps;
15075
- return tablePrivateMethods.handleSelectRow({
15140
+ tablePrivateMethods.handleSelectRow({
15076
15141
  row: matchObj.parent
15077
15142
  }, parentStatus, isForce);
15143
+ return;
15078
15144
  }
15079
15145
  } else {
15080
15146
  if (isForce || !checkMethod || checkMethod({
@@ -15094,7 +15160,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15094
15160
  }
15095
15161
  }
15096
15162
  reactData.selectCheckboxMaps = selectRowMaps;
15097
- tablePrivateMethods.checkSelectionStatus();
15098
15163
  },
15099
15164
  triggerHeaderTitleEvent(evnt, iconParams, params) {
15100
15165
  const tipContent = iconParams.content || iconParams.message;
@@ -15403,6 +15468,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15403
15468
  tablePrivateMethods.triggerCheckRowEvent(evnt, params, value);
15404
15469
  } else {
15405
15470
  tablePrivateMethods.handleSelectRow(params, value);
15471
+ tablePrivateMethods.checkSelectionStatus();
15406
15472
  }
15407
15473
  },
15408
15474
  triggerCheckRowEvent(evnt, params, value) {
@@ -15442,6 +15508,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15442
15508
  row
15443
15509
  })) {
15444
15510
  tablePrivateMethods.handleSelectRow(params, value);
15511
+ tablePrivateMethods.checkSelectionStatus();
15445
15512
  tableMethods.dispatchEvent('checkbox-change', Object.assign({
15446
15513
  records: tableMethods.getCheckboxRecords(),
15447
15514
  reserves: tableMethods.getCheckboxReserveRecords(),