@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.js
CHANGED
|
@@ -13519,7 +13519,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13519
13519
|
// src/components/Table/hooks/useScrollStorage.ts
|
|
13520
13520
|
import { useMemo as useMemo23 } from "react";
|
|
13521
13521
|
function useScrollStorage(tableId, enabled = true) {
|
|
13522
|
-
const storageKey = `scrollPosition_${window.location.pathname}_${tableId}`;
|
|
13522
|
+
const storageKey = `scrollPosition_${window.location.pathname}${window.location.search}_${tableId}`;
|
|
13523
13523
|
return useMemo23(
|
|
13524
13524
|
() => ({
|
|
13525
13525
|
getScrollIndex: () => {
|
|
@@ -13901,7 +13901,7 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
|
|
|
13901
13901
|
}
|
|
13902
13902
|
);
|
|
13903
13903
|
}
|
|
13904
|
-
function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, _stickyOffset, infiniteScroll, _tableContainerRef, persistScrollPosition =
|
|
13904
|
+
function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, _stickyOffset, infiniteScroll, _tableContainerRef, persistScrollPosition = infiniteScroll === void 0) {
|
|
13905
13905
|
const { footerStyle, listStyle } = useMemo24(() => {
|
|
13906
13906
|
const { paddingBottom, ...otherRootStyles } = style.rootCss ?? {};
|
|
13907
13907
|
return { footerStyle: { paddingBottom }, listStyle: { ...style, rootCss: otherRootStyles } };
|
|
@@ -13910,13 +13910,14 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
13910
13910
|
const { getScrollIndex, setScrollIndex } = useScrollStorage(id, persistScrollPosition);
|
|
13911
13911
|
const savedScrollIndex = getScrollIndex();
|
|
13912
13912
|
const topItemCount = stickyHeader ? tableHeadRows.length : 0;
|
|
13913
|
-
const
|
|
13913
|
+
const validatedScrollIndex = savedScrollIndex !== void 0 && savedScrollIndex < visibleDataRows.length ? savedScrollIndex : void 0;
|
|
13914
|
+
const virtuosoKey = !!validatedScrollIndex && visibleDataRows.length > 0 ? "with-data" : "virtuoso";
|
|
13914
13915
|
return /* @__PURE__ */ jsx81(
|
|
13915
13916
|
Virtuoso2,
|
|
13916
13917
|
{
|
|
13917
13918
|
overscan: 5,
|
|
13918
13919
|
ref: virtuosoRef,
|
|
13919
|
-
...
|
|
13920
|
+
...validatedScrollIndex !== void 0 ? { initialTopMostItemIndex: validatedScrollIndex } : {},
|
|
13920
13921
|
components: {
|
|
13921
13922
|
// Applying a zIndex: 2 to ensure it stays on top of sticky columns
|
|
13922
13923
|
TopItemList: React13.forwardRef((props, ref) => /* @__PURE__ */ jsx81(
|
|
@@ -13955,7 +13956,7 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
13955
13956
|
},
|
|
13956
13957
|
rangeChanged: (newRange) => {
|
|
13957
13958
|
virtuosoRangeRef.current = newRange;
|
|
13958
|
-
if (!infiniteScroll) {
|
|
13959
|
+
if (!infiniteScroll && visibleDataRows.length > 0) {
|
|
13959
13960
|
setScrollIndex(newRange.startIndex);
|
|
13960
13961
|
}
|
|
13961
13962
|
},
|