@tap-payments/os-micro-frontend-shared 0.0.286 → 0.0.288
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/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +3 -2
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +17 -16
- package/build/components/TableCells/CustomCells/StatusCell/constant.js +13 -16
- package/build/components/VirtualTable/SheetView/SheetViewVirtualTable.js +2 -1
- package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +1 -1
- package/build/types/table.d.ts +2 -2
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ import StatusChip from '../../StatusChip';
|
|
|
11
11
|
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, tableMode, showBadge = true, }) {
|
|
12
12
|
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
13
13
|
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
|
-
const sheetViewStatusStyle = chargeStatus ? chargeSheetViewChipStyles[chargeStatus] :
|
|
14
|
+
const sheetViewStatusStyle = chargeStatus ? chargeSheetViewChipStyles[chargeStatus] : {};
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
const { t } = useTranslation();
|
|
17
17
|
const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
|
|
@@ -19,7 +19,8 @@ export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip
|
|
|
19
19
|
const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
|
|
20
20
|
const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx("div", Object.assign({ "data-testid": "ChargeStatusIcon_ChargeIcon", style: Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '16px', height: '16px', borderRadius: unCapturedStatusStyle ? '50%' : '' }, iconWrapperStyles) }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", "data-testid": "ChargeStatusIcon_StatusIcon", style: Object.assign({ borderRadius: unCapturedStatusStyle ? '50%' : '', width: '16px', height: '16px' }, iconStyles) }) })));
|
|
21
21
|
if (tableMode === 'sheet') {
|
|
22
|
-
|
|
22
|
+
const { background, color, border } = sheetViewStatusStyle;
|
|
23
|
+
return _jsx(StatusChip, Object.assign({ sx: { background, color, border } }, { children: t(camelCase(chargeStatus)) }));
|
|
23
24
|
}
|
|
24
25
|
if (isTextShown) {
|
|
25
26
|
return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
@@ -13,22 +13,6 @@ export declare const statusIcons: {
|
|
|
13
13
|
UNKNOWN: string;
|
|
14
14
|
AUTHORIZED: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const chargeSheetViewChipStyles: {
|
|
17
|
-
CAPTURED: {
|
|
18
|
-
color: string;
|
|
19
|
-
background: string;
|
|
20
|
-
};
|
|
21
|
-
ABANDONED: {
|
|
22
|
-
color: string;
|
|
23
|
-
background: string;
|
|
24
|
-
border: string;
|
|
25
|
-
};
|
|
26
|
-
CANCELLED: {
|
|
27
|
-
color: string;
|
|
28
|
-
background: string;
|
|
29
|
-
border: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
16
|
export declare const unCapturedStatusesStyles: Record<(typeof unCapturedStatuses)[number], {
|
|
33
17
|
gatewayIcon: string;
|
|
34
18
|
acquirerIcon: string;
|
|
@@ -78,3 +62,20 @@ export declare const capturedStatusesStyles: Record<(typeof unCapturedStatuses)[
|
|
|
78
62
|
color: string;
|
|
79
63
|
background: string;
|
|
80
64
|
}>;
|
|
65
|
+
export declare const chargeSheetViewChipStyles: {
|
|
66
|
+
ABANDONED: {
|
|
67
|
+
color: string;
|
|
68
|
+
background: string;
|
|
69
|
+
border: string;
|
|
70
|
+
};
|
|
71
|
+
CANCELLED: {
|
|
72
|
+
color: string;
|
|
73
|
+
background: string;
|
|
74
|
+
border: string;
|
|
75
|
+
};
|
|
76
|
+
INITIATED: {
|
|
77
|
+
color: string;
|
|
78
|
+
background: string;
|
|
79
|
+
border: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -13,22 +13,6 @@ export const statusIcons = {
|
|
|
13
13
|
UNKNOWN: unknownIcon,
|
|
14
14
|
AUTHORIZED: authorizedIcon,
|
|
15
15
|
};
|
|
16
|
-
export const chargeSheetViewChipStyles = {
|
|
17
|
-
CAPTURED: {
|
|
18
|
-
color: '#1F88D0',
|
|
19
|
-
background: '#1F88D01A',
|
|
20
|
-
},
|
|
21
|
-
ABANDONED: {
|
|
22
|
-
color: '#FFD600',
|
|
23
|
-
background: 'white',
|
|
24
|
-
border: '1px solid #FFD60080',
|
|
25
|
-
},
|
|
26
|
-
CANCELLED: {
|
|
27
|
-
color: '#EDC806',
|
|
28
|
-
background: '#FFD6001A',
|
|
29
|
-
border: 'none',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
16
|
export const unCapturedStatusesStyles = {
|
|
33
17
|
UNKNOWN: {
|
|
34
18
|
gatewayIcon: gatewayOrangeIcon,
|
|
@@ -124,3 +108,16 @@ export const capturedStatusesStyles = {
|
|
|
124
108
|
background: '#1F88D00D',
|
|
125
109
|
},
|
|
126
110
|
};
|
|
111
|
+
export const chargeSheetViewChipStyles = Object.assign(Object.assign(Object.assign({}, unCapturedStatusesStyles), capturedStatusesStyles), { ABANDONED: {
|
|
112
|
+
color: '#FFD600',
|
|
113
|
+
background: 'white',
|
|
114
|
+
border: '1px solid #FFD60080',
|
|
115
|
+
}, CANCELLED: {
|
|
116
|
+
color: '#EDC806',
|
|
117
|
+
background: '#FFD6001A',
|
|
118
|
+
border: 'none',
|
|
119
|
+
}, INITIATED: {
|
|
120
|
+
color: '#8D8D94',
|
|
121
|
+
background: 'white',
|
|
122
|
+
border: '1px solid #8D8D941A',
|
|
123
|
+
} });
|
|
@@ -97,7 +97,8 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
97
97
|
if (isLastRow) {
|
|
98
98
|
const usedHeight = rows.length * rowHeight;
|
|
99
99
|
const remainingHeight = height - usedHeight;
|
|
100
|
-
|
|
100
|
+
const minimumLastRowHeight = rowHeight * 2;
|
|
101
|
+
return Math.max(remainingHeight, minimumLastRowHeight);
|
|
101
102
|
}
|
|
102
103
|
return rowHeight;
|
|
103
104
|
};
|
|
@@ -48,7 +48,7 @@ function ColumnFilter(filter) {
|
|
|
48
48
|
return filter.render(componentSharedProps);
|
|
49
49
|
}
|
|
50
50
|
return null;
|
|
51
|
-
}, [open, filter,
|
|
51
|
+
}, [open, filter, onCloseDropdown]);
|
|
52
52
|
return (_jsxs(_Fragment, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 } }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: (e) => {
|
|
53
53
|
e.stopPropagation();
|
|
54
54
|
setAnchorEl(null);
|
package/build/types/table.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { SxProps } from '@mui/material/styles';
|
|
2
3
|
import { BoxProps } from '@mui/material/Box';
|
|
3
4
|
import { TableHeadProps } from '@mui/material/TableHead';
|
|
4
5
|
import { TableRowProps } from '@mui/material/TableRow';
|
|
5
6
|
import { DragControls } from 'framer-motion';
|
|
7
|
+
import { CustomColumnFilterProps } from '../components/VirtualTable';
|
|
6
8
|
import { Country } from './appConfig';
|
|
7
9
|
import { SortingOrder } from './sort';
|
|
8
|
-
import { SxProps } from '@mui/material';
|
|
9
|
-
import { CustomColumnFilterProps } from '../components/VirtualTable';
|
|
10
10
|
export interface TableFilters<T> {
|
|
11
11
|
order: string;
|
|
12
12
|
dateRange: [Date, Date];
|
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.288",
|
|
5
|
+
"testVersion": 6,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|