@tap-payments/os-micro-frontend-shared 0.1.96-test.3 → 0.1.96-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/build/components/StatusChip/StatusChip.d.ts +1 -1
- package/build/components/StatusChip/StatusChip.js +11 -8
- package/build/components/StatusChip/style.d.ts +1 -0
- package/build/components/StatusChip/type.d.ts +1 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.d.ts +1 -4
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js +4 -6
- package/build/components/VirtualTables/components/style.js +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.d.ts +2 -2
- package/build/constants/table/cell/authorizationTableCellWidth.js +2 -2
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +2 -2
- package/build/constants/table/cell/chargeTableCellWidth.js +2 -2
- package/build/constants/table/cell/destinationsTableCellWidth.d.ts +2 -2
- package/build/constants/table/cell/destinationsTableCellWidth.js +2 -2
- package/build/constants/table/cell/refundTableCellWidth.d.ts +2 -2
- package/build/constants/table/cell/refundTableCellWidth.js +2 -2
- package/build/utils/table.d.ts +0 -5
- package/build/utils/table.js +1 -33
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChipProps } from './type';
|
|
2
|
-
declare const StatusChip: ({ children, unknownText, copyText, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const StatusChip: ({ children, unknownText, copyText, expandDirection, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default StatusChip;
|
|
@@ -18,7 +18,7 @@ import { copyIcon, greenCheckIcon } from '../../constants/index.js';
|
|
|
18
18
|
import { unknownGeographyColors } from './constants';
|
|
19
19
|
import { ChipStyled, Wrapper, CopyWrapper } from './style';
|
|
20
20
|
const StatusChip = (_a) => {
|
|
21
|
-
var { children, unknownText, copyText } = _a, props = __rest(_a, ["children", "unknownText", "copyText"]);
|
|
21
|
+
var { children, unknownText, copyText, expandDirection = 'right' } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection"]);
|
|
22
22
|
const [showCopy, setShowCopy] = useState(false);
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const isSelected = props.isSelected;
|
|
@@ -38,12 +38,15 @@ const StatusChip = (_a) => {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const isCopyActive = isSelected && copyText;
|
|
42
|
+
return (_jsxs(motion.div, Object.assign({ style: { position: 'relative' }, animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(motion.div, Object.assign({ style: { position: 'absolute', top: 0, zIndex: isSelected ? 3 : 0 }, animate: {
|
|
43
|
+
left: isCopyActive && expandDirection === 'left' ? -12 : 0,
|
|
44
|
+
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected }, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
45
|
+
paddingRight: isCopyActive ? 12 : 0,
|
|
46
|
+
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: [_jsx(Wrapper, { children: children }), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: isCopyActive && (_jsx(CopyWrapper, { children: _jsx(motion.img, { initial: { opacity: 0, x: -5 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -2 }, transition: { delay: 0.2, duration: 0.1 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : copyIcon, style: {
|
|
47
|
+
height: 12,
|
|
48
|
+
width: 12,
|
|
49
|
+
objectFit: 'contain',
|
|
50
|
+
} }) })) }))] })) })) }))] })));
|
|
48
51
|
};
|
|
49
52
|
export default StatusChip;
|
|
@@ -11,6 +11,7 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
|
|
|
11
11
|
maxWidth?: string | undefined;
|
|
12
12
|
isSelected?: boolean | undefined;
|
|
13
13
|
copyText?: string | undefined;
|
|
14
|
+
expandDirection?: "left" | "right" | undefined;
|
|
14
15
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
16
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
17
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.d.ts
CHANGED
|
@@ -7,10 +7,7 @@ interface ISheetViewTableLoadingProps {
|
|
|
7
7
|
isLoading?: boolean;
|
|
8
8
|
rowsCount?: number;
|
|
9
9
|
isPinned?: boolean;
|
|
10
|
-
tableType?: string;
|
|
11
|
-
containerHeight?: number;
|
|
12
|
-
isCompact?: boolean;
|
|
13
10
|
}
|
|
14
|
-
declare function SheetViewTableLoading({ columns, isLoaded, animationType, isPinned,
|
|
11
|
+
declare function SheetViewTableLoading({ columns, isLoaded, animationType, isLoading, rowsCount, isPinned, }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
15
12
|
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableLoading>;
|
|
16
13
|
export default _default;
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import uniqueId from 'lodash/uniqueId';
|
|
5
|
-
import {
|
|
5
|
+
import { calculateMaxAllowedRows } from '../../../../utils/index.js';
|
|
6
6
|
import SheetViewTableRowLoading from './SheetViewTableRowLoading';
|
|
7
7
|
const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
|
|
8
8
|
overflow: 'hidden',
|
|
@@ -11,11 +11,9 @@ const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
|
|
|
11
11
|
filter: isLoaded && !isPinned ? 'blur(8px)' : 'none',
|
|
12
12
|
marginTop: isLoaded && !isPinned ? '1rem' : '0',
|
|
13
13
|
}));
|
|
14
|
-
function SheetViewTableLoading({ columns, isLoaded = false, animationType, isPinned = false,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const maxAllowedRows = calculateSheetViewMaxRows(availableHeight, rowHeight);
|
|
18
|
-
console.log({ maxAllowedRows, availableHeight, rowHeight, containerHeight });
|
|
14
|
+
function SheetViewTableLoading({ columns, isLoaded = false, animationType, isLoading = false, rowsCount, isPinned = false, }) {
|
|
15
|
+
let maxAllowedRows = rowsCount || calculateMaxAllowedRows(isLoaded, isLoading);
|
|
16
|
+
maxAllowedRows = rowsCount || Math.max(maxAllowedRows, 25);
|
|
19
17
|
return (_jsx(Wrapper, Object.assign({ isLoaded: isLoaded, isPinned: isPinned, "data-testid": "SheetViewTableLoading" }, { children: [...Array(maxAllowedRows)].map((_, index) => (_jsx(SheetViewTableRowLoading, { columns: columns, animationType: animationType, rowIndex: index, useTableBackground: !isPinned }, `i-${uniqueId('SheetViewTableLoadingRow_')}`))) })));
|
|
20
18
|
}
|
|
21
19
|
export default memo(SheetViewTableLoading);
|
|
@@ -146,7 +146,7 @@ export const SheetViewTableContainer = styled(Box)(() => ({
|
|
|
146
146
|
position: 'relative',
|
|
147
147
|
display: 'flex',
|
|
148
148
|
flexDirection: 'column',
|
|
149
|
-
height: '
|
|
149
|
+
height: 'calc(100vh - 300px)',
|
|
150
150
|
paddingInline: '28px',
|
|
151
151
|
borderRadius: '8px',
|
|
152
152
|
marginBottom: '16px !important',
|
|
@@ -57,12 +57,12 @@ export declare const authorizationTableCellWidth: {
|
|
|
57
57
|
readonly payment_agreement: {
|
|
58
58
|
readonly default: "50px";
|
|
59
59
|
readonly text: "150px";
|
|
60
|
-
readonly sheet: "
|
|
60
|
+
readonly sheet: "230px";
|
|
61
61
|
};
|
|
62
62
|
readonly amount: {
|
|
63
63
|
readonly default: "170px";
|
|
64
64
|
readonly text: "195px";
|
|
65
|
-
readonly sheet: "
|
|
65
|
+
readonly sheet: "150px";
|
|
66
66
|
};
|
|
67
67
|
readonly destinations: {
|
|
68
68
|
readonly default: "70px";
|
|
@@ -57,12 +57,12 @@ export const authorizationTableCellWidth = {
|
|
|
57
57
|
payment_agreement: {
|
|
58
58
|
default: '50px',
|
|
59
59
|
text: '150px',
|
|
60
|
-
sheet: '
|
|
60
|
+
sheet: '230px',
|
|
61
61
|
},
|
|
62
62
|
amount: {
|
|
63
63
|
default: '170px',
|
|
64
64
|
text: '195px',
|
|
65
|
-
sheet: '
|
|
65
|
+
sheet: '150px',
|
|
66
66
|
},
|
|
67
67
|
destinations: {
|
|
68
68
|
default: '70px',
|
|
@@ -52,7 +52,7 @@ export declare const chargeTableCellWidth: {
|
|
|
52
52
|
readonly payment_agreement: {
|
|
53
53
|
readonly default: "50px";
|
|
54
54
|
readonly text: "150px";
|
|
55
|
-
readonly sheet: "
|
|
55
|
+
readonly sheet: "230px";
|
|
56
56
|
};
|
|
57
57
|
readonly payment_initiated: {
|
|
58
58
|
readonly default: "150px";
|
|
@@ -222,7 +222,7 @@ export declare const chargeTableCellWidth: {
|
|
|
222
222
|
readonly consolidated_amount: {
|
|
223
223
|
readonly default: "180px";
|
|
224
224
|
readonly text: "180px";
|
|
225
|
-
readonly sheet: "
|
|
225
|
+
readonly sheet: "150px";
|
|
226
226
|
};
|
|
227
227
|
readonly customer_amount: {
|
|
228
228
|
readonly default: "150px";
|
|
@@ -52,7 +52,7 @@ export const chargeTableCellWidth = {
|
|
|
52
52
|
payment_agreement: {
|
|
53
53
|
default: '50px',
|
|
54
54
|
text: '150px',
|
|
55
|
-
sheet: '
|
|
55
|
+
sheet: '230px',
|
|
56
56
|
},
|
|
57
57
|
payment_initiated: {
|
|
58
58
|
default: '150px',
|
|
@@ -222,7 +222,7 @@ export const chargeTableCellWidth = {
|
|
|
222
222
|
consolidated_amount: {
|
|
223
223
|
default: '180px',
|
|
224
224
|
text: '180px',
|
|
225
|
-
sheet: '
|
|
225
|
+
sheet: '150px',
|
|
226
226
|
},
|
|
227
227
|
customer_amount: {
|
|
228
228
|
default: '150px',
|
|
@@ -62,12 +62,12 @@ export declare const destinationsTableCellWidth: {
|
|
|
62
62
|
readonly payment_agreement: {
|
|
63
63
|
readonly default: "50px";
|
|
64
64
|
readonly text: "250px";
|
|
65
|
-
readonly sheet: "
|
|
65
|
+
readonly sheet: "230px";
|
|
66
66
|
};
|
|
67
67
|
readonly amount: {
|
|
68
68
|
readonly default: "195px";
|
|
69
69
|
readonly text: "195px";
|
|
70
|
-
readonly sheet: "
|
|
70
|
+
readonly sheet: "150px";
|
|
71
71
|
};
|
|
72
72
|
readonly status: {
|
|
73
73
|
readonly default: "50px";
|
|
@@ -62,12 +62,12 @@ export const destinationsTableCellWidth = {
|
|
|
62
62
|
payment_agreement: {
|
|
63
63
|
default: '50px',
|
|
64
64
|
text: '250px',
|
|
65
|
-
sheet: '
|
|
65
|
+
sheet: '230px',
|
|
66
66
|
},
|
|
67
67
|
amount: {
|
|
68
68
|
default: '195px',
|
|
69
69
|
text: '195px',
|
|
70
|
-
sheet: '
|
|
70
|
+
sheet: '150px',
|
|
71
71
|
},
|
|
72
72
|
status: {
|
|
73
73
|
default: '50px',
|
|
@@ -47,7 +47,7 @@ export declare const refundTableCellWidth: {
|
|
|
47
47
|
readonly payment_agreement: {
|
|
48
48
|
readonly default: "50px";
|
|
49
49
|
readonly text: "200px";
|
|
50
|
-
readonly sheet: "
|
|
50
|
+
readonly sheet: "230px";
|
|
51
51
|
};
|
|
52
52
|
readonly payment_initiated: {
|
|
53
53
|
readonly default: "150px";
|
|
@@ -92,7 +92,7 @@ export declare const refundTableCellWidth: {
|
|
|
92
92
|
readonly amount: {
|
|
93
93
|
readonly default: "195px";
|
|
94
94
|
readonly text: "195px";
|
|
95
|
-
readonly sheet: "
|
|
95
|
+
readonly sheet: "150px";
|
|
96
96
|
};
|
|
97
97
|
readonly payouts: {
|
|
98
98
|
readonly default: "195px";
|
|
@@ -47,7 +47,7 @@ export const refundTableCellWidth = {
|
|
|
47
47
|
payment_agreement: {
|
|
48
48
|
default: '50px',
|
|
49
49
|
text: '200px',
|
|
50
|
-
sheet: '
|
|
50
|
+
sheet: '230px',
|
|
51
51
|
},
|
|
52
52
|
payment_initiated: {
|
|
53
53
|
default: '150px',
|
|
@@ -92,7 +92,7 @@ export const refundTableCellWidth = {
|
|
|
92
92
|
amount: {
|
|
93
93
|
default: '195px',
|
|
94
94
|
text: '195px',
|
|
95
|
-
sheet: '
|
|
95
|
+
sheet: '150px',
|
|
96
96
|
},
|
|
97
97
|
payouts: {
|
|
98
98
|
default: '195px',
|
package/build/utils/table.d.ts
CHANGED
|
@@ -6,9 +6,4 @@ export declare const getColumnWidthPercentage: (widthInPx: number, options?: {
|
|
|
6
6
|
export declare const getCellWidth: ({ table, cellID, tableMode }: TableCellWidthProps) => string;
|
|
7
7
|
export declare const calculateMaxAllowedRows: (isLoaded: boolean, isLoading: boolean) => number;
|
|
8
8
|
export declare const isHeightNotFullyFilledByRows: (totalRows: number) => boolean;
|
|
9
|
-
export declare const calculateSheetViewHeight: (totalRows: number, rowHeight?: number) => number;
|
|
10
|
-
export declare const calculateSheetViewMaxRows: (availableHeight: number, rowHeight?: number) => number;
|
|
11
|
-
export declare const isSheetViewScrollable: (totalRows: number, containerHeight: number, rowHeight?: number) => boolean;
|
|
12
|
-
export declare const getSheetViewRowHeight: () => number;
|
|
13
|
-
export declare const calculateSheetViewOptimalHeight: (totalRows: number, tableType: string, maxHeightPercentage?: number) => number;
|
|
14
9
|
export declare const isTableDefaultMode: (tableMode?: TableMode) => boolean;
|
package/build/utils/table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth,
|
|
1
|
+
import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, } from '../constants/index.js';
|
|
2
2
|
export const getColumnWidthPercentage = (widthInPx, options) => {
|
|
3
3
|
const { isFirst, isLast } = options || {};
|
|
4
4
|
const paddingInPx = isFirst || isLast ? 0 : 0;
|
|
@@ -73,38 +73,6 @@ export const isHeightNotFullyFilledByRows = (totalRows) => {
|
|
|
73
73
|
const allowedRows = maxRowsThatFit();
|
|
74
74
|
return totalRows < allowedRows + 1;
|
|
75
75
|
};
|
|
76
|
-
export const calculateSheetViewHeight = (totalRows, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
77
|
-
const headerHeight = 56;
|
|
78
|
-
const padding = 16;
|
|
79
|
-
const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
|
|
80
|
-
const minHeight = 200;
|
|
81
|
-
const maxHeight = window.innerHeight * 0.8;
|
|
82
|
-
return Math.max(minHeight, Math.min(calculatedHeight, maxHeight));
|
|
83
|
-
};
|
|
84
|
-
export const calculateSheetViewMaxRows = (availableHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
85
|
-
const headerHeight = 56;
|
|
86
|
-
const padding = 16;
|
|
87
|
-
const availableContentHeight = availableHeight - headerHeight - padding;
|
|
88
|
-
return Math.floor(availableContentHeight / rowHeight);
|
|
89
|
-
};
|
|
90
|
-
export const isSheetViewScrollable = (totalRows, containerHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
91
|
-
const headerHeight = 56;
|
|
92
|
-
const padding = 16;
|
|
93
|
-
const contentHeight = headerHeight + totalRows * rowHeight + padding;
|
|
94
|
-
return contentHeight > containerHeight;
|
|
95
|
-
};
|
|
96
|
-
export const getSheetViewRowHeight = () => {
|
|
97
|
-
const baseRowHeight = SHEET_VIEW_TABLE_ROW_HEIGHT;
|
|
98
|
-
return baseRowHeight * 0.8;
|
|
99
|
-
};
|
|
100
|
-
export const calculateSheetViewOptimalHeight = (totalRows, tableType, maxHeightPercentage = 0.8) => {
|
|
101
|
-
const rowHeight = getSheetViewRowHeight();
|
|
102
|
-
const headerHeight = 56;
|
|
103
|
-
const padding = 16;
|
|
104
|
-
const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
|
|
105
|
-
const maxHeight = window.innerHeight * maxHeightPercentage;
|
|
106
|
-
return Math.min(calculatedHeight, maxHeight);
|
|
107
|
-
};
|
|
108
76
|
export const isTableDefaultMode = (tableMode = 'default') => {
|
|
109
77
|
return tableMode === 'default';
|
|
110
78
|
};
|
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.1.96-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.96-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|