@tap-payments/os-micro-frontend-shared 0.0.69-sheetview-table-v2 → 0.0.69-sheetview-pin-v1
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/SearchButton/styles.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -1
- package/build/components/VirtualTable/PinExample.d.ts +3 -0
- package/build/components/VirtualTable/PinExample.js +87 -0
- package/build/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/build/components/VirtualTable/VirtualTable.js +29 -10
- package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +1 -1
- package/build/components/VirtualTable/components/TableHeader.d.ts +6 -2
- package/build/components/VirtualTable/components/TableHeader.js +92 -14
- package/build/components/VirtualTable/components/TableRow.d.ts +2 -2
- package/build/components/VirtualTable/components/TableRow.js +30 -4
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.d.ts +1 -1
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.js +5 -5
- package/build/components/VirtualTable/index.d.ts +2 -0
- package/build/components/VirtualTable/index.js +2 -0
- package/build/components/VirtualTable/style.d.ts +1 -4
- package/build/components/VirtualTable/style.js +23 -11
- package/build/constants/assets.d.ts +2 -0
- package/build/constants/assets.js +2 -0
- package/build/constants/table.d.ts +0 -1
- package/build/constants/table.js +0 -1
- package/build/types/table.d.ts +3 -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
|
+
```
|
|
@@ -554,9 +554,9 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
|
|
|
554
554
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
555
555
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
556
556
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
557
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
558
557
|
src?: string | undefined;
|
|
559
558
|
alt?: string | undefined;
|
|
559
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
560
560
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
561
561
|
useMap?: string | undefined;
|
|
562
562
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -269,9 +269,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
269
269
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
270
270
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
271
271
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
272
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
273
272
|
src?: string | undefined;
|
|
274
273
|
alt?: string | undefined;
|
|
274
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
275
275
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
276
276
|
useMap?: string | undefined;
|
|
277
277
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -273,9 +273,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
|
|
|
273
273
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
274
274
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
275
275
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
276
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
277
276
|
src?: string | undefined;
|
|
278
277
|
alt?: string | undefined;
|
|
278
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
279
279
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
280
280
|
useMap?: string | undefined;
|
|
281
281
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -262,9 +262,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
|
|
|
262
262
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
263
263
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
264
264
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
265
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
266
265
|
src?: string | undefined;
|
|
267
266
|
alt?: string | undefined;
|
|
267
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
268
268
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
269
269
|
useMap?: string | undefined;
|
|
270
270
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -0,0 +1,87 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
11
|
+
import { useState } from 'react';
|
|
12
|
+
import { Box, Typography } from '@mui/material';
|
|
13
|
+
import VirtualTable from './VirtualTable';
|
|
14
|
+
const testData = Array.from({ length: 50 }, (_, index) => ({
|
|
15
|
+
id: index + 1,
|
|
16
|
+
name: `User ${index + 1}`,
|
|
17
|
+
email: `user${index + 1}@example.com`,
|
|
18
|
+
department: ['Engineering', 'Marketing', 'Sales', 'HR'][index % 4],
|
|
19
|
+
salary: 50000 + index * 1000,
|
|
20
|
+
status: ['Active', 'Inactive'][index % 2],
|
|
21
|
+
location: ['New York', 'London', 'Tokyo', 'Sydney'][index % 4],
|
|
22
|
+
}));
|
|
23
|
+
const testColumns = [
|
|
24
|
+
{
|
|
25
|
+
id: 'id',
|
|
26
|
+
header: 'ID',
|
|
27
|
+
width: 80,
|
|
28
|
+
pinnable: true,
|
|
29
|
+
align: 'center',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'name',
|
|
33
|
+
header: 'Name',
|
|
34
|
+
width: 150,
|
|
35
|
+
pinnable: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'email',
|
|
39
|
+
header: 'Email',
|
|
40
|
+
width: 200,
|
|
41
|
+
pinnable: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'department',
|
|
45
|
+
header: 'Department',
|
|
46
|
+
width: 120,
|
|
47
|
+
pinnable: true,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'salary',
|
|
51
|
+
header: 'Salary',
|
|
52
|
+
width: 100,
|
|
53
|
+
pinnable: true,
|
|
54
|
+
align: 'right',
|
|
55
|
+
format: ({ value }) => `$${value === null || value === void 0 ? void 0 : value.toLocaleString()}`,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'status',
|
|
59
|
+
header: 'Status',
|
|
60
|
+
width: 100,
|
|
61
|
+
pinnable: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'location',
|
|
65
|
+
header: 'Location',
|
|
66
|
+
width: 120,
|
|
67
|
+
pinnable: true,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const PinExample = () => {
|
|
71
|
+
const [pinnedColumns, setPinnedColumns] = useState(new Set(['id']));
|
|
72
|
+
const handleColumnPin = (columnId, isPinned) => {
|
|
73
|
+
console.log('%cPinExample.handleColumnPin TRIGGERED!', 'color: green; font-weight: bold;', { columnId, isPinned });
|
|
74
|
+
setPinnedColumns((prev) => {
|
|
75
|
+
const newSet = new Set(prev);
|
|
76
|
+
if (isPinned) {
|
|
77
|
+
newSet.add(columnId);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
newSet.delete(columnId);
|
|
81
|
+
}
|
|
82
|
+
return newSet;
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
return (_jsxs(Box, Object.assign({ sx: { padding: 2, border: '3px solid red', margin: 2, backgroundColor: '#fff5f5' } }, { children: [_jsx(Typography, Object.assign({ variant: "h5", gutterBottom: true, sx: { color: 'red', fontWeight: 'bold' } }, { children: "PINNING TEST COMPONENT" })), _jsx(Typography, Object.assign({ variant: "body1", sx: { mb: 2 } }, { children: "If you see this component, the `onColumnPin` callback should be working. Check the console for logs." })), _jsxs(Typography, Object.assign({ variant: "body2", color: "text.secondary", sx: { mb: 2 } }, { children: ["Currently Pinned: ", _jsx("strong", { children: Array.from(pinnedColumns).join(', ') || 'None' })] })), _jsx(Box, Object.assign({ sx: { height: 600, width: '100%' } }, { children: _jsx(VirtualTable, { columns: testColumns, rows: testData, pinnedColumns: pinnedColumns, onColumnPin: handleColumnPin, showHeader: true, error: null, triggerDataRefetch: () => __awaiter(void 0, void 0, void 0, function* () { }), showBackgroundColor: false }) }))] })));
|
|
86
|
+
};
|
|
87
|
+
export default PinExample;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IVirtualTable } from '../../types/index.js';
|
|
3
|
-
declare function VirtualTable(
|
|
3
|
+
declare function VirtualTable(props: Readonly<IVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof VirtualTable>;
|
|
5
5
|
export default _default;
|
|
@@ -13,7 +13,7 @@ import { useTheme } from '@mui/material/styles';
|
|
|
13
13
|
import memoize from 'memoize-one';
|
|
14
14
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
15
15
|
import InfiniteLoader from 'react-window-infinite-loader';
|
|
16
|
-
import { TABLE_ROW_HEIGHT, TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN
|
|
16
|
+
import { TABLE_ROW_HEIGHT, TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN } from '../../constants/index.js';
|
|
17
17
|
import { useDelayToSetValue } from '../../hooks/index.js';
|
|
18
18
|
import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../utils/index.js';
|
|
19
19
|
import TableFooter from './components/TableFooter/TableFooter';
|
|
@@ -22,7 +22,7 @@ import TableLastItem from './components/TableLastItem';
|
|
|
22
22
|
import TableNoData from './components/TableNoData';
|
|
23
23
|
import ListItemWrapper from './components/virtualScroll/ListItemWrapper';
|
|
24
24
|
import { StyledBox, StyledTableBox, StyledVirtualList, TableContainer, TableWrapper } from './style';
|
|
25
|
-
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded,
|
|
25
|
+
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, pinnedColumns) => ({
|
|
26
26
|
columns,
|
|
27
27
|
isLoading,
|
|
28
28
|
rows,
|
|
@@ -32,11 +32,30 @@ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToInde
|
|
|
32
32
|
lastItemIndex,
|
|
33
33
|
isError,
|
|
34
34
|
areAllRowsLoaded,
|
|
35
|
-
|
|
35
|
+
pinnedColumns,
|
|
36
36
|
}));
|
|
37
|
-
function VirtualTable(
|
|
37
|
+
function VirtualTable(props) {
|
|
38
38
|
var _a;
|
|
39
|
+
const { columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = TABLE_ROW_HEIGHT, isLoading, error, columnsSorting, onColumnSort, pinnedColumns: controlledPinnedColumns, onColumnPin: onColumnPinProp, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, showBackgroundColor, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, dragControls, isSheetView = false, } = props;
|
|
39
40
|
const theme = useTheme();
|
|
41
|
+
const [uncontrolledPinnedColumns, setUncontrolledPinnedColumns] = useState(new Set());
|
|
42
|
+
const isControlled = controlledPinnedColumns !== undefined;
|
|
43
|
+
const pinnedColumns = isControlled ? controlledPinnedColumns : uncontrolledPinnedColumns;
|
|
44
|
+
const handleColumnPin = (columnId, isPinned) => {
|
|
45
|
+
if (!isControlled) {
|
|
46
|
+
setUncontrolledPinnedColumns((prev) => {
|
|
47
|
+
const newSet = new Set(prev);
|
|
48
|
+
if (isPinned) {
|
|
49
|
+
newSet.add(columnId);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
newSet.delete(columnId);
|
|
53
|
+
}
|
|
54
|
+
return newSet;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
onColumnPinProp === null || onColumnPinProp === void 0 ? void 0 : onColumnPinProp(columnId, isPinned);
|
|
58
|
+
};
|
|
40
59
|
const onPointerDown = (e) => {
|
|
41
60
|
dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
|
|
42
61
|
};
|
|
@@ -55,8 +74,7 @@ function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader,
|
|
|
55
74
|
const orderedColumns = useMemo(() => shownColumns.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); }), [shownColumns]);
|
|
56
75
|
const areTotalRowsNotFillingHeight = isHeightNotFullyFilledByRows(rows.length) && !tableLoading;
|
|
57
76
|
const itemsCount = isDelayedFetchingNextPage || (areAllRowsLoaded && !areTotalRowsNotFillingHeight) ? rows.length + 1 : rows.length;
|
|
58
|
-
const itemData = createItemData(orderedColumns, isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, lastItemIndex, (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0, isError, areAllRowsLoaded && !areTotalRowsNotFillingHeight,
|
|
59
|
-
const tableRowHeight = isSheetView ? SHEET_VIEW_TABLE_ROW_HEIGHT : TABLE_ROW_HEIGHT;
|
|
77
|
+
const itemData = createItemData(orderedColumns, isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, lastItemIndex, (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0, isError, areAllRowsLoaded && !areTotalRowsNotFillingHeight, pinnedColumns);
|
|
60
78
|
const renderTableContainer = useMemo(() => {
|
|
61
79
|
const setBackdropVisibility = (isVisible) => {
|
|
62
80
|
setShowBackdrop(isVisible);
|
|
@@ -66,7 +84,7 @@ function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader,
|
|
|
66
84
|
return;
|
|
67
85
|
yield (loadMoreItems === null || loadMoreItems === void 0 ? void 0 : loadMoreItems());
|
|
68
86
|
});
|
|
69
|
-
return (_jsx(InfiniteLoader, Object.assign({ "data-testid": "VirtualTable_InfiniteLoader", isItemLoaded: (index) => index !== lastItemIndex, itemCount: itemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered, ref }) => (_jsx(AutoSizer, Object.assign({ ref: ref, "data-testid": "VirtualTable_AutoSizer" }, { children: ({ height, width }) => (_jsx(StyledVirtualList, Object.assign({ "data-testid": "VirtualTable_VirtualList", useIsScrolling: true, className: "list", itemData: itemData, height: height || 0, width: width || 0, itemCount: itemsCount, itemSize: () =>
|
|
87
|
+
return (_jsx(InfiniteLoader, Object.assign({ "data-testid": "VirtualTable_InfiniteLoader", isItemLoaded: (index) => index !== lastItemIndex, itemCount: itemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered, ref }) => (_jsx(AutoSizer, Object.assign({ ref: ref, "data-testid": "VirtualTable_AutoSizer" }, { children: ({ height, width }) => (_jsx(StyledVirtualList, Object.assign({ "data-testid": "VirtualTable_VirtualList", useIsScrolling: true, className: "list", itemData: itemData, height: height || 0, width: width || 0, itemCount: itemsCount, itemSize: () => TABLE_ROW_HEIGHT, onItemsRendered: onItemsRendered, setBackdropVisibility: setBackdropVisibility, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, scrollToIndex: scrollToIndex, overscanCount: TABLE_LIST_OVER_SCAN }, { children: ListItemWrapper }))) }))) })));
|
|
70
88
|
}, [
|
|
71
89
|
orderedColumns,
|
|
72
90
|
error,
|
|
@@ -83,12 +101,13 @@ function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader,
|
|
|
83
101
|
areAllRowsLoaded,
|
|
84
102
|
areTotalRowsNotFillingHeight,
|
|
85
103
|
itemsCount,
|
|
86
|
-
|
|
104
|
+
pinnedColumns,
|
|
87
105
|
]);
|
|
88
106
|
const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
|
|
89
|
-
|
|
107
|
+
const hasPinnableColumns = useMemo(() => columns.some((c) => c.pinnable), [columns]);
|
|
108
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [_jsx(StyledTableBox, Object.assign({ as: "main", id: "table-box-container", "aria-labelledby": "table-box-container", "data-testid": "VirtualTable_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({ isSheetView: isSheetView, "data-testid": "VirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign({}, tableBodyStyles) }, { children: [showHeader && (_jsx(TableHeader, { "data-testid": "VirtualTable_TableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: pinnedColumns, onColumnPin: hasPinnableColumns ? handleColumnPin : undefined })), showNoDataView ? (_jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps })) : (_jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
90
109
|
width: '100%',
|
|
91
110
|
minWidth: 'fit-content',
|
|
92
|
-
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "VirtualTable_StyledBox", hidePadding: true, className: "list-wrapper" }, { children: renderTableContainer })) })))] })) })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) *
|
|
111
|
+
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "VirtualTable_StyledBox", hidePadding: true, className: "list-wrapper" }, { children: renderTableContainer })) })))] })) })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) * TABLE_ROW_HEIGHT, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, "data-testid": "VirtualTable_TableLastItem" }))] }), _jsx(TableFooter, Object.assign({ "data-testid": "VirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
93
112
|
}
|
|
94
113
|
export default memo(VirtualTable);
|
|
@@ -50,7 +50,7 @@ function ColumnFilter(filter) {
|
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}, [open, filter, anchorEl, setAnchorEl]);
|
|
53
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCloseDropdown }, { children: _jsxs(Box, Object.assign({ component: "section", "data-testid": "ColumnFilter", sx: { position: 'relative', display: '
|
|
53
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCloseDropdown }, { children: _jsxs(Box, Object.assign({ component: "section", "data-testid": "ColumnFilter", sx: { position: 'relative', display: 'inline-block', marginTop: 'auto' } }, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 }, onClick: openDropdown }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: () => {
|
|
54
54
|
filter.onClear(filterApiKeys);
|
|
55
55
|
} })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { marginInlineStart: '8px', cursor: 'pointer' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start", sx: {
|
|
56
56
|
zIndex: 9999,
|
|
@@ -8,6 +8,9 @@ export declare const actionsIcons: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const ActionIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
10
10
|
export declare const ColumnIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
11
|
+
export declare const PinIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
12
|
+
isPinned: boolean;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
11
14
|
interface StyledHeaderProps {
|
|
12
15
|
showBackDrop: boolean;
|
|
13
16
|
}
|
|
@@ -19,9 +22,10 @@ interface TableHeaderProps {
|
|
|
19
22
|
headerProps?: TableHeadProps;
|
|
20
23
|
columnsSorting?: IVirtualTable['columnsSorting'];
|
|
21
24
|
onColumnSort?: IVirtualTable['onColumnSort'];
|
|
25
|
+
pinnedColumns?: IVirtualTable['pinnedColumns'];
|
|
26
|
+
onColumnPin?: IVirtualTable['onColumnPin'];
|
|
22
27
|
showBackDrop: boolean;
|
|
23
|
-
isSheetView?: boolean;
|
|
24
28
|
}
|
|
25
|
-
declare function TableHeader(
|
|
29
|
+
declare function TableHeader(props: Readonly<TableHeaderProps>): import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
declare const _default: import("react").MemoExoticComponent<typeof TableHeader>;
|
|
27
31
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import { Box, styled, useTheme } from '@mui/material';
|
|
|
4
4
|
import TableHead from '@mui/material/TableHead';
|
|
5
5
|
import MUITableRow from '@mui/material/TableRow';
|
|
6
6
|
import Dropdown from '../../DropdownMenu';
|
|
7
|
-
import { columnIcon, disputeIcon, flagIcon, refundInitiatedIcon, sortAzIcon, sortZaIcon } from '../../../constants/index.js';
|
|
7
|
+
import { columnIcon, disputeIcon, flagIcon, refundInitiatedIcon, sortAzIcon, sortZaIcon, pinIcon, unpinIcon } from '../../../constants/index.js';
|
|
8
8
|
import ColumnFilter from './ColumnFilter';
|
|
9
9
|
import { StyledCell } from '../style';
|
|
10
10
|
export const actionsIcons = {
|
|
@@ -21,6 +21,19 @@ export const ColumnIcon = styled('img')(() => ({
|
|
|
21
21
|
height: '6.4px',
|
|
22
22
|
cursor: 'pointer',
|
|
23
23
|
}));
|
|
24
|
+
export const PinIcon = styled('img')(({ isPinned }) => ({
|
|
25
|
+
width: '12px',
|
|
26
|
+
height: '12px',
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
opacity: isPinned ? 1 : 0.6,
|
|
29
|
+
transform: isPinned ? 'scale(1.1)' : 'scale(1)',
|
|
30
|
+
transition: 'all 0.2s ease',
|
|
31
|
+
filter: isPinned ? 'brightness(1.2)' : 'brightness(1)',
|
|
32
|
+
'&:hover': {
|
|
33
|
+
opacity: 1,
|
|
34
|
+
transform: 'scale(1.1)',
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
24
37
|
export const StyledHeader = styled(TableHead, {
|
|
25
38
|
shouldForwardProp: (prop) => prop !== 'showBackDrop',
|
|
26
39
|
})(({ showBackDrop, theme }) => ({
|
|
@@ -31,19 +44,30 @@ export const StyledHeader = styled(TableHead, {
|
|
|
31
44
|
backgroundColor: theme.palette.background.default,
|
|
32
45
|
zIndex: 1,
|
|
33
46
|
}));
|
|
34
|
-
const StyledMUITableRow = styled(MUITableRow
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
const StyledMUITableRow = styled(MUITableRow)({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
justifyContent: 'flex-start',
|
|
50
|
+
paddingInline: '32px',
|
|
51
|
+
paddingBlock: '16px',
|
|
52
|
+
width: '100%',
|
|
53
|
+
minWidth: 'fit-content',
|
|
54
|
+
});
|
|
55
|
+
function TableHeader(props) {
|
|
56
|
+
const { columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns, onColumnPin } = props;
|
|
44
57
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
45
58
|
const open = Boolean(anchorEl);
|
|
46
59
|
const theme = useTheme();
|
|
60
|
+
console.log('--- TableHeader ---', {
|
|
61
|
+
onColumnPinExists: !!onColumnPin,
|
|
62
|
+
onColumnPinType: typeof onColumnPin,
|
|
63
|
+
});
|
|
64
|
+
console.log('TableHeader rendered with:', {
|
|
65
|
+
columnsCount: columns.length,
|
|
66
|
+
pinnedColumnsCount: (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.size) || 0,
|
|
67
|
+
pinnedColumnIds: Array.from(pinnedColumns || []),
|
|
68
|
+
onColumnPinExists: !!onColumnPin,
|
|
69
|
+
pinnableColumns: columns.filter((col) => col.pinnable).map((col) => col.id),
|
|
70
|
+
});
|
|
47
71
|
const handleClick = (event) => {
|
|
48
72
|
setAnchorEl(event.currentTarget);
|
|
49
73
|
};
|
|
@@ -58,11 +82,65 @@ function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columns
|
|
|
58
82
|
handleClose();
|
|
59
83
|
}
|
|
60
84
|
};
|
|
61
|
-
|
|
62
|
-
|
|
85
|
+
const handlePinToggle = (columnId) => {
|
|
86
|
+
const isPinned = (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.has(columnId)) || false;
|
|
87
|
+
if (onColumnPin) {
|
|
88
|
+
onColumnPin(columnId, !isPinned);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.error('onColumnPin callback is not provided!');
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const calculateLeftPosition = (columnIndex) => {
|
|
95
|
+
let left = 0;
|
|
96
|
+
for (let i = 0; i < columnIndex; i++) {
|
|
97
|
+
const column = columns[i];
|
|
98
|
+
if (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.has(column.id)) {
|
|
99
|
+
const width = typeof column.width === 'string' ? parseInt(column.width) : column.width || 200;
|
|
100
|
+
left += width;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return left;
|
|
104
|
+
};
|
|
105
|
+
return (_jsxs(StyledHeader, Object.assign({ component: "nav", "data-testid": "VirtualTable_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": "VirtualTable_TableHeader_StyledMUITableRow" }, { children: columns.map((column, colIndex) => {
|
|
106
|
+
const { header, id, align, headerStyle, sortable, filter, pinnable } = column;
|
|
63
107
|
const isFirst = id === columns[0].id;
|
|
64
108
|
const isLast = id === columns[columns.length - 1].id;
|
|
65
|
-
|
|
109
|
+
const isPinned = (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.has(id)) || false;
|
|
110
|
+
const leftPosition = isPinned ? calculateLeftPosition(colIndex) : undefined;
|
|
111
|
+
console.log('Rendering column:', id, 'isPinned:', isPinned, 'pinnedColumns size:', pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.size);
|
|
112
|
+
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_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, sx: Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'baseline', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: column.width, textAlign: align, overflow: 'unset', position: isPinned ? 'sticky' : 'static', left: leftPosition, zIndex: isPinned ? 15 : 1, backgroundColor: isPinned ? theme.palette.background.paper : 'transparent', borderRight: isPinned ? `1px solid ${theme.palette.divider}` : 'none', boxShadow: isPinned ? theme.shadows[4] : 'none', '&::after': isPinned
|
|
113
|
+
? {
|
|
114
|
+
content: '""',
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
right: -1,
|
|
117
|
+
top: 0,
|
|
118
|
+
bottom: 0,
|
|
119
|
+
width: '4px',
|
|
120
|
+
background: `linear-gradient(90deg, rgba(0,0,0,0.1) 0%, transparent 100%)`,
|
|
121
|
+
pointerEvents: 'none',
|
|
122
|
+
}
|
|
123
|
+
: {} }, headerStyle) }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_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": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), pinnable && (_jsx(Box, Object.assign({ component: "div", onClick: (e) => {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
console.log('🔥 Pin wrapper clicked for column:', id, 'isPinned:', isPinned);
|
|
127
|
+
handlePinToggle(id);
|
|
128
|
+
}, sx: {
|
|
129
|
+
cursor: 'pointer',
|
|
130
|
+
display: 'flex',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
justifyContent: 'center',
|
|
133
|
+
padding: '2px',
|
|
134
|
+
borderRadius: '2px',
|
|
135
|
+
'&:hover': {
|
|
136
|
+
backgroundColor: 'rgba(0,0,0,0.1)',
|
|
137
|
+
},
|
|
138
|
+
} }, { children: _jsx(PinIcon, { src: isPinned ? unpinIcon : pinIcon, alt: isPinned ? 'unpin-column' : 'pin-column', isPinned: isPinned, "data-testid": "VirtualTable_TableHeader_PinIcon", title: isPinned ? 'Unpin column' : 'Pin column', onError: (e) => {
|
|
139
|
+
console.warn('Pin icon failed to load, using fallback');
|
|
140
|
+
const target = e.target;
|
|
141
|
+
target.src =
|
|
142
|
+
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiBmaWxsPSIjNjY2IiByeD0iMiIvPgo8L3N2Zz4K';
|
|
143
|
+
} }) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter)), sortable && _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id })] }), `${id}-${colIndex}`));
|
|
66
144
|
}) })), _jsx(Dropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: [
|
|
67
145
|
{
|
|
68
146
|
label: 'Sort A-Z',
|
|
@@ -5,13 +5,13 @@ interface ITableRowProps<R = any> {
|
|
|
5
5
|
row: R;
|
|
6
6
|
columns: Array<IColumnProps<R>>;
|
|
7
7
|
index: number;
|
|
8
|
+
pinnedColumns?: Set<string>;
|
|
8
9
|
rowProps?: TableRowProps & {
|
|
9
10
|
showShadowHighlight?: boolean;
|
|
10
11
|
onRowClick?: (row: R) => void;
|
|
11
12
|
showLoadedStyle?: boolean;
|
|
12
13
|
};
|
|
13
|
-
isSheetView?: boolean;
|
|
14
14
|
}
|
|
15
|
-
declare function TableRow({ row, columns, index,
|
|
15
|
+
declare function TableRow({ row, columns, index, pinnedColumns, rowProps }: Readonly<ITableRowProps>): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
declare const _default: import("react").MemoExoticComponent<typeof TableRow>;
|
|
17
17
|
export default _default;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
|
+
import { useTheme } from '@mui/material/styles';
|
|
4
5
|
import { areEqual } from 'react-window';
|
|
5
6
|
import { StyledCell, StyledTableRow } from '../style';
|
|
6
|
-
function TableRow({ row, columns, index,
|
|
7
|
+
function TableRow({ row, columns, index, pinnedColumns, rowProps }) {
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const calculateLeftPosition = (columnIndex) => {
|
|
10
|
+
let left = 0;
|
|
11
|
+
for (let i = 0; i < columnIndex; i++) {
|
|
12
|
+
const column = columns[i];
|
|
13
|
+
if (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.has(column.id)) {
|
|
14
|
+
const width = typeof column.width === 'string' ? parseInt(column.width) : column.width || 200;
|
|
15
|
+
left += width;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return left;
|
|
19
|
+
};
|
|
7
20
|
const renderCell = (column) => {
|
|
8
21
|
const { render, format, selector } = column;
|
|
9
22
|
if (!(column === null || column === void 0 ? void 0 : column.id) || !row)
|
|
@@ -13,8 +26,21 @@ function TableRow({ row, columns, index, rowProps, isSheetView }) {
|
|
|
13
26
|
return render ? render({ row, column, index, value: row[column === null || column === void 0 ? void 0 : column.id] }) : _jsx(_Fragment, { children: formattedValue });
|
|
14
27
|
};
|
|
15
28
|
const content = useMemo(() => (_jsx(_Fragment, { children: columns.map((column, colIndex) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
const isPinned = (pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.has(column.id)) || false;
|
|
30
|
+
const leftPosition = isPinned ? calculateLeftPosition(colIndex) : undefined;
|
|
31
|
+
return (_jsx(StyledCell, Object.assign({ component: "div", "data-testid": "TableRow_TableCell", "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: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, sx: Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: column.align === 'right' ? 'flex-end' : 'flex-start', position: isPinned ? 'sticky' : 'static', left: leftPosition, zIndex: isPinned ? 14 : 1, backgroundColor: isPinned ? theme.palette.background.paper : 'transparent', borderRight: isPinned ? `1px solid ${theme.palette.divider}` : 'none', boxShadow: isPinned ? theme.shadows[3] : 'none', '&::after': isPinned
|
|
32
|
+
? {
|
|
33
|
+
content: '""',
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
right: -1,
|
|
36
|
+
top: 0,
|
|
37
|
+
bottom: 0,
|
|
38
|
+
width: '4px',
|
|
39
|
+
background: `linear-gradient(90deg, rgba(0,0,0,0.08) 0%, transparent 100%)`,
|
|
40
|
+
pointerEvents: 'none',
|
|
41
|
+
}
|
|
42
|
+
: {} }, column.cellStyle) }, { children: renderCell(column) }), `${column.id}-${colIndex}`));
|
|
43
|
+
}) })), [columns, row, pinnedColumns, theme]);
|
|
44
|
+
return (_createElement(StyledTableRow, Object.assign({ "data-testid": "TableRow", onClick: rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick, showShadowHighlight: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showShadowHighlight, showLoadedStyle: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showLoadedStyle, component: "article" }, rowProps, { key: index }), content));
|
|
19
45
|
}
|
|
20
46
|
export default memo(TableRow, areEqual);
|
|
@@ -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,
|
|
9
|
+
declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, pinnedColumns, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default ListItemWrapper;
|
|
@@ -14,7 +14,7 @@ import React from 'react';
|
|
|
14
14
|
import { Box } from '@mui/material';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
|
-
import { blueCircleLoaderIcon, tableBackgroundLoader, TABLE_ROW_HEIGHT
|
|
17
|
+
import { blueCircleLoaderIcon, tableBackgroundLoader, TABLE_ROW_HEIGHT } from '../../../../constants/index.js';
|
|
18
18
|
import { ActionIcon } from '../../style';
|
|
19
19
|
import { RowErrorState } from '../RowErrorState';
|
|
20
20
|
import { StyledParagraph } from '../TableLastItem';
|
|
@@ -44,7 +44,7 @@ export const StyledItemWrapper = styled('div', {
|
|
|
44
44
|
height: '100%',
|
|
45
45
|
}));
|
|
46
46
|
function ListItemWrapper(_a) {
|
|
47
|
-
var { index, style } = _a, _b = _a.data, { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded,
|
|
47
|
+
var { index, style } = _a, _b = _a.data, { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, pinnedColumns } = _b, restData = __rest(_b, ["renderedScrollTopRef", "rows", "rowProps", "columns", "isLoading", "scrollToIndex", "limit", "totalCount", "newLoadedRowsEndIndex", "isError", "areAllRowsLoaded", "pinnedColumns"]);
|
|
48
48
|
const lastItemIndex = rows.length - 1;
|
|
49
49
|
const row = rows[index];
|
|
50
50
|
const isLoadingRow = isLoading && index === lastItemIndex + 1;
|
|
@@ -56,7 +56,7 @@ function ListItemWrapper(_a) {
|
|
|
56
56
|
const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
|
|
57
57
|
if (isLastRow) {
|
|
58
58
|
return (_jsx(Box, Object.assign({ sx: {
|
|
59
|
-
height:
|
|
59
|
+
height: TABLE_ROW_HEIGHT,
|
|
60
60
|
display: 'flex',
|
|
61
61
|
justifyContent: 'center',
|
|
62
62
|
alignItems: 'center',
|
|
@@ -69,8 +69,8 @@ function ListItemWrapper(_a) {
|
|
|
69
69
|
height: '100%',
|
|
70
70
|
} }, { children: isError ? _jsx(RowErrorState, {}) : lastRowContent })) })));
|
|
71
71
|
}
|
|
72
|
-
return _jsx(TableRow, { index: index, row: row, columns: columns, rowProps: memoizedRowProps,
|
|
73
|
-
}, [restData, index, row, columns, memoizedRowProps,
|
|
72
|
+
return _jsx(TableRow, { index: index, row: row, columns: columns, rowProps: memoizedRowProps, pinnedColumns: pinnedColumns }, `row-${index}`);
|
|
73
|
+
}, [restData, index, row, columns, memoizedRowProps, pinnedColumns]);
|
|
74
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 })) })));
|
|
75
75
|
}
|
|
76
76
|
export default ListItemWrapper;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import VirtualTable from './VirtualTable';
|
|
2
|
+
export { default as VirtualTable } from './VirtualTable';
|
|
2
3
|
export { default as VirtualTableWithCard } from './VirtualTableWithCard';
|
|
4
|
+
export { default as PinExample } from './PinExample';
|
|
3
5
|
export * from './components';
|
|
4
6
|
export { StyledCell } from './style';
|
|
5
7
|
export default VirtualTable;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import VirtualTable from './VirtualTable';
|
|
2
|
+
export { default as VirtualTable } from './VirtualTable';
|
|
2
3
|
export { default as VirtualTableWithCard } from './VirtualTableWithCard';
|
|
4
|
+
export { default as PinExample } from './PinExample';
|
|
3
5
|
export * from './components';
|
|
4
6
|
export { StyledCell } from './style';
|
|
5
7
|
export default VirtualTable;
|
|
@@ -17,11 +17,9 @@ export declare const StyledSolidBackground: import("@emotion/styled").StyledComp
|
|
|
17
17
|
export declare const StyledCell: import("@emotion/styled").StyledComponent<import("@mui/material").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
18
18
|
isLast: boolean;
|
|
19
19
|
isFirst: boolean;
|
|
20
|
-
isSheetView?: boolean | undefined;
|
|
21
20
|
}, {}, {}>;
|
|
22
21
|
interface StyledVirtualListProps {
|
|
23
22
|
areTotalRowsNotFillingHeight: boolean;
|
|
24
|
-
isSheetView?: boolean;
|
|
25
23
|
}
|
|
26
24
|
export declare const StyledVirtualList: import("@emotion/styled").StyledComponent<import("react-window").VariableSizeListProps<any> & {
|
|
27
25
|
setBackdropVisibility: (isVisible: boolean) => void;
|
|
@@ -32,7 +30,6 @@ export declare const StyledTableRow: import("@emotion/styled").StyledComponent<i
|
|
|
32
30
|
}, "className" | "style" | "classes" | "children" | "sx" | "hover" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
33
31
|
showShadowHighlight?: boolean | undefined;
|
|
34
32
|
showLoadedStyle?: boolean | undefined;
|
|
35
|
-
isSheetView?: boolean | undefined;
|
|
36
33
|
}, {}, {}>;
|
|
37
34
|
export declare const StyledTableBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
38
35
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -303,9 +300,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
303
300
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
304
301
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
305
302
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
306
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
307
303
|
src?: string | undefined;
|
|
308
304
|
alt?: string | undefined;
|
|
305
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
309
306
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
310
307
|
useMap?: string | undefined;
|
|
311
308
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -29,18 +29,30 @@ export const StyledSolidBackground = styled(Box)(({ theme }) => ({
|
|
|
29
29
|
backgroundColor: theme.palette.background.default,
|
|
30
30
|
}));
|
|
31
31
|
export const StyledCell = styled(TableCell, {
|
|
32
|
-
shouldForwardProp: (prop) =>
|
|
33
|
-
})(({ theme, isLast, isFirst
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
shouldForwardProp: (prop) => prop !== 'isLast' && prop !== 'isFirst',
|
|
33
|
+
})(({ theme, isLast, isFirst }) => ({
|
|
34
|
+
paddingBlock: '0',
|
|
35
|
+
paddingInline: '0.3875rem !important',
|
|
36
|
+
paddingLeft: isFirst ? '0 !important' : '0.3875rem !important',
|
|
37
|
+
paddingRight: isLast ? '0 !important' : '0.3875rem !important',
|
|
38
|
+
color: theme.palette.grey[700],
|
|
39
|
+
fontSize: theme.typography.caption.fontSize,
|
|
40
|
+
height: '100%',
|
|
41
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
42
|
+
whiteSpace: 'nowrap',
|
|
43
|
+
overflow: 'hidden',
|
|
44
|
+
textOverflow: 'ellipsis',
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
}));
|
|
36
48
|
export const StyledVirtualList = styled(VirtualScrollList, {
|
|
37
|
-
shouldForwardProp: (prop) =>
|
|
38
|
-
})(({ theme, areTotalRowsNotFillingHeight
|
|
39
|
-
backgroundColor: theme.palette.
|
|
40
|
-
}))
|
|
49
|
+
shouldForwardProp: (prop) => prop !== 'areTotalRowsNotFillingHeight',
|
|
50
|
+
})(({ theme, areTotalRowsNotFillingHeight }) => ({
|
|
51
|
+
backgroundColor: areTotalRowsNotFillingHeight ? 'transparent' : theme.palette.background.default,
|
|
52
|
+
}));
|
|
41
53
|
export const StyledTableRow = styled(MUITableRow, {
|
|
42
|
-
shouldForwardProp: (props) =>
|
|
43
|
-
})(({ theme, showShadowHighlight, showLoadedStyle
|
|
54
|
+
shouldForwardProp: (props) => props !== 'showShadowHighlight' && props !== 'showLoadedStyle',
|
|
55
|
+
})(({ theme, showShadowHighlight, showLoadedStyle }) => (Object.assign(Object.assign({ display: 'flex', borderBottom: `1px solid ${theme === null || theme === void 0 ? void 0 : theme.palette.divider}`, paddingInline: '32px', position: 'relative', height: '100%', width: '100%', '&:hover': {
|
|
44
56
|
boxShadow: theme.shadows[12],
|
|
45
57
|
zIndex: 1,
|
|
46
58
|
'.payment-sources-container': {
|
|
@@ -77,7 +89,7 @@ export const StyledTableRow = styled(MUITableRow, {
|
|
|
77
89
|
position: 'absolute',
|
|
78
90
|
left: 0,
|
|
79
91
|
},
|
|
80
|
-
}))))
|
|
92
|
+
}))));
|
|
81
93
|
export const StyledTableBox = styled(Box, {
|
|
82
94
|
shouldForwardProp: (prop) => prop !== 'showBackgroundColor' && prop !== 'showNoDataView',
|
|
83
95
|
})(({ theme, showBackgroundColor, showNoDataView }) => ({
|
|
@@ -15,6 +15,8 @@ export declare const flagIcon: string;
|
|
|
15
15
|
export declare const disputeIcon: string;
|
|
16
16
|
export declare const timezoneIcon: string;
|
|
17
17
|
export declare const greyTimezoneIcon: string;
|
|
18
|
+
export declare const pinIcon: string;
|
|
19
|
+
export declare const unpinIcon: string;
|
|
18
20
|
export declare const subscriptionIcon: string;
|
|
19
21
|
export declare const savedCardIcon: string;
|
|
20
22
|
export declare const egyptFlagIcon: string;
|
|
@@ -16,6 +16,8 @@ export const flagIcon = `${lightUrl}/flag.svg`;
|
|
|
16
16
|
export const disputeIcon = `${lightUrl}/dispute.svg`;
|
|
17
17
|
export const timezoneIcon = `${lightUrl}/timezone.svg`;
|
|
18
18
|
export const greyTimezoneIcon = `${lightUrl}/greyTimezone.svg`;
|
|
19
|
+
export const pinIcon = `${lightUrl}/pin.svg`;
|
|
20
|
+
export const unpinIcon = `${lightUrl}/unpin.svg`;
|
|
19
21
|
export const subscriptionIcon = `${lightUrl}/subscription.svg`;
|
|
20
22
|
export const savedCardIcon = `${lightUrl}/savedCard.svg`;
|
|
21
23
|
export const egyptFlagIcon = `${lightUrl}/egypt.svg`;
|
package/build/constants/table.js
CHANGED
package/build/types/table.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export interface IColumnProps<R = any> {
|
|
|
33
33
|
cellStyle?: React.CSSProperties;
|
|
34
34
|
headerStyle?: React.CSSProperties;
|
|
35
35
|
filter?: IColumnFilter;
|
|
36
|
+
pinnable?: boolean;
|
|
36
37
|
}
|
|
37
38
|
export interface TableFooterProps extends BoxProps {
|
|
38
39
|
totalCount?: number;
|
|
@@ -107,6 +108,8 @@ export interface IVirtualTable<R = any> {
|
|
|
107
108
|
error: Error | null;
|
|
108
109
|
columnsSorting?: Record<keyof R, 'asc' | 'desc'>;
|
|
109
110
|
onColumnSort?: (columnsSorting: Record<string, SortingOrder>) => void;
|
|
111
|
+
pinnedColumns?: Set<string>;
|
|
112
|
+
onColumnPin?: (columnId: string, isPinned: boolean) => void;
|
|
110
113
|
loadMoreItems?: () => Promise<unknown>;
|
|
111
114
|
triggerDataRefetch: () => Promise<unknown>;
|
|
112
115
|
scrollToIndex?: number;
|
package/package.json
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.0.69-sheetview-
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "build/index.js",
|
|
7
|
-
"module": "build/index.js",
|
|
8
|
-
"types": "build/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./build/index.d.ts",
|
|
12
|
-
"import": "./build/index.js",
|
|
13
|
-
"require": "./build/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./constants": {
|
|
16
|
-
"types": "./build/constants/index.d.ts",
|
|
17
|
-
"import": "./build/constants/index.js",
|
|
18
|
-
"require": "./build/constants/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./components": {
|
|
21
|
-
"types": "./build/components/index.d.ts",
|
|
22
|
-
"import": "./build/components/index.js",
|
|
23
|
-
"require": "./build/components/index.js"
|
|
24
|
-
},
|
|
25
|
-
"./components/*": {
|
|
26
|
-
"types": "./build/components/*/index.d.ts",
|
|
27
|
-
"import": "./build/components/*/index.js",
|
|
28
|
-
"require": "./build/components/*/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./hooks": {
|
|
31
|
-
"types": "./build/hooks/index.d.ts",
|
|
32
|
-
"import": "./build/hooks/index.js",
|
|
33
|
-
"require": "./build/hooks/index.js"
|
|
34
|
-
},
|
|
35
|
-
"./utils": {
|
|
36
|
-
"types": "./build/utils/index.d.ts",
|
|
37
|
-
"import": "./build/utils/index.js",
|
|
38
|
-
"require": "./build/utils/index.js"
|
|
39
|
-
},
|
|
40
|
-
"./theme": {
|
|
41
|
-
"types": "./build/theme/index.d.ts",
|
|
42
|
-
"import": "./build/theme/index.js",
|
|
43
|
-
"require": "./build/theme/index.js"
|
|
44
|
-
},
|
|
45
|
-
"./types": {
|
|
46
|
-
"types": "./build/types/index.d.ts",
|
|
47
|
-
"import": "./build/types/index.js",
|
|
48
|
-
"require": "./build/types/index.js"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"license": "MIT",
|
|
52
|
-
"author": {
|
|
53
|
-
"name": "Ahmed Sharkawy",
|
|
54
|
-
"email": "a.elsharkawy@tap.company"
|
|
55
|
-
},
|
|
56
|
-
"files": [
|
|
57
|
-
"build",
|
|
58
|
-
"readme.md"
|
|
59
|
-
],
|
|
60
|
-
"scripts": {
|
|
61
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
62
|
-
"push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
|
|
63
|
-
"dev": "vite",
|
|
64
|
-
"build": "tsc -b && vite build ",
|
|
65
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
66
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
67
|
-
"lint": "eslint . --color",
|
|
68
|
-
"lint:fix": "eslint src --fix --color",
|
|
69
|
-
"preview": "vite preview",
|
|
70
|
-
"prepare": "husky"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"@emotion/react": "^11.11.0",
|
|
74
|
-
"@emotion/styled": "^11.11.0",
|
|
75
|
-
"@hookform/resolvers": "^3.3.1",
|
|
76
|
-
"@mui/material": "^5.12.3",
|
|
77
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
78
|
-
"axios": "^1.4.0",
|
|
79
|
-
"dayjs": "^1.11.8",
|
|
80
|
-
"framer-motion": "10.11.0",
|
|
81
|
-
"i18next": "^22.4.15",
|
|
82
|
-
"memoize-one": "^6.0.0",
|
|
83
|
-
"re-resizable": "^6.9.9",
|
|
84
|
-
"react": "^18.2.0",
|
|
85
|
-
"react-currency-input-field": "^3.6.11",
|
|
86
|
-
"react-dom": "^18.2.0",
|
|
87
|
-
"react-draggable": "^4.4.6",
|
|
88
|
-
"react-dropzone": "^14.2.3",
|
|
89
|
-
"react-hook-form": "^7.45.4",
|
|
90
|
-
"react-hot-toast": "^2.4.1",
|
|
91
|
-
"react-i18next": "^12.2.2",
|
|
92
|
-
"react-multi-date-picker": "^4.1.2",
|
|
93
|
-
"react-router-dom": "^6.14.2",
|
|
94
|
-
"react-virtualized-auto-sizer": "^1.0.20",
|
|
95
|
-
"react-window": "^1.8.9",
|
|
96
|
-
"react-window-infinite-loader": "^1.0.9",
|
|
97
|
-
"react18-input-otp": "^1.1.4",
|
|
98
|
-
"recharts": "^2.15.1"
|
|
99
|
-
},
|
|
100
|
-
"devDependencies": {
|
|
101
|
-
"@eslint/js": "^9.17.0",
|
|
102
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
103
|
-
"@types/lodash": "^4.17.15",
|
|
104
|
-
"@types/react": "^18.2.6",
|
|
105
|
-
"@types/react-dom": "^18.3.5",
|
|
106
|
-
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
107
|
-
"@types/react-window": "^1.8.5",
|
|
108
|
-
"@types/react-window-infinite-loader": "^1.0.6",
|
|
109
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
110
|
-
"eslint": "^9.17.0",
|
|
111
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
112
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
113
|
-
"globals": "^15.14.0",
|
|
114
|
-
"husky": "^8.0.3",
|
|
115
|
-
"lint-staged": "^13.2.2",
|
|
116
|
-
"prettier": "^2.8.8",
|
|
117
|
-
"tsc-alias": "^1.8.16",
|
|
118
|
-
"typescript": "5.0.2",
|
|
119
|
-
"typescript-eslint": "^8.18.2",
|
|
120
|
-
"vite": "6.0.5",
|
|
121
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
122
|
-
},
|
|
123
|
-
"lint-staged": {
|
|
124
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
125
|
-
"yarn run prettier:fix",
|
|
126
|
-
"yarn run lint"
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.0.69-sheetview-pin-v1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"types": "build/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./build/index.d.ts",
|
|
12
|
+
"import": "./build/index.js",
|
|
13
|
+
"require": "./build/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./constants": {
|
|
16
|
+
"types": "./build/constants/index.d.ts",
|
|
17
|
+
"import": "./build/constants/index.js",
|
|
18
|
+
"require": "./build/constants/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./components": {
|
|
21
|
+
"types": "./build/components/index.d.ts",
|
|
22
|
+
"import": "./build/components/index.js",
|
|
23
|
+
"require": "./build/components/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./components/*": {
|
|
26
|
+
"types": "./build/components/*/index.d.ts",
|
|
27
|
+
"import": "./build/components/*/index.js",
|
|
28
|
+
"require": "./build/components/*/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./hooks": {
|
|
31
|
+
"types": "./build/hooks/index.d.ts",
|
|
32
|
+
"import": "./build/hooks/index.js",
|
|
33
|
+
"require": "./build/hooks/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./utils": {
|
|
36
|
+
"types": "./build/utils/index.d.ts",
|
|
37
|
+
"import": "./build/utils/index.js",
|
|
38
|
+
"require": "./build/utils/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./theme": {
|
|
41
|
+
"types": "./build/theme/index.d.ts",
|
|
42
|
+
"import": "./build/theme/index.js",
|
|
43
|
+
"require": "./build/theme/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./types": {
|
|
46
|
+
"types": "./build/types/index.d.ts",
|
|
47
|
+
"import": "./build/types/index.js",
|
|
48
|
+
"require": "./build/types/index.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": {
|
|
53
|
+
"name": "Ahmed Sharkawy",
|
|
54
|
+
"email": "a.elsharkawy@tap.company"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"build",
|
|
58
|
+
"readme.md"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
62
|
+
"push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
|
|
63
|
+
"dev": "vite",
|
|
64
|
+
"build": "tsc -b && vite build ",
|
|
65
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
66
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
67
|
+
"lint": "eslint . --color",
|
|
68
|
+
"lint:fix": "eslint src --fix --color",
|
|
69
|
+
"preview": "vite preview",
|
|
70
|
+
"prepare": "husky"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@emotion/react": "^11.11.0",
|
|
74
|
+
"@emotion/styled": "^11.11.0",
|
|
75
|
+
"@hookform/resolvers": "^3.3.1",
|
|
76
|
+
"@mui/material": "^5.12.3",
|
|
77
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
78
|
+
"axios": "^1.4.0",
|
|
79
|
+
"dayjs": "^1.11.8",
|
|
80
|
+
"framer-motion": "10.11.0",
|
|
81
|
+
"i18next": "^22.4.15",
|
|
82
|
+
"memoize-one": "^6.0.0",
|
|
83
|
+
"re-resizable": "^6.9.9",
|
|
84
|
+
"react": "^18.2.0",
|
|
85
|
+
"react-currency-input-field": "^3.6.11",
|
|
86
|
+
"react-dom": "^18.2.0",
|
|
87
|
+
"react-draggable": "^4.4.6",
|
|
88
|
+
"react-dropzone": "^14.2.3",
|
|
89
|
+
"react-hook-form": "^7.45.4",
|
|
90
|
+
"react-hot-toast": "^2.4.1",
|
|
91
|
+
"react-i18next": "^12.2.2",
|
|
92
|
+
"react-multi-date-picker": "^4.1.2",
|
|
93
|
+
"react-router-dom": "^6.14.2",
|
|
94
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
95
|
+
"react-window": "^1.8.9",
|
|
96
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
97
|
+
"react18-input-otp": "^1.1.4",
|
|
98
|
+
"recharts": "^2.15.1"
|
|
99
|
+
},
|
|
100
|
+
"devDependencies": {
|
|
101
|
+
"@eslint/js": "^9.17.0",
|
|
102
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
103
|
+
"@types/lodash": "^4.17.15",
|
|
104
|
+
"@types/react": "^18.2.6",
|
|
105
|
+
"@types/react-dom": "^18.3.5",
|
|
106
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
107
|
+
"@types/react-window": "^1.8.5",
|
|
108
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
109
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
110
|
+
"eslint": "^9.17.0",
|
|
111
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
112
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
113
|
+
"globals": "^15.14.0",
|
|
114
|
+
"husky": "^8.0.3",
|
|
115
|
+
"lint-staged": "^13.2.2",
|
|
116
|
+
"prettier": "^2.8.8",
|
|
117
|
+
"tsc-alias": "^1.8.16",
|
|
118
|
+
"typescript": "5.0.2",
|
|
119
|
+
"typescript-eslint": "^8.18.2",
|
|
120
|
+
"vite": "6.0.5",
|
|
121
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
122
|
+
},
|
|
123
|
+
"lint-staged": {
|
|
124
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
125
|
+
"yarn run prettier:fix",
|
|
126
|
+
"yarn run lint"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|