@tap-payments/os-micro-frontend-shared 0.0.256 → 0.0.257-test.4
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/SheetView/SheetViewVirtualTable.js +24 -5
- package/build/components/VirtualTable/SheetView/components/SheetViewTableLoading.d.ts +12 -0
- package/build/components/VirtualTable/SheetView/components/SheetViewTableLoading.js +20 -0
- package/build/components/VirtualTable/SheetView/components/SheetViewTableNoData.d.ts +18 -0
- package/build/components/VirtualTable/SheetView/components/SheetViewTableNoData.js +32 -0
- package/build/components/VirtualTable/SheetView/components/SheetViewTableRowLoading.d.ts +12 -0
- package/build/components/VirtualTable/SheetView/components/SheetViewTableRowLoading.js +43 -0
- package/build/components/VirtualTable/SheetView/components/index.d.ts +3 -0
- package/build/components/VirtualTable/SheetView/components/index.js +3 -0
- package/build/components/VirtualTable/components/TableRow.js +1 -1
- package/build/components/VirtualTable/style.d.ts +1 -1
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/payment.d.ts +5 -0
- package/build/constants/payment.js +38 -0
- package/build/types/analytics.d.ts +2 -1
- package/build/types/analytics.js +1 -0
- package/package.json +3 -3
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;
|
|
557
558
|
src?: string | undefined;
|
|
558
559
|
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;
|
|
@@ -272,9 +272,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
272
272
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
273
273
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
274
274
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
275
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
275
276
|
src?: string | undefined;
|
|
276
277
|
alt?: string | undefined;
|
|
277
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
278
278
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
279
279
|
useMap?: string | undefined;
|
|
280
280
|
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;
|
|
276
277
|
src?: string | undefined;
|
|
277
278
|
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;
|
|
265
266
|
src?: string | undefined;
|
|
266
267
|
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;
|
|
@@ -18,6 +18,7 @@ import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError
|
|
|
18
18
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
19
19
|
import TableLastItem from '../components/TableLastItem';
|
|
20
20
|
import TableNoData from '../components/TableNoData';
|
|
21
|
+
import { SheetViewTableNoData } from './components';
|
|
21
22
|
import ListItemWrapper from '../components/virtualScroll/ListItemWrapper';
|
|
22
23
|
import { StyledBox, StyledTableBox, StyledVirtualList, TableContainer, TableWrapper } from '../style';
|
|
23
24
|
import { SheetViewVirtualTableWrapper, PinnedStartColumnWrapper, PinnedEndColumnWrapper, MainTableWrapper, UnpinnedTableHeaderWrapper } from './style';
|
|
@@ -113,9 +114,12 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
113
114
|
handleScroll,
|
|
114
115
|
scrollToIndex,
|
|
115
116
|
areTotalRowsNotFillingHeight,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
clearBackdropVisibilityTimeout,
|
|
118
|
+
lastItemIndex,
|
|
119
|
+
pinnedEndVirtualListRef,
|
|
120
|
+
pinnedStartVirtualListRef,
|
|
121
|
+
scrollableVirtualListRef,
|
|
122
|
+
theme.palette.background.default,
|
|
119
123
|
]);
|
|
120
124
|
const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
|
|
121
125
|
const pinnedStartColumnsWidth = useMemo(() => pinnedStartColumnsData.reduce((acc, col) => {
|
|
@@ -137,9 +141,24 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
137
141
|
overflowX: 'hidden',
|
|
138
142
|
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_PinnedStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(columnsData, containerKey, true, columnsWidth) })) }))] })) }));
|
|
139
143
|
};
|
|
140
|
-
return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [showNoDataView ? (
|
|
144
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [showNoDataView ? (tableLoading ? (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox_Loading", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "auto", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView, scrollable: true, sx: {
|
|
145
|
+
marginLeft: '28px',
|
|
146
|
+
marginRight: '28px',
|
|
147
|
+
maxHeight: 'calc(100vh - 200px)',
|
|
148
|
+
overflow: 'auto',
|
|
149
|
+
} }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingTableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: 'auto' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [], onColumnPin: handleColumnPin, isPinnable: false, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_LoadingTableWrapper", sx: {
|
|
150
|
+
width: '100%',
|
|
151
|
+
minWidth: 'fit-content',
|
|
152
|
+
height: 'auto',
|
|
153
|
+
display: 'flex',
|
|
154
|
+
flexDirection: 'column',
|
|
155
|
+
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingStyledBox", hidePadding: true, className: "list-wrapper", sx: {
|
|
156
|
+
height: 'auto',
|
|
157
|
+
display: 'flex',
|
|
158
|
+
flexDirection: 'column',
|
|
159
|
+
} }, { children: _jsx(SheetViewTableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) }))] })) }))) : (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsx(TableWrapper, Object.assign({ isSheetView: true, "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) })))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
141
160
|
width: '100%',
|
|
142
161
|
minWidth: 'fit-content',
|
|
143
|
-
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) * TABLE_ROW_HEIGHT, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, "data-testid": "SheetViewVirtualTable_TableLastItem" }))] }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
162
|
+
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) * TABLE_ROW_HEIGHT, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, "data-testid": "SheetViewVirtualTable_TableLastItem" }))] }), !tableLoading && (_jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps)))] }));
|
|
144
163
|
}
|
|
145
164
|
export default memo(SheetViewVirtualTable);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AnimationType, IColumnProps } from '../../../../types/index.js';
|
|
3
|
+
interface ISheetViewTableLoadingProps {
|
|
4
|
+
columns: IColumnProps[];
|
|
5
|
+
isLoaded?: boolean;
|
|
6
|
+
animationType?: AnimationType;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
rowsCount?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function SheetViewTableLoading({ columns, isLoaded, animationType, isLoading, rowsCount }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableLoading>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import uniqueId from 'lodash/uniqueId';
|
|
5
|
+
import { calculateMaxAllowedRows } from '../../../../utils/index.js';
|
|
6
|
+
import SheetViewTableRowLoading from './SheetViewTableRowLoading';
|
|
7
|
+
const Wrapper = styled('section')(({ isLoaded = false }) => ({
|
|
8
|
+
overflow: 'hidden',
|
|
9
|
+
paddingInline: isLoaded ? '32px' : '0px',
|
|
10
|
+
backgroundColor: isLoaded ? 'rgba(255, 255, 255, 0.60)' : 'none',
|
|
11
|
+
filter: isLoaded ? 'blur(8px)' : 'none',
|
|
12
|
+
marginTop: isLoaded ? '1rem' : '0',
|
|
13
|
+
height: 'auto',
|
|
14
|
+
}));
|
|
15
|
+
function SheetViewTableLoading({ columns, isLoaded = false, animationType, isLoading = false, rowsCount }) {
|
|
16
|
+
let maxAllowedRows = rowsCount || calculateMaxAllowedRows(isLoaded, isLoading);
|
|
17
|
+
maxAllowedRows = rowsCount || Math.max(maxAllowedRows, 12);
|
|
18
|
+
return (_jsx(Wrapper, Object.assign({ isLoaded: isLoaded, "data-testid": "SheetViewTableLoading" }, { children: [...Array(maxAllowedRows)].map((_, index) => (_jsx(SheetViewTableRowLoading, { columns: columns, animationType: animationType, rowIndex: index }, `i-${uniqueId('SheetViewTableLoadingRow_')}`))) })));
|
|
19
|
+
}
|
|
20
|
+
export default memo(SheetViewTableLoading);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IColumnProps, IVirtualTable } from '../../../../types/index.js';
|
|
3
|
+
interface SheetViewTableNoDataProps {
|
|
4
|
+
tableEmpty: boolean;
|
|
5
|
+
tableLoading: boolean;
|
|
6
|
+
isTimeoutError: boolean;
|
|
7
|
+
error: Error | null;
|
|
8
|
+
tableError: boolean;
|
|
9
|
+
orderedColumns: IColumnProps[];
|
|
10
|
+
triggerDataRefetch: () => Promise<unknown>;
|
|
11
|
+
footerProps: IVirtualTable['footerProps'];
|
|
12
|
+
}
|
|
13
|
+
declare function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }: SheetViewTableNoDataProps): JSX.Element;
|
|
14
|
+
declare namespace SheetViewTableNoData {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableNoData>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { backendErrorHandler } from '../../../../utils/index.js';
|
|
4
|
+
import EmptyList from '../../components/EmptyList/EmptyList';
|
|
5
|
+
import ErrorList from '../../components/ErrorList/ErrorList';
|
|
6
|
+
import SheetViewTableLoading from './SheetViewTableLoading';
|
|
7
|
+
import { StyledSolidBackground } from '../../style';
|
|
8
|
+
function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }) {
|
|
9
|
+
let content;
|
|
10
|
+
if (tableLoading) {
|
|
11
|
+
content = (_jsx(StyledSolidBackground, Object.assign({ "data-testid": "SheetViewVirtualTable_SolidBackground" }, { children: _jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: orderedColumns, isLoading: true }) })));
|
|
12
|
+
}
|
|
13
|
+
else if (isTimeoutError) {
|
|
14
|
+
content = (_jsx(ErrorList, { "data-testid": "SheetViewVirtualTable_ErrorList_timeoutError", shouldMinimizeWidth: true, heading: "timeOut", message: "yourRequestOutPleaseTryAgain", triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
15
|
+
}
|
|
16
|
+
else if (tableError) {
|
|
17
|
+
const axiosErr = error;
|
|
18
|
+
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'connectionErrorMsg' });
|
|
19
|
+
content = (_jsx(ErrorList, { "data-testid": "SheetViewVirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: formatted, triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
20
|
+
}
|
|
21
|
+
else if (tableEmpty) {
|
|
22
|
+
const axiosErr = error;
|
|
23
|
+
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'tryAdjustingTheDateOrFilters' });
|
|
24
|
+
content = _jsx(EmptyList, { sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, heading: "nothingFound", message: formatted });
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
content = (_jsx(ErrorList, { "data-testid": "SheetViewVirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: "connectionErrorMsg", triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
28
|
+
}
|
|
29
|
+
return content;
|
|
30
|
+
}
|
|
31
|
+
SheetViewTableNoData.displayName = 'SheetViewTableNoData';
|
|
32
|
+
export default memo(SheetViewTableNoData);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { AnimationType, IColumnProps } from '../../../../types/index.js';
|
|
3
|
+
interface ISheetViewTableRowLoadingProps {
|
|
4
|
+
columns: IColumnProps[];
|
|
5
|
+
index?: number;
|
|
6
|
+
animationType?: AnimationType;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
rowIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex }: ISheetViewTableRowLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableRowLoading>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import TableCell from '@mui/material/TableCell';
|
|
6
|
+
import MUITableRow from '@mui/material/TableRow';
|
|
7
|
+
import { areEqual } from 'react-window';
|
|
8
|
+
const StyledSkeleton = styled(Skeleton)(({ theme }) => ({
|
|
9
|
+
backgroundColor: theme.palette.grey[100],
|
|
10
|
+
borderRadius: '64px',
|
|
11
|
+
width: '100%',
|
|
12
|
+
minWidth: '20px',
|
|
13
|
+
}));
|
|
14
|
+
function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex = 0 }) {
|
|
15
|
+
return (_jsx(MUITableRow, Object.assign({ sx: Object.assign(Object.assign({}, style), { display: 'flex', borderBottom: '1px solid #F2F2F2', minHeight: '28px', height: '28px', alignItems: 'center', '&:hover': {
|
|
16
|
+
backgroundColor: 'transparent !important',
|
|
17
|
+
} }), component: "div", hover: true }, { children: columns.map((column, colIndex) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const isLastColumn = colIndex === columns.length - 1;
|
|
20
|
+
const isFirstColumn = colIndex === 0;
|
|
21
|
+
const shouldShowActualData = isFirstColumn && column.render;
|
|
22
|
+
return (_jsx(TableCell, Object.assign({ sx: {
|
|
23
|
+
width: column.width || `${100 / columns.length}%` || '20%',
|
|
24
|
+
paddingBlock: '0',
|
|
25
|
+
paddingInline: '8px !important',
|
|
26
|
+
paddingLeft: isFirstColumn ? '8px !important' : '8px !important',
|
|
27
|
+
paddingRight: isLastColumn ? '8px !important' : '8px !important',
|
|
28
|
+
borderRight: isLastColumn ? 'none' : '1px solid #F2F2F2',
|
|
29
|
+
height: '100%',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
whiteSpace: 'nowrap',
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
}, component: "div" }, { children: shouldShowActualData ? ((_a = column.render) === null || _a === void 0 ? void 0 : _a.call(column, {
|
|
36
|
+
index: rowIndex,
|
|
37
|
+
row: {},
|
|
38
|
+
column,
|
|
39
|
+
value: rowIndex + 1,
|
|
40
|
+
})) : (_jsx(StyledSkeleton, { variant: "rectangular", animation: animationType, height: 16 })) }), `${column.id}-${colIndex}`));
|
|
41
|
+
}) }), index));
|
|
42
|
+
}
|
|
43
|
+
export default memo(SheetViewTableRowLoading, areEqual);
|
|
@@ -25,7 +25,7 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
|
|
|
25
25
|
isColumnSelected,
|
|
26
26
|
isLastRow,
|
|
27
27
|
});
|
|
28
|
-
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, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, onClick: (event) => onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, columnIdStr, event), sx: Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected }, { children: renderCell(column) }), `${column.id}-${colIndex}`));
|
|
28
|
+
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, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, onClick: (event) => onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, columnIdStr, event), sx: Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected && (column === null || column === void 0 ? void 0 : column.isDefaultPinned) }, { children: renderCell(column) }), `${column.id}-${colIndex}`));
|
|
29
29
|
}) })), [columns, row, index, selectedCell, selectedColumn, onCellClick, isLastRow]);
|
|
30
30
|
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, isSheetView: isSheetView }), content));
|
|
31
31
|
}
|
|
@@ -307,9 +307,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
307
307
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
308
308
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
309
309
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
310
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
310
311
|
src?: string | undefined;
|
|
311
312
|
alt?: string | undefined;
|
|
312
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
313
313
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
314
314
|
useMap?: string | undefined;
|
|
315
315
|
loading?: "eager" | "lazy" | undefined;
|
package/build/constants/index.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { lightUrl } from './assets';
|
|
2
|
+
export const PAYMENT_TYPES = [
|
|
3
|
+
{
|
|
4
|
+
name: 'CARD',
|
|
5
|
+
label: 'Card',
|
|
6
|
+
icon: `${lightUrl}/payment-method/card.svg`,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'EXPRESS',
|
|
10
|
+
label: 'Express Checkout',
|
|
11
|
+
icon: `${lightUrl}/express_checkout.svg`,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'DEVICE',
|
|
15
|
+
label: 'Device',
|
|
16
|
+
icon: `${lightUrl}/device.svg`,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'PT_WALLET',
|
|
20
|
+
label: 'Pass-Thru Wallet',
|
|
21
|
+
icon: `${lightUrl}/passThruWallet.svg`,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'SV_WALLET',
|
|
25
|
+
label: 'Stored Value Wallet',
|
|
26
|
+
icon: `${lightUrl}/storedValueWallet.svg`,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'BNPL',
|
|
30
|
+
label: 'Buy Now Pay Later',
|
|
31
|
+
icon: `${lightUrl}/buyNowPayLater.svg`,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'CASH',
|
|
35
|
+
label: 'Cash Wallet',
|
|
36
|
+
icon: `${lightUrl}/cash.svg`,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
@@ -27,5 +27,6 @@ export interface AnalyticsDetails {
|
|
|
27
27
|
export declare enum ChargeBreakDownType {
|
|
28
28
|
PaymentMethod = "PAYMENT_METHOD",
|
|
29
29
|
PaymentCurrency = "PAYMENT_CURRENCY",
|
|
30
|
-
PaymentScheme = "PAYMENT_SCHEME"
|
|
30
|
+
PaymentScheme = "PAYMENT_SCHEME",
|
|
31
|
+
PaymentType = "PAYMENT_TYPE"
|
|
31
32
|
}
|
package/build/types/analytics.js
CHANGED
|
@@ -3,4 +3,5 @@ export var ChargeBreakDownType;
|
|
|
3
3
|
ChargeBreakDownType["PaymentMethod"] = "PAYMENT_METHOD";
|
|
4
4
|
ChargeBreakDownType["PaymentCurrency"] = "PAYMENT_CURRENCY";
|
|
5
5
|
ChargeBreakDownType["PaymentScheme"] = "PAYMENT_SCHEME";
|
|
6
|
+
ChargeBreakDownType["PaymentType"] = "PAYMENT_TYPE";
|
|
6
7
|
})(ChargeBreakDownType || (ChargeBreakDownType = {}));
|
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.257-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -131,4 +131,4 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"registry": "https://registry.npmjs.org/"
|
|
133
133
|
}
|
|
134
|
-
}
|
|
134
|
+
}
|