@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.
@@ -46,7 +46,7 @@ class BaseTable extends EventTarget_1.EventTarget {
46
46
  constructor(options = {}) {
47
47
  var _a, _b, _c, _d, _e, _f, _g;
48
48
  super(), this.showFrozenIcon = !0, this.showSort = !0, this.bottomFrozenRowCount = 0,
49
- this.rightFrozenColCount = 0, this.version = "0.9.2-alpha.1", this.id = `VTable${Date.now()}`,
49
+ this.rightFrozenColCount = 0, this.version = "0.9.2-alpha.2", this.id = `VTable${Date.now()}`,
50
50
  this.throttleInvalidate = (0, util_1.throttle2)(this.invalidate.bind(this), 200);
51
51
  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 = pixel_ratio_1.defaultPixelRatio} = options;
52
52
  this.options = options, this._widthMode = widthMode, this._heightMode = heightMode,
@@ -379,7 +379,10 @@ class BaseTable extends EventTarget_1.EventTarget {
379
379
  height;
380
380
  }
381
381
  let h = 0;
382
- for (let i = startRow; i <= endRow; i++) h += this.getRowHeight(i);
382
+ if ("autoHeight" !== this.heightMode && this.internalProps.layoutMap && endRow >= this.columnHeaderLevelCount) {
383
+ for (let i = startRow; i < this.columnHeaderLevelCount; i++) h += this.getRowHeight(i);
384
+ h += this.defaultRowHeight * (endRow - Math.max(this.columnHeaderLevelCount, startRow) + 1);
385
+ } else for (let i = startRow; i <= endRow; i++) h += this.getRowHeight(i);
383
386
  return startRow >= 0 && endRow >= 0 && h > 0 && this._rowRangeHeightsMap.set(`$${startRow}$${endRow}`, Math.round(h)),
384
387
  Math.round(h);
385
388
  }