@tap-payments/os-micro-frontend-shared 0.1.22 → 0.1.24

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.
Files changed (102) hide show
  1. package/build/components/AccountDropdown/style.d.ts +1 -1
  2. package/build/components/ActivityAreaChart/styles.d.ts +3 -3
  3. package/build/components/AppServices/style.d.ts +1 -1
  4. package/build/components/CircularProgressWithLabel/style.d.ts +1 -1
  5. package/build/components/DockButton/style.d.ts +1 -1
  6. package/build/components/FileUpload/style.d.ts +2 -2
  7. package/build/components/FileUploader/style.d.ts +1 -1
  8. package/build/components/IconWithBadge/IconWithBadge.d.ts +1 -1
  9. package/build/components/IconWithBadge/IconWithBadge.js +2 -2
  10. package/build/components/IconWithBadge/type.d.ts +1 -0
  11. package/build/components/IconWithLabel/style.d.ts +1 -1
  12. package/build/components/IconsDropdown/style.d.ts +2 -2
  13. package/build/components/JSONViewer/style.d.ts +1 -1
  14. package/build/components/LabeledIconDropdown/style.d.ts +3 -3
  15. package/build/components/MultiSelectWithSearch/style.d.ts +3 -3
  16. package/build/components/NestedDropdown/styles.d.ts +1 -1
  17. package/build/components/ProgressBar/style.d.ts +1 -1
  18. package/build/components/ProgressRing/style.d.ts +2 -2
  19. package/build/components/RFH/Inputs/SelectWithAccordion/style.d.ts +3 -3
  20. package/build/components/SelectDropdown/style.d.ts +1 -1
  21. package/build/components/SelectWithSearch/style.d.ts +3 -3
  22. package/build/components/StatusBar/StatusBar.js +7 -12
  23. package/build/components/StatusBar/index.d.ts +1 -1
  24. package/build/components/StatusBar/type.d.ts +2 -7
  25. package/build/components/StatusBar/type.js +0 -6
  26. package/build/components/StatusLabel/style.d.ts +1 -1
  27. package/build/components/TableCells/CustomCells/AppsCell/AppsCell.js +3 -0
  28. package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.d.ts +1 -1
  29. package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.js +3 -8
  30. package/build/components/TableCells/CustomCells/BrandsCell/type.d.ts +1 -0
  31. package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +2 -2
  32. package/build/components/TableCells/CustomCells/EntityCell/EntityCell.d.ts +1 -1
  33. package/build/components/TableCells/CustomCells/EntityCell/EntityCell.js +2 -2
  34. package/build/components/TableCells/CustomCells/EntityCell/type.d.ts +1 -0
  35. package/build/components/TableCells/CustomCells/LeadStatusCell/LeadStatusCell.d.ts +2 -0
  36. package/build/components/TableCells/CustomCells/LeadStatusCell/LeadStatusCell.js +25 -0
  37. package/build/components/TableCells/CustomCells/LeadStatusCell/constant.d.ts +7 -0
  38. package/build/components/TableCells/CustomCells/LeadStatusCell/constant.js +8 -0
  39. package/build/components/TableCells/CustomCells/LeadStatusCell/index.d.ts +1 -0
  40. package/build/components/TableCells/CustomCells/LeadStatusCell/index.js +1 -0
  41. package/build/components/TableCells/CustomCells/LeadStatusCell/style.d.ts +2 -0
  42. package/build/components/TableCells/CustomCells/LeadStatusCell/style.js +12 -0
  43. package/build/components/TableCells/CustomCells/LeadStatusCell/type.d.ts +6 -0
  44. package/build/components/TableCells/CustomCells/index.d.ts +2 -0
  45. package/build/components/TableCells/CustomCells/index.js +2 -0
  46. package/build/components/TableHeader/style.d.ts +1 -1
  47. package/build/components/Timepicker/style.d.ts +2 -2
  48. package/build/components/ToolbarIcon/ExpandButton/style.d.ts +1 -1
  49. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.d.ts +1 -6
  50. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +59 -161
  51. package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.d.ts +5 -0
  52. package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.js +19 -0
  53. package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.d.ts +5 -0
  54. package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.js +15 -0
  55. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.d.ts +5 -0
  56. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.js +13 -0
  57. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.d.ts +5 -0
  58. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.js +20 -0
  59. package/build/components/VirtualTables/SheetViewVirtualTable/components/{SheetViewTableHeader/SheetViewTableHeader.d.ts → SheetViewTableHeader.d.ts} +1 -1
  60. package/build/components/VirtualTables/SheetViewVirtualTable/components/{SheetViewTableHeader/SheetViewTableHeader.js → SheetViewTableHeader.js} +3 -3
  61. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.d.ts +14 -0
  62. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +49 -0
  63. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.d.ts +44 -0
  64. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +33 -0
  65. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.d.ts +6 -0
  66. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.js +6 -0
  67. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.d.ts +6 -0
  68. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.js +6 -0
  69. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumnsWidths.d.ts +5 -0
  70. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumnsWidths.js +15 -0
  71. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableData.d.ts +20 -0
  72. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableData.js +40 -0
  73. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.d.ts +15 -0
  74. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +31 -0
  75. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +44 -0
  76. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +53 -0
  77. package/build/components/VirtualTables/SheetViewVirtualTable/index.d.ts +2 -0
  78. package/build/components/VirtualTables/SheetViewVirtualTable/index.js +2 -0
  79. package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +89 -0
  80. package/build/components/VirtualTables/SheetViewVirtualTable/types.js +1 -0
  81. package/build/components/VirtualTables/components/TableFooter/style.d.ts +2 -2
  82. package/build/components/VirtualTables/components/TableHeader/components/TableCell/TableCell.js +7 -5
  83. package/build/components/VirtualTables/components/TableRow.js +1 -1
  84. package/build/components/VirtualTables/components/style.d.ts +3 -0
  85. package/build/components/VirtualTables/components/style.js +6 -0
  86. package/build/components/Widget/style.d.ts +1 -1
  87. package/build/components/WindowAppIcon/style.d.ts +1 -1
  88. package/build/constants/assets.d.ts +5 -0
  89. package/build/constants/assets.js +5 -0
  90. package/build/utils/index.d.ts +1 -0
  91. package/build/utils/index.js +1 -0
  92. package/build/utils/style.d.ts +9 -0
  93. package/build/utils/style.js +62 -0
  94. package/package.json +1 -1
  95. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.d.ts +0 -14
  96. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.js +0 -46
  97. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/index.d.ts +0 -2
  98. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/index.js +0 -2
  99. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/type.d.ts +0 -19
  100. package/build/components/VirtualTables/utils/getSelectionStyles.d.ts +0 -55
  101. package/build/components/VirtualTables/utils/getSelectionStyles.js +0 -31
  102. /package/build/components/{VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader → TableCells/CustomCells/LeadStatusCell}/type.js +0 -0
@@ -1,188 +1,86 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
- import { useMemo, memo, useState, useCallback } from 'react';
12
- import { useTheme } from '@mui/material/styles';
13
- import memoize from 'memoize-one';
14
- import InfiniteLoader from 'react-window-infinite-loader';
15
- import AutoSizer from 'react-virtualized-auto-sizer';
16
- import { TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN } from '../../../constants/index.js';
17
- import { useDelayToSetValue } from '../../../hooks/index.js';
18
- import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../../utils/index.js';
2
+ import { memo, useCallback } from 'react';
3
+ import { TABLE_THRESHOLD } from '../../../constants/index.js';
19
4
  import TableFooter from '../components/TableFooter/TableFooter';
20
- import TableNoData from '../components/TableNoData';
21
- import ListItemWrapper from '../components/virtualScroll/ListItemWrapper';
22
- import { SheetViewTableContainer, StyledBox, StyledTableBox, StyledVirtualList, TableWrapper } from '../components/style';
23
- import { SheetViewVirtualTableWrapper, PinnedStartColumnWrapper, PinnedEndColumnWrapper, MainTableWrapper, UnpinnedTableHeaderWrapper } from './style';
24
- import SheetViewTableHeader from './components/SheetViewTableHeader';
25
- import { usePinnedColumns } from './hooks/usePinnedColumns';
26
- import { useSynchronizedScroll } from './hooks/useSynchronizedScroll';
27
- import SheetViewTableLoading from './components/SheetViewTableLoading';
28
- const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, onCellClick, containerHeight, rowHeight) => ({
29
- columns,
30
- isLoading,
31
- rows,
32
- rowProps,
33
- scrollToIndex,
34
- totalCount,
35
- lastItemIndex,
36
- isError,
37
- areAllRowsLoaded,
38
- limit: totalCount,
39
- newLoadedRowsEndIndex: lastItemIndex,
40
- isSheetView: true,
41
- isPinned,
42
- selectedCell,
43
- selectedColumn,
44
- onCellClick,
45
- containerHeight,
46
- rowHeight,
47
- }));
5
+ import { SheetViewTableContainer } from '../components/style';
6
+ import { SheetViewVirtualTableWrapper } from './style';
7
+ import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths } from './hooks';
8
+ import { PinnedColumn, MainTable, LoadingMainTable, NoDataView, VirtualTable } from './components';
48
9
  function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableTitle, dragControls, onColumnPin, clearBackdropVisibilityTimeout = 100, isPinnable = false, tableMode, }) {
49
- const theme = useTheme();
10
+ const { selectedCell, selectedColumn, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick } = useTableState();
11
+ const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
12
+ rows,
13
+ isLoading,
14
+ error,
15
+ isFetchingNextPage,
16
+ areAllRowsLoaded,
17
+ });
50
18
  const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(columns, isPinnable, onColumnPin);
51
19
  const { pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef, handleScroll } = useSynchronizedScroll();
52
- const [selectedCell, setSelectedCell] = useState(null);
53
- const [selectedColumn, setSelectedColumn] = useState(null);
54
- const handleCellClick = useCallback((rowIndex, columnIndex, event, pinnedType) => {
55
- event.stopPropagation();
56
- const cellKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${rowIndex}-${columnIndex}`;
57
- setSelectedCell((prev) => (prev === cellKey ? null : cellKey));
58
- setSelectedColumn(null);
59
- }, []);
60
- const handleColumnClick = useCallback((columnIndex, event, pinnedType) => {
61
- event.stopPropagation();
62
- const columnKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${columnIndex}`;
63
- setSelectedColumn((prev) => (prev === columnKey ? null : columnKey));
64
- setSelectedCell(null);
65
- }, []);
20
+ const { pinnedStartColumnsWidth, pinnedEndColumnsWidth } = usePinnedColumnsWidths(pinnedStartColumnsData, pinnedEndColumnsData);
21
+ const { getItemSize, getItemDataForContainer } = useVirtualTableContainer({
22
+ rowHeight,
23
+ areAllRowsLoaded,
24
+ rows,
25
+ isDelayedFetchingNextPage,
26
+ rowProps,
27
+ scrollToIndex,
28
+ footerProps,
29
+ isError,
30
+ selectedCell,
31
+ selectedColumn,
32
+ handleCellClick,
33
+ });
66
34
  const onPointerDown = (e) => {
67
35
  dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
68
36
  };
69
- const isDelayedFetchingNextPage = useDelayToSetValue({
70
- value: isFetchingNextPage,
71
- delay: 1000,
72
- });
73
- const [showBackDrop, setShowBackdrop] = useState(false);
74
- const isError = hasError(error);
75
- const tableLoading = isLoading !== null && isLoading !== void 0 ? isLoading : true;
76
- const tableError = !isLoading && rows.length === 0 && isError && !isNotFoundError(error);
77
- const tableEmpty = !isLoading && rows.length === 0;
78
- const hasTimeoutError = isTimeoutError(error);
79
- const lastItemIndex = rows.length - 1;
80
- const areTotalRowsNotFillingHeight = isHeightNotFullyFilledByRows(rows.length) && !tableLoading;
81
- const itemsCount = isDelayedFetchingNextPage || areAllRowsLoaded ? rows.length + 1 : rows.length;
82
- const createVirtualTableContainer = useCallback((columnsToRender, containerKey, isPinned = false, fixedWidth) => {
83
- const tableItemsCount = itemsCount;
84
- const handleOnLoadMoreItems = () => __awaiter(this, void 0, void 0, function* () {
85
- if (areAllRowsLoaded)
86
- return;
87
- yield (loadMoreItems === null || loadMoreItems === void 0 ? void 0 : loadMoreItems());
88
- });
37
+ const createVirtualTableContainer = useCallback((columnsData, containerKey, isPinned = false, fixedWidth) => {
89
38
  const listRef = containerKey === 'pinnedStart' ? pinnedStartVirtualListRef : containerKey === 'pinnedEnd' ? pinnedEndVirtualListRef : scrollableVirtualListRef;
90
39
  const handleScrollCallback = (scrollProps) => {
91
40
  const source = containerKey === 'pinnedStart' ? 'start' : containerKey === 'pinnedEnd' ? 'end' : 'scrollable';
92
41
  handleScroll(scrollProps, source);
93
42
  };
94
- return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: tableItemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered }) => (_jsx(AutoSizer, { children: ({ height, width }) => {
95
- var _a;
96
- const getItemSize = (index) => {
97
- const isLastRow = areAllRowsLoaded && index === rows.length;
98
- if (isLastRow) {
99
- const usedHeight = rows.length * rowHeight;
100
- const remainingHeight = height - usedHeight;
101
- const minimumLastRowHeight = rowHeight * 2;
102
- return Math.max(remainingHeight, minimumLastRowHeight);
103
- }
104
- return rowHeight;
105
- };
106
- const commonItemDataParams = [
107
- isDelayedFetchingNextPage,
108
- rows,
109
- rowProps,
110
- scrollToIndex,
111
- lastItemIndex,
112
- (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0,
113
- isError,
114
- areAllRowsLoaded,
115
- ];
116
- const commonItemDataSuffix = [selectedCell, selectedColumn, handleCellClick, height, rowHeight];
117
- const getItemDataForContainer = (columnsData, isPinnedColumn) => createItemData(columnsData, ...commonItemDataParams, isPinnedColumn, ...commonItemDataSuffix);
118
- const currentItemData = containerKey === 'pinnedStart'
119
- ? getItemDataForContainer(pinnedStartColumnsData, true)
120
- : containerKey === 'pinnedEnd'
121
- ? getItemDataForContainer(pinnedEndColumnsData, true)
122
- : getItemDataForContainer(unpinnedColumnsData, false);
123
- return (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: tableItemsCount, itemSize: getItemSize, itemData: currentItemData, onItemsRendered: onItemsRendered, overscanCount: TABLE_LIST_OVER_SCAN, setBackdropVisibility: setShowBackdrop, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: handleScrollCallback, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, style: {
124
- overflowX: isPinned ? 'hidden' : 'auto',
125
- paddingBottom: isPinned ? '25px' : '13px',
126
- backgroundColor: isPinned ? 'transparent' : '#F6F8FACC',
127
- } }, { children: ListItemWrapper })));
128
- } })) })));
43
+ return (_jsx(VirtualTable, { columnsData: columnsData, itemCount: itemsCount, lastItemIndex: lastItemIndex, areAllRowsLoaded: areAllRowsLoaded, loadMoreItems: loadMoreItems, threshold: threshold, getItemSize: getItemSize, getItemData: getItemDataForContainer, isPinned: isPinned, fixedWidth: fixedWidth, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, onScroll: handleScrollCallback, setBackdropVisibility: setShowBackdrop, listRef: listRef }));
129
44
  }, [
130
45
  itemsCount,
46
+ lastItemIndex,
131
47
  areAllRowsLoaded,
132
48
  loadMoreItems,
133
49
  threshold,
134
- rowHeight,
135
- rows,
136
- pinnedStartColumnsData,
137
- pinnedEndColumnsData,
138
- unpinnedColumnsData,
139
- isDelayedFetchingNextPage,
140
- rowProps,
50
+ getItemSize,
51
+ getItemDataForContainer,
141
52
  scrollToIndex,
142
- lastItemIndex,
143
- footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount,
144
- isError,
145
53
  areTotalRowsNotFillingHeight,
146
- selectedCell,
147
- selectedColumn,
148
- handleCellClick,
149
- handleScroll,
150
54
  clearBackdropVisibilityTimeout,
151
- pinnedEndVirtualListRef,
55
+ handleScroll,
56
+ setShowBackdrop,
152
57
  pinnedStartVirtualListRef,
58
+ pinnedEndVirtualListRef,
153
59
  scrollableVirtualListRef,
154
- theme.palette.background.default,
155
60
  ]);
156
- const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
157
- const pinnedStartColumnsWidth = useMemo(() => pinnedStartColumnsData.reduce((acc, col) => {
158
- const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
159
- return acc + width;
160
- }, 0.2), [pinnedStartColumnsData]);
161
- const pinnedEndColumnsWidth = useMemo(() => pinnedEndColumnsData.reduce((acc, col) => {
162
- const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
163
- return acc + width;
164
- }, 0.2), [pinnedEndColumnsData]);
165
- const renderPinnedColumn = (position, columnsData, columnsWidth, pinnedColumnsList) => {
166
- const Wrapper = position === 'start' ? PinnedStartColumnWrapper : PinnedEndColumnWrapper;
167
- const containerKey = position === 'start' ? 'pinnedStart' : 'pinnedEnd';
168
- if (columnsData.length === 0)
169
- return null;
170
- return (_jsx(Wrapper, { children: _jsxs(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: [showHeader && (_jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_PinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: columnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: pinnedColumnsList, onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick, tablePosition: position === 'start' ? 'pinnedStart' : 'pinnedEnd', hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
171
- width: '100%',
172
- minWidth: 'fit-content',
173
- overflowX: 'hidden',
174
- } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_PinnedStyledBox", hidePadding: true, className: "list-wrapper" }, { children: tableLoading ? (_jsx(SheetViewTableLoading, { "data-testid": `SheetViewVirtualTable_PinnedTableLoading_${position}`, columns: columnsData, isLoading: true, isPinned: true })) : (createVirtualTableContainer(columnsData, containerKey, true, columnsWidth)) })) }))] })) }));
61
+ const baseCommonProps = {
62
+ showHeader,
63
+ columnsSorting,
64
+ onColumnSort,
65
+ headerProps,
66
+ showBackDrop,
67
+ onColumnPin: handleColumnPin,
68
+ isPinnable,
69
+ lastColumnId,
70
+ selectedColumn,
71
+ onColumnClick: handleColumnClick,
72
+ tableTitle,
73
+ areAllRowsLoaded,
74
+ isFetchingNextPage,
75
+ scrollToIndex,
76
+ isLoading,
77
+ isError,
78
+ tableMode,
79
+ showNoDataView,
80
+ tableBodyStyles,
175
81
  };
176
- return (_jsxs(_Fragment, { children: [_jsx(SheetViewTableContainer, { children: showNoDataView ? (tableLoading ? (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox_Loading", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingTableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick, tablePosition: "scrollable", hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_LoadingTableWrapper", sx: {
177
- width: '100%',
178
- minWidth: 'fit-content',
179
- } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingStyledBox", hidePadding: true, className: "list-wrapper", sx: {
180
- height: '100%',
181
- display: 'flex',
182
- flexDirection: 'column',
183
- } }, { children: _jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: unpinnedColumnsData, isLoading: true, isPinned: false }) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })) : (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [], onColumnPin: handleColumnPin, isPinnable: false, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick }) })), _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps })] })) })))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick, tablePosition: "scrollable", hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
184
- width: '100%',
185
- minWidth: 'fit-content',
186
- } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })) }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
82
+ const commonPropsWithTableStates = Object.assign(Object.assign({}, baseCommonProps), { hasTimeoutError,
83
+ tableLoading });
84
+ return (_jsxs(_Fragment, { children: [_jsx(SheetViewTableContainer, { children: showNoDataView ? (tableLoading ? (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates))), _jsx(LoadingMainTable, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns }, commonPropsWithTableStates)), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)))] })) : (_jsx(NoDataView, Object.assign({ tableLoading: tableLoading, tableError: tableError, tableEmpty: tableEmpty, hasTimeoutError: hasTimeoutError, orderedColumns: orderedColumns, error: error, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }, baseCommonProps)))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates))), _jsx(MainTable, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)))] })) }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
187
85
  }
188
86
  export default memo(SheetViewVirtualTable);
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { LoadingMainTableProps } from '../types';
3
+ declare function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, }: LoadingMainTableProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof LoadingMainTable>;
5
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style';
5
+ import { MainTableWrapper, UnpinnedTableHeaderWrapper } from '../style';
6
+ import SheetViewTableHeader from './SheetViewTableHeader';
7
+ import SheetViewTableLoading from './SheetViewTableLoading';
8
+ function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, }) {
9
+ const theme = useTheme();
10
+ return (_jsx(MainTableWrapper, Object.assign({ hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox_Loading", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingTableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: "scrollable", hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_LoadingTableWrapper", sx: {
11
+ width: '100%',
12
+ minWidth: 'fit-content',
13
+ } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingStyledBox", hidePadding: true, className: "list-wrapper", sx: {
14
+ height: '100%',
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ } }, { children: _jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: unpinnedColumnsData, isLoading: true, isPinned: false }) })) }))] })) })) })));
18
+ }
19
+ export default memo(LoadingMainTable);
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { MainTableProps } from '../types';
3
+ declare function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, tableLoading, createVirtualTableContainer, }: MainTableProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof MainTable>;
5
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style';
5
+ import { MainTableWrapper, UnpinnedTableHeaderWrapper } from '../style';
6
+ import SheetViewTableHeader from './SheetViewTableHeader';
7
+ import SheetViewTableLoading from './SheetViewTableLoading';
8
+ function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, tableLoading, createVirtualTableContainer, }) {
9
+ const theme = useTheme();
10
+ return (_jsx(MainTableWrapper, Object.assign({ hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: "scrollable", hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
11
+ width: '100%',
12
+ minWidth: 'fit-content',
13
+ } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: tableLoading ? (_jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: unpinnedColumnsData, isLoading: true, isPinned: false })) : (createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false)) })) }))] })) })) })));
14
+ }
15
+ export default memo(MainTable);
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { NoDataViewProps } from '../types';
3
+ declare function NoDataView({ tableLoading, tableError, tableEmpty, hasTimeoutError, orderedColumns, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, tableMode, tableBodyStyles, error, triggerDataRefetch, footerProps, }: NoDataViewProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof NoDataView>;
5
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { StyledTableBox, TableWrapper } from '../../components/style';
5
+ import { UnpinnedTableHeaderWrapper } from '../style';
6
+ import TableNoData from '../../components/TableNoData';
7
+ import SheetViewTableHeader from './SheetViewTableHeader';
8
+ function NoDataView({ tableLoading, tableError, tableEmpty, hasTimeoutError, orderedColumns, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, tableMode, tableBodyStyles, error, triggerDataRefetch, footerProps, }) {
9
+ const theme = useTheme();
10
+ const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
11
+ return (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [], onColumnPin: onColumnPin, isPinnable: false, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick }) })), _jsx(TableNoData, { error: error || null, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch || (() => Promise.resolve()), footerProps: footerProps })] })) })));
12
+ }
13
+ export default memo(NoDataView);
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { PinnedColumnProps } from '../types';
3
+ declare function PinnedColumn({ position, columnsData, columnsWidth, pinnedColumnsList, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, hasPinnedStart, hasPinnedEnd, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableLoading, createVirtualTableContainer, }: PinnedColumnProps): import("react/jsx-runtime").JSX.Element | null;
4
+ declare const _default: import("react").MemoExoticComponent<typeof PinnedColumn>;
5
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style';
5
+ import { PinnedStartColumnWrapper, PinnedEndColumnWrapper } from '../style';
6
+ import SheetViewTableHeader from './SheetViewTableHeader';
7
+ import SheetViewTableLoading from './SheetViewTableLoading';
8
+ function PinnedColumn({ position, columnsData, columnsWidth, pinnedColumnsList, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, hasPinnedStart, hasPinnedEnd, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableLoading, createVirtualTableContainer, }) {
9
+ const theme = useTheme();
10
+ if (columnsData.length === 0)
11
+ return null;
12
+ const Wrapper = position === 'start' ? PinnedStartColumnWrapper : PinnedEndColumnWrapper;
13
+ const containerKey = position === 'start' ? 'pinnedStart' : 'pinnedEnd';
14
+ return (_jsx(Wrapper, { children: _jsxs(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: [showHeader && (_jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_PinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: columnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: pinnedColumnsList, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: position === 'start' ? 'pinnedStart' : 'pinnedEnd', hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
15
+ width: '100%',
16
+ minWidth: 'fit-content',
17
+ overflowX: 'hidden',
18
+ } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_PinnedStyledBox", hidePadding: true, className: "list-wrapper" }, { children: tableLoading ? (_jsx(SheetViewTableLoading, { "data-testid": `SheetViewVirtualTable_PinnedTableLoading_${position}`, columns: columnsData, isLoading: true, isPinned: true })) : (createVirtualTableContainer(columnsData, containerKey, true, columnsWidth)) })) }))] })) }));
19
+ }
20
+ export default memo(PinnedColumn);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SheetViewTableHeaderProps } from './type';
2
+ import { SheetViewTableHeaderProps } from '../types';
3
3
  declare function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, }: SheetViewTableHeaderProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableHeader>;
5
5
  export default _default;
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
- import { StyledHeader, StyledMUITableRow } from '../../style';
4
- import TableCell from './TableCell';
3
+ import { StyledHeader, StyledMUITableRow } from '../style';
4
+ import SheetViewTableHeaderCell from './SheetViewTableHeaderCell';
5
5
  function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns = [], onColumnPin, isPinnable = false, lastColumnId, selectedColumn = null, onColumnClick, }) {
6
6
  return (_jsx(StyledHeader, Object.assign({ component: "nav", "data-testid": "SheetViewVirtualTable_TableHeader_StyledHeader", showBackDrop: showBackDrop }, headerProps, { children: _jsx(StyledMUITableRow, Object.assign({ component: "section", "data-testid": "SheetViewVirtualTable_TableHeader_StyledMUITableRow" }, { children: columns.map((column, colIndex) => {
7
7
  var _a;
8
8
  const columnKey = `${(_a = column.pinned) !== null && _a !== void 0 ? _a : 'default'}-${colIndex}`;
9
- return (_jsx(TableCell, { column: column, colIndex: colIndex, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, isDefaultPinned: !!column.isDefaultPinned, isSelected: selectedColumn === columnKey, onColumnSort: onColumnSort, columnsSorting: columnsSorting, pinnedColumns: pinnedColumns, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, onColumnClick: onColumnClick }, `${column.id}-${colIndex}`));
9
+ return (_jsx(SheetViewTableHeaderCell, { column: column, colIndex: colIndex, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, isDefaultPinned: !!column.isDefaultPinned, isSelected: selectedColumn === columnKey, onColumnSort: onColumnSort, columnsSorting: columnsSorting, pinnedColumns: pinnedColumns, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, onColumnClick: onColumnClick }, `${column.id}-${colIndex}`));
10
10
  }) })) })));
11
11
  }
12
12
  export default memo(SheetViewTableHeader);
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import type { IColumnProps } from '../../../../types/index.js';
3
+ import { SheetViewTableHeaderProps } from '../types';
4
+ interface SheetViewTableHeaderCellProps extends Pick<SheetViewTableHeaderProps, 'onColumnSort' | 'columnsSorting' | 'onColumnPin' | 'isPinnable' | 'lastColumnId' | 'onColumnClick' | 'pinnedColumns'> {
5
+ column: IColumnProps;
6
+ colIndex: number;
7
+ isFirst: boolean;
8
+ isLast: boolean;
9
+ isSelected: boolean;
10
+ isDefaultPinned: boolean;
11
+ }
12
+ declare function SheetViewTableHeaderCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order, tableViewId, pinned }, colIndex, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }: SheetViewTableHeaderCellProps): import("react/jsx-runtime").JSX.Element;
13
+ declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableHeaderCell>;
14
+ export default _default;
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useCallback, useMemo, useRef, useState } from 'react';
3
+ import Box from '@mui/material/Box';
4
+ import { pinIcon, unpinIcon } from '../../../../constants/index.js';
5
+ import ColumnFilter from '../../components/ColumnFilter';
6
+ import { StyledCell, TableHeaderInner } from '../../components/style';
7
+ import { PinIconContainer, HeaderText } from '../style';
8
+ import ColumnSort from '../../components/ColumnSort';
9
+ function SheetViewTableHeaderCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order, tableViewId, pinned }, colIndex, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }) {
10
+ const [columnFilterEl, setColumnFilterEl] = useState(null);
11
+ const cellRef = useRef(null);
12
+ const checkIsPanned = useCallback((columnId) => pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.includes(columnId), [pinnedColumns]);
13
+ const isPinned = useMemo(() => checkIsPanned(id), [id, checkIsPanned]);
14
+ const handlePinClick = (columnId) => {
15
+ if (checkIsPanned(columnId)) {
16
+ onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId, 'unpin');
17
+ }
18
+ else {
19
+ if (columnId === lastColumnId) {
20
+ onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId, 'end');
21
+ }
22
+ else {
23
+ onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId, 'start');
24
+ }
25
+ }
26
+ };
27
+ const onOpenFilterDropdown = () => {
28
+ setColumnFilterEl(cellRef.current);
29
+ };
30
+ return (_jsx(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, "data-column-pinned": isPinned, isFirst: isFirst, isLast: isLast, isSheetView: true, ref: cellRef, onClick: (event) => {
31
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, event, pinned);
32
+ }, sx: (theme) => (Object.assign({ display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width, textAlign: align, overflow: 'unset', cursor: 'pointer', boxSizing: 'border-box', border: isSelected ? '1px solid #1F88D0' : '1px solid #F2F2F2', backgroundColor: isSelected ? '#F2F2F2' : '#FCFCFC', minHeight: isSelected ? '28px' : 'auto', position: 'relative', '&:before': {
33
+ content: '""',
34
+ border: isSelected ? '1px solid #1F88D0' : '1px solid transparent',
35
+ position: 'absolute',
36
+ top: 0,
37
+ right: 0,
38
+ left: 0,
39
+ bottom: 0,
40
+ } }, headerStyle)) }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: onOpenFilterDropdown }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && (_jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl, onClose: (event) => {
41
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, event, pinned);
42
+ } }))), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
43
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, e, pinned);
44
+ } })), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
45
+ event.stopPropagation();
46
+ handlePinClick(id);
47
+ }, title: isPinned ? 'Unpin column' : 'Pin column' }, { children: _jsx("img", { src: isPinned ? unpinIcon : pinIcon, alt: "pin-icon" }) })))] })) })));
48
+ }
49
+ export default memo(SheetViewTableHeaderCell);
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ import { ListOnScrollProps, VariableSizeList } from 'react-window';
3
+ import type { IColumnProps } from '../../../../types/index.js';
4
+ type VirtualTableItemData = {
5
+ columns: IColumnProps[];
6
+ isLoading: boolean;
7
+ rows: unknown[];
8
+ rowProps: unknown;
9
+ scrollToIndex?: number;
10
+ totalCount: number;
11
+ lastItemIndex: number;
12
+ isError: boolean;
13
+ areAllRowsLoaded: boolean;
14
+ limit: number;
15
+ newLoadedRowsEndIndex: number;
16
+ isSheetView: boolean;
17
+ isPinned: boolean;
18
+ selectedCell: string | null;
19
+ selectedColumn: string | null;
20
+ onCellClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
21
+ containerHeight: number;
22
+ rowHeight: number;
23
+ };
24
+ interface VirtualTableProps {
25
+ columnsData: IColumnProps[];
26
+ itemCount: number;
27
+ lastItemIndex: number;
28
+ areAllRowsLoaded?: boolean;
29
+ loadMoreItems?: () => Promise<unknown>;
30
+ threshold: number;
31
+ getItemSize: (index: number, height: number) => number;
32
+ getItemData: (columnsData: IColumnProps[], isPinned: boolean, height: number) => VirtualTableItemData;
33
+ isPinned: boolean;
34
+ fixedWidth?: number;
35
+ scrollToIndex?: number;
36
+ areTotalRowsNotFillingHeight: boolean;
37
+ clearBackdropVisibilityTimeout: number;
38
+ onScroll?: (scrollProps: ListOnScrollProps) => void;
39
+ setBackdropVisibility: (visible: boolean) => void;
40
+ listRef: React.RefObject<VariableSizeList>;
41
+ }
42
+ declare function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, }: VirtualTableProps): import("react/jsx-runtime").JSX.Element;
43
+ declare const _default: import("react").MemoExoticComponent<typeof VirtualTable>;
44
+ export default _default;
@@ -0,0 +1,33 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { memo } from 'react';
12
+ import InfiniteLoader from 'react-window-infinite-loader';
13
+ import AutoSizer from 'react-virtualized-auto-sizer';
14
+ import { TABLE_LIST_OVER_SCAN } from '../../../../constants/index.js';
15
+ import ListItemWrapper from '../../components/virtualScroll/ListItemWrapper';
16
+ import { StyledVirtualList } from '../../components/style';
17
+ function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, }) {
18
+ const handleOnLoadMoreItems = () => __awaiter(this, void 0, void 0, function* () {
19
+ if (areAllRowsLoaded)
20
+ return;
21
+ yield (loadMoreItems === null || loadMoreItems === void 0 ? void 0 : loadMoreItems());
22
+ });
23
+ return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: itemCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered, ref }) => (_jsx(AutoSizer, Object.assign({ ref: ref }, { children: ({ height, width }) => {
24
+ const itemSize = (index) => getItemSize(index, height);
25
+ const itemData = getItemData(columnsData, isPinned, height);
26
+ return (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: itemCount, itemSize: itemSize, itemData: itemData, onItemsRendered: onItemsRendered, overscanCount: TABLE_LIST_OVER_SCAN, setBackdropVisibility: setBackdropVisibility, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: onScroll, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, style: {
27
+ overflowX: isPinned ? 'hidden' : 'auto',
28
+ paddingBottom: isPinned ? '25px' : '13px',
29
+ backgroundColor: isPinned ? 'transparent' : '#F6F8FACC',
30
+ } }, { children: ListItemWrapper })));
31
+ } }))) })));
32
+ }
33
+ export default memo(VirtualTable);
@@ -1,3 +1,9 @@
1
1
  export { default as SheetViewTableLoading } from './SheetViewTableLoading';
2
2
  export { default as SheetViewTableRowLoading } from './SheetViewTableRowLoading';
3
3
  export { default as SheetViewTableNoData } from './SheetViewTableNoData';
4
+ export { default as SheetViewTableHeader } from './SheetViewTableHeader';
5
+ export { default as VirtualTable } from './VirtualTable';
6
+ export { default as PinnedColumn } from './PinnedColumn';
7
+ export { default as MainTable } from './MainTable';
8
+ export { default as LoadingMainTable } from './LoadingMainTable';
9
+ export { default as NoDataView } from './NoDataView';
@@ -1,3 +1,9 @@
1
1
  export { default as SheetViewTableLoading } from './SheetViewTableLoading';
2
2
  export { default as SheetViewTableRowLoading } from './SheetViewTableRowLoading';
3
3
  export { default as SheetViewTableNoData } from './SheetViewTableNoData';
4
+ export { default as SheetViewTableHeader } from './SheetViewTableHeader';
5
+ export { default as VirtualTable } from './VirtualTable';
6
+ export { default as PinnedColumn } from './PinnedColumn';
7
+ export { default as MainTable } from './MainTable';
8
+ export { default as LoadingMainTable } from './LoadingMainTable';
9
+ export { default as NoDataView } from './NoDataView';
@@ -0,0 +1,6 @@
1
+ export { usePinnedColumns } from './usePinnedColumns';
2
+ export { useSynchronizedScroll } from './useSynchronizedScroll';
3
+ export { useTableState } from './useTableState';
4
+ export { useTableData } from './useTableData';
5
+ export { useVirtualTableContainer } from './useVirtualTableContainer';
6
+ export { usePinnedColumnsWidths } from './usePinnedColumnsWidths';
@@ -0,0 +1,6 @@
1
+ export { usePinnedColumns } from './usePinnedColumns';
2
+ export { useSynchronizedScroll } from './useSynchronizedScroll';
3
+ export { useTableState } from './useTableState';
4
+ export { useTableData } from './useTableData';
5
+ export { useVirtualTableContainer } from './useVirtualTableContainer';
6
+ export { usePinnedColumnsWidths } from './usePinnedColumnsWidths';