vxe-table 3.9.9 → 3.9.10

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/lib/index.umd.js CHANGED
@@ -2220,9 +2220,9 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.9.9";
2223
+ const version = "3.9.10";
2224
2224
  core_.VxeUI.version = version;
2225
- core_.VxeUI.tableVersion = "3.9.9";
2225
+ core_.VxeUI.tableVersion = "3.9.10";
2226
2226
  core_.VxeUI.setConfig({
2227
2227
  emptyCell: ' ',
2228
2228
  table: {
@@ -2764,7 +2764,7 @@ function isNodeElement(elem) {
2764
2764
  const {
2765
2765
  log: log_log
2766
2766
  } = core_.VxeUI;
2767
- const log_version = `table v${"3.9.9"}`;
2767
+ const log_version = `table v${"3.9.10"}`;
2768
2768
  const warnLog = log_log.create('warn', log_version);
2769
2769
  const errLog = log_log.create('error', log_version);
2770
2770
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5058,7 +5058,6 @@ const Methods = {
5058
5058
  } = this;
5059
5059
  return this.handleTableData(true).then(() => {
5060
5060
  this.updateFooter();
5061
- this.checkSelectionStatus();
5062
5061
  if (scrollXLoad || scrollYLoad) {
5063
5062
  if (scrollXLoad) {
5064
5063
  this.updateScrollXSpace();
@@ -8643,9 +8642,8 @@ const Methods = {
8643
8642
  if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
8644
8643
  rows = [rows];
8645
8644
  }
8646
- rows.forEach(row => this.handleSelectRow({
8647
- row
8648
- }, !!value, isForce));
8645
+ this.handleBatchSelectRows(rows, !!value, isForce);
8646
+ this.checkSelectionStatus();
8649
8647
  return this.$nextTick();
8650
8648
  },
8651
8649
  /**
@@ -8654,6 +8652,9 @@ const Methods = {
8654
8652
  * @param {Boolean} value 是否选中
8655
8653
  */
8656
8654
  setCheckboxRow(rows, value) {
8655
+ if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
8656
+ rows = [rows];
8657
+ }
8657
8658
  return this.handleCheckedCheckboxRow(rows, value, true);
8658
8659
  },
8659
8660
  isCheckedByCheckboxRow(row) {
@@ -8674,6 +8675,72 @@ const Methods = {
8674
8675
  } = this;
8675
8676
  return !!treeIndeterminateMaps[getRowid(this, row)] && !this.isCheckedByCheckboxRow(row);
8676
8677
  },
8678
+ /**
8679
+ * 多行
8680
+ * 多选,行选中事件
8681
+ * value 选中true 不选false 半选-1
8682
+ */
8683
+ handleBatchSelectRows(rows, value, isForce) {
8684
+ const $xeTable = this;
8685
+ const {
8686
+ treeConfig
8687
+ } = $xeTable;
8688
+ const {
8689
+ selectCheckboxMaps,
8690
+ checkboxOpts
8691
+ } = this;
8692
+ const {
8693
+ checkField,
8694
+ checkStrictly,
8695
+ checkMethod
8696
+ } = checkboxOpts;
8697
+ if (checkField) {
8698
+ if (treeConfig && !checkStrictly) {
8699
+ rows.forEach(row => {
8700
+ this.handleSelectRow({
8701
+ row
8702
+ }, value, isForce);
8703
+ });
8704
+ } else {
8705
+ rows.forEach(row => {
8706
+ if (isForce || !checkMethod || checkMethod({
8707
+ row
8708
+ })) {
8709
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, value);
8710
+ this.handleCheckboxReserveRow(row, value);
8711
+ }
8712
+ });
8713
+ }
8714
+ } else {
8715
+ if (treeConfig && !checkStrictly) {
8716
+ rows.forEach(row => {
8717
+ this.handleSelectRow({
8718
+ row
8719
+ }, value, isForce);
8720
+ });
8721
+ } else {
8722
+ const selectRowMaps = Object.assign({}, selectCheckboxMaps);
8723
+ rows.forEach(row => {
8724
+ const rowid = getRowid($xeTable, row);
8725
+ if (isForce || !checkMethod || checkMethod({
8726
+ row
8727
+ })) {
8728
+ if (value) {
8729
+ if (!selectRowMaps[rowid]) {
8730
+ selectRowMaps[rowid] = row;
8731
+ }
8732
+ } else {
8733
+ if (selectRowMaps[rowid]) {
8734
+ delete selectRowMaps[rowid];
8735
+ }
8736
+ }
8737
+ this.handleCheckboxReserveRow(row, value);
8738
+ }
8739
+ });
8740
+ this.selectCheckboxMaps = selectRowMaps;
8741
+ }
8742
+ }
8743
+ },
8677
8744
  /**
8678
8745
  * 多选,行选中事件
8679
8746
  * value 选中true 不选false 半选-1
@@ -8874,7 +8941,6 @@ const Methods = {
8874
8941
  }
8875
8942
  }
8876
8943
  this.selectCheckboxMaps = selectRowMaps;
8877
- this.checkSelectionStatus();
8878
8944
  },
8879
8945
  handleToggleCheckRowEvent(evnt, params) {
8880
8946
  const {
@@ -8901,6 +8967,7 @@ const Methods = {
8901
8967
  this.triggerCheckRowEvent(evnt, params, value);
8902
8968
  } else {
8903
8969
  this.handleSelectRow(params, value);
8970
+ this.checkSelectionStatus();
8904
8971
  }
8905
8972
  },
8906
8973
  triggerCheckRowEvent(evnt, params, value) {
@@ -8940,6 +9007,7 @@ const Methods = {
8940
9007
  row
8941
9008
  })) {
8942
9009
  this.handleSelectRow(params, value);
9010
+ this.checkSelectionStatus();
8943
9011
  this.emitEvent('checkbox-change', Object.assign({
8944
9012
  records: this.getCheckboxRecords(),
8945
9013
  reserves: this.getCheckboxReserveRecords(),
@@ -8963,6 +9031,7 @@ const Methods = {
8963
9031
  this.handleSelectRow({
8964
9032
  row
8965
9033
  }, value, true);
9034
+ this.checkSelectionStatus();
8966
9035
  return this.$nextTick();
8967
9036
  },
8968
9037
  handleCheckedAllCheckboxRow(value, isForce) {