@tap-payments/os-micro-frontend-shared 0.1.234 → 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({}, (!isSheetView && 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 })) })));
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;
@@ -3,6 +3,6 @@ export declare const TABLE_CONTENT_ROW_HEIGHT = 70;
3
3
  export declare const TABLE_ROW_HEIGHT = 57;
4
4
  export declare const TABLE_THRESHOLD = 200;
5
5
  export declare const TABLE_LIST_OVER_SCAN = 5;
6
- export declare const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 50;
6
+ export declare const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 40;
7
7
  export declare const SHEET_VIEW_TABLE_THRESHOLD = 20;
8
8
  export declare const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
@@ -3,6 +3,6 @@ export const TABLE_CONTENT_ROW_HEIGHT = 70;
3
3
  export const TABLE_ROW_HEIGHT = 57;
4
4
  export const TABLE_THRESHOLD = 200;
5
5
  export const TABLE_LIST_OVER_SCAN = 5;
6
- export const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 50;
6
+ export const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 40;
7
7
  export const SHEET_VIEW_TABLE_THRESHOLD = 20;
8
8
  export const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
package/package.json CHANGED
@@ -1,7 +1,7 @@
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",
4
+ "version": "0.1.236",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",