@visactor/vtable 0.9.2-alpha.1 → 0.9.2-alpha.2

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.
@@ -73,7 +73,7 @@ export class BaseTable extends EventTarget {
73
73
  constructor(options = {}) {
74
74
  var _a, _b, _c, _d, _e, _f, _g;
75
75
  super(), this.showFrozenIcon = !0, this.showSort = !0, this.bottomFrozenRowCount = 0,
76
- this.rightFrozenColCount = 0, this.version = "0.9.2-alpha.1", this.id = `VTable${Date.now()}`,
76
+ this.rightFrozenColCount = 0, this.version = "0.9.2-alpha.2", this.id = `VTable${Date.now()}`,
77
77
  this.throttleInvalidate = throttle2(this.invalidate.bind(this), 200);
78
78
  const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, keyboardOptions: keyboardOptions, parentElement: parentElement, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio} = options;
79
79
  this.options = options, this._widthMode = widthMode, this._heightMode = heightMode,
@@ -402,7 +402,10 @@ export class BaseTable extends EventTarget {
402
402
  height;
403
403
  }
404
404
  let h = 0;
405
- for (let i = startRow; i <= endRow; i++) h += this.getRowHeight(i);
405
+ if ("autoHeight" !== this.heightMode && this.internalProps.layoutMap && endRow >= this.columnHeaderLevelCount) {
406
+ for (let i = startRow; i < this.columnHeaderLevelCount; i++) h += this.getRowHeight(i);
407
+ h += this.defaultRowHeight * (endRow - Math.max(this.columnHeaderLevelCount, startRow) + 1);
408
+ } else for (let i = startRow; i <= endRow; i++) h += this.getRowHeight(i);
406
409
  return startRow >= 0 && endRow >= 0 && h > 0 && this._rowRangeHeightsMap.set(`$${startRow}$${endRow}`, Math.round(h)),
407
410
  Math.round(h);
408
411
  }