@tap-payments/os-micro-frontend-shared 0.0.280 → 0.0.282
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/TableCells/CustomCells/DestinationCell/DestinationCell.js +22 -19
- package/build/components/VirtualTable/SheetView/SheetViewVirtualTable.js +2 -2
- package/build/components/VirtualTable/components/TableFooter/style.js +2 -2
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.d.ts +3 -1
- package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.js +10 -7
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.js +1 -1
- package/package.json +2 -2
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
|
+
```
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import Tooltip from '../../../Tooltip';
|
|
14
14
|
import { destinationSolidIcon } from '../../../../constants/index.js';
|
|
15
15
|
import { formatAmount } from '../../../../utils/index.js';
|
|
@@ -18,37 +18,40 @@ import TableCell from '../../TableCell';
|
|
|
18
18
|
import { TextLabel } from '../style';
|
|
19
19
|
import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
|
|
20
20
|
function DestinationCell(_a) {
|
|
21
|
-
var _b, _c, _d, _e, _f
|
|
21
|
+
var _b, _c, _d, _e, _f;
|
|
22
22
|
var { destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "isTextShown", "destination", "destinationsAmount", "hidden", "iconDirection", "tableMode"]);
|
|
23
23
|
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
24
24
|
const formattedAmount = formatAmount(destinationsAmount || 0);
|
|
25
25
|
const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
];
|
|
26
|
+
const isSheetView = tableMode === 'sheet';
|
|
27
|
+
if (isSheetView) {
|
|
28
|
+
const sheetViewChips = destinations === null || destinations === void 0 ? void 0 : destinations.reduce((acc, dest) => {
|
|
29
|
+
const formattedDestAmount = formatAmount((dest === null || dest === void 0 ? void 0 : dest.amount) || 0);
|
|
30
|
+
return [
|
|
31
|
+
...acc,
|
|
32
|
+
{
|
|
33
|
+
key: 'id',
|
|
34
|
+
content: dest === null || dest === void 0 ? void 0 : dest.id,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'amount',
|
|
38
|
+
content: (_jsxs(_Fragment, { children: [_jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}, []);
|
|
42
42
|
return (_jsx(TableCell, Object.assign({ sx: {
|
|
43
43
|
width: 'fit-content',
|
|
44
44
|
overflow: 'visible',
|
|
45
45
|
} }, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
46
46
|
}
|
|
47
|
+
if (!destinationsCount || hidden) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
47
50
|
const textView = (_jsx(TextLabel, Object.assign({ sx: {
|
|
48
51
|
textAlign: 'left',
|
|
49
52
|
justifyContent: 'flex-start',
|
|
50
53
|
height: 'auto',
|
|
51
|
-
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (
|
|
54
|
+
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id, " - ", _jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", destinationsCount - 1] })) : (_jsxs("div", { children: ["Destination ", (_e = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _e === void 0 ? void 0 : _e.id, " - ", _jsx(CurrencyIcon, { currency: (_f = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _f === void 0 ? void 0 : _f.currency }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })));
|
|
52
55
|
return (_jsx(TableCell, Object.assign({ sx: {
|
|
53
56
|
width: 'fit-content',
|
|
54
57
|
overflow: 'visible',
|
|
@@ -96,8 +96,8 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
96
96
|
};
|
|
97
97
|
return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: tableItemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered }) => (_jsx(AutoSizer, { children: ({ height, width }) => (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: tableItemsCount, itemSize: () => rowHeight, itemData: currentItemData, onItemsRendered: onItemsRendered, overscanCount: TABLE_LIST_OVER_SCAN, setBackdropVisibility: setShowBackdrop, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: handleScrollCallback, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, style: {
|
|
98
98
|
overflowX: isPinned ? 'hidden' : 'auto',
|
|
99
|
-
paddingBottom: '
|
|
100
|
-
backgroundColor: isPinned ? 'transparent' :
|
|
99
|
+
paddingBottom: isPinned ? '25px' : '13px',
|
|
100
|
+
backgroundColor: isPinned ? 'transparent' : '#F6F8FACC',
|
|
101
101
|
} }, { children: ListItemWrapper }))) })) })));
|
|
102
102
|
}, [
|
|
103
103
|
itemsCount,
|
|
@@ -14,8 +14,8 @@ export const EngravingLine = styled('div')(({ theme }) => ({
|
|
|
14
14
|
left: 0,
|
|
15
15
|
right: 0,
|
|
16
16
|
height: '1.5px',
|
|
17
|
-
backgroundColor: theme.palette.grey[
|
|
18
|
-
boxShadow: `inset 0 1px 0 0 ${theme.palette.grey[
|
|
17
|
+
backgroundColor: theme.palette.grey[300],
|
|
18
|
+
boxShadow: `inset 0 1px 0 0 ${theme.palette.grey[300]}`,
|
|
19
19
|
}));
|
|
20
20
|
export const Label = styled(Box)(({ theme }) => ({
|
|
21
21
|
borderRadius: '37.5px',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ListChildComponentProps } from 'react-window';
|
|
3
|
-
export declare const LastRowContent: React.MemoExoticComponent<({ isLoadingRow }: {
|
|
3
|
+
export declare const LastRowContent: React.MemoExoticComponent<({ isLoadingRow, isSheetView }: {
|
|
4
4
|
isLoadingRow: boolean;
|
|
5
|
+
isSheetView: boolean;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
6
7
|
export declare const StyledItemWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
7
8
|
showShadowHighlight?: boolean | undefined;
|
|
9
|
+
isSheetView?: boolean | undefined;
|
|
8
10
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
11
|
declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export default ListItemWrapper;
|
|
@@ -19,15 +19,18 @@ import { ActionIcon } from '../../style';
|
|
|
19
19
|
import { RowErrorState } from '../RowErrorState';
|
|
20
20
|
import { StyledParagraph } from '../TableLastItem';
|
|
21
21
|
import TableRow from '../TableRow';
|
|
22
|
-
export const LastRowContent = React.memo(({ isLoadingRow }) => {
|
|
22
|
+
export const LastRowContent = React.memo(({ isLoadingRow, isSheetView }) => {
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
if (isLoadingRow) {
|
|
25
25
|
return (_jsxs(Box, Object.assign({ "data-testid": "ListItemWrapper_lastRowContent_isLoadingRow", sx: {
|
|
26
|
-
height: '24px',
|
|
26
|
+
height: isSheetView ? '100%' : '24px',
|
|
27
27
|
width: '24px',
|
|
28
28
|
borderRadius: '50%',
|
|
29
29
|
background: 'transparent',
|
|
30
30
|
position: 'relative',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
alignItems: 'center',
|
|
31
34
|
} }, { children: [_jsx(ActionIcon, { sx: { position: 'absolute' }, src: tableBackgroundLoader }), _jsx(ActionIcon, { sx: { position: 'absolute', padding: '3px' }, src: blueCircleLoaderIcon, alt: "tableLoadingSpinnerIcon", className: "spinner-loader", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } })] })));
|
|
32
35
|
}
|
|
33
36
|
return _jsx(StyledParagraph, Object.assign({ "data-testid": "ListItemWrapper_lastRowContent" }, { children: t('allRecordsHaveBeenSuccessfullyLoaded') }));
|
|
@@ -38,10 +41,10 @@ const createRowClickHandler = (row, onRowClick) => (e) => {
|
|
|
38
41
|
onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row);
|
|
39
42
|
};
|
|
40
43
|
export const StyledItemWrapper = styled('div', {
|
|
41
|
-
shouldForwardProp: (props) => props !== 'showShadowHighlight',
|
|
42
|
-
})(({ theme }) => ({
|
|
43
|
-
backgroundColor: theme.palette.background.default,
|
|
44
|
+
shouldForwardProp: (props) => props !== 'showShadowHighlight' && props !== 'isSheetView',
|
|
45
|
+
})(({ theme, isSheetView }) => ({
|
|
44
46
|
height: '100%',
|
|
47
|
+
backgroundColor: isSheetView ? '#F6F8FACC' : theme.palette.background.default,
|
|
45
48
|
}));
|
|
46
49
|
function ListItemWrapper(_a) {
|
|
47
50
|
var _b;
|
|
@@ -53,7 +56,7 @@ function ListItemWrapper(_a) {
|
|
|
53
56
|
const rowClickHandler = React.useCallback(createRowClickHandler(row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick), [row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick]);
|
|
54
57
|
const memoizedRowProps = React.useMemo(() => (Object.assign(Object.assign({ showShadowHighlight: scrollToIndex === index, showLoadedStyle: isLoadedRow }, rowProps), { onClick: rowClickHandler })), [scrollToIndex, index, isLoadedRow, rowProps, rowClickHandler, isLoadingRow, areAllRowsLoaded, lastItemIndex]);
|
|
55
58
|
const memoizedListItemComponent = React.useMemo(() => {
|
|
56
|
-
const lastRowContent = _jsx(LastRowContent, { isLoadingRow: isLoadingRow });
|
|
59
|
+
const lastRowContent = _jsx(LastRowContent, { isSheetView: isSheetView, isLoadingRow: isLoadingRow });
|
|
57
60
|
const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
|
|
58
61
|
if (isPinned && isLastRow) {
|
|
59
62
|
return (_jsx(Box, { sx: Object.assign(Object.assign({}, (isSheetView ? { minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT } : { height: TABLE_ROW_HEIGHT })), { backgroundColor: '#F6F8FACC' }) }));
|
|
@@ -70,6 +73,6 @@ function ListItemWrapper(_a) {
|
|
|
70
73
|
}
|
|
71
74
|
return (_jsx(TableRow, { index: index, row: row, columns: columns, rowProps: memoizedRowProps, isSheetView: isSheetView, selectedCell: restData.selectedCell, selectedColumn: restData.selectedColumn, onCellClick: restData.onCellClick, isLastRow: index === rows.length - 1 }, `row-${index}`));
|
|
72
75
|
}, [restData, index, row, columns, memoizedRowProps, isSheetView]);
|
|
73
|
-
return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({}, style), { top: Number(style.top) - ((_b = renderedScrollTopRef === null || renderedScrollTopRef === void 0 ? void 0 : renderedScrollTopRef.current) !== null && _b !== void 0 ? _b : 0), willChange: 'top' }) }, { children: _jsx(StyledItemWrapper, Object.assign({ "data-testid": "ListItemWrapper_StyledItemWrapper" }, { children: memoizedListItemComponent })) })));
|
|
76
|
+
return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({}, style), { top: Number(style.top) - ((_b = renderedScrollTopRef === null || renderedScrollTopRef === void 0 ? void 0 : renderedScrollTopRef.current) !== null && _b !== void 0 ? _b : 0), willChange: 'top' }) }, { children: _jsx(StyledItemWrapper, Object.assign({ isSheetView: isSheetView, "data-testid": "ListItemWrapper_StyledItemWrapper" }, { children: memoizedListItemComponent })) })));
|
|
74
77
|
}
|
|
75
78
|
export default ListItemWrapper;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.282",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|