vxe-table 3.17.6 → 3.17.7

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.
@@ -2751,12 +2751,17 @@ function autoCellWidth($xeTable) {
2751
2751
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
2752
2752
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2753
2753
  let colHeight = rowRest.height;
2754
+ let firstCellStyle = null;
2755
+ let topBottomPadding = 0;
2754
2756
  for (let i = 0; i < cellElemList.length; i++) {
2755
- const cellElem = cellElemList[i];
2756
- const tdEl = cellElem.parentElement;
2757
- const topBottomPadding = Math.ceil(_xeUtils.default.toNumber(tdEl.style.paddingTop) + _xeUtils.default.toNumber(tdEl.style.paddingBottom));
2758
- const cellHeight = cellElem ? cellElem.clientHeight : 0;
2759
- colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
2757
+ const wrapperElem = cellElemList[i];
2758
+ const cellElem = wrapperElem.parentElement;
2759
+ if (!firstCellStyle) {
2760
+ firstCellStyle = getComputedStyle(cellElem);
2761
+ topBottomPadding = firstCellStyle ? Math.ceil(_xeUtils.default.toNumber(firstCellStyle.paddingTop) + _xeUtils.default.toNumber(firstCellStyle.paddingBottom)) : 0;
2762
+ }
2763
+ const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2764
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2760
2765
  }
2761
2766
  return colHeight;
2762
2767
  };
@@ -6551,6 +6556,7 @@ const Methods = {
6551
6556
  },
6552
6557
  handleRowResizeMousedownEvent(evnt, params) {
6553
6558
  const $xeTable = this;
6559
+ const props = $xeTable;
6554
6560
  const reactData = $xeTable;
6555
6561
  const internalData = $xeTable;
6556
6562
  evnt.stopPropagation();
@@ -6558,6 +6564,9 @@ const Methods = {
6558
6564
  const {
6559
6565
  row
6560
6566
  } = params;
6567
+ const {
6568
+ showOverflow
6569
+ } = props;
6561
6570
  const {
6562
6571
  overflowX,
6563
6572
  scrollbarWidth,
@@ -6596,7 +6605,10 @@ const Methods = {
6596
6605
  return;
6597
6606
  }
6598
6607
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
6599
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
6608
+ let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
6609
+ if (!showOverflow) {
6610
+ currCellHeight = tdEl.clientHeight;
6611
+ }
6600
6612
  const tableRect = tableEl.getBoundingClientRect();
6601
6613
  const trRect = trEl.getBoundingClientRect();
6602
6614
  const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
@@ -6781,6 +6793,32 @@ const Methods = {
6781
6793
  });
6782
6794
  return rest;
6783
6795
  },
6796
+ recalcRowHeight(rowOrId) {
6797
+ const $xeTable = this;
6798
+ const reactData = $xeTable;
6799
+ const internalData = $xeTable;
6800
+ const {
6801
+ fullAllDataRowIdData
6802
+ } = internalData;
6803
+ const rows = _xeUtils.default.isArray(rowOrId) ? rowOrId : [rowOrId];
6804
+ const el = $xeTable.$refs.refElem;
6805
+ if (el) {
6806
+ const {
6807
+ handleGetRowId
6808
+ } = (0, _util.createHandleGetRowId)($xeTable);
6809
+ el.setAttribute('data-calc-row', 'Y');
6810
+ rows.forEach(row => {
6811
+ const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : handleGetRowId(row);
6812
+ const rowRest = fullAllDataRowIdData[rowid];
6813
+ if (rowRest) {
6814
+ rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
6815
+ }
6816
+ el.removeAttribute('data-calc-row');
6817
+ });
6818
+ reactData.calcCellHeightFlag++;
6819
+ }
6820
+ return $xeTable.$nextTick();
6821
+ },
6784
6822
  setRowHeight(rowOrId, height) {
6785
6823
  const $xeTable = this;
6786
6824
  const reactData = $xeTable;