@homebound/beam 2.415.2 → 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 +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 =
|
|
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 } };
|
|
@@ -14269,13 +14269,14 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
14269
14269
|
const { getScrollIndex, setScrollIndex } = useScrollStorage(id, persistScrollPosition);
|
|
14270
14270
|
const savedScrollIndex = getScrollIndex();
|
|
14271
14271
|
const topItemCount = stickyHeader ? tableHeadRows.length : 0;
|
|
14272
|
-
const
|
|
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
|
-
...
|
|
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,7 +14315,7 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
14314
14315
|
},
|
|
14315
14316
|
rangeChanged: (newRange) => {
|
|
14316
14317
|
virtuosoRangeRef.current = newRange;
|
|
14317
|
-
if (!infiniteScroll) {
|
|
14318
|
+
if (!infiniteScroll && visibleDataRows.length > 0) {
|
|
14318
14319
|
setScrollIndex(newRange.startIndex);
|
|
14319
14320
|
}
|
|
14320
14321
|
},
|