vxe-table 3.13.0-beta.9 → 3.13.0

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.
@@ -295,7 +295,9 @@ const updateScrollYStatus = ($xeTable, fullData) => {
295
295
  return scrollYLoad;
296
296
  };
297
297
  function updateAfterListIndex($xeTable) {
298
+ const props = $xeTable;
298
299
  const internalData = $xeTable;
300
+ const { treeConfig } = props;
299
301
  const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
300
302
  const fullMaps = {};
301
303
  afterFullData.forEach((row, index) => {
@@ -303,7 +305,9 @@ function updateAfterListIndex($xeTable) {
303
305
  const rowRest = fullAllDataRowIdData[rowid];
304
306
  const seq = index + 1;
305
307
  if (rowRest) {
306
- rowRest.seq = seq;
308
+ if (!treeConfig) {
309
+ rowRest.seq = seq;
310
+ }
307
311
  rowRest._index = index;
308
312
  }
309
313
  else {
@@ -1928,6 +1932,15 @@ function updateRowExpandStyle($xeTable) {
1928
1932
  }
1929
1933
  }
1930
1934
  }
1935
+ function handleRowExpandScroll($xeTable) {
1936
+ const internalData = $xeTable;
1937
+ const { elemStore } = internalData;
1938
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
1939
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
1940
+ if (rowExpandEl && bodyScrollElem) {
1941
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop;
1942
+ }
1943
+ }
1931
1944
  const Methods = {
1932
1945
  callSlot(slotFunc, params, h, vNodes) {
1933
1946
  if (slotFunc) {
@@ -5439,7 +5452,7 @@ const Methods = {
5439
5452
  const isSelected = sLen >= vLen;
5440
5453
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
5441
5454
  if (checkField) {
5442
- XEUtils.get(row, checkField, isSelected);
5455
+ XEUtils.set(row, checkField, isSelected);
5443
5456
  }
5444
5457
  if (isSelected) {
5445
5458
  if (!checkField) {
@@ -7293,12 +7306,12 @@ const Methods = {
7293
7306
  */
7294
7307
  setRowExpand(rows, expanded) {
7295
7308
  const $xeTable = this;
7296
- const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn: column } = this;
7309
+ const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn } = this;
7297
7310
  let rExpandedMaps = Object.assign({}, rowExpandedMaps);
7298
7311
  const { reserve, lazy, accordion, toggleMethod } = expandOpts;
7299
7312
  const lazyRests = [];
7300
- const columnIndex = this.getColumnIndex(column);
7301
- const $columnIndex = this.getVMColumnIndex(column);
7313
+ const columnIndex = $xeTable.getColumnIndex(expandColumn);
7314
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn);
7302
7315
  if (rows) {
7303
7316
  if (!XEUtils.isArray(rows)) {
7304
7317
  rows = [rows];
@@ -7308,7 +7321,7 @@ const Methods = {
7308
7321
  rExpandedMaps = {};
7309
7322
  rows = rows.slice(rows.length - 1, rows.length);
7310
7323
  }
7311
- const validRows = toggleMethod ? rows.filter((row) => toggleMethod({ expanded, column, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows;
7324
+ const validRows = toggleMethod ? rows.filter((row) => toggleMethod({ expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows;
7312
7325
  if (expanded) {
7313
7326
  validRows.forEach((row) => {
7314
7327
  const rowid = getRowid(this, row);
@@ -7339,7 +7352,13 @@ const Methods = {
7339
7352
  this.rowExpandedMaps = rExpandedMaps;
7340
7353
  return Promise.all(lazyRests)
7341
7354
  .then(() => $xeTable.recalculate())
7342
- .then(() => $xeTable.updateCellAreas());
7355
+ .then(() => {
7356
+ if (expandColumn) {
7357
+ updateRowExpandStyle($xeTable);
7358
+ handleRowExpandScroll($xeTable);
7359
+ }
7360
+ return $xeTable.updateCellAreas();
7361
+ });
7343
7362
  },
7344
7363
  /**
7345
7364
  * 判断行是否为展开状态
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.0-beta.9";
3
+ export const version = "3.13.0";
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.0-beta.9"}`;
3
+ const version = `table v${"3.13.0"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.13.0-beta.9";
2223
+ const version = "3.13.0";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
2843
2843
  const {
2844
2844
  log: log_log
2845
2845
  } = core_.VxeUI;
2846
- const log_version = `table v${"3.13.0-beta.9"}`;
2846
+ const log_version = `table v${"3.13.0"}`;
2847
2847
  const warnLog = log_log.create('warn', log_version);
2848
2848
  const errLog = log_log.create('error', log_version);
2849
2849
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5425,7 +5425,11 @@ const updateScrollYStatus = ($xeTable, fullData) => {
5425
5425
  return scrollYLoad;
5426
5426
  };
5427
5427
  function updateAfterListIndex($xeTable) {
5428
+ const props = $xeTable;
5428
5429
  const internalData = $xeTable;
5430
+ const {
5431
+ treeConfig
5432
+ } = props;
5429
5433
  const {
5430
5434
  afterFullData,
5431
5435
  fullDataRowIdData,
@@ -5437,7 +5441,9 @@ function updateAfterListIndex($xeTable) {
5437
5441
  const rowRest = fullAllDataRowIdData[rowid];
5438
5442
  const seq = index + 1;
5439
5443
  if (rowRest) {
5440
- rowRest.seq = seq;
5444
+ if (!treeConfig) {
5445
+ rowRest.seq = seq;
5446
+ }
5441
5447
  rowRest._index = index;
5442
5448
  } else {
5443
5449
  const rest = {
@@ -7304,6 +7310,17 @@ function updateRowExpandStyle($xeTable) {
7304
7310
  }
7305
7311
  }
7306
7312
  }
7313
+ function handleRowExpandScroll($xeTable) {
7314
+ const internalData = $xeTable;
7315
+ const {
7316
+ elemStore
7317
+ } = internalData;
7318
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
7319
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
7320
+ if (rowExpandEl && bodyScrollElem) {
7321
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop;
7322
+ }
7323
+ }
7307
7324
  const Methods = {
7308
7325
  callSlot(slotFunc, params, h, vNodes) {
7309
7326
  if (slotFunc) {
@@ -11393,7 +11410,7 @@ const Methods = {
11393
11410
  const isSelected = sLen >= vLen;
11394
11411
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
11395
11412
  if (checkField) {
11396
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField, isSelected);
11413
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, isSelected);
11397
11414
  }
11398
11415
  if (isSelected) {
11399
11416
  if (!checkField) {
@@ -13637,7 +13654,7 @@ const Methods = {
13637
13654
  fullAllDataRowIdData,
13638
13655
  rowExpandLazyLoadedMaps,
13639
13656
  expandOpts,
13640
- expandColumn: column
13657
+ expandColumn
13641
13658
  } = this;
13642
13659
  let rExpandedMaps = {
13643
13660
  ...rowExpandedMaps
@@ -13649,8 +13666,8 @@ const Methods = {
13649
13666
  toggleMethod
13650
13667
  } = expandOpts;
13651
13668
  const lazyRests = [];
13652
- const columnIndex = this.getColumnIndex(column);
13653
- const $columnIndex = this.getVMColumnIndex(column);
13669
+ const columnIndex = $xeTable.getColumnIndex(expandColumn);
13670
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn);
13654
13671
  if (rows) {
13655
13672
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
13656
13673
  rows = [rows];
@@ -13662,7 +13679,7 @@ const Methods = {
13662
13679
  }
13663
13680
  const validRows = toggleMethod ? rows.filter(row => toggleMethod({
13664
13681
  expanded,
13665
- column,
13682
+ column: expandColumn,
13666
13683
  columnIndex,
13667
13684
  $columnIndex,
13668
13685
  row,
@@ -13695,7 +13712,13 @@ const Methods = {
13695
13712
  }
13696
13713
  }
13697
13714
  this.rowExpandedMaps = rExpandedMaps;
13698
- return Promise.all(lazyRests).then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas());
13715
+ return Promise.all(lazyRests).then(() => $xeTable.recalculate()).then(() => {
13716
+ if (expandColumn) {
13717
+ updateRowExpandStyle($xeTable);
13718
+ handleRowExpandScroll($xeTable);
13719
+ }
13720
+ return $xeTable.updateCellAreas();
13721
+ });
13699
13722
  },
13700
13723
  /**
13701
13724
  * 判断行是否为展开状态