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.
@@ -2921,20 +2921,32 @@ function autoCellWidth($xeTable) {
2921
2921
  /**
2922
2922
  * 计算自适应行高
2923
2923
  */
2924
- const calcCellAutoHeight = (rowRest, wrapperEl) => {
2925
- const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2924
+ const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
2925
+ const reactData = $xeTable;
2926
+ const {
2927
+ scrollXLoad
2928
+ } = reactData;
2929
+ const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2926
2930
  let colHeight = rowRest.height;
2927
2931
  let firstCellStyle = null;
2928
2932
  let topBottomPadding = 0;
2929
- for (let i = 0; i < cellElemList.length; i++) {
2930
- const wrapperElem = cellElemList[i];
2933
+ for (let i = 0; i < wrapperElemList.length; i++) {
2934
+ const wrapperElem = wrapperElemList[i];
2931
2935
  const cellElem = wrapperElem.parentElement;
2932
2936
  if (!firstCellStyle) {
2937
+ const cellStyle = cellElem.style;
2938
+ const orHeight = cellStyle.height;
2939
+ if (!scrollXLoad) {
2940
+ cellStyle.height = '';
2941
+ }
2933
2942
  firstCellStyle = getComputedStyle(cellElem);
2934
2943
  topBottomPadding = firstCellStyle ? Math.ceil(_xeUtils.default.toNumber(firstCellStyle.paddingTop) + _xeUtils.default.toNumber(firstCellStyle.paddingBottom)) : 0;
2944
+ if (!scrollXLoad) {
2945
+ cellStyle.height = orHeight;
2946
+ }
2935
2947
  }
2936
2948
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2937
- colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2949
+ colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
2938
2950
  }
2939
2951
  return colHeight;
2940
2952
  };
@@ -2964,13 +2976,15 @@ const calcCellHeight = $xeTable => {
2964
2976
  const {
2965
2977
  handleGetRowId
2966
2978
  } = (0, _util.createHandleGetRowId)($xeTable);
2979
+ el.setAttribute('data-calc-row', 'Y');
2967
2980
  tableData.forEach(row => {
2968
2981
  const rowid = handleGetRowId(row);
2969
2982
  const rowRest = fullAllDataRowIdData[rowid];
2970
2983
  if (rowRest) {
2971
- const height = calcCellAutoHeight(rowRest, el);
2984
+ const height = calcCellAutoHeight($xeTable, rowRest, el);
2972
2985
  rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
2973
2986
  }
2987
+ el.removeAttribute('data-calc-row');
2974
2988
  });
2975
2989
  reactData.calcCellHeightFlag++;
2976
2990
  }
@@ -7155,7 +7169,9 @@ const Methods = {
7155
7169
  return;
7156
7170
  }
7157
7171
  const handleRsHeight = () => {
7158
- const resizeHeight = calcCellAutoHeight(rowRest, el);
7172
+ el.setAttribute('data-calc-row', 'Y');
7173
+ const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
7174
+ el.removeAttribute('data-calc-row');
7159
7175
  const resizeParams = Object.assign(Object.assign({}, params), {
7160
7176
  resizeHeight,
7161
7177
  resizeRow: row
@@ -7254,7 +7270,7 @@ const Methods = {
7254
7270
  const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : handleGetRowId(row);
7255
7271
  const rowRest = fullAllDataRowIdData[rowid];
7256
7272
  if (rowRest) {
7257
- rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
7273
+ rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
7258
7274
  }
7259
7275
  el.removeAttribute('data-calc-row');
7260
7276
  });