@tap-payments/os-micro-frontend-shared 0.1.235 → 0.1.236
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback, useMemo, useRef } from 'react';
|
|
2
|
+
import { memo, useCallback, useMemo, useRef, useEffect } from 'react';
|
|
3
3
|
import { SHEET_VIEW_TABLE_THRESHOLD } from '../../../constants/index.js';
|
|
4
4
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
5
5
|
import { SheetViewTableContainer } from '../components/style';
|
|
@@ -26,6 +26,14 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
26
26
|
const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(columns, isPinnable, onColumnPin);
|
|
27
27
|
// Scroll synchronization
|
|
28
28
|
const { pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef, handleScroll } = useSynchronizedScroll();
|
|
29
|
+
// Reset virtual list cache when row count changes
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
var _a, _b, _c;
|
|
32
|
+
// Reset all virtual lists to recalculate item sizes
|
|
33
|
+
(_a = pinnedStartVirtualListRef.current) === null || _a === void 0 ? void 0 : _a.resetAfterIndex(0);
|
|
34
|
+
(_b = scrollableVirtualListRef.current) === null || _b === void 0 ? void 0 : _b.resetAfterIndex(0);
|
|
35
|
+
(_c = pinnedEndVirtualListRef.current) === null || _c === void 0 ? void 0 : _c.resetAfterIndex(0);
|
|
36
|
+
}, [rows.length, pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef]);
|
|
29
37
|
// Column resize functionality
|
|
30
38
|
const { columnWidths, isResizing, resizingColumn, resizeIndicatorX, cursorPosition, startResize, handleColumnClick: handleColumnClickWithResize, } = useColumnResize({
|
|
31
39
|
columns,
|
|
@@ -107,6 +107,6 @@ function ListItemWrapper(_a) {
|
|
|
107
107
|
renderSheetViewLoadingRow,
|
|
108
108
|
isLoadMoreLoading,
|
|
109
109
|
]);
|
|
110
|
-
return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({},
|
|
110
|
+
return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({}, style), { top: Number(style.top) - ((_b = renderedScrollTopRef === null || renderedScrollTopRef === void 0 ? void 0 : renderedScrollTopRef.current) !== null && _b !== void 0 ? _b : 0), willChange: 'top' }) }, { children: _jsx(StyledItemWrapper, Object.assign({ "data-testid": "ListItemWrapper_StyledItemWrapper", isSheetView: isSheetView }, { children: memoizedListItemComponent })) })));
|
|
111
111
|
}
|
|
112
112
|
export default ListItemWrapper;
|
package/package.json
CHANGED