@tap-payments/os-micro-frontend-shared 0.1.102 → 0.1.103-test.107
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/ColorPicker/ColorPicker.d.ts +4 -1
- package/build/components/ColorPicker/ColorPicker.js +3 -12
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +38 -17
- package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.js +25 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.js +27 -4
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +18 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +15 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +8 -4
- package/build/components/VirtualTables/optimization/AnimationOptimizations.d.ts +25 -0
- package/build/components/VirtualTables/optimization/AnimationOptimizations.js +86 -0
- package/build/utils/color.d.ts +11 -0
- package/build/utils/color.js +10 -0
- package/package.json +143 -139
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
|
+
```
|
|
@@ -5,6 +5,9 @@ type ColorPickerProps = {
|
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
onReset?: () => void;
|
|
7
7
|
sx?: SxProps;
|
|
8
|
+
options?: {
|
|
9
|
+
hideReset?: boolean;
|
|
10
|
+
};
|
|
8
11
|
};
|
|
9
|
-
declare const ColorPicker: ({ id, value, onChange, onReset, sx }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const ColorPicker: ({ id, value, onChange, onReset, sx, options }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
export default ColorPicker;
|
|
@@ -13,7 +13,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { useCallback, useRef, useState } from 'react';
|
|
14
14
|
import { RgbaColorPicker } from 'react-colorful';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import Color from 'color';
|
|
17
16
|
import Box from '@mui/material/Box';
|
|
18
17
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
19
18
|
import Divider from '@mui/material/Divider';
|
|
@@ -22,16 +21,8 @@ import Stack from '@mui/material/Stack';
|
|
|
22
21
|
import Typography from '@mui/material/Typography';
|
|
23
22
|
import { CancelButton, ConfirmButton, Footer, StyledCloseButtonWrapper, StyledColorWidgetWrapper } from './style';
|
|
24
23
|
import { closeXIcon } from '../../constants/index.js';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const { r, g, b, alpha = 1 } = colorInstance.object();
|
|
28
|
-
return {
|
|
29
|
-
value: { r, g, b, alpha },
|
|
30
|
-
stringified: `rgba(${r},${g},${b},${alpha})`,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const rgba2Hexa = (value) => Color(value).hexa();
|
|
34
|
-
const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx }) => {
|
|
24
|
+
import { hexa2Rgba, rgba2Hexa } from '../../utils/index.js';
|
|
25
|
+
const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx, options }) => {
|
|
35
26
|
const { t } = useTranslation();
|
|
36
27
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
37
28
|
const rootRef = useRef(null);
|
|
@@ -54,6 +45,6 @@ const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx }) => {
|
|
|
54
45
|
onChange(rgba2Hexa(Object.assign(Object.assign({}, rest), { alpha })));
|
|
55
46
|
setAnchorEl(null);
|
|
56
47
|
}, [onChange, color]);
|
|
57
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: () => setAnchorEl(null) }, { children: _jsxs(Stack, Object.assign({ ref: rootRef, bgcolor: "grey.400", borderRadius: "4px", p: "4px", pr: "12px", direction: "row", justifyContent: "space-between", spacing: 1, alignItems: "center", className: "color-picker" }, { children: [_jsxs(Stack, Object.assign({
|
|
48
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: () => setAnchorEl(null) }, { children: _jsxs(Stack, Object.assign({ ref: rootRef, bgcolor: "grey.400", borderRadius: "4px", p: "4px", pr: "12px", direction: "row", justifyContent: "space-between", spacing: 1, alignItems: "center", className: "color-picker", sx: sx }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", className: "color-picker__controls-wrapper" }, { children: [_jsx(Box, { borderRadius: "5px", width: 32, height: 32, sx: { backgroundColor: value }, className: "color-picker__viewer" }), _jsxs(Box, Object.assign({ className: "color-picker__actions-wrapper" }, { children: [_jsx(Typography, Object.assign({ className: "color-picker__label", fontWeight: 500, fontSize: 9, color: "text.primary", textTransform: "uppercase" }, { children: value })), _jsx(Typography, Object.assign({ className: "color-picker__edit-btn", role: "button", onClick: handleOpen, htmlFor: id, fontWeight: 500, fontSize: 9, color: "info.dark", component: "label", sx: { textDecoration: 'underline', cursor: 'pointer' } }, { children: "Edit" }))] }))] })), !(options === null || options === void 0 ? void 0 : options.hideReset) ? (_jsx(StyledCloseButtonWrapper, Object.assign({ className: "color-picker__close-btn", type: "button", onClick: onReset }, { children: _jsx(Box, { component: "img", src: closeXIcon, width: 10, height: 10 }) }))) : (_jsx("div", {})), _jsx(Popper, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, placement: "top" }, { children: _jsxs(StyledColorWidgetWrapper, Object.assign({ className: "color-picker__widget" }, { children: [_jsx(RgbaColorPicker, { color: color, onChange: setColor }), _jsx(Divider, { sx: { my: '12px' } }), _jsxs(Footer, Object.assign({ className: "color-picker__widget-actions" }, { children: [_jsx(CancelButton, Object.assign({ className: "color-picker__widget-actions__cancel", onClick: handleCancel }, { children: t('cancel') })), _jsx(ConfirmButton, Object.assign({ className: "color-picker__widget-actions__confirm", onClick: handleConfirm }, { children: t('okay') }))] }))] })) }))] })) })));
|
|
58
49
|
};
|
|
59
50
|
export default ColorPicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback } from 'react';
|
|
2
|
+
import { memo, useCallback, useMemo } from 'react';
|
|
3
3
|
import { SHEET_VIEW_TABLE_THRESHOLD } from '../../../constants/index.js';
|
|
4
4
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
5
5
|
import { SheetViewTableContainer } from '../components/style';
|
|
@@ -37,30 +37,51 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
37
37
|
const onPointerDown = (e) => {
|
|
38
38
|
dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
|
|
39
39
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
const scrollHandlers = useMemo(() => ({
|
|
41
|
+
start: (scrollProps) => handleScroll(scrollProps, 'start'),
|
|
42
|
+
end: (scrollProps) => handleScroll(scrollProps, 'end'),
|
|
43
|
+
scrollable: (scrollProps) => handleScroll(scrollProps, 'scrollable'),
|
|
44
|
+
}), [handleScroll]);
|
|
45
|
+
const stableTableProps = useMemo(() => ({
|
|
46
|
+
itemCount: itemsCount,
|
|
47
|
+
lastItemIndex,
|
|
48
|
+
areAllRowsLoaded,
|
|
49
|
+
loadMoreItems,
|
|
50
|
+
threshold,
|
|
51
|
+
areTotalRowsNotFillingHeight,
|
|
52
|
+
clearBackdropVisibilityTimeout,
|
|
53
|
+
overscanCount,
|
|
54
|
+
}), [
|
|
48
55
|
itemsCount,
|
|
49
56
|
lastItemIndex,
|
|
50
57
|
areAllRowsLoaded,
|
|
51
58
|
loadMoreItems,
|
|
52
59
|
threshold,
|
|
53
|
-
getItemSize,
|
|
54
|
-
getItemDataForContainer,
|
|
55
|
-
scrollToIndex,
|
|
56
60
|
areTotalRowsNotFillingHeight,
|
|
57
61
|
clearBackdropVisibilityTimeout,
|
|
58
|
-
|
|
59
|
-
setShowBackdrop,
|
|
60
|
-
pinnedStartVirtualListRef,
|
|
61
|
-
pinnedEndVirtualListRef,
|
|
62
|
-
scrollableVirtualListRef,
|
|
62
|
+
overscanCount,
|
|
63
63
|
]);
|
|
64
|
+
const dynamicTableProps = useMemo(() => ({
|
|
65
|
+
getItemSize,
|
|
66
|
+
getItemData: getItemDataForContainer,
|
|
67
|
+
scrollToIndex,
|
|
68
|
+
setBackdropVisibility: setShowBackdrop,
|
|
69
|
+
}), [getItemSize, getItemDataForContainer, scrollToIndex, setShowBackdrop]);
|
|
70
|
+
const createPinnedStartTable = useCallback((columnsData, fixedWidth) => (_jsx(VirtualTable, Object.assign({ columnsData: columnsData }, stableTableProps, dynamicTableProps, { isPinned: true, fixedWidth: fixedWidth, onScroll: scrollHandlers.start, listRef: pinnedStartVirtualListRef }), "pinned-start")), [stableTableProps, dynamicTableProps, scrollHandlers.start, pinnedStartVirtualListRef]);
|
|
71
|
+
const createPinnedEndTable = useCallback((columnsData, fixedWidth) => (_jsx(VirtualTable, Object.assign({ columnsData: columnsData }, stableTableProps, dynamicTableProps, { isPinned: true, fixedWidth: fixedWidth, onScroll: scrollHandlers.end, listRef: pinnedEndVirtualListRef }), "pinned-end")), [stableTableProps, dynamicTableProps, scrollHandlers.end, pinnedEndVirtualListRef]);
|
|
72
|
+
const createScrollableTable = useCallback((columnsData) => (_jsx(VirtualTable, Object.assign({ columnsData: columnsData }, stableTableProps, dynamicTableProps, { isPinned: false, onScroll: scrollHandlers.scrollable, listRef: scrollableVirtualListRef }), "scrollable")), [stableTableProps, dynamicTableProps, scrollHandlers.scrollable, scrollableVirtualListRef]);
|
|
73
|
+
console.log({ selectedCell, selectedColumn, selectedRow, selectedChip });
|
|
74
|
+
const createVirtualTableContainer = useCallback((columnsData, containerKey, isPinned = false, fixedWidth) => {
|
|
75
|
+
switch (containerKey) {
|
|
76
|
+
case 'pinnedStart':
|
|
77
|
+
return createPinnedStartTable(columnsData, fixedWidth);
|
|
78
|
+
case 'pinnedEnd':
|
|
79
|
+
return createPinnedEndTable(columnsData, fixedWidth);
|
|
80
|
+
case 'scrollable':
|
|
81
|
+
default:
|
|
82
|
+
return createScrollableTable(columnsData);
|
|
83
|
+
}
|
|
84
|
+
}, [createPinnedStartTable, createPinnedEndTable, createScrollableTable]);
|
|
64
85
|
const baseCommonProps = {
|
|
65
86
|
showHeader,
|
|
66
87
|
columnsSorting,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
3
|
import { useTheme } from '@mui/material/styles';
|
|
4
4
|
import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style';
|
|
5
5
|
import { MainTableWrapper, UnpinnedTableHeaderWrapper } from '../style';
|
|
@@ -7,7 +7,9 @@ import SheetViewTableHeader from './SheetViewTableHeader';
|
|
|
7
7
|
import SheetViewTableLoading from './SheetViewTableLoading';
|
|
8
8
|
function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, tableLoading, createVirtualTableContainer, }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
|
-
|
|
10
|
+
const allPinnedColumns = useMemo(() => [...pinnedStartColumns, ...pinnedEndColumns], [pinnedStartColumns, pinnedEndColumns]);
|
|
11
|
+
const memoizedTableBodyStyles = useMemo(() => (Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' })), [tableBodyStyles]);
|
|
12
|
+
return (_jsx(MainTableWrapper, Object.assign({ hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: memoizedTableBodyStyles }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: allPinnedColumns, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: "scrollable", hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
11
13
|
width: '100%',
|
|
12
14
|
minWidth: 'fit-content',
|
|
13
15
|
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper", sx: {
|
|
@@ -16,4 +18,24 @@ function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHead
|
|
|
16
18
|
overflow: 'hidden',
|
|
17
19
|
} }, { children: tableLoading ? (_jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: unpinnedColumnsData, isLoading: true, isPinned: false })) : (createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false)) })) }))] })) })) })));
|
|
18
20
|
}
|
|
19
|
-
export default memo(MainTable)
|
|
21
|
+
export default memo(MainTable, (prevProps, nextProps) => {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
23
|
+
const criticalProps = [
|
|
24
|
+
'hasPinnedStart',
|
|
25
|
+
'hasPinnedEnd',
|
|
26
|
+
'showHeader',
|
|
27
|
+
'showBackDrop',
|
|
28
|
+
'tableLoading',
|
|
29
|
+
'showNoDataView',
|
|
30
|
+
'isLoading',
|
|
31
|
+
'isError',
|
|
32
|
+
'hasTimeoutError',
|
|
33
|
+
'tableMode',
|
|
34
|
+
];
|
|
35
|
+
const areCriticalPropsSame = criticalProps.every((prop) => prevProps[prop] === nextProps[prop]);
|
|
36
|
+
const areColumnsDataSame = ((_a = prevProps.unpinnedColumnsData) === null || _a === void 0 ? void 0 : _a.length) === ((_b = nextProps.unpinnedColumnsData) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
37
|
+
((_c = prevProps.unpinnedColumnsData) === null || _c === void 0 ? void 0 : _c.every((col, index) => { var _a, _b; return col.id === ((_b = (_a = nextProps.unpinnedColumnsData) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.id); }));
|
|
38
|
+
const arePinnedColumnsSame = ((_d = prevProps.pinnedStartColumns) === null || _d === void 0 ? void 0 : _d.length) === ((_e = nextProps.pinnedStartColumns) === null || _e === void 0 ? void 0 : _e.length) &&
|
|
39
|
+
((_f = prevProps.pinnedEndColumns) === null || _f === void 0 ? void 0 : _f.length) === ((_g = nextProps.pinnedEndColumns) === null || _g === void 0 ? void 0 : _g.length);
|
|
40
|
+
return areCriticalPropsSame && areColumnsDataSame && arePinnedColumnsSame;
|
|
41
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
3
|
import { useTheme } from '@mui/material/styles';
|
|
4
4
|
import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style';
|
|
5
5
|
import { PinnedStartColumnWrapper, PinnedEndColumnWrapper } from '../style';
|
|
@@ -7,10 +7,15 @@ import SheetViewTableHeader from './SheetViewTableHeader';
|
|
|
7
7
|
import SheetViewTableLoading from './SheetViewTableLoading';
|
|
8
8
|
function PinnedColumn({ position, columnsData, columnsWidth, pinnedColumnsList, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, hasPinnedStart, hasPinnedEnd, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableLoading, createVirtualTableContainer, }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
|
+
const { Wrapper, containerKey } = useMemo(() => {
|
|
11
|
+
const key = position === 'start' ? 'pinnedStart' : 'pinnedEnd';
|
|
12
|
+
return {
|
|
13
|
+
Wrapper: position === 'start' ? PinnedStartColumnWrapper : PinnedEndColumnWrapper,
|
|
14
|
+
containerKey: key,
|
|
15
|
+
};
|
|
16
|
+
}, [position]);
|
|
10
17
|
if (columnsData.length === 0)
|
|
11
18
|
return null;
|
|
12
|
-
const Wrapper = position === 'start' ? PinnedStartColumnWrapper : PinnedEndColumnWrapper;
|
|
13
|
-
const containerKey = position === 'start' ? 'pinnedStart' : 'pinnedEnd';
|
|
14
19
|
return (_jsx(Wrapper, { children: _jsxs(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: [showHeader && (_jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_PinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: columnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: pinnedColumnsList, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: position === 'start' ? 'pinnedStart' : 'pinnedEnd', hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
15
20
|
width: '100%',
|
|
16
21
|
minWidth: 'fit-content',
|
|
@@ -21,4 +26,22 @@ function PinnedColumn({ position, columnsData, columnsWidth, pinnedColumnsList,
|
|
|
21
26
|
overflow: 'hidden',
|
|
22
27
|
} }, { children: tableLoading ? (_jsx(SheetViewTableLoading, { "data-testid": `SheetViewVirtualTable_PinnedTableLoading_${position}`, columns: columnsData, isLoading: true, isPinned: true })) : (createVirtualTableContainer(columnsData, containerKey, true, columnsWidth)) })) }))] })) }));
|
|
23
28
|
}
|
|
24
|
-
export default memo(PinnedColumn)
|
|
29
|
+
export default memo(PinnedColumn, (prevProps, nextProps) => {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31
|
+
const criticalProps = [
|
|
32
|
+
'position',
|
|
33
|
+
'columnsWidth',
|
|
34
|
+
'showHeader',
|
|
35
|
+
'showBackDrop',
|
|
36
|
+
'tableLoading',
|
|
37
|
+
'showNoDataView',
|
|
38
|
+
'hasPinnedStart',
|
|
39
|
+
'hasPinnedEnd',
|
|
40
|
+
];
|
|
41
|
+
const areCriticalPropsSame = criticalProps.every((prop) => prevProps[prop] === nextProps[prop]);
|
|
42
|
+
const areColumnsDataSame = ((_a = prevProps.columnsData) === null || _a === void 0 ? void 0 : _a.length) === ((_b = nextProps.columnsData) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
43
|
+
((_c = prevProps.columnsData) === null || _c === void 0 ? void 0 : _c.every((col, index) => { var _a, _b, _c, _d; return col.id === ((_b = (_a = nextProps.columnsData) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.id) && col.width === ((_d = (_c = nextProps.columnsData) === null || _c === void 0 ? void 0 : _c[index]) === null || _d === void 0 ? void 0 : _d.width); }));
|
|
44
|
+
const arePinnedColumnsSame = ((_d = prevProps.pinnedColumnsList) === null || _d === void 0 ? void 0 : _d.length) === ((_e = nextProps.pinnedColumnsList) === null || _e === void 0 ? void 0 : _e.length) &&
|
|
45
|
+
((_f = prevProps.pinnedColumnsList) === null || _f === void 0 ? void 0 : _f.every((col, index) => { var _a; return col === ((_a = nextProps.pinnedColumnsList) === null || _a === void 0 ? void 0 : _a[index]); }));
|
|
46
|
+
return areCriticalPropsSame && areColumnsDataSame && arePinnedColumnsSame;
|
|
47
|
+
});
|
|
@@ -30,4 +30,21 @@ function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded,
|
|
|
30
30
|
} }, { children: ListItemWrapper })));
|
|
31
31
|
} }))) })));
|
|
32
32
|
}
|
|
33
|
-
export default memo(VirtualTable)
|
|
33
|
+
export default memo(VirtualTable, (prevProps, nextProps) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const propsToCompare = [
|
|
36
|
+
'columnsData',
|
|
37
|
+
'itemCount',
|
|
38
|
+
'lastItemIndex',
|
|
39
|
+
'areAllRowsLoaded',
|
|
40
|
+
'isPinned',
|
|
41
|
+
'fixedWidth',
|
|
42
|
+
'scrollToIndex',
|
|
43
|
+
'areTotalRowsNotFillingHeight',
|
|
44
|
+
'overscanCount',
|
|
45
|
+
];
|
|
46
|
+
const areCriticalPropsSame = propsToCompare.every((key) => prevProps[key] === nextProps[key]);
|
|
47
|
+
const areColumnsDataSame = ((_a = prevProps.columnsData) === null || _a === void 0 ? void 0 : _a.length) === ((_b = nextProps.columnsData) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
48
|
+
((_c = prevProps.columnsData) === null || _c === void 0 ? void 0 : _c.every((col, index) => { var _a, _b, _c, _d; return col.id === ((_b = (_a = nextProps.columnsData) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.id) && col.width === ((_d = (_c = nextProps.columnsData) === null || _c === void 0 ? void 0 : _c[index]) === null || _d === void 0 ? void 0 : _d.width); }));
|
|
49
|
+
return areCriticalPropsSame && areColumnsDataSame;
|
|
50
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
1
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
2
2
|
export const useTableState = () => {
|
|
3
3
|
const [selectedCell, setSelectedCell] = useState(null);
|
|
4
4
|
const [selectedColumn, setSelectedColumn] = useState(null);
|
|
@@ -48,7 +48,7 @@ export const useTableState = () => {
|
|
|
48
48
|
setSelectedChip(null);
|
|
49
49
|
setSelectedRow(null);
|
|
50
50
|
}, []);
|
|
51
|
-
|
|
51
|
+
const tableStateAPI = useMemo(() => ({
|
|
52
52
|
selectedCell,
|
|
53
53
|
selectedColumn,
|
|
54
54
|
selectedRow,
|
|
@@ -59,5 +59,17 @@ export const useTableState = () => {
|
|
|
59
59
|
handleCellClick,
|
|
60
60
|
handleColumnClick,
|
|
61
61
|
resetSelection,
|
|
62
|
-
}
|
|
62
|
+
}), [
|
|
63
|
+
selectedCell,
|
|
64
|
+
selectedColumn,
|
|
65
|
+
selectedRow,
|
|
66
|
+
showBackDrop,
|
|
67
|
+
selectedChip,
|
|
68
|
+
setShowBackdrop,
|
|
69
|
+
handleChipClick,
|
|
70
|
+
handleCellClick,
|
|
71
|
+
handleColumnClick,
|
|
72
|
+
resetSelection,
|
|
73
|
+
]);
|
|
74
|
+
return tableStateAPI;
|
|
63
75
|
};
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useMemo } from 'react';
|
|
1
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import memoize from 'memoize-one';
|
|
3
3
|
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, selectedRow, selectedChip, onCellClick, onChipClick, containerHeight, rowHeight) => ({
|
|
4
4
|
columns,
|
|
@@ -24,16 +24,20 @@ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToInde
|
|
|
24
24
|
rowHeight,
|
|
25
25
|
}));
|
|
26
26
|
export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, selectedRow, selectedChip, handleCellClick, handleChipClick, }) => {
|
|
27
|
+
const stableRowsLength = useRef(rows.length);
|
|
28
|
+
if (stableRowsLength.current !== rows.length) {
|
|
29
|
+
stableRowsLength.current = rows.length;
|
|
30
|
+
}
|
|
27
31
|
const getItemSize = useCallback((index, height) => {
|
|
28
|
-
const isLastRow = areAllRowsLoaded && index ===
|
|
32
|
+
const isLastRow = areAllRowsLoaded && index === stableRowsLength.current;
|
|
29
33
|
if (isLastRow) {
|
|
30
|
-
const usedHeight =
|
|
34
|
+
const usedHeight = stableRowsLength.current * rowHeight;
|
|
31
35
|
const remainingHeight = height - usedHeight;
|
|
32
36
|
const minimumLastRowHeight = rowHeight * 2;
|
|
33
37
|
return Math.max(remainingHeight, minimumLastRowHeight);
|
|
34
38
|
}
|
|
35
39
|
return rowHeight;
|
|
36
|
-
}, [areAllRowsLoaded,
|
|
40
|
+
}, [areAllRowsLoaded, rowHeight]);
|
|
37
41
|
const commonItemDataParams = useMemo(() => {
|
|
38
42
|
var _a;
|
|
39
43
|
return [
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useAnimationOptimization: (isAnimating: boolean) => ((callback: () => void) => void) | null;
|
|
3
|
+
export declare const OptimizedAnimatedCell: import("react").MemoExoticComponent<({ children, ...props }: {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export declare const animationStyles: {
|
|
8
|
+
slideIn: {
|
|
9
|
+
transform: string;
|
|
10
|
+
transition: string;
|
|
11
|
+
};
|
|
12
|
+
slideOut: {
|
|
13
|
+
transform: string;
|
|
14
|
+
transition: string;
|
|
15
|
+
};
|
|
16
|
+
fadeIn: {
|
|
17
|
+
opacity: number;
|
|
18
|
+
transition: string;
|
|
19
|
+
};
|
|
20
|
+
fadeOut: {
|
|
21
|
+
opacity: number;
|
|
22
|
+
transition: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const useScrollOptimization: () => boolean;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { memo, useMemo, useRef, useEffect } from 'react';
|
|
14
|
+
const optimizedCellStyles = {
|
|
15
|
+
willChange: 'transform, opacity',
|
|
16
|
+
transform: 'translateZ(0)',
|
|
17
|
+
contain: 'layout style paint',
|
|
18
|
+
};
|
|
19
|
+
export const useAnimationOptimization = (isAnimating) => {
|
|
20
|
+
const animationFrameRef = useRef();
|
|
21
|
+
const throttledUpdate = useMemo(() => {
|
|
22
|
+
if (!isAnimating)
|
|
23
|
+
return null;
|
|
24
|
+
return (callback) => {
|
|
25
|
+
if (animationFrameRef.current) {
|
|
26
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
27
|
+
}
|
|
28
|
+
animationFrameRef.current = requestAnimationFrame(callback);
|
|
29
|
+
};
|
|
30
|
+
}, [isAnimating]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
return () => {
|
|
33
|
+
if (animationFrameRef.current) {
|
|
34
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return throttledUpdate;
|
|
39
|
+
};
|
|
40
|
+
export const OptimizedAnimatedCell = memo((_a) => {
|
|
41
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
42
|
+
return (_jsx("div", Object.assign({ style: optimizedCellStyles }, props, { children: children })));
|
|
43
|
+
}, (prevProps, nextProps) => {
|
|
44
|
+
return prevProps.isAnimating === nextProps.isAnimating && prevProps.children === nextProps.children;
|
|
45
|
+
});
|
|
46
|
+
export const animationStyles = {
|
|
47
|
+
slideIn: {
|
|
48
|
+
transform: 'translateX(0)',
|
|
49
|
+
transition: 'transform 0.2s ease-out',
|
|
50
|
+
},
|
|
51
|
+
slideOut: {
|
|
52
|
+
transform: 'translateX(-100%)',
|
|
53
|
+
transition: 'transform 0.2s ease-out',
|
|
54
|
+
},
|
|
55
|
+
fadeIn: {
|
|
56
|
+
opacity: 1,
|
|
57
|
+
transition: 'opacity 0.15s ease-out',
|
|
58
|
+
},
|
|
59
|
+
fadeOut: {
|
|
60
|
+
opacity: 0,
|
|
61
|
+
transition: 'opacity 0.15s ease-out',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const useScrollOptimization = () => {
|
|
65
|
+
const isScrolling = useRef(false);
|
|
66
|
+
const scrollTimeoutRef = useRef();
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const handleScroll = () => {
|
|
69
|
+
isScrolling.current = true;
|
|
70
|
+
if (scrollTimeoutRef.current) {
|
|
71
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
72
|
+
}
|
|
73
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
74
|
+
isScrolling.current = false;
|
|
75
|
+
}, 150);
|
|
76
|
+
};
|
|
77
|
+
window.addEventListener('scroll', handleScroll, { passive: true });
|
|
78
|
+
return () => {
|
|
79
|
+
window.removeEventListener('scroll', handleScroll);
|
|
80
|
+
if (scrollTimeoutRef.current) {
|
|
81
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
return isScrolling.current;
|
|
86
|
+
};
|
package/build/utils/color.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { ColorObject } from 'color';
|
|
1
2
|
export declare function getRandomColor(): string;
|
|
2
3
|
export declare function getRandomGradientColor(): string;
|
|
4
|
+
export declare const hexa2Rgba: (value: string) => {
|
|
5
|
+
value: {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
alpha: number;
|
|
10
|
+
};
|
|
11
|
+
stringified: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const rgba2Hexa: (value: ColorObject) => string;
|
package/build/utils/color.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Color from 'color';
|
|
1
2
|
export function getRandomColor() {
|
|
2
3
|
const colors = [
|
|
3
4
|
'#D6D6D6',
|
|
@@ -36,3 +37,12 @@ export function getRandomGradientColor() {
|
|
|
36
37
|
];
|
|
37
38
|
return colors[Math.trunc(Math.random() * colors.length)];
|
|
38
39
|
}
|
|
40
|
+
export const hexa2Rgba = (value) => {
|
|
41
|
+
const colorInstance = Color(value).rgb();
|
|
42
|
+
const { r, g, b, alpha = 1 } = colorInstance.object();
|
|
43
|
+
return {
|
|
44
|
+
value: { r, g, b, alpha },
|
|
45
|
+
stringified: `rgba(${r},${g},${b},${alpha})`,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export const rgba2Hexa = (value) => Color(value).hexa();
|
package/package.json
CHANGED
|
@@ -1,139 +1,143 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"testVersion":
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "build/index.js",
|
|
8
|
-
"module": "build/index.js",
|
|
9
|
-
"types": "build/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./build/index.d.ts",
|
|
13
|
-
"import": "./build/index.js",
|
|
14
|
-
"require": "./build/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./constants": {
|
|
17
|
-
"types": "./build/constants/index.d.ts",
|
|
18
|
-
"import": "./build/constants/index.js",
|
|
19
|
-
"require": "./build/constants/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./components": {
|
|
22
|
-
"types": "./build/components/index.d.ts",
|
|
23
|
-
"import": "./build/components/index.js",
|
|
24
|
-
"require": "./build/components/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./components/*": {
|
|
27
|
-
"types": "./build/components/*/index.d.ts",
|
|
28
|
-
"import": "./build/components/*/index.js",
|
|
29
|
-
"require": "./build/components/*/index.js"
|
|
30
|
-
},
|
|
31
|
-
"./hooks": {
|
|
32
|
-
"types": "./build/hooks/index.d.ts",
|
|
33
|
-
"import": "./build/hooks/index.js",
|
|
34
|
-
"require": "./build/hooks/index.js"
|
|
35
|
-
},
|
|
36
|
-
"./utils": {
|
|
37
|
-
"types": "./build/utils/index.d.ts",
|
|
38
|
-
"import": "./build/utils/index.js",
|
|
39
|
-
"require": "./build/utils/index.js"
|
|
40
|
-
},
|
|
41
|
-
"./theme": {
|
|
42
|
-
"types": "./build/theme/index.d.ts",
|
|
43
|
-
"import": "./build/theme/index.js",
|
|
44
|
-
"require": "./build/theme/index.js"
|
|
45
|
-
},
|
|
46
|
-
"./types": {
|
|
47
|
-
"types": "./build/types/index.d.ts",
|
|
48
|
-
"import": "./build/types/index.js",
|
|
49
|
-
"require": "./build/types/index.js"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"author": {
|
|
54
|
-
"name": "Ahmed Sharkawy",
|
|
55
|
-
"email": "a.elsharkawy@tap.company"
|
|
56
|
-
},
|
|
57
|
-
"files": [
|
|
58
|
-
"build",
|
|
59
|
-
"readme.md"
|
|
60
|
-
],
|
|
61
|
-
"scripts": {
|
|
62
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
-
"push:local": "yarn ts:build && yalc publish --push",
|
|
64
|
-
"push": "npm run ts:build && npm publish --access public",
|
|
65
|
-
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
66
|
-
"dev": "vite",
|
|
67
|
-
"build": "tsc -b && vite build ",
|
|
68
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
69
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
70
|
-
"lint": "eslint . --color",
|
|
71
|
-
"lint:fix": "eslint src --fix --color",
|
|
72
|
-
"preview": "vite preview",
|
|
73
|
-
"prepare": "husky"
|
|
74
|
-
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@emotion/react": "^11.11.0",
|
|
77
|
-
"@emotion/styled": "^11.11.0",
|
|
78
|
-
"@hookform/resolvers": "^3.3.1",
|
|
79
|
-
"@mui/material": "^5.12.3",
|
|
80
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
81
|
-
"axios": "^1.4.0",
|
|
82
|
-
"color": "^5.0.0",
|
|
83
|
-
"dayjs": "^1.11.8",
|
|
84
|
-
"framer-motion": "10.11.0",
|
|
85
|
-
"i18next": "^22.4.15",
|
|
86
|
-
"memoize-one": "^6.0.0",
|
|
87
|
-
"re-resizable": "^6.9.9",
|
|
88
|
-
"react": "^18.2.0",
|
|
89
|
-
"react-colorful": "^5.6.1",
|
|
90
|
-
"react-currency-input-field": "^3.6.11",
|
|
91
|
-
"react-dom": "^18.2.0",
|
|
92
|
-
"react-draggable": "^4.4.6",
|
|
93
|
-
"react-dropzone": "^14.2.3",
|
|
94
|
-
"react-hook-form": "^7.45.4",
|
|
95
|
-
"react-hot-toast": "^2.4.1",
|
|
96
|
-
"react-i18next": "^12.2.2",
|
|
97
|
-
"react-lazy-load-image-component": "^1.6.3",
|
|
98
|
-
"react-multi-date-picker": "^4.1.2",
|
|
99
|
-
"react-router-dom": "^7.7.0",
|
|
100
|
-
"react-virtualized-auto-sizer": "^1.0.20",
|
|
101
|
-
"react-window": "^1.8.9",
|
|
102
|
-
"react-window-infinite-loader": "^1.0.9",
|
|
103
|
-
"react18-input-otp": "^1.1.4",
|
|
104
|
-
"recharts": "^2.15.1"
|
|
105
|
-
},
|
|
106
|
-
"devDependencies": {
|
|
107
|
-
"@eslint/js": "^9.17.0",
|
|
108
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
109
|
-
"@types/lodash": "^4.17.15",
|
|
110
|
-
"@types/react": "^18.2.6",
|
|
111
|
-
"@types/react-dom": "^18.3.5",
|
|
112
|
-
"@types/react-lazy-load-image-component": "^1.6.4",
|
|
113
|
-
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
114
|
-
"@types/react-window": "^1.8.5",
|
|
115
|
-
"@types/react-window-infinite-loader": "^1.0.6",
|
|
116
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
117
|
-
"eslint": "^9.17.0",
|
|
118
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
119
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
120
|
-
"globals": "^15.14.0",
|
|
121
|
-
"husky": "^
|
|
122
|
-
"lint-staged": "^
|
|
123
|
-
"prettier": "^2.8.8",
|
|
124
|
-
"tsc-alias": "^1.8.16",
|
|
125
|
-
"typescript": "5.0.2",
|
|
126
|
-
"typescript-eslint": "^8.18.2",
|
|
127
|
-
"vite": "
|
|
128
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
129
|
-
},
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.1.103-test.107",
|
|
5
|
+
"testVersion": 107,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "build/index.js",
|
|
8
|
+
"module": "build/index.js",
|
|
9
|
+
"types": "build/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./build/index.d.ts",
|
|
13
|
+
"import": "./build/index.js",
|
|
14
|
+
"require": "./build/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./constants": {
|
|
17
|
+
"types": "./build/constants/index.d.ts",
|
|
18
|
+
"import": "./build/constants/index.js",
|
|
19
|
+
"require": "./build/constants/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"types": "./build/components/index.d.ts",
|
|
23
|
+
"import": "./build/components/index.js",
|
|
24
|
+
"require": "./build/components/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./components/*": {
|
|
27
|
+
"types": "./build/components/*/index.d.ts",
|
|
28
|
+
"import": "./build/components/*/index.js",
|
|
29
|
+
"require": "./build/components/*/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./hooks": {
|
|
32
|
+
"types": "./build/hooks/index.d.ts",
|
|
33
|
+
"import": "./build/hooks/index.js",
|
|
34
|
+
"require": "./build/hooks/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./utils": {
|
|
37
|
+
"types": "./build/utils/index.d.ts",
|
|
38
|
+
"import": "./build/utils/index.js",
|
|
39
|
+
"require": "./build/utils/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./theme": {
|
|
42
|
+
"types": "./build/theme/index.d.ts",
|
|
43
|
+
"import": "./build/theme/index.js",
|
|
44
|
+
"require": "./build/theme/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./types": {
|
|
47
|
+
"types": "./build/types/index.d.ts",
|
|
48
|
+
"import": "./build/types/index.js",
|
|
49
|
+
"require": "./build/types/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "Ahmed Sharkawy",
|
|
55
|
+
"email": "a.elsharkawy@tap.company"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"build",
|
|
59
|
+
"readme.md"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
+
"push:local": "yarn ts:build && yalc publish --push",
|
|
64
|
+
"push": "npm run ts:build && npm publish --access public",
|
|
65
|
+
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
66
|
+
"dev": "vite",
|
|
67
|
+
"build": "tsc -b && vite build ",
|
|
68
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
69
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
70
|
+
"lint": "eslint . --color",
|
|
71
|
+
"lint:fix": "eslint src --fix --color",
|
|
72
|
+
"preview": "vite preview",
|
|
73
|
+
"prepare": "husky"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@emotion/react": "^11.11.0",
|
|
77
|
+
"@emotion/styled": "^11.11.0",
|
|
78
|
+
"@hookform/resolvers": "^3.3.1",
|
|
79
|
+
"@mui/material": "^5.12.3",
|
|
80
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
81
|
+
"axios": "^1.4.0",
|
|
82
|
+
"color": "^5.0.0",
|
|
83
|
+
"dayjs": "^1.11.8",
|
|
84
|
+
"framer-motion": "10.11.0",
|
|
85
|
+
"i18next": "^22.4.15",
|
|
86
|
+
"memoize-one": "^6.0.0",
|
|
87
|
+
"re-resizable": "^6.9.9",
|
|
88
|
+
"react": "^18.2.0",
|
|
89
|
+
"react-colorful": "^5.6.1",
|
|
90
|
+
"react-currency-input-field": "^3.6.11",
|
|
91
|
+
"react-dom": "^18.2.0",
|
|
92
|
+
"react-draggable": "^4.4.6",
|
|
93
|
+
"react-dropzone": "^14.2.3",
|
|
94
|
+
"react-hook-form": "^7.45.4",
|
|
95
|
+
"react-hot-toast": "^2.4.1",
|
|
96
|
+
"react-i18next": "^12.2.2",
|
|
97
|
+
"react-lazy-load-image-component": "^1.6.3",
|
|
98
|
+
"react-multi-date-picker": "^4.1.2",
|
|
99
|
+
"react-router-dom": "^7.7.0",
|
|
100
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
101
|
+
"react-window": "^1.8.9",
|
|
102
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
103
|
+
"react18-input-otp": "^1.1.4",
|
|
104
|
+
"recharts": "^2.15.1"
|
|
105
|
+
},
|
|
106
|
+
"devDependencies": {
|
|
107
|
+
"@eslint/js": "^9.17.0",
|
|
108
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
109
|
+
"@types/lodash": "^4.17.15",
|
|
110
|
+
"@types/react": "^18.2.6",
|
|
111
|
+
"@types/react-dom": "^18.3.5",
|
|
112
|
+
"@types/react-lazy-load-image-component": "^1.6.4",
|
|
113
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
114
|
+
"@types/react-window": "^1.8.5",
|
|
115
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
116
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
117
|
+
"eslint": "^9.17.0",
|
|
118
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
119
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
120
|
+
"globals": "^15.14.0",
|
|
121
|
+
"husky": "^9.1.7",
|
|
122
|
+
"lint-staged": "^16.1.6",
|
|
123
|
+
"prettier": "^2.8.8",
|
|
124
|
+
"tsc-alias": "^1.8.16",
|
|
125
|
+
"typescript": "5.0.2",
|
|
126
|
+
"typescript-eslint": "^8.18.2",
|
|
127
|
+
"vite": "^7.1.4",
|
|
128
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
129
|
+
},
|
|
130
|
+
"peerDependencies": {
|
|
131
|
+
"react": ">=18.0.0",
|
|
132
|
+
"react-dom": ">=18.0.0"
|
|
133
|
+
},
|
|
134
|
+
"lint-staged": {
|
|
135
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
136
|
+
"yarn run prettier:fix",
|
|
137
|
+
"yarn run lint"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"publishConfig": {
|
|
141
|
+
"registry": "https://registry.npmjs.org/"
|
|
142
|
+
}
|
|
143
|
+
}
|