@tap-payments/os-micro-frontend-shared 0.0.74 → 0.0.75-pin-icon-v13
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/VirtualTable/SheetViewVirtualTable.d.ts +9 -0
- package/build/components/VirtualTable/SheetViewVirtualTable.js +163 -0
- package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +8 -3
- package/build/components/VirtualTable/components/SheetViewTableHeader.d.ts +24 -0
- package/build/components/VirtualTable/components/SheetViewTableHeader.js +99 -0
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.d.ts +1 -1
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.js +6 -2
- package/build/components/VirtualTable/components/virtualScroll/VirtualScrollList.d.ts +4 -5
- package/build/components/VirtualTable/components/virtualScroll/VirtualScrollList.js +3 -3
- package/build/components/VirtualTable/style.d.ts +1 -1
- package/build/components/VirtualTable/style.js +3 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/constants/assets.d.ts +3 -1
- package/build/constants/assets.js +199 -197
- package/build/types/table.d.ts +2 -0
- package/package.json +129 -129
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IVirtualTable } from '../../types/index.js';
|
|
3
|
+
interface ISheetViewVirtualTable extends Omit<IVirtualTable, 'isSheetView'> {
|
|
4
|
+
onColumnPin?: (columnId: string, isPinned: boolean) => void;
|
|
5
|
+
isPinnable?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function SheetViewVirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, rowHeight, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, showBackgroundColor, areAllRowsLoaded, tableBodyStyles, tableMode, tableTitle, dragControls, onColumnPin, isPinnable, }: Readonly<ISheetViewVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof SheetViewVirtualTable>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,163 @@
|
|
|
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
import { useMemo, memo, useState, useCallback, useRef } 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 { TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN, TABLE_ROW_HEIGHT } from '../../constants/index.js';
|
|
16
|
+
import { useDelayToSetValue } from '../../hooks/index.js';
|
|
17
|
+
import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../utils/index.js';
|
|
18
|
+
import TableFooter from './components/TableFooter/TableFooter';
|
|
19
|
+
import TableLastItem from './components/TableLastItem';
|
|
20
|
+
import TableNoData from './components/TableNoData';
|
|
21
|
+
import ListItemWrapper from './components/virtualScroll/ListItemWrapper';
|
|
22
|
+
import { StyledBox, StyledTableBox, StyledVirtualList, TableContainer, TableWrapper } from './style';
|
|
23
|
+
import SheetViewTableHeader from './components/SheetViewTableHeader';
|
|
24
|
+
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
25
|
+
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned) => ({
|
|
26
|
+
columns,
|
|
27
|
+
isLoading,
|
|
28
|
+
rows,
|
|
29
|
+
rowProps,
|
|
30
|
+
scrollToIndex,
|
|
31
|
+
totalCount,
|
|
32
|
+
lastItemIndex,
|
|
33
|
+
isError,
|
|
34
|
+
areAllRowsLoaded,
|
|
35
|
+
limit: totalCount,
|
|
36
|
+
newLoadedRowsEndIndex: lastItemIndex,
|
|
37
|
+
isSheetView: true,
|
|
38
|
+
isPinned,
|
|
39
|
+
}));
|
|
40
|
+
function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, showBackgroundColor, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, dragControls, onColumnPin, isPinnable = false, }) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
const [internalPinnedColumns, setInternalPinnedColumns] = useState(() => isPinnable ? columns.filter((c) => c.pinned).map((c) => c.id) : []);
|
|
44
|
+
const pinnedVirtualListRef = useRef(null);
|
|
45
|
+
const scrollableVirtualListRef = useRef(null);
|
|
46
|
+
const onPointerDown = (e) => {
|
|
47
|
+
dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
|
|
48
|
+
};
|
|
49
|
+
const isDelayedFetchingNextPage = useDelayToSetValue({
|
|
50
|
+
value: isFetchingNextPage,
|
|
51
|
+
delay: 1000,
|
|
52
|
+
});
|
|
53
|
+
const [showBackDrop, setShowBackdrop] = useState(false);
|
|
54
|
+
const isError = hasError(error);
|
|
55
|
+
const tableLoading = isLoading !== null && isLoading !== void 0 ? isLoading : true;
|
|
56
|
+
const tableError = !isLoading && rows.length === 0 && isError && !isNotFoundError(error);
|
|
57
|
+
const tableEmpty = !isLoading && rows.length === 0;
|
|
58
|
+
const hasTimeoutError = isTimeoutError(error);
|
|
59
|
+
const lastItemIndex = rows.length - 1;
|
|
60
|
+
const shownColumns = useMemo(() => columns.filter((column) => !column.hidden), [columns]);
|
|
61
|
+
const { pinnedColumnsData, unpinnedColumnsData } = useMemo(() => {
|
|
62
|
+
const pinned = shownColumns.filter((column) => internalPinnedColumns.includes(column.id));
|
|
63
|
+
const unpinned = shownColumns.filter((column) => !internalPinnedColumns.includes(column.id));
|
|
64
|
+
const sortedPinned = pinned.sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.order) !== null && _a !== void 0 ? _a : 1000000) - ((_b = b === null || b === void 0 ? void 0 : b.order) !== null && _b !== void 0 ? _b : 1000000); });
|
|
65
|
+
const sortedUnpinned = unpinned.sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.order) !== null && _a !== void 0 ? _a : 1000000) - ((_b = b === null || b === void 0 ? void 0 : b.order) !== null && _b !== void 0 ? _b : 1000000); });
|
|
66
|
+
return {
|
|
67
|
+
pinnedColumnsData: sortedPinned,
|
|
68
|
+
unpinnedColumnsData: sortedUnpinned,
|
|
69
|
+
};
|
|
70
|
+
}, [shownColumns, internalPinnedColumns]);
|
|
71
|
+
const orderedColumns = useMemo(() => [...pinnedColumnsData, ...unpinnedColumnsData], [pinnedColumnsData, unpinnedColumnsData]);
|
|
72
|
+
const areTotalRowsNotFillingHeight = isHeightNotFullyFilledByRows(rows.length) && !tableLoading;
|
|
73
|
+
const itemsCount = isDelayedFetchingNextPage || (areAllRowsLoaded && !areTotalRowsNotFillingHeight) ? rows.length + 1 : rows.length;
|
|
74
|
+
const pinnedItemData = createItemData(pinnedColumnsData, isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, lastItemIndex, (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0, isError, areAllRowsLoaded && !areTotalRowsNotFillingHeight, true);
|
|
75
|
+
const unpinnedItemData = createItemData(unpinnedColumnsData, isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, lastItemIndex, (_b = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _b !== void 0 ? _b : 0, isError, areAllRowsLoaded && !areTotalRowsNotFillingHeight, false);
|
|
76
|
+
const handleColumnPin = useCallback((columnId) => {
|
|
77
|
+
if (!isPinnable)
|
|
78
|
+
return;
|
|
79
|
+
const newPinnedColumns = internalPinnedColumns.includes(columnId)
|
|
80
|
+
? internalPinnedColumns.filter((id) => id !== columnId)
|
|
81
|
+
: [...internalPinnedColumns, columnId];
|
|
82
|
+
setInternalPinnedColumns(newPinnedColumns);
|
|
83
|
+
onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId, !internalPinnedColumns.includes(columnId));
|
|
84
|
+
}, [internalPinnedColumns, onColumnPin, isPinnable]);
|
|
85
|
+
const handleScrollableScroll = useCallback(({ scrollOffset }) => {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
(_a = scrollableVirtualListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(scrollOffset);
|
|
88
|
+
(_b = pinnedVirtualListRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo(scrollOffset);
|
|
89
|
+
}, [pinnedVirtualListRef]);
|
|
90
|
+
const handlePinnedScroll = useCallback(({ scrollOffset }) => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
(_a = scrollableVirtualListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(scrollOffset);
|
|
93
|
+
(_b = pinnedVirtualListRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo(scrollOffset);
|
|
94
|
+
}, [scrollableVirtualListRef]);
|
|
95
|
+
const createVirtualTableContainer = useCallback((columnsToRender, containerKey, isPinned = false, fixedWidth) => {
|
|
96
|
+
const tableItemsCount = itemsCount;
|
|
97
|
+
const handleOnLoadMoreItems = () => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (areAllRowsLoaded)
|
|
99
|
+
return;
|
|
100
|
+
yield (loadMoreItems === null || loadMoreItems === void 0 ? void 0 : loadMoreItems());
|
|
101
|
+
});
|
|
102
|
+
const currentItemData = isPinned ? pinnedItemData : unpinnedItemData;
|
|
103
|
+
return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: tableItemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered }) => (_jsx(AutoSizer, { children: ({ height, width }) => (_jsx(StyledVirtualList, Object.assign({ listRef: isPinned ? pinnedVirtualListRef : scrollableVirtualListRef, height: height, width: fixedWidth || width, itemCount: tableItemsCount, itemSize: () => rowHeight, itemData: currentItemData, onItemsRendered: onItemsRendered, overscanCount: TABLE_LIST_OVER_SCAN, setBackdropVisibility: setShowBackdrop, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: isPinned ? handlePinnedScroll : handleScrollableScroll, style: {
|
|
104
|
+
overflowX: isPinned ? 'hidden' : 'auto',
|
|
105
|
+
} }, { children: ListItemWrapper }))) })) })));
|
|
106
|
+
}, [
|
|
107
|
+
itemsCount,
|
|
108
|
+
rows.length,
|
|
109
|
+
areAllRowsLoaded,
|
|
110
|
+
loadMoreItems,
|
|
111
|
+
threshold,
|
|
112
|
+
rowHeight,
|
|
113
|
+
pinnedItemData,
|
|
114
|
+
unpinnedItemData,
|
|
115
|
+
handlePinnedScroll,
|
|
116
|
+
handleScrollableScroll,
|
|
117
|
+
pinnedVirtualListRef,
|
|
118
|
+
scrollableVirtualListRef,
|
|
119
|
+
]);
|
|
120
|
+
const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
|
|
121
|
+
const pinnedColumnsWidth = pinnedColumnsData.reduce((acc, col) => {
|
|
122
|
+
const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
|
|
123
|
+
return acc + width;
|
|
124
|
+
}, 0);
|
|
125
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [showNoDataView ? (_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-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsx(TableWrapper, Object.assign({ isSheetView: true, "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) }))) : (_jsxs("div", Object.assign({ style: {
|
|
126
|
+
display: 'flex',
|
|
127
|
+
width: '100%',
|
|
128
|
+
height: '100%',
|
|
129
|
+
overflow: 'hidden',
|
|
130
|
+
} }, { children: [pinnedColumnsData.length > 0 && (_jsx("div", Object.assign({ style: {
|
|
131
|
+
width: `${pinnedColumnsWidth}px`,
|
|
132
|
+
zIndex: 10,
|
|
133
|
+
flex: '0 0 auto',
|
|
134
|
+
minWidth: 0,
|
|
135
|
+
display: 'flex',
|
|
136
|
+
flexDirection: 'column',
|
|
137
|
+
position: 'relative',
|
|
138
|
+
marginLeft: '32px',
|
|
139
|
+
boxShadow: '4px 0px 24px 0px #00000014',
|
|
140
|
+
backgroundColor: theme.palette.primary.light,
|
|
141
|
+
border: '1px solid #F2F2F2',
|
|
142
|
+
} }, { 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-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: [showHeader && (_jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_PinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: pinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: internalPinnedColumns, onColumnPin: handleColumnPin, isPinnable: isPinnable })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
143
|
+
width: '100%',
|
|
144
|
+
minWidth: 'fit-content',
|
|
145
|
+
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_PinnedStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(pinnedColumnsData, 'pinned', true, pinnedColumnsWidth) })) }))] })) }))), _jsx("div", Object.assign({ style: {
|
|
146
|
+
flex: '1 1 auto',
|
|
147
|
+
minWidth: 0,
|
|
148
|
+
display: 'flex',
|
|
149
|
+
flexDirection: 'column',
|
|
150
|
+
marginRight: '32px',
|
|
151
|
+
border: '1px solid #F2F2F2',
|
|
152
|
+
marginLeft: pinnedColumnsData.length < 1 ? '32px' : '0',
|
|
153
|
+
position: 'relative',
|
|
154
|
+
} }, { 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-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { 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("div", Object.assign({ style: {
|
|
155
|
+
flexShrink: 0,
|
|
156
|
+
borderBottom: '1px solid #E0E0E0',
|
|
157
|
+
height: 'auto',
|
|
158
|
+
} }, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: internalPinnedColumns, onColumnPin: handleColumnPin, isPinnable: isPinnable }) }))), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
159
|
+
width: '100%',
|
|
160
|
+
minWidth: 'fit-content',
|
|
161
|
+
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) }))] }))), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) * TABLE_ROW_HEIGHT, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, "data-testid": "SheetViewVirtualTable_TableLastItem" }))] }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
162
|
+
}
|
|
163
|
+
export default memo(SheetViewVirtualTable);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import Collapse from '@mui/material/Collapse';
|
|
5
5
|
import lodashValues from 'lodash/values';
|
|
@@ -38,10 +38,15 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
|
|
|
38
38
|
const isAnyInputWithValue = Object.entries(values).some(([inputKey, val]) => { var _a; return Boolean(val) && (((_a = getFilterByApiKey(inputKey)) === null || _a === void 0 ? void 0 : _a.filterGroup) !== filterGroup || !filterGroup); });
|
|
39
39
|
return isOnlyOneFilter && !inputWithValue && isAnyInputWithValue;
|
|
40
40
|
}, [options, values, isOnlyOneFilter]);
|
|
41
|
-
return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, render }) =>
|
|
41
|
+
return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, render }) => {
|
|
42
|
+
if (render) {
|
|
43
|
+
return render();
|
|
44
|
+
}
|
|
45
|
+
return (_jsx(InputStyled, { className: "input", "data-testid": "ColumnFilterInputs_InputStyled", name: apiKey, placeholder: placeholder, onChange: (e) => {
|
|
42
46
|
setValues(Object.assign(Object.assign({}, values), { [apiKey]: e.target.value }));
|
|
43
47
|
}, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey), inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue(apiKey) ? 'close' : 'search', src: isInputHasValue(apiKey) ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue(apiKey) ? 'pointer' : 'default' }, onClick: () => {
|
|
44
48
|
onClickResetInput(apiKey);
|
|
45
|
-
} }) }
|
|
49
|
+
} }) }, apiKey));
|
|
50
|
+
}) })), _jsx(Collapse, Object.assign({ in: showClearButton, component: "section", "data-testid": "ColumnFilterInputs_Collapse" }, { children: _jsx(ClearWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_ClearWrapper" }, { children: _jsx(ClearButton, Object.assign({ type: "button", onClick: onClickClear, "data-testid": "ColumnFilterInputs_ClearButton" }, { children: t('clear') })) })) })), _jsxs(Footer, Object.assign({ component: "footer", "data-testid": "ColumnFilterInputs_footer" }, { children: [_jsx(CancelButton, Object.assign({ type: "button", onClick: onClickCancel, "data-testid": "ColumnFilterInputs_CancelButton" }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ type: "button", onClick: onClickOkay, "data-testid": "ColumnFilterInputs_OkayButton" }, { children: t('okay') }))] }))] })));
|
|
46
51
|
}
|
|
47
52
|
export default Inputs;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type TableHeadProps } from '@mui/material';
|
|
3
|
+
import type { IColumnProps, IVirtualTable } from '../../../types/index.js';
|
|
4
|
+
export declare const ActionIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
|
+
export declare const ColumnIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
6
|
+
interface StyledHeaderProps {
|
|
7
|
+
showBackDrop: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledHeader: import("@emotion/styled").StyledComponent<import("@mui/material").TableHeadOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
|
|
11
|
+
}, "className" | "style" | "classes" | "children" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & StyledHeaderProps, {}, {}>;
|
|
12
|
+
interface SheetViewTableHeaderProps {
|
|
13
|
+
columns: IColumnProps[];
|
|
14
|
+
headerProps?: TableHeadProps;
|
|
15
|
+
columnsSorting?: IVirtualTable['columnsSorting'];
|
|
16
|
+
onColumnSort?: IVirtualTable['onColumnSort'];
|
|
17
|
+
showBackDrop: boolean;
|
|
18
|
+
pinnedColumns?: string[];
|
|
19
|
+
onColumnPin?: (columnId: string) => void;
|
|
20
|
+
isPinnable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns, onColumnPin, isPinnable, }: SheetViewTableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableHeader>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useState } from 'react';
|
|
3
|
+
import { Box, styled, useTheme } from '@mui/material';
|
|
4
|
+
import TableHead from '@mui/material/TableHead';
|
|
5
|
+
import MUITableRow from '@mui/material/TableRow';
|
|
6
|
+
import Dropdown from '../../DropdownMenu';
|
|
7
|
+
import { columnIcon, pinIcon, sortAzIcon, sortZaIcon, unpinIcon } from '../../../constants/index.js';
|
|
8
|
+
import ColumnFilter from './ColumnFilter';
|
|
9
|
+
import { StyledCell } from '../style';
|
|
10
|
+
export const ActionIcon = styled('img')(() => ({
|
|
11
|
+
width: '13.3px',
|
|
12
|
+
height: '13.3px',
|
|
13
|
+
}));
|
|
14
|
+
export const ColumnIcon = styled('img')(() => ({
|
|
15
|
+
width: '8px',
|
|
16
|
+
height: '6.4px',
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
}));
|
|
19
|
+
const PinIcon = styled('div')(({ theme, isPinned }) => ({
|
|
20
|
+
width: '16px',
|
|
21
|
+
height: 'auto',
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
borderRadius: '2px',
|
|
27
|
+
padding: '2px',
|
|
28
|
+
transition: 'all 0.2s ease',
|
|
29
|
+
}));
|
|
30
|
+
export const StyledHeader = styled(TableHead, {
|
|
31
|
+
shouldForwardProp: (prop) => prop !== 'showBackDrop',
|
|
32
|
+
})(({ showBackDrop, theme }) => ({
|
|
33
|
+
width: '100%',
|
|
34
|
+
minWidth: 'fit-content',
|
|
35
|
+
flex: '0 0 auto',
|
|
36
|
+
boxShadow: showBackDrop ? theme.shadows[23] : 'none',
|
|
37
|
+
backgroundColor: theme.palette.background.default,
|
|
38
|
+
zIndex: 1,
|
|
39
|
+
}));
|
|
40
|
+
const StyledMUITableRow = styled(MUITableRow)(({ theme }) => ({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
justifyContent: 'flex-start',
|
|
43
|
+
width: '100%',
|
|
44
|
+
minWidth: 'fit-content',
|
|
45
|
+
height: '28px',
|
|
46
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
47
|
+
backgroundColor: theme.palette.primary.light,
|
|
48
|
+
}));
|
|
49
|
+
function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns = [], onColumnPin, isPinnable = false, }) {
|
|
50
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
51
|
+
const open = Boolean(anchorEl);
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
const handleClick = (event) => {
|
|
54
|
+
setAnchorEl(event.currentTarget);
|
|
55
|
+
};
|
|
56
|
+
const handleClose = () => {
|
|
57
|
+
setAnchorEl(null);
|
|
58
|
+
};
|
|
59
|
+
const handleSortingOption = (columnId, order) => {
|
|
60
|
+
if (columnId) {
|
|
61
|
+
onColumnSort === null || onColumnSort === void 0 ? void 0 : onColumnSort({
|
|
62
|
+
[columnId]: order,
|
|
63
|
+
});
|
|
64
|
+
handleClose();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const handlePinClick = (columnId, event) => {
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId);
|
|
70
|
+
};
|
|
71
|
+
const PinSVG = ({ isPinned }) => (_jsx("svg", Object.assign({ width: "12", height: "12", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z", fill: "currentColor" }) })));
|
|
72
|
+
return (_jsxs(StyledHeader, Object.assign({ component: "nav", "data-testid": "SheetViewVirtualTable_TableHeader_StyledHeader", showBackDrop: showBackDrop }, headerProps, { sx: Object.assign({ width: '100%', minWidth: 'auto', overflowX: 'scroll' }, headerProps === null || headerProps === void 0 ? void 0 : headerProps.sx) }, { children: [_jsx(StyledMUITableRow, Object.assign({ component: "section", "data-testid": "SheetViewVirtualTable_TableHeader_StyledMUITableRow" }, { children: columns.map((column, colIndex) => {
|
|
73
|
+
const { header, id, align, headerStyle, sortable, filter, pinnable } = column;
|
|
74
|
+
const isFirst = id === columns[0].id;
|
|
75
|
+
const isLast = id === columns[columns.length - 1].id;
|
|
76
|
+
const isPinned = pinnedColumns.includes(id);
|
|
77
|
+
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, "data-column-pinned": isPinned, isFirst: isFirst, isLast: isLast, isSheetView: true, sx: Object.assign({ display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: column.width, textAlign: align, overflow: 'unset' }, headerStyle) }, { 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("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter)), sortable && _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id }), isPinnable && pinnable && (_jsx(PinIcon, Object.assign({ isPinned: isPinned, onClick: (event) => handlePinClick(id, event), title: isPinned ? 'Unpin column' : 'Pin column' }, { children: _jsx("img", { src: isPinned ? unpinIcon : pinIcon, alt: "pin-icon" }) })))] }), `${id}-${colIndex}`));
|
|
78
|
+
}) })), _jsx(Dropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: [
|
|
79
|
+
{
|
|
80
|
+
label: 'Sort A-Z',
|
|
81
|
+
name: 'asc',
|
|
82
|
+
icon: _jsx(ActionIcon, { src: sortAzIcon, alt: "sort-icon" }),
|
|
83
|
+
selected: (columnsSorting === null || columnsSorting === void 0 ? void 0 : columnsSorting[(anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.dataset.id) || '']) === 'asc',
|
|
84
|
+
onClick: () => {
|
|
85
|
+
handleSortingOption(anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.dataset.id, 'asc');
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'Sort Z-A',
|
|
90
|
+
name: 'desc',
|
|
91
|
+
icon: _jsx(ActionIcon, { src: sortZaIcon, alt: "sort-icon" }),
|
|
92
|
+
selected: (columnsSorting === null || columnsSorting === void 0 ? void 0 : columnsSorting[(anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.dataset.id) || '']) === 'desc',
|
|
93
|
+
onClick: () => {
|
|
94
|
+
handleSortingOption(anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.dataset.id, 'desc');
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
] })] })));
|
|
98
|
+
}
|
|
99
|
+
export default memo(SheetViewTableHeader);
|
|
@@ -6,5 +6,5 @@ export declare const LastRowContent: React.MemoExoticComponent<({ isLoadingRow }
|
|
|
6
6
|
export declare const StyledItemWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
7
7
|
showShadowHighlight?: boolean | undefined;
|
|
8
8
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
-
declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default ListItemWrapper;
|
|
@@ -44,7 +44,8 @@ export const StyledItemWrapper = styled('div', {
|
|
|
44
44
|
height: '100%',
|
|
45
45
|
}));
|
|
46
46
|
function ListItemWrapper(_a) {
|
|
47
|
-
var
|
|
47
|
+
var _b;
|
|
48
|
+
var { index, style } = _a, _c = _a.data, { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned = false } = _c, restData = __rest(_c, ["renderedScrollTopRef", "rows", "rowProps", "columns", "isLoading", "scrollToIndex", "limit", "totalCount", "newLoadedRowsEndIndex", "isError", "areAllRowsLoaded", "isSheetView", "isPinned"]);
|
|
48
49
|
const lastItemIndex = rows.length - 1;
|
|
49
50
|
const row = rows[index];
|
|
50
51
|
const isLoadingRow = isLoading && index === lastItemIndex + 1;
|
|
@@ -54,6 +55,9 @@ function ListItemWrapper(_a) {
|
|
|
54
55
|
const memoizedListItemComponent = React.useMemo(() => {
|
|
55
56
|
const lastRowContent = _jsx(LastRowContent, { isLoadingRow: isLoadingRow });
|
|
56
57
|
const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
|
|
58
|
+
if (isPinned && isLastRow) {
|
|
59
|
+
return _jsx(Box, { sx: { height: isSheetView ? SHEET_VIEW_TABLE_ROW_HEIGHT : TABLE_ROW_HEIGHT, backgroundColor: '#F6F8FACC' } });
|
|
60
|
+
}
|
|
57
61
|
if (isLastRow) {
|
|
58
62
|
return (_jsx(Box, Object.assign({ sx: {
|
|
59
63
|
height: isSheetView ? SHEET_VIEW_TABLE_ROW_HEIGHT : TABLE_ROW_HEIGHT,
|
|
@@ -71,6 +75,6 @@ function ListItemWrapper(_a) {
|
|
|
71
75
|
}
|
|
72
76
|
return _jsx(TableRow, { index: index, row: row, columns: columns, rowProps: memoizedRowProps, isSheetView: isSheetView }, `row-${index}`);
|
|
73
77
|
}, [restData, index, row, columns, memoizedRowProps, isSheetView]);
|
|
74
|
-
return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({}, style), { top: Number(style.top) - renderedScrollTopRef.current, willChange: 'top' }) }, { children: _jsx(StyledItemWrapper, Object.assign({ "data-testid": "ListItemWrapper_StyledItemWrapper" }, { children: memoizedListItemComponent })) })));
|
|
78
|
+
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" }, { children: memoizedListItemComponent })) })));
|
|
75
79
|
}
|
|
76
80
|
export default ListItemWrapper;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { VariableSizeList, VariableSizeListProps } from 'react-window';
|
|
3
|
-
|
|
3
|
+
declare const VirtualScrollList: React.ForwardRefExoticComponent<VariableSizeListProps<any> & {
|
|
4
4
|
setBackdropVisibility: (isVisible: boolean) => void;
|
|
5
|
-
scrollToIndex?: number;
|
|
6
|
-
listRef?: React.RefObject<VariableSizeList
|
|
7
|
-
}
|
|
8
|
-
declare function VirtualScrollList({ itemData, children, setBackdropVisibility, scrollToIndex, listRef: externalListRef, ...restProps }: ExtendedVariableSizeListProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
scrollToIndex?: number | undefined;
|
|
6
|
+
listRef?: React.RefObject<VariableSizeList<any>> | undefined;
|
|
7
|
+
} & React.RefAttributes<VariableSizeList<any>>>;
|
|
9
8
|
export default VirtualScrollList;
|
|
@@ -16,7 +16,7 @@ import VirtualScrollInner from './VirtualScrollInner';
|
|
|
16
16
|
import VirtualScrollOuter from './VirtualScrollOuter';
|
|
17
17
|
import useScrollBackShadow from '../../hooks/useScrollBackShadow';
|
|
18
18
|
import { VirtualScrollOuterProvider } from '../../context';
|
|
19
|
-
|
|
19
|
+
const VirtualScrollList = React.forwardRef((_a, ref) => {
|
|
20
20
|
var { itemData, children, setBackdropVisibility, scrollToIndex, listRef: externalListRef } = _a, restProps = __rest(_a, ["itemData", "children", "setBackdropVisibility", "scrollToIndex", "listRef"]);
|
|
21
21
|
const { handleBackDropVisibility, clearBackdropVisibility, clearTimer } = useScrollBackShadow({
|
|
22
22
|
setBackdropVisibility,
|
|
@@ -25,7 +25,7 @@ function VirtualScrollList(_a) {
|
|
|
25
25
|
const scrollTopRef = useRef(undefined);
|
|
26
26
|
const scrollLocked = useRef(false);
|
|
27
27
|
const internalListRef = useRef(null);
|
|
28
|
-
const listRef = externalListRef || internalListRef;
|
|
28
|
+
const listRef = ref || externalListRef || internalListRef;
|
|
29
29
|
const scrollTo = useCallback(() => {
|
|
30
30
|
var _a, _b;
|
|
31
31
|
clearTimer();
|
|
@@ -58,5 +58,5 @@ function VirtualScrollList(_a) {
|
|
|
58
58
|
scrollLocked.current = scrollTo();
|
|
59
59
|
}, [scrollTo]);
|
|
60
60
|
return (_jsx(VirtualScrollOuterProvider, Object.assign({ value: handleScroll }, { children: _jsx(VariableSizeList, Object.assign({ ref: listRef, "data-testid": "VirtualScrollList", itemData: itemDataInternal, outerElementType: VirtualScrollOuter, innerElementType: VirtualScrollInner, onScroll: handleOnScroll }, restProps, { children: children })) })));
|
|
61
|
-
}
|
|
61
|
+
});
|
|
62
62
|
export default VirtualScrollList;
|
|
@@ -27,7 +27,7 @@ export declare const StyledVirtualList: import("@emotion/styled").StyledComponen
|
|
|
27
27
|
setBackdropVisibility: (isVisible: boolean) => void;
|
|
28
28
|
scrollToIndex?: number | undefined;
|
|
29
29
|
listRef?: import("react").RefObject<import("react-window").VariableSizeList<any>> | undefined;
|
|
30
|
-
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & StyledVirtualListProps, {}, {}>;
|
|
30
|
+
} & import("react").RefAttributes<import("react-window").VariableSizeList<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & StyledVirtualListProps, {}, {}>;
|
|
31
31
|
export declare const StyledTableRow: import("@emotion/styled").StyledComponent<import("@mui/material").TableRowOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
|
|
32
32
|
ref?: ((instance: HTMLTableRowElement | null) => void) | import("react").RefObject<HTMLTableRowElement> | null | undefined;
|
|
33
33
|
}, "className" | "style" | "classes" | "children" | "sx" | "hover" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
@@ -32,6 +32,9 @@ export const StyledCell = styled(TableCell, {
|
|
|
32
32
|
shouldForwardProp: (prop) => !['isLast', 'isFirst', 'isSheetView'].includes(prop),
|
|
33
33
|
})(({ theme, isLast, isFirst, isSheetView }) => (Object.assign({ paddingBlock: '0', paddingInline: '0.3875rem !important', paddingLeft: isFirst ? '0 !important' : '0.3875rem !important', paddingRight: isLast ? '0 !important' : '0.3875rem !important', color: theme.palette.grey[700], fontSize: theme.typography.caption.fontSize, height: '100%', fontWeight: theme.typography.fontWeightRegular, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'flex', alignItems: 'center' }, (isSheetView && {
|
|
34
34
|
borderRight: isLast ? 'none' : `1px solid ${theme.palette.divider}`,
|
|
35
|
+
paddingInline: '0.375rem !important',
|
|
36
|
+
paddingLeft: '0.375rem !important',
|
|
37
|
+
paddingRight: '0.375rem !important',
|
|
35
38
|
}))));
|
|
36
39
|
export const StyledVirtualList = styled(VirtualScrollList, {
|
|
37
40
|
shouldForwardProp: (prop) => !['areTotalRowsNotFillingHeight', 'isSheetView'].includes(prop),
|
|
@@ -12,6 +12,7 @@ export { default as Dialog, DialogToolbar } from './Dialog';
|
|
|
12
12
|
export { default as Tooltip } from './Tooltip';
|
|
13
13
|
export * from './RFH';
|
|
14
14
|
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as SheetViewVirtualTable } from './VirtualTable/SheetViewVirtualTable';
|
|
15
16
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
16
17
|
export { default as TapLogo } from './TapLogo';
|
|
17
18
|
export { default as StatusButton, ChevronIcon, type ChevronIconProps, type StatusButtonIcon, type StatusButtonProps } from './StatusButton';
|
|
@@ -12,6 +12,7 @@ export { default as Dialog, DialogToolbar } from './Dialog';
|
|
|
12
12
|
export { default as Tooltip } from './Tooltip';
|
|
13
13
|
export * from './RFH';
|
|
14
14
|
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as SheetViewVirtualTable } from './VirtualTable/SheetViewVirtualTable';
|
|
15
16
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
16
17
|
export { default as TapLogo } from './TapLogo';
|
|
17
18
|
export { default as StatusButton, ChevronIcon } from './StatusButton';
|
|
@@ -186,6 +186,7 @@ export declare const dueDateBlackIcon: string;
|
|
|
186
186
|
export declare const dueDateGrayIcon: string;
|
|
187
187
|
export declare const timerBlueIcon: string;
|
|
188
188
|
export declare const expiredIcon: string;
|
|
189
|
+
export declare const remindedIcon: string;
|
|
189
190
|
export declare const remindedRedIcon: string;
|
|
190
191
|
export declare const chevronWhiteIcon: string;
|
|
191
192
|
export declare const chevronGrayIcon: string;
|
|
@@ -326,6 +327,8 @@ export declare const authenticationBiometricIcon: string;
|
|
|
326
327
|
export declare const authenticationDeviceIcon: string;
|
|
327
328
|
export declare const authenticationIssuerIcon: string;
|
|
328
329
|
export declare const authenticationSchemeIcon: string;
|
|
330
|
+
export declare const pinIcon: string;
|
|
331
|
+
export declare const unpinIcon: string;
|
|
329
332
|
export declare const switcherIcon: string;
|
|
330
333
|
export declare const tokenSavedStatusIcon: string;
|
|
331
334
|
export declare const tokenTransactedStatusIcon: string;
|
|
@@ -481,4 +484,3 @@ export declare const bankNoteIcon: string;
|
|
|
481
484
|
export declare const terminalDeviceFrame: string;
|
|
482
485
|
export declare const blackBrushIcon: string;
|
|
483
486
|
export declare const mutedOutlinedCheckIcon: string;
|
|
484
|
-
export declare const outlinedPlatformIcon: string;
|