@homebound/beam 2.415.1 → 2.415.3

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.cjs CHANGED
@@ -13878,7 +13878,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
13878
13878
  // src/components/Table/hooks/useScrollStorage.ts
13879
13879
  var import_react72 = require("react");
13880
13880
  function useScrollStorage(tableId, enabled = true) {
13881
- const storageKey = `scrollPosition_${window.location.pathname}_${tableId}`;
13881
+ const storageKey = `scrollPosition_${window.location.pathname}${window.location.search}_${tableId}`;
13882
13882
  return (0, import_react72.useMemo)(
13883
13883
  () => ({
13884
13884
  getScrollIndex: () => {
@@ -14260,7 +14260,7 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
14260
14260
  }
14261
14261
  );
14262
14262
  }
14263
- function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, _stickyOffset, infiniteScroll, _tableContainerRef, persistScrollPosition = true) {
14263
+ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, _stickyOffset, infiniteScroll, _tableContainerRef, persistScrollPosition = infiniteScroll === void 0) {
14264
14264
  const { footerStyle, listStyle } = (0, import_react74.useMemo)(() => {
14265
14265
  const { paddingBottom, ...otherRootStyles } = style.rootCss ?? {};
14266
14266
  return { footerStyle: { paddingBottom }, listStyle: { ...style, rootCss: otherRootStyles } };
@@ -14268,14 +14268,15 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
14268
14268
  const [fetchMoreInProgress, setFetchMoreInProgress] = (0, import_react74.useState)(false);
14269
14269
  const { getScrollIndex, setScrollIndex } = useScrollStorage(id, persistScrollPosition);
14270
14270
  const savedScrollIndex = getScrollIndex();
14271
- const initialScrollIndex = !!savedScrollIndex && visibleDataRows.length > 0 && savedScrollIndex < visibleDataRows.length ? savedScrollIndex : void 0;
14272
14271
  const topItemCount = stickyHeader ? tableHeadRows.length : 0;
14272
+ const validatedScrollIndex = savedScrollIndex !== void 0 && savedScrollIndex < visibleDataRows.length ? savedScrollIndex : void 0;
14273
+ const virtuosoKey = !!validatedScrollIndex && visibleDataRows.length > 0 ? "with-data" : "virtuoso";
14273
14274
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
14274
14275
  import_react_virtuoso2.Virtuoso,
14275
14276
  {
14276
14277
  overscan: 5,
14277
14278
  ref: virtuosoRef,
14278
- ...initialScrollIndex !== void 0 ? { initialTopMostItemIndex: initialScrollIndex + topItemCount } : {},
14279
+ ...validatedScrollIndex !== void 0 ? { initialTopMostItemIndex: validatedScrollIndex } : {},
14279
14280
  components: {
14280
14281
  // Applying a zIndex: 2 to ensure it stays on top of sticky columns
14281
14282
  TopItemList: import_react74.default.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
@@ -14314,8 +14315,8 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
14314
14315
  },
14315
14316
  rangeChanged: (newRange) => {
14316
14317
  virtuosoRangeRef.current = newRange;
14317
- if (!infiniteScroll) {
14318
- setScrollIndex(newRange.startIndex + tableHeadRows.length);
14318
+ if (!infiniteScroll && visibleDataRows.length > 0) {
14319
+ setScrollIndex(newRange.startIndex);
14319
14320
  }
14320
14321
  },
14321
14322
  totalCount: tableHeadRows.length + (firstRowMessage ? 1 : 0) + visibleDataRows.length + keptSelectedRows.length,
@@ -14336,7 +14337,8 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
14336
14337
  }
14337
14338
  }
14338
14339
  } : {}
14339
- }
14340
+ },
14341
+ virtuosoKey
14340
14342
  );
14341
14343
  }
14342
14344
  var VirtualRoot = (0, import_memoize_one.default)(