@tap-payments/os-micro-frontend-shared 0.1.234-test.1-test.2-test.3-test.4 → 0.1.234-test.1-test.2-test.3-test.4-test.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.
@@ -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,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.234-test.1-test.2-test.3-test.4",
5
- "testVersion": 4,
4
+ "version": "0.1.234-test.1-test.2-test.3-test.4-test.5",
5
+ "testVersion": 5,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",