vxe-table 3.19.9 → 3.19.11

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.
@@ -231,6 +231,7 @@ function getFooterContent(h, params) {
231
231
  itemValue = XEUtils.get(row, column.field);
232
232
  }
233
233
  const footParams = Object.assign(params, {
234
+ cellValue: itemValue,
234
235
  itemValue
235
236
  });
236
237
  if (footerFormatter) {
@@ -3254,9 +3254,9 @@ function loadTableData($xeTable, datas, isReset) {
3254
3254
  // if (!props.showOverflow) {
3255
3255
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
3256
3256
  // }
3257
- if (props.spanMethod) {
3258
- errLog('vxe.error.scrollErrProp', ['table.span-method']);
3259
- }
3257
+ // if (props.spanMethod) {
3258
+ // warnLog('vxe.error.scrollErrProp', ['span-method'])
3259
+ // }
3260
3260
  }
3261
3261
  handleReserveStatus($xeTable);
3262
3262
  $xeTable.checkSelectionStatus();
@@ -4387,7 +4387,7 @@ const Methods = {
4387
4387
  const internalData = $xeTable;
4388
4388
  const { treeConfig } = props;
4389
4389
  const { isRowGroupStatus } = reactData;
4390
- const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps } = internalData;
4390
+ const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps, rowExpandedMaps, selectCheckboxMaps } = internalData;
4391
4391
  const fullAllDataRowIdMaps = isReset ? {} : Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
4392
4392
  const fullDataRowIdMaps = {};
4393
4393
  const idMaps = {};
@@ -4408,6 +4408,13 @@ const Methods = {
4408
4408
  rowRest.level = level;
4409
4409
  rowRest.index = currIndex;
4410
4410
  rowRest.treeIndex = index;
4411
+ // 更新缓存
4412
+ if (selectCheckboxMaps[rowid]) {
4413
+ selectCheckboxMaps[rowid] = row;
4414
+ }
4415
+ if (rowExpandedMaps[rowid]) {
4416
+ rowExpandedMaps[rowid] = row;
4417
+ }
4411
4418
  idMaps[rowid] = true;
4412
4419
  fullDataRowIdMaps[rowid] = rowRest;
4413
4420
  fullAllDataRowIdMaps[rowid] = rowRest;
@@ -11327,22 +11334,27 @@ const Methods = {
11327
11334
  }
11328
11335
  else {
11329
11336
  const firstRow = afterFullData[startIndex];
11330
- let rowid = getRowid($xeTable, firstRow);
11331
- let rowRest = fullAllDataRowIdData[rowid] || {};
11332
- ySpaceTop = (rowRest.oTop || 0);
11333
- const lastRow = afterFullData[afterFullData.length - 1];
11334
- rowid = getRowid($xeTable, lastRow);
11335
- rowRest = fullAllDataRowIdData[rowid] || {};
11336
- // 如果为空时还没计算完数据,保持原高度不变
11337
- if (rowRest.oTop) {
11338
- sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11339
- // 是否展开行
11340
- if (expandColumn && rowExpandedMaps[rowid]) {
11341
- sYHeight += rowRest.expandHeight || expandOpts.height || 0;
11337
+ if (firstRow) {
11338
+ let rowid = getRowid($xeTable, firstRow);
11339
+ let rowRest = fullAllDataRowIdData[rowid] || {};
11340
+ ySpaceTop = (rowRest.oTop || 0);
11341
+ const lastRow = afterFullData[afterFullData.length - 1];
11342
+ rowid = getRowid($xeTable, lastRow);
11343
+ rowRest = fullAllDataRowIdData[rowid] || {};
11344
+ // 如果为空时还没计算完数据,保持原高度不变
11345
+ if (rowRest.oTop) {
11346
+ sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11347
+ // 是否展开行
11348
+ if (expandColumn && rowExpandedMaps[rowid]) {
11349
+ sYHeight += rowRest.expandHeight || expandOpts.height || 0;
11350
+ }
11351
+ }
11352
+ if (sYHeight > maxYHeight) {
11353
+ isScrollYBig = true;
11342
11354
  }
11343
11355
  }
11344
- if (sYHeight > maxYHeight) {
11345
- isScrollYBig = true;
11356
+ else {
11357
+ sYHeight = bodyTableElem ? bodyTableElem.clientHeight : 0;
11346
11358
  }
11347
11359
  }
11348
11360
  }
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.19.9";
3
+ export const version = "3.19.11";
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.19.9"}`;
3
+ const version = `table v${"3.19.11"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2005,7 +2005,7 @@ function getClass(property, params) {
2005
2005
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2006
2006
 
2007
2007
 
2008
- const version = "3.19.9";
2008
+ const version = "3.19.11";
2009
2009
  core_.VxeUI.version = version;
2010
2010
  core_.VxeUI.tableVersion = version;
2011
2011
  core_.VxeUI.setConfig({
@@ -2713,7 +2713,7 @@ function isNodeElement(elem) {
2713
2713
  const {
2714
2714
  log: log_log
2715
2715
  } = core_.VxeUI;
2716
- const log_version = `table v${"3.19.9"}`;
2716
+ const log_version = `table v${"3.19.11"}`;
2717
2717
  const warnLog = log_log.create('warn', log_version);
2718
2718
  const errLog = log_log.create('error', log_version);
2719
2719
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -4005,6 +4005,7 @@ function getFooterContent(h, params) {
4005
4005
  itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
4006
4006
  }
4007
4007
  const footParams = Object.assign(params, {
4008
+ cellValue: itemValue,
4008
4009
  itemValue
4009
4010
  });
4010
4011
  if (footerFormatter) {
@@ -9761,9 +9762,9 @@ function loadTableData($xeTable, datas, isReset) {
9761
9762
  // if (!props.showOverflow) {
9762
9763
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
9763
9764
  // }
9764
- if (props.spanMethod) {
9765
- errLog('vxe.error.scrollErrProp', ['table.span-method']);
9766
- }
9765
+ // if (props.spanMethod) {
9766
+ // warnLog('vxe.error.scrollErrProp', ['span-method'])
9767
+ // }
9767
9768
  }
9768
9769
  handleReserveStatus($xeTable);
9769
9770
  $xeTable.checkSelectionStatus();
@@ -11047,7 +11048,9 @@ const Methods = {
11047
11048
  tableFullData,
11048
11049
  tableFullTreeData,
11049
11050
  tableFullGroupData,
11050
- treeExpandedMaps
11051
+ treeExpandedMaps,
11052
+ rowExpandedMaps,
11053
+ selectCheckboxMaps
11051
11054
  } = internalData;
11052
11055
  const fullAllDataRowIdMaps = isReset ? {} : {
11053
11056
  ...fullAllDataRowIdData
@@ -11089,6 +11092,13 @@ const Methods = {
11089
11092
  rowRest.level = level;
11090
11093
  rowRest.index = currIndex;
11091
11094
  rowRest.treeIndex = index;
11095
+ // 更新缓存
11096
+ if (selectCheckboxMaps[rowid]) {
11097
+ selectCheckboxMaps[rowid] = row;
11098
+ }
11099
+ if (rowExpandedMaps[rowid]) {
11100
+ rowExpandedMaps[rowid] = row;
11101
+ }
11092
11102
  idMaps[rowid] = true;
11093
11103
  fullDataRowIdMaps[rowid] = rowRest;
11094
11104
  fullAllDataRowIdMaps[rowid] = rowRest;
@@ -19122,22 +19132,26 @@ const Methods = {
19122
19132
  ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
19123
19133
  } else {
19124
19134
  const firstRow = afterFullData[startIndex];
19125
- let rowid = getRowid($xeTable, firstRow);
19126
- let rowRest = fullAllDataRowIdData[rowid] || {};
19127
- ySpaceTop = rowRest.oTop || 0;
19128
- const lastRow = afterFullData[afterFullData.length - 1];
19129
- rowid = getRowid($xeTable, lastRow);
19130
- rowRest = fullAllDataRowIdData[rowid] || {};
19131
- // 如果为空时还没计算完数据,保持原高度不变
19132
- if (rowRest.oTop) {
19133
- sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
19134
- // 是否展开行
19135
- if (expandColumn && rowExpandedMaps[rowid]) {
19136
- sYHeight += rowRest.expandHeight || expandOpts.height || 0;
19135
+ if (firstRow) {
19136
+ let rowid = getRowid($xeTable, firstRow);
19137
+ let rowRest = fullAllDataRowIdData[rowid] || {};
19138
+ ySpaceTop = rowRest.oTop || 0;
19139
+ const lastRow = afterFullData[afterFullData.length - 1];
19140
+ rowid = getRowid($xeTable, lastRow);
19141
+ rowRest = fullAllDataRowIdData[rowid] || {};
19142
+ // 如果为空时还没计算完数据,保持原高度不变
19143
+ if (rowRest.oTop) {
19144
+ sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
19145
+ // 是否展开行
19146
+ if (expandColumn && rowExpandedMaps[rowid]) {
19147
+ sYHeight += rowRest.expandHeight || expandOpts.height || 0;
19148
+ }
19137
19149
  }
19138
- }
19139
- if (sYHeight > maxYHeight) {
19140
- isScrollYBig = true;
19150
+ if (sYHeight > maxYHeight) {
19151
+ isScrollYBig = true;
19152
+ }
19153
+ } else {
19154
+ sYHeight = bodyTableElem ? bodyTableElem.clientHeight : 0;
19141
19155
  }
19142
19156
  }
19143
19157
  } else {
@@ -27588,8 +27602,7 @@ function handleImport($xeTable, content, opts) {
27588
27602
  let loadRest;
27589
27603
  if (opts.mode === 'insert' || opts.mode === 'insertBottom') {
27590
27604
  loadRest = $xeTable.insertAt(data, -1);
27591
- }
27592
- if (opts.mode === 'insertTop') {
27605
+ } else if (opts.mode === 'insertTop') {
27593
27606
  loadRest = $xeTable.insert(data);
27594
27607
  } else {
27595
27608
  loadRest = $xeTable.reloadData(data);