vxe-table 4.11.0-beta.9 → 4.11.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.
@@ -1474,6 +1474,7 @@ export default defineComponent({
1474
1474
  };
1475
1475
  };
1476
1476
  const updateAfterListIndex = () => {
1477
+ const { treeConfig } = props;
1477
1478
  const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
1478
1479
  const fullMaps = {};
1479
1480
  afterFullData.forEach((row, index) => {
@@ -1481,7 +1482,9 @@ export default defineComponent({
1481
1482
  const rowRest = fullAllDataRowIdData[rowid];
1482
1483
  const seq = index + 1;
1483
1484
  if (rowRest) {
1484
- rowRest.seq = seq;
1485
+ if (!treeConfig) {
1486
+ rowRest.seq = seq;
1487
+ }
1485
1488
  rowRest._index = index;
1486
1489
  }
1487
1490
  else {
@@ -3344,6 +3347,14 @@ export default defineComponent({
3344
3347
  }
3345
3348
  }
3346
3349
  };
3350
+ const handleRowExpandScroll = () => {
3351
+ const { elemStore } = internalData;
3352
+ const rowExpandEl = refRowExpandElem.value;
3353
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3354
+ if (rowExpandEl && bodyScrollElem) {
3355
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop;
3356
+ }
3357
+ };
3347
3358
  tableMethods = {
3348
3359
  dispatchEvent,
3349
3360
  /**
@@ -5078,14 +5089,14 @@ export default defineComponent({
5078
5089
  * @param {Boolean} expanded 是否展开
5079
5090
  */
5080
5091
  setRowExpand(rows, expanded) {
5081
- const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn: column } = reactData;
5092
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn } = reactData;
5082
5093
  const { fullAllDataRowIdData } = internalData;
5083
5094
  let rExpandedMaps = Object.assign({}, rowExpandedMaps);
5084
5095
  const expandOpts = computeExpandOpts.value;
5085
5096
  const { reserve, lazy, accordion, toggleMethod } = expandOpts;
5086
5097
  const lazyRests = [];
5087
- const columnIndex = tableMethods.getColumnIndex(column);
5088
- const $columnIndex = tableMethods.getVMColumnIndex(column);
5098
+ const columnIndex = $xeTable.getColumnIndex(expandColumn);
5099
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn);
5089
5100
  if (rows) {
5090
5101
  if (!XEUtils.isArray(rows)) {
5091
5102
  rows = [rows];
@@ -5095,7 +5106,7 @@ export default defineComponent({
5095
5106
  rExpandedMaps = {};
5096
5107
  rows = rows.slice(rows.length - 1, rows.length);
5097
5108
  }
5098
- const validRows = toggleMethod ? rows.filter((row) => toggleMethod({ $table: $xeTable, expanded, column, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows;
5109
+ const validRows = toggleMethod ? rows.filter((row) => toggleMethod({ $table: $xeTable, expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows;
5099
5110
  if (expanded) {
5100
5111
  validRows.forEach((row) => {
5101
5112
  const rowid = getRowid($xeTable, row);
@@ -5126,7 +5137,13 @@ export default defineComponent({
5126
5137
  reactData.rowExpandedMaps = rExpandedMaps;
5127
5138
  return Promise.all(lazyRests)
5128
5139
  .then(() => $xeTable.recalculate())
5129
- .then(() => $xeTable.updateCellAreas());
5140
+ .then(() => {
5141
+ if (expandColumn) {
5142
+ updateRowExpandStyle();
5143
+ handleRowExpandScroll();
5144
+ }
5145
+ return $xeTable.updateCellAreas();
5146
+ });
5130
5147
  },
5131
5148
  /**
5132
5149
  * 判断行是否为展开状态
@@ -7208,7 +7225,7 @@ export default defineComponent({
7208
7225
  const isSelected = sLen >= vLen;
7209
7226
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
7210
7227
  if (checkField) {
7211
- XEUtils.get(row, checkField, isSelected);
7228
+ XEUtils.set(row, checkField, isSelected);
7212
7229
  }
7213
7230
  if (isSelected) {
7214
7231
  if (!checkField) {
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 = "4.11.0-beta.9";
3
+ export const version = "4.11.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${"4.11.0-beta.9"}`;
3
+ const version = `table v${"4.11.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
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.11.0-beta.9";
3141
+ const version = "4.11.0";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3586,7 +3586,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3586
3586
  const {
3587
3587
  log: log_log
3588
3588
  } = core_.VxeUI;
3589
- const log_version = `table v${"4.11.0-beta.9"}`;
3589
+ const log_version = `table v${"4.11.0"}`;
3590
3590
  const warnLog = log_log.create('warn', log_version);
3591
3591
  const errLog = log_log.create('error', log_version);
3592
3592
  ;// ./packages/table/src/columnInfo.ts
@@ -11975,6 +11975,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11975
11975
  };
11976
11976
  };
11977
11977
  const updateAfterListIndex = () => {
11978
+ const {
11979
+ treeConfig
11980
+ } = props;
11978
11981
  const {
11979
11982
  afterFullData,
11980
11983
  fullDataRowIdData,
@@ -11986,7 +11989,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11986
11989
  const rowRest = fullAllDataRowIdData[rowid];
11987
11990
  const seq = index + 1;
11988
11991
  if (rowRest) {
11989
- rowRest.seq = seq;
11992
+ if (!treeConfig) {
11993
+ rowRest.seq = seq;
11994
+ }
11990
11995
  rowRest._index = index;
11991
11996
  } else {
11992
11997
  const rest = {
@@ -14223,6 +14228,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14223
14228
  }
14224
14229
  }
14225
14230
  };
14231
+ const handleRowExpandScroll = () => {
14232
+ const {
14233
+ elemStore
14234
+ } = internalData;
14235
+ const rowExpandEl = refRowExpandElem.value;
14236
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
14237
+ if (rowExpandEl && bodyScrollElem) {
14238
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop;
14239
+ }
14240
+ };
14226
14241
  tableMethods = {
14227
14242
  dispatchEvent,
14228
14243
  /**
@@ -16210,7 +16225,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16210
16225
  const {
16211
16226
  rowExpandedMaps,
16212
16227
  rowExpandLazyLoadedMaps,
16213
- expandColumn: column
16228
+ expandColumn
16214
16229
  } = reactData;
16215
16230
  const {
16216
16231
  fullAllDataRowIdData
@@ -16226,8 +16241,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16226
16241
  toggleMethod
16227
16242
  } = expandOpts;
16228
16243
  const lazyRests = [];
16229
- const columnIndex = tableMethods.getColumnIndex(column);
16230
- const $columnIndex = tableMethods.getVMColumnIndex(column);
16244
+ const columnIndex = $xeTable.getColumnIndex(expandColumn);
16245
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn);
16231
16246
  if (rows) {
16232
16247
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
16233
16248
  rows = [rows];
@@ -16240,7 +16255,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16240
16255
  const validRows = toggleMethod ? rows.filter(row => toggleMethod({
16241
16256
  $table: $xeTable,
16242
16257
  expanded,
16243
- column,
16258
+ column: expandColumn,
16244
16259
  columnIndex,
16245
16260
  $columnIndex,
16246
16261
  row,
@@ -16273,7 +16288,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16273
16288
  }
16274
16289
  }
16275
16290
  reactData.rowExpandedMaps = rExpandedMaps;
16276
- return Promise.all(lazyRests).then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas());
16291
+ return Promise.all(lazyRests).then(() => $xeTable.recalculate()).then(() => {
16292
+ if (expandColumn) {
16293
+ updateRowExpandStyle();
16294
+ handleRowExpandScroll();
16295
+ }
16296
+ return $xeTable.updateCellAreas();
16297
+ });
16277
16298
  },
16278
16299
  /**
16279
16300
  * 判断行是否为展开状态
@@ -18623,7 +18644,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
18623
18644
  const isSelected = sLen >= vLen;
18624
18645
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
18625
18646
  if (checkField) {
18626
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField, isSelected);
18647
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, isSelected);
18627
18648
  }
18628
18649
  if (isSelected) {
18629
18650
  if (!checkField) {