@revolist/revogrid 4.23.3 → 4.23.5

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.
Files changed (37) hide show
  1. package/dist/cjs/{column.drag.plugin-DJueWxN_.js → column.drag.plugin-yUSx3qoN.js} +2 -2
  2. package/dist/cjs/{header-cell-renderer-QrcXXSkF.js → header-cell-renderer-vVr4IWNV.js} +7 -18
  3. package/dist/cjs/index.cjs.js +3 -3
  4. package/dist/cjs/revo-grid.cjs.entry.js +13 -4
  5. package/dist/cjs/revogr-attribution_7.cjs.entry.js +1 -1
  6. package/dist/cjs/revogr-data_4.cjs.entry.js +27 -13
  7. package/dist/cjs/{viewport.store-BlKQ4x9H.js → viewport.store-BscUCiUk.js} +23 -0
  8. package/dist/collection/components/header/header-renderer.js +10 -7
  9. package/dist/collection/components/header/resizable.element.js +7 -18
  10. package/dist/collection/components/revoGrid/viewport.resize.service.js +1 -0
  11. package/dist/collection/components/scroll/revogr-viewport-scroll.js +15 -5
  12. package/dist/collection/services/dimension.provider.js +11 -2
  13. package/dist/collection/store/vp/viewport.helpers.js +23 -0
  14. package/dist/{revo-grid/column.drag.plugin-DCZW62Uc.js → esm/column.drag.plugin-Cg2U-91C.js} +2 -2
  15. package/dist/esm/{header-cell-renderer-BsvUQ8GS.js → header-cell-renderer-B-LX2sgu.js} +7 -18
  16. package/dist/esm/index.js +4 -4
  17. package/dist/esm/revo-grid.entry.js +13 -4
  18. package/dist/esm/revogr-attribution_7.entry.js +1 -1
  19. package/dist/esm/revogr-data_4.entry.js +27 -13
  20. package/dist/{revo-grid/viewport.store-COAfzAyu.js → esm/viewport.store-_c579YyM.js} +23 -0
  21. package/dist/{esm/column.drag.plugin-DCZW62Uc.js → revo-grid/column.drag.plugin-Cg2U-91C.js} +2 -2
  22. package/dist/revo-grid/{header-cell-renderer-BsvUQ8GS.js → header-cell-renderer-B-LX2sgu.js} +7 -18
  23. package/dist/revo-grid/index.esm.js +4 -4
  24. package/dist/revo-grid/revo-grid.entry.js +13 -4
  25. package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
  26. package/dist/revo-grid/revogr-data_4.entry.js +27 -13
  27. package/dist/{esm/viewport.store-COAfzAyu.js → revo-grid/viewport.store-_c579YyM.js} +23 -0
  28. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +1 -0
  29. package/dist/types/services/scroll.dimension.helpers.d.ts +19 -0
  30. package/dist/types/store/vp/viewport.helpers.d.ts +23 -0
  31. package/hydrate/index.js +66 -31
  32. package/hydrate/index.mjs +66 -31
  33. package/package.json +1 -1
  34. package/readme.md +127 -16
  35. package/standalone/revo-grid.js +1 -1
  36. package/standalone/revogr-header2.js +1 -1
  37. package/standalone/revogr-viewport-scroll2.js +1 -1
@@ -5,12 +5,12 @@
5
5
 
6
6
  var column_service = require('./column.service-C1Qvcf5l.js');
7
7
  var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
8
- var viewport_store = require('./viewport.store-BlKQ4x9H.js');
8
+ var viewport_store = require('./viewport.store-BscUCiUk.js');
9
9
  var index$1 = require('./index-DxaSE5uZ.js');
10
10
  var index = require('./index-Dq8Xzj5l.js');
11
11
  var filter_button = require('./filter.button-w6LWnyhi.js');
12
12
  var debounce = require('./debounce-CcpHiH2p.js');
13
- var headerCellRenderer = require('./header-cell-renderer-QrcXXSkF.js');
13
+ var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
14
14
 
15
15
  function calculateRealSize({ count, originItemSize, sizes, }) {
16
16
  const safeCount = Math.max(0, count);
@@ -285,24 +285,13 @@ const ResizableElement = (props, children) => {
285
285
  }
286
286
  })) ||
287
287
  null;
288
- if (props.active) {
289
- if (props.canResize) {
290
- for (let p in props.active) {
291
- resizeEls.push(index.h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
292
- var _a;
293
- e.preventDefault();
294
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
295
- }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
296
- }
297
- }
298
- else {
299
- for (let _p in props.active) {
300
- resizeEls.push(index.h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
301
- var _a;
302
- e.preventDefault();
303
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
304
- }, class: `no-resize` }));
305
- }
288
+ if (props.active && props.canResize) {
289
+ for (let p in props.active) {
290
+ resizeEls.push(index.h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
291
+ var _a;
292
+ e.preventDefault();
293
+ (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
294
+ }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
306
295
  }
307
296
  }
308
297
  return (index.h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
@@ -4,15 +4,15 @@
4
4
  'use strict';
5
5
 
6
6
  var column_service = require('./column.service-C1Qvcf5l.js');
7
- var column_drag_plugin = require('./column.drag.plugin-DJueWxN_.js');
8
- var headerCellRenderer = require('./header-cell-renderer-QrcXXSkF.js');
7
+ var column_drag_plugin = require('./column.drag.plugin-yUSx3qoN.js');
8
+ var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
9
9
  var cellRenderer = require('./cell-renderer-Dcz022q7.js');
10
10
  var index$1 = require('./index-DxaSE5uZ.js');
11
11
  var textEditor = require('./text-editor-B4W-m-r-.js');
12
12
  var edit_utils = require('./edit.utils-pKeiYFLJ.js');
13
13
  var index = require('./index-Dq8Xzj5l.js');
14
14
  var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
15
- var viewport_store = require('./viewport.store-BlKQ4x9H.js');
15
+ var viewport_store = require('./viewport.store-BscUCiUk.js');
16
16
  var filter_button = require('./filter.button-w6LWnyhi.js');
17
17
  require('./debounce-CcpHiH2p.js');
18
18
 
@@ -8,13 +8,13 @@ var column_service = require('./column.service-C1Qvcf5l.js');
8
8
  var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
9
9
  var debounce = require('./debounce-CcpHiH2p.js');
10
10
  var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
11
- var viewport_store = require('./viewport.store-BlKQ4x9H.js');
12
- var column_drag_plugin = require('./column.drag.plugin-DJueWxN_.js');
11
+ var column_drag_plugin = require('./column.drag.plugin-yUSx3qoN.js');
12
+ var viewport_store = require('./viewport.store-BscUCiUk.js');
13
13
  var theme_service = require('./theme.service-BgnxGIjK.js');
14
14
  var index$1 = require('./index-DxaSE5uZ.js');
15
15
  var events = require('./events-DeLDyZlb.js');
16
16
  require('./filter.button-w6LWnyhi.js');
17
- require('./header-cell-renderer-QrcXXSkF.js');
17
+ require('./header-cell-renderer-vVr4IWNV.js');
18
18
 
19
19
  class ColumnDataProvider {
20
20
  get stores() {
@@ -374,7 +374,16 @@ class DimensionProvider {
374
374
  clientSize,
375
375
  virtualSize: viewportSize,
376
376
  });
377
- const renderCoordinate = viewport_store.clampViewportCoordinate(coordinate, dimension, viewportSize);
377
+ // Render offset must use the true logical scroll coordinate
378
+ // It is the logical scroll position that should be used for compressed-scroll offset math.
379
+ const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
380
+ scrollDimension.logicalScrollSize); // prevents positions past the logical end
381
+ /**
382
+ * If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
383
+ * Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
384
+ *
385
+ * In normal scrolling, logical and physical coordinates are the same, so offset is 0.
386
+ */
378
387
  const renderOffset = clientSize && viewportSize
379
388
  ? scrollDimension.getRenderOffset(renderCoordinate)
380
389
  : 0;
@@ -10,7 +10,7 @@ var column_service = require('./column.service-C1Qvcf5l.js');
10
10
  var edit_utils = require('./edit.utils-pKeiYFLJ.js');
11
11
  var index$1 = require('./index-DxaSE5uZ.js');
12
12
  var debounce = require('./debounce-CcpHiH2p.js');
13
- var viewport_store = require('./viewport.store-BlKQ4x9H.js');
13
+ var viewport_store = require('./viewport.store-BscUCiUk.js');
14
14
  var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
15
15
  var throttle = require('./throttle-BCwEuJJq.js');
16
16
 
@@ -8,7 +8,7 @@ var column_service = require('./column.service-C1Qvcf5l.js');
8
8
  var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
9
9
  var cellRenderer = require('./cell-renderer-Dcz022q7.js');
10
10
  var filter_button = require('./filter.button-w6LWnyhi.js');
11
- var headerCellRenderer = require('./header-cell-renderer-QrcXXSkF.js');
11
+ var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
12
12
  var throttle = require('./throttle-BCwEuJJq.js');
13
13
  var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
14
14
  require('./debounce-CcpHiH2p.js');
@@ -264,20 +264,23 @@ const RevogrData = class {
264
264
  RevogrData.style = revogrDataStyleCss();
265
265
 
266
266
  const HeaderRenderer = (p) => {
267
- var _a, _b, _c, _d, _e, _f, _g;
267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
268
+ const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
269
+ ((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
270
+ ((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
268
271
  const cellClass = {
269
272
  [dimension_helpers.HEADER_CLASS]: true,
270
- [dimension_helpers.HEADER_SORTABLE_CLASS]: !!((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable),
273
+ [dimension_helpers.HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
271
274
  };
272
- if ((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) {
275
+ if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
273
276
  cellClass[p.data.order] = true;
274
277
  }
275
278
  const dataProps = {
276
- key: String((_d = (_c = p.data) === null || _c === void 0 ? void 0 : _c.prop) !== null && _d !== void 0 ? _d : p.column.itemIndex),
279
+ key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
277
280
  [dimension_helpers.DATA_COL]: p.column.itemIndex,
278
281
  canResize: p.canResize,
279
- minWidth: ((_e = p.data) === null || _e === void 0 ? void 0 : _e.minSize) || dimension_helpers.MIN_COL_SIZE,
280
- maxWidth: (_f = p.data) === null || _f === void 0 ? void 0 : _f.maxSize,
282
+ minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || dimension_helpers.MIN_COL_SIZE,
283
+ maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
281
284
  active: p.active || ['r'],
282
285
  class: cellClass,
283
286
  style: {
@@ -313,7 +316,7 @@ const HeaderRenderer = (p) => {
313
316
  }
314
317
  }
315
318
  }
316
- return (index.h(headerCellRenderer.HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, index.h(cellRenderer.SortingSign, { column: p.data }), p.canFilter && ((_g = p.data) === null || _g === void 0 ? void 0 : _g.filter) !== false ? (index.h(filter_button.FilterButton, { column: p.data })) : ('')));
319
+ return (index.h(headerCellRenderer.HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? index.h(cellRenderer.SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (index.h(filter_button.FilterButton, { column: p.data })) : ('')));
317
320
  };
318
321
 
319
322
  const HeaderGroupRenderer = (p) => {
@@ -607,6 +610,7 @@ class GridResizeService {
607
610
  }
608
611
  destroy() {
609
612
  var _a;
613
+ this.apply.cancel();
610
614
  (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
611
615
  this.resizeObserver = null;
612
616
  }
@@ -745,6 +749,10 @@ const RevogrViewportScroll = class {
745
749
  scroll: this.horizontalScroll.scrollLeft,
746
750
  noScroll: this.colType !== 'rgCol',
747
751
  };
752
+ this.setScrollParams({
753
+ rgRow: calculatedHeight,
754
+ rgCol: calculatedWidth,
755
+ });
748
756
  // Process changes in order: width first, then height
749
757
  const dimensions = ['rgCol', 'rgRow'];
750
758
  for (const dimension of dimensions) {
@@ -801,24 +809,30 @@ const RevogrViewportScroll = class {
801
809
  }
802
810
  async componentDidRender() {
803
811
  var _a, _b, _c, _d;
812
+ this.setScrollParams({
813
+ rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
814
+ rgCol: this.horizontalScroll.clientWidth,
815
+ });
816
+ this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
817
+ this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
818
+ }
819
+ setScrollParams(clientSize) {
804
820
  this.localScrollService.setParams({
805
821
  contentSize: this.contentHeight,
806
- clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
822
+ clientSize: clientSize.rgRow,
807
823
  virtualSize: 0,
808
824
  }, 'rgRow');
809
825
  this.localScrollService.setParams({
810
826
  contentSize: this.contentWidth,
811
- clientSize: this.horizontalScroll.clientWidth,
827
+ clientSize: clientSize.rgCol,
812
828
  virtualSize: 0,
813
829
  }, 'rgCol');
814
- this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
815
- this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
816
830
  }
817
831
  render() {
818
832
  var _a, _b;
819
833
  const physicalContentHeight = throttle.getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
820
834
  const physicalContentWidth = throttle.getContentSize(this.contentWidth, 0);
821
- return (index.h(index.Host, { key: 'e52df53dcdcac76f02160615399c558e78fe5825', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, index.h("div", { key: '6821c4472db2208c2d52da9d6d43a7e5343d15bb', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, index.h("div", { key: '1916ec94af312621ed4d937c905ed745a23a7d3b', class: "header-wrapper", ref: e => (this.header = e) }, index.h("slot", { key: '2348a566b127f27d969a4e2ff67fab4022501ceb', name: viewport_helpers.HEADER_SLOT })), index.h("div", { key: 'd88eebb7b0028b350f5b0feb6b3893efbd3f645c', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, index.h("div", { key: '1778856706d9d6bbc52882a150cb66c9b3f11e06', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, index.h("slot", { key: '200bc8a9e692b6183ac2665b68961d28892f7cab', name: viewport_helpers.CONTENT_SLOT }))), index.h("div", { key: 'dc812739b4ad829867dd1effe94a871be247979a', class: "footer-wrapper", ref: e => (this.footer = e) }, index.h("slot", { key: '06e3b3a4f88c477dc33268ee317856820f2650e6', name: viewport_helpers.FOOTER_SLOT })))));
835
+ return (index.h(index.Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, index.h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, index.h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, index.h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: viewport_helpers.HEADER_SLOT })), index.h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, index.h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, index.h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: viewport_helpers.CONTENT_SLOT }))), index.h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, index.h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: viewport_helpers.FOOTER_SLOT })))));
822
836
  }
823
837
  /**
824
838
  * Extra layer for scroll event monitoring, where MouseWheel event is not passing
@@ -17,6 +17,29 @@ function getViewportMaxCoordinate(dimension, viewportSize, frameOffset = 1) {
17
17
  }
18
18
  return Math.max(0, dimension.realSize - viewportSize - dimension.originItemSize * frameOffset);
19
19
  }
20
+ /**
21
+ * Clamp the viewport coordinate within the valid range.
22
+ * Given a scroll position, pick a safe starting point for rendering visible items.
23
+ *
24
+ * Do not use it when you need the exact scroll position for positioning math.
25
+ *
26
+ * It does two things:
27
+ * 1. If the coordinate is below 0, use 0.
28
+ * 2. If the coordinate is too close to the very end, pull it back a bit.
29
+ *
30
+ * Example:
31
+ *
32
+ * content height: 1000px
33
+ * viewport height: 200px
34
+ * row height: 30px
35
+ * The real max scroll is:
36
+ *
37
+ * 1000 - 200 = 800
38
+ * But clampViewportCoordinate may clamp to:
39
+ *
40
+ * 1000 - 200 - 30 = 770
41
+ * Ask for 800 -> it returns 770.
42
+ */
20
43
  function clampViewportCoordinate(coordinate, dimension, viewportSize, frameOffset = 1) {
21
44
  return Math.min(Math.max(0, coordinate), getViewportMaxCoordinate(dimension, viewportSize, frameOffset));
22
45
  }
@@ -7,20 +7,23 @@ import { SortingSign } from "../../plugins/sorting/sorting.sign";
7
7
  import { DATA_COL, FOCUS_CLASS, HEADER_CLASS, HEADER_SORTABLE_CLASS, MIN_COL_SIZE, } from "../../utils/consts";
8
8
  import { HeaderCellRenderer } from "./header-cell-renderer";
9
9
  const HeaderRenderer = (p) => {
10
- var _a, _b, _c, _d, _e, _f, _g;
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
+ const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
12
+ ((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
13
+ ((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
11
14
  const cellClass = {
12
15
  [HEADER_CLASS]: true,
13
- [HEADER_SORTABLE_CLASS]: !!((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable),
16
+ [HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
14
17
  };
15
- if ((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) {
18
+ if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
16
19
  cellClass[p.data.order] = true;
17
20
  }
18
21
  const dataProps = {
19
- key: String((_d = (_c = p.data) === null || _c === void 0 ? void 0 : _c.prop) !== null && _d !== void 0 ? _d : p.column.itemIndex),
22
+ key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
20
23
  [DATA_COL]: p.column.itemIndex,
21
24
  canResize: p.canResize,
22
- minWidth: ((_e = p.data) === null || _e === void 0 ? void 0 : _e.minSize) || MIN_COL_SIZE,
23
- maxWidth: (_f = p.data) === null || _f === void 0 ? void 0 : _f.maxSize,
25
+ minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
26
+ maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
24
27
  active: p.active || ['r'],
25
28
  class: cellClass,
26
29
  style: {
@@ -56,6 +59,6 @@ const HeaderRenderer = (p) => {
56
59
  }
57
60
  }
58
61
  }
59
- return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((_g = p.data) === null || _g === void 0 ? void 0 : _g.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
62
+ return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? h(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
60
63
  };
61
64
  export default HeaderRenderer;
@@ -13,24 +13,13 @@ export const ResizableElement = (props, children) => {
13
13
  }
14
14
  })) ||
15
15
  null;
16
- if (props.active) {
17
- if (props.canResize) {
18
- for (let p in props.active) {
19
- resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
20
- var _a;
21
- e.preventDefault();
22
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
23
- }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
24
- }
25
- }
26
- else {
27
- for (let _p in props.active) {
28
- resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
29
- var _a;
30
- e.preventDefault();
31
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
32
- }, class: `no-resize` }));
33
- }
16
+ if (props.active && props.canResize) {
17
+ for (let p in props.active) {
18
+ resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
19
+ var _a;
20
+ e.preventDefault();
21
+ (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
22
+ }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
34
23
  }
35
24
  }
36
25
  return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
@@ -48,6 +48,7 @@ export default class GridResizeService {
48
48
  }
49
49
  destroy() {
50
50
  var _a;
51
+ this.apply.cancel();
51
52
  (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
52
53
  this.resizeObserver = null;
53
54
  }
@@ -138,6 +138,10 @@ export class RevogrViewportScroll {
138
138
  scroll: this.horizontalScroll.scrollLeft,
139
139
  noScroll: this.colType !== 'rgCol',
140
140
  };
141
+ this.setScrollParams({
142
+ rgRow: calculatedHeight,
143
+ rgCol: calculatedWidth,
144
+ });
141
145
  // Process changes in order: width first, then height
142
146
  const dimensions = ['rgCol', 'rgRow'];
143
147
  for (const dimension of dimensions) {
@@ -194,24 +198,30 @@ export class RevogrViewportScroll {
194
198
  }
195
199
  async componentDidRender() {
196
200
  var _a, _b, _c, _d;
201
+ this.setScrollParams({
202
+ rgRow: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
203
+ rgCol: this.horizontalScroll.clientWidth,
204
+ });
205
+ this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
206
+ this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
207
+ }
208
+ setScrollParams(clientSize) {
197
209
  this.localScrollService.setParams({
198
210
  contentSize: this.contentHeight,
199
- clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
211
+ clientSize: clientSize.rgRow,
200
212
  virtualSize: 0,
201
213
  }, 'rgRow');
202
214
  this.localScrollService.setParams({
203
215
  contentSize: this.contentWidth,
204
- clientSize: this.horizontalScroll.clientWidth,
216
+ clientSize: clientSize.rgCol,
205
217
  virtualSize: 0,
206
218
  }, 'rgCol');
207
- this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
208
- this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
209
219
  }
210
220
  render() {
211
221
  var _a, _b;
212
222
  const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
213
223
  const physicalContentWidth = getContentSize(this.contentWidth, 0);
214
- return (h(Host, { key: 'e52df53dcdcac76f02160615399c558e78fe5825', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '6821c4472db2208c2d52da9d6d43a7e5343d15bb', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: '1916ec94af312621ed4d937c905ed745a23a7d3b', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '2348a566b127f27d969a4e2ff67fab4022501ceb', name: HEADER_SLOT })), h("div", { key: 'd88eebb7b0028b350f5b0feb6b3893efbd3f645c', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: '1778856706d9d6bbc52882a150cb66c9b3f11e06', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '200bc8a9e692b6183ac2665b68961d28892f7cab', name: CONTENT_SLOT }))), h("div", { key: 'dc812739b4ad829867dd1effe94a871be247979a', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '06e3b3a4f88c477dc33268ee317856820f2650e6', name: FOOTER_SLOT })))));
224
+ return (h(Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: HEADER_SLOT })), h("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: CONTENT_SLOT }))), h("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: FOOTER_SLOT })))));
215
225
  }
216
226
  /**
217
227
  * Extra layer for scroll event monitoring, where MouseWheel event is not passing
@@ -4,7 +4,7 @@
4
4
  import reduce from "lodash/reduce";
5
5
  import debounce from "lodash/debounce";
6
6
  import { RESIZE_INTERVAL } from "../utils/consts";
7
- import { columnTypes, rowTypes, getItemByIndex, DimensionStore, gatherTrimmedItems, clampViewportCoordinate, } from "../store/index";
7
+ import { columnTypes, rowTypes, getItemByIndex, DimensionStore, gatherTrimmedItems, } from "../store/index";
8
8
  import { getColumnSizes } from "../utils/column.utils";
9
9
  import { getScrollDimension } from "./scroll.dimension.helpers";
10
10
  /**
@@ -152,7 +152,16 @@ export default class DimensionProvider {
152
152
  clientSize,
153
153
  virtualSize: viewportSize,
154
154
  });
155
- const renderCoordinate = clampViewportCoordinate(coordinate, dimension, viewportSize);
155
+ // Render offset must use the true logical scroll coordinate
156
+ // It is the logical scroll position that should be used for compressed-scroll offset math.
157
+ const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
158
+ scrollDimension.logicalScrollSize); // prevents positions past the logical end
159
+ /**
160
+ * If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
161
+ * Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
162
+ *
163
+ * In normal scrolling, logical and physical coordinates are the same, so offset is 0.
164
+ */
156
165
  const renderOffset = clientSize && viewportSize
157
166
  ? scrollDimension.getRenderOffset(renderCoordinate)
158
167
  : 0;
@@ -8,6 +8,29 @@ export function getViewportMaxCoordinate(dimension, viewportSize, frameOffset =
8
8
  }
9
9
  return Math.max(0, dimension.realSize - viewportSize - dimension.originItemSize * frameOffset);
10
10
  }
11
+ /**
12
+ * Clamp the viewport coordinate within the valid range.
13
+ * Given a scroll position, pick a safe starting point for rendering visible items.
14
+ *
15
+ * Do not use it when you need the exact scroll position for positioning math.
16
+ *
17
+ * It does two things:
18
+ * 1. If the coordinate is below 0, use 0.
19
+ * 2. If the coordinate is too close to the very end, pull it back a bit.
20
+ *
21
+ * Example:
22
+ *
23
+ * content height: 1000px
24
+ * viewport height: 200px
25
+ * row height: 30px
26
+ * The real max scroll is:
27
+ *
28
+ * 1000 - 200 = 800
29
+ * But clampViewportCoordinate may clamp to:
30
+ *
31
+ * 1000 - 200 - 30 = 770
32
+ * Ask for 800 -> it returns 770.
33
+ */
11
34
  export function clampViewportCoordinate(coordinate, dimension, viewportSize, frameOffset = 1) {
12
35
  return Math.min(Math.max(0, coordinate), getViewportMaxCoordinate(dimension, viewportSize, frameOffset));
13
36
  }
@@ -3,12 +3,12 @@
3
3
  */
4
4
  import { J as reduce, g as getRange, K as baseEach, C as getColumnType, c as columnTypes, L as toInteger, u as isGrouping, t as getGroupingName, r as rowTypes, B as getCellDataParsed, A as getCellRaw, j as GROUP_COLUMN_PROP, I as getColumnByProp, h as GROUP_EXPANDED, x as getParsedGroup, y as isSameGroup, G as GROUP_DEPTH, e as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, o as GROUPING_ROW_TYPE, p as getSource, f as PSEUDO_GROUP_COLUMN, s as gatherGrouping, m as GROUP_EXPAND_EVENT, v as isGroupingColumn, q as getExpanded, E as isColGrouping } from './column.service-CC_SD8W3.js';
5
5
  import { K as createStore, l as setStore, i as calculateDimensionData, L as identity, N as isArray, b as getSourceItem, g as getPhysical, e as setItems, j as getItemByPosition } from './dimension.helpers-CGKwSvw6.js';
6
- import { j as calculateRowHeaderSize } from './viewport.store-COAfzAyu.js';
6
+ import { j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
7
7
  import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
8
8
  import { h } from './index-Chp_81rd.js';
9
9
  import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
- import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-BsvUQ8GS.js';
11
+ import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-B-LX2sgu.js';
12
12
 
13
13
  function calculateRealSize({ count, originItemSize, sizes, }) {
14
14
  const safeCount = Math.max(0, count);
@@ -283,24 +283,13 @@ const ResizableElement = (props, children) => {
283
283
  }
284
284
  })) ||
285
285
  null;
286
- if (props.active) {
287
- if (props.canResize) {
288
- for (let p in props.active) {
289
- resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
290
- var _a;
291
- e.preventDefault();
292
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
293
- }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
294
- }
295
- }
296
- else {
297
- for (let _p in props.active) {
298
- resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
299
- var _a;
300
- e.preventDefault();
301
- (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
302
- }, class: `no-resize` }));
303
- }
286
+ if (props.active && props.canResize) {
287
+ for (let p in props.active) {
288
+ resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
289
+ var _a;
290
+ e.preventDefault();
291
+ (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
292
+ }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
304
293
  }
305
294
  }
306
295
  return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
package/dist/esm/index.js CHANGED
@@ -2,16 +2,16 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-CC_SD8W3.js';
5
- import { B as BasePlugin } from './column.drag.plugin-DCZW62Uc.js';
6
- export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-DCZW62Uc.js';
7
- export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BsvUQ8GS.js';
5
+ import { B as BasePlugin } from './column.drag.plugin-Cg2U-91C.js';
6
+ export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-Cg2U-91C.js';
7
+ export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-B-LX2sgu.js';
8
8
  export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-BtN-NGCk.js';
9
9
  export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
10
10
  export { T as TextEditor } from './text-editor-C3RUSwH5.js';
11
11
  export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaKey, g as isCut, m as isEditInput, n as isEditorCtrConstructible, f as isEnterKeyValue, i as isMetaKey, j as isPaste, l as isShortcutModifier, d as isTab, e as isTabKeyValue } from './edit.utils-Dnnbd0xG.js';
12
12
  export { h } from './index-Chp_81rd.js';
13
13
  export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CGKwSvw6.js';
14
- export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-COAfzAyu.js';
14
+ export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-_c579YyM.js';
15
15
  export { A as AND_OR_BUTTON, e as AndOrButton, a as FILTER_BUTTON_ACTIVE, F as FILTER_BUTTON_CLASS, b as FILTER_PROP, c as FilterButton, T as TRASH_BUTTON, d as TrashButton, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
16
16
  import './debounce-PCRWZliA.js';
17
17
 
@@ -6,13 +6,13 @@ import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as
6
6
  import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.js';
7
7
  import { d as debounce } from './debounce-PCRWZliA.js';
8
8
  import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
9
- import { c as clampViewportCoordinate, V as ViewportStore } from './viewport.store-COAfzAyu.js';
10
- import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-DCZW62Uc.js';
9
+ import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-Cg2U-91C.js';
10
+ import { V as ViewportStore } from './viewport.store-_c579YyM.js';
11
11
  import { T as ThemeService } from './theme.service-BmnDvr6P.js';
12
12
  import { t as timeout } from './index-Db3qZoW5.js';
13
13
  import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
14
14
  import './filter.button-C8XTWPU2.js';
15
- import './header-cell-renderer-BsvUQ8GS.js';
15
+ import './header-cell-renderer-B-LX2sgu.js';
16
16
 
17
17
  class ColumnDataProvider {
18
18
  get stores() {
@@ -372,7 +372,16 @@ class DimensionProvider {
372
372
  clientSize,
373
373
  virtualSize: viewportSize,
374
374
  });
375
- const renderCoordinate = clampViewportCoordinate(coordinate, dimension, viewportSize);
375
+ // Render offset must use the true logical scroll coordinate
376
+ // It is the logical scroll position that should be used for compressed-scroll offset math.
377
+ const renderCoordinate = Math.min(Math.max(0, coordinate), // prevents negative scroll positions
378
+ scrollDimension.logicalScrollSize); // prevents positions past the logical end
379
+ /**
380
+ * If viewport sizing is initialized (clientSize and viewportSize are truthy), calculate the offset needed for compressed scroll.
381
+ * Otherwise keep renderOffset at 0, because there is not enough measurement data yet.
382
+ *
383
+ * In normal scrolling, logical and physical coordinates are the same, so offset is 0.
384
+ */
376
385
  const renderOffset = clientSize && viewportSize
377
386
  ? scrollDimension.getRenderOffset(renderCoordinate)
378
387
  : 0;
@@ -8,7 +8,7 @@ import { g as getRange, M as ColumnService, z as getCellData, N as getCellEditor
8
8
  import { l as isShortcutModifier, m as isEditInput, c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './edit.utils-Dnnbd0xG.js';
9
9
  import { t as timeout, g as getScrollbarSize } from './index-Db3qZoW5.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
- import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-COAfzAyu.js';
11
+ import { V as ViewportStore, j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
12
12
  import { H as HEADER_SLOT } from './viewport.helpers-CoCAvmZs.js';
13
13
  import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-CaUDyxyU.js';
14
14