vxe-table 3.19.7 → 3.19.8

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.
@@ -2402,20 +2402,30 @@ function autoCellWidth($xeTable) {
2402
2402
  /**
2403
2403
  * 计算自适应行高
2404
2404
  */
2405
- const calcCellAutoHeight = (rowRest, wrapperEl) => {
2406
- const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2405
+ const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
2406
+ const reactData = $xeTable;
2407
+ const { scrollXLoad } = reactData;
2408
+ const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2407
2409
  let colHeight = rowRest.height;
2408
2410
  let firstCellStyle = null;
2409
2411
  let topBottomPadding = 0;
2410
- for (let i = 0; i < cellElemList.length; i++) {
2411
- const wrapperElem = cellElemList[i];
2412
+ for (let i = 0; i < wrapperElemList.length; i++) {
2413
+ const wrapperElem = wrapperElemList[i];
2412
2414
  const cellElem = wrapperElem.parentElement;
2413
2415
  if (!firstCellStyle) {
2416
+ const cellStyle = cellElem.style;
2417
+ const orHeight = cellStyle.height;
2418
+ if (!scrollXLoad) {
2419
+ cellStyle.height = '';
2420
+ }
2414
2421
  firstCellStyle = getComputedStyle(cellElem);
2415
2422
  topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
2423
+ if (!scrollXLoad) {
2424
+ cellStyle.height = orHeight;
2425
+ }
2416
2426
  }
2417
2427
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2418
- colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2428
+ colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
2419
2429
  }
2420
2430
  return colHeight;
2421
2431
  };
@@ -2434,13 +2444,15 @@ const calcCellHeight = ($xeTable) => {
2434
2444
  const el = $xeTable.$refs.refElem;
2435
2445
  if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
2436
2446
  const { handleGetRowId } = createHandleGetRowId($xeTable);
2447
+ el.setAttribute('data-calc-row', 'Y');
2437
2448
  tableData.forEach(row => {
2438
2449
  const rowid = handleGetRowId(row);
2439
2450
  const rowRest = fullAllDataRowIdData[rowid];
2440
2451
  if (rowRest) {
2441
- const height = calcCellAutoHeight(rowRest, el);
2452
+ const height = calcCellAutoHeight($xeTable, rowRest, el);
2442
2453
  rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
2443
2454
  }
2455
+ el.removeAttribute('data-calc-row');
2444
2456
  });
2445
2457
  reactData.calcCellHeightFlag++;
2446
2458
  }
@@ -6106,7 +6118,9 @@ const Methods = {
6106
6118
  return;
6107
6119
  }
6108
6120
  const handleRsHeight = () => {
6109
- const resizeHeight = calcCellAutoHeight(rowRest, el);
6121
+ el.setAttribute('data-calc-row', 'Y');
6122
+ const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
6123
+ el.removeAttribute('data-calc-row');
6110
6124
  const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
6111
6125
  reactData.isDragResize = false;
6112
6126
  internalData._lastResizeTime = Date.now();
@@ -6191,7 +6205,7 @@ const Methods = {
6191
6205
  const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
6192
6206
  const rowRest = fullAllDataRowIdData[rowid];
6193
6207
  if (rowRest) {
6194
- rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
6208
+ rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
6195
6209
  }
6196
6210
  el.removeAttribute('data-calc-row');
6197
6211
  });
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.7";
3
+ export const version = "3.19.8";
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.7"}`;
3
+ const version = `table v${"3.19.8"}`;
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.7";
2008
+ const version = "3.19.8";
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.7"}`;
2716
+ const log_version = `table v${"3.19.8"}`;
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
@@ -8800,20 +8800,32 @@ function autoCellWidth($xeTable) {
8800
8800
  /**
8801
8801
  * 计算自适应行高
8802
8802
  */
8803
- const calcCellAutoHeight = (rowRest, wrapperEl) => {
8804
- const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
8803
+ const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
8804
+ const reactData = $xeTable;
8805
+ const {
8806
+ scrollXLoad
8807
+ } = reactData;
8808
+ const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
8805
8809
  let colHeight = rowRest.height;
8806
8810
  let firstCellStyle = null;
8807
8811
  let topBottomPadding = 0;
8808
- for (let i = 0; i < cellElemList.length; i++) {
8809
- const wrapperElem = cellElemList[i];
8812
+ for (let i = 0; i < wrapperElemList.length; i++) {
8813
+ const wrapperElem = wrapperElemList[i];
8810
8814
  const cellElem = wrapperElem.parentElement;
8811
8815
  if (!firstCellStyle) {
8816
+ const cellStyle = cellElem.style;
8817
+ const orHeight = cellStyle.height;
8818
+ if (!scrollXLoad) {
8819
+ cellStyle.height = '';
8820
+ }
8812
8821
  firstCellStyle = getComputedStyle(cellElem);
8813
8822
  topBottomPadding = firstCellStyle ? Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)) : 0;
8823
+ if (!scrollXLoad) {
8824
+ cellStyle.height = orHeight;
8825
+ }
8814
8826
  }
8815
8827
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
8816
- colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
8828
+ colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
8817
8829
  }
8818
8830
  return colHeight;
8819
8831
  };
@@ -8843,13 +8855,15 @@ const calcCellHeight = $xeTable => {
8843
8855
  const {
8844
8856
  handleGetRowId
8845
8857
  } = createHandleGetRowId($xeTable);
8858
+ el.setAttribute('data-calc-row', 'Y');
8846
8859
  tableData.forEach(row => {
8847
8860
  const rowid = handleGetRowId(row);
8848
8861
  const rowRest = fullAllDataRowIdData[rowid];
8849
8862
  if (rowRest) {
8850
- const height = calcCellAutoHeight(rowRest, el);
8863
+ const height = calcCellAutoHeight($xeTable, rowRest, el);
8851
8864
  rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
8852
8865
  }
8866
+ el.removeAttribute('data-calc-row');
8853
8867
  });
8854
8868
  reactData.calcCellHeightFlag++;
8855
8869
  }
@@ -13039,7 +13053,9 @@ const Methods = {
13039
13053
  return;
13040
13054
  }
13041
13055
  const handleRsHeight = () => {
13042
- const resizeHeight = calcCellAutoHeight(rowRest, el);
13056
+ el.setAttribute('data-calc-row', 'Y');
13057
+ const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
13058
+ el.removeAttribute('data-calc-row');
13043
13059
  const resizeParams = {
13044
13060
  ...params,
13045
13061
  resizeHeight,
@@ -13139,7 +13155,7 @@ const Methods = {
13139
13155
  const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : handleGetRowId(row);
13140
13156
  const rowRest = fullAllDataRowIdData[rowid];
13141
13157
  if (rowRest) {
13142
- rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
13158
+ rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
13143
13159
  }
13144
13160
  el.removeAttribute('data-calc-row');
13145
13161
  });