@taocompany/magic-grid 0.3.3 → 0.3.4

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.
package/dist/index.es.js CHANGED
@@ -18783,7 +18783,7 @@ var RS = class {
18783
18783
  }
18784
18784
  syncViewportHeight() {
18785
18785
  let e = this.getViewportHeight(), t = this.resolveLogicalScrollTopForSync(), n = this.getScrollRange(e);
18786
- n.compressed ? (this.deps.spacerEl.style.height = "", this.deps.scrollPhantomEl.style.height = `${n.physicalMaxScroll + 1}px`, this.syncCompressedLayerHeight(e)) : (this.deps.spacerEl.style.height = `${n.physicalSpacerHeight}px`, this.deps.scrollPhantomEl.style.height = "0px", this.deps.viewportEl.style.removeProperty("--mg-viewport-px")), this.syncScrollMode(e);
18786
+ this.applySpacerLayoutFromRange(e, n), this.syncScrollMode(e);
18787
18787
  let r = Math.min(t, n.logicalMaxScroll);
18788
18788
  this.deps.scrollBridge.syncScrollTop(r), this.applyPhysicalScrollFromLogical(r), this.syncHeaderFooterRowWidth(), this.syncScrollbarGutter(), this.syncBorderClosureState(), this.syncIndexColumnFill();
18789
18789
  }
@@ -18821,10 +18821,7 @@ var RS = class {
18821
18821
  let n = this.getViewportHeight();
18822
18822
  this.syncCompressedLayerHeight(n);
18823
18823
  let r = e ?? this.getLogicalScrollTop(), i = t ?? this.deps.viewportEl.scrollLeft, a = this.deps.viewportEl.clientWidth, o = xS(this.deps.columnModel, i, a);
18824
- if (o !== i) {
18825
- this.scrollTo(r, o);
18826
- return;
18827
- }
18824
+ o !== i && (this.deps.viewportEl.scrollLeft = o, this.lastScrollLeft = o, this.deps.headerScrollEl.scrollLeft = o, this.syncFooterScrollLeft(), this.syncFloatingFilterScrollLeft());
18828
18825
  let s = this.getRenderViewportHeightInternal(), c = this.deps.columnViewport.update(o, a), l = this.deps.columnViewport.getWindow();
18829
18826
  c && (this.renderHeader(l), this.deps.refreshFooter?.(), this.deps.refreshFloatingFilter?.(), this.deps.applyFocusVisuals()), this.syncFooterScrollLeft(), this.syncFloatingFilterScrollLeft(), this.syncPinnedRows(), this.deps.rowRenderer.redraw(r, s, l, c), this.deps.applyCellRangeVisuals?.(), this.syncIndexColumnFill(), this.onAfterRedraw?.();
18830
18827
  }
@@ -18841,7 +18838,17 @@ var RS = class {
18841
18838
  return this.overlayScrollbars === null && (this.overlayScrollbars = FS()), this.overlayScrollbars;
18842
18839
  }
18843
18840
  handleViewportResize() {
18844
- this.deps.isDestroyed() || (PS(), this.overlayScrollbars = null, this.syncViewportHeight());
18841
+ if (this.deps.isDestroyed()) return;
18842
+ PS(), this.overlayScrollbars = null;
18843
+ let e = this.getViewportHeight(), t = this.getScrollRange(e);
18844
+ this.applySpacerLayoutFromRange(e, t), this.syncHeaderFooterRowWidth(), this.syncScrollbarGutter(), this.syncBorderClosureState(), this.syncIndexColumnFill();
18845
+ }
18846
+ applySpacerLayoutFromRange(e, t) {
18847
+ if (t.compressed) {
18848
+ this.deps.spacerEl.style.height = "", this.deps.scrollPhantomEl.style.height = `${t.physicalMaxScroll + 1}px`, this.syncCompressedLayerHeight(e);
18849
+ return;
18850
+ }
18851
+ this.deps.spacerEl.style.height = `${t.physicalSpacerHeight}px`, this.deps.scrollPhantomEl.style.height = "0px", this.deps.viewportEl.style.removeProperty("--mg-viewport-px");
18845
18852
  }
18846
18853
  syncHeaderFooterRowWidth() {
18847
18854
  let e = this.deps.columnModel.getTotalWidth();