vxe-table 4.20.3 → 4.20.4

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/dist/all.esm.js CHANGED
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
44
44
  return cellValue === '' || XEUtils.eqNull(cellValue);
45
45
  }
46
46
 
47
- const version = "4.20.3";
47
+ const version = "4.20.4";
48
48
  VxeUI.version = version;
49
49
  VxeUI.tableVersion = version;
50
50
  VxeUI.setConfig({
@@ -756,7 +756,7 @@ function wheelScrollTopTo(diffNum, cb) {
756
756
  }
757
757
 
758
758
  const { log } = VxeUI;
759
- const tableVersion = `table v${"4.20.3"}`;
759
+ const tableVersion = `table v${"4.20.4"}`;
760
760
  function createComponentLog(name) {
761
761
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
762
762
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -18055,7 +18055,8 @@ var VxeTableComponent = defineVxeComponent({
18055
18055
  }
18056
18056
  else if (checkRowKeys) {
18057
18057
  const defSelection = [];
18058
- checkRowKeys.forEach((rowid) => {
18058
+ checkRowKeys.forEach((rowKey) => {
18059
+ const rowid = encodeRowid(rowKey);
18059
18060
  if (fullDataRowIdData[rowid]) {
18060
18061
  defSelection.push(fullDataRowIdData[rowid].row);
18061
18062
  }
@@ -18072,7 +18073,8 @@ var VxeTableComponent = defineVxeComponent({
18072
18073
  if (radioConfig) {
18073
18074
  const { fullDataRowIdData } = internalData;
18074
18075
  const radioOpts = computeRadioOpts.value;
18075
- const { checkRowKey: rowid, reserve } = radioOpts;
18076
+ const { checkRowKey: rowKey, reserve } = radioOpts;
18077
+ const rowid = rowKey ? encodeRowid(rowKey) : null;
18076
18078
  if (rowid) {
18077
18079
  if (fullDataRowIdData[rowid]) {
18078
18080
  handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
@@ -18098,7 +18100,8 @@ var VxeTableComponent = defineVxeComponent({
18098
18100
  }
18099
18101
  else if (expandRowKeys) {
18100
18102
  const defExpandeds = [];
18101
- expandRowKeys.forEach((rowid) => {
18103
+ expandRowKeys.forEach((rowKey) => {
18104
+ const rowid = encodeRowid(rowKey);
18102
18105
  if (fullDataRowIdData[rowid]) {
18103
18106
  defExpandeds.push(fullDataRowIdData[rowid].row);
18104
18107
  }
@@ -18357,7 +18360,8 @@ var VxeTableComponent = defineVxeComponent({
18357
18360
  }
18358
18361
  else if (expandRowKeys) {
18359
18362
  const defExpandeds = [];
18360
- expandRowKeys.forEach((rowid) => {
18363
+ expandRowKeys.forEach((rowKey) => {
18364
+ const rowid = encodeRowid(rowKey);
18361
18365
  const rowRest = fullAllDataRowIdData[rowid];
18362
18366
  if (rowRest) {
18363
18367
  defExpandeds.push(rowRest.row);
@@ -21676,13 +21680,14 @@ var VxeTableComponent = defineVxeComponent({
21676
21680
  }
21677
21681
  return handleCheckedCheckboxRow(rows, checked, true);
21678
21682
  },
21679
- setCheckboxRowKey(keys, checked) {
21683
+ setCheckboxRowByKey(keys, checked) {
21680
21684
  const { fullAllDataRowIdData } = internalData;
21681
21685
  if (!XEUtils.isArray(keys)) {
21682
21686
  keys = [keys];
21683
21687
  }
21684
21688
  const rows = [];
21685
- keys.forEach((rowid) => {
21689
+ keys.forEach((rowKey) => {
21690
+ const rowid = encodeRowid(rowKey);
21686
21691
  const rowRest = fullAllDataRowIdData[rowid];
21687
21692
  if (rowRest) {
21688
21693
  rows.push(rowRest.row);
@@ -21690,6 +21695,9 @@ var VxeTableComponent = defineVxeComponent({
21690
21695
  });
21691
21696
  return handleCheckedCheckboxRow(rows, checked, true);
21692
21697
  },
21698
+ setCheckboxRowKey(keys, checked) {
21699
+ return $xeTable.setCheckboxRowByKey(keys, checked);
21700
+ },
21693
21701
  isCheckedByCheckboxRow(row) {
21694
21702
  const { updateCheckboxFlag } = reactData;
21695
21703
  const { selectCheckboxMaps } = internalData;
@@ -21700,11 +21708,12 @@ var VxeTableComponent = defineVxeComponent({
21700
21708
  }
21701
21709
  return !!updateCheckboxFlag && !!selectCheckboxMaps[getRowid($xeTable, row)];
21702
21710
  },
21703
- isCheckedByCheckboxRowKey(rowid) {
21711
+ isCheckedByCheckboxRowKey(rowKey) {
21704
21712
  const { updateCheckboxFlag } = reactData;
21705
21713
  const { fullAllDataRowIdData, selectCheckboxMaps } = internalData;
21706
21714
  const checkboxOpts = computeCheckboxOpts.value;
21707
21715
  const { checkField } = checkboxOpts;
21716
+ const rowid = encodeRowid(rowKey);
21708
21717
  if (checkField) {
21709
21718
  const rowRest = fullAllDataRowIdData[rowid];
21710
21719
  if (rowRest) {
@@ -21718,8 +21727,9 @@ var VxeTableComponent = defineVxeComponent({
21718
21727
  const { treeIndeterminateRowMaps } = internalData;
21719
21728
  return !!treeIndeterminateRowMaps[getRowid($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
21720
21729
  },
21721
- isIndeterminateByCheckboxRowKey(rowid) {
21730
+ isIndeterminateByCheckboxRowKey(rowKey) {
21722
21731
  const { treeIndeterminateRowMaps } = internalData;
21732
+ const rowid = encodeRowid(rowKey);
21723
21733
  return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
21724
21734
  },
21725
21735
  /**
@@ -21912,14 +21922,18 @@ var VxeTableComponent = defineVxeComponent({
21912
21922
  * 用于单选行,设置某一行为选中状态
21913
21923
  * @param key 行主键
21914
21924
  */
21915
- setRadioRowKey(rowid) {
21925
+ setRadioByRowKey(rowKey) {
21916
21926
  const { fullAllDataRowIdData } = internalData;
21927
+ const rowid = encodeRowid(rowKey);
21917
21928
  const rowRest = fullAllDataRowIdData[rowid];
21918
21929
  if (rowRest) {
21919
21930
  return handleCheckedRadioRow(rowRest.row, true);
21920
21931
  }
21921
21932
  return nextTick();
21922
21933
  },
21934
+ setRadioRowKey(rowKey) {
21935
+ return $xeTable.setRadioByRowKey(rowKey);
21936
+ },
21923
21937
  /**
21924
21938
  * 用于当前行,手动清空当前高亮的状态
21925
21939
  */