@tap-payments/os-micro-frontend-shared 0.0.129-sheetview-component-ui-v2 → 0.0.129-sheetview-component-ui-v4
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.d.ts +3 -1
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +7 -2
- package/build/components/TableCells/CustomCells/CustomerCell/style.js +1 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.js +3 -3
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +12 -0
- package/build/components/TableCells/CustomCells/StatusCell/constant.js +12 -0
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +2 -2
- package/build/constants/table/cell/chargeTableCellWidth.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { type ChargeStatus } from '../../TableCells';
|
|
3
|
-
|
|
3
|
+
import { TableMode } from '../../../types/index.js';
|
|
4
|
+
export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, tableMode, showBadge, }: Readonly<{
|
|
4
5
|
chargeStatus?: ChargeStatus;
|
|
5
6
|
gatewayTooltip?: string;
|
|
6
7
|
showAuthorizedStatus?: boolean;
|
|
@@ -17,4 +18,5 @@ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquire
|
|
|
17
18
|
gatewayContainerStyles?: CSSProperties;
|
|
18
19
|
gateWayIconStyles?: CSSProperties;
|
|
19
20
|
showBadge?: boolean;
|
|
21
|
+
tableMode?: TableMode;
|
|
20
22
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,17 +5,22 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import Tooltip from '../../Tooltip';
|
|
6
6
|
import { unCapturedStatuses } from '../../../constants/index.js';
|
|
7
7
|
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
|
|
8
|
-
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
8
|
+
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons, sheetViewChipStyles, } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
9
9
|
import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
|
|
10
|
-
|
|
10
|
+
import StatusChip from '../../StatusChip';
|
|
11
|
+
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, tableMode, showBadge = true, }) {
|
|
11
12
|
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
12
13
|
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
|
+
const sheetViewStatusStyle = chargeStatus ? sheetViewChipStyles[chargeStatus] : null;
|
|
13
15
|
const theme = useTheme();
|
|
14
16
|
const { t } = useTranslation();
|
|
15
17
|
const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
|
|
16
18
|
const acquirerTooltipTitle = acquirerTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Acquirer" }), _jsx("div", { children: acquirerTooltip })] }));
|
|
17
19
|
const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
|
|
18
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
|
+
if (tableMode === 'sheet') {
|
|
22
|
+
return _jsx(StatusChip, Object.assign({ sx: Object.assign({}, sheetViewStatusStyle) }, { children: t(camelCase(chargeStatus)) }));
|
|
23
|
+
}
|
|
19
24
|
if (isTextShown) {
|
|
20
25
|
return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
21
26
|
background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
|
|
@@ -7,7 +7,7 @@ export const StyledCustomerCell = styled('span')(({ theme }) => ({
|
|
|
7
7
|
}));
|
|
8
8
|
export const StyledCustomerName = styled('span', {
|
|
9
9
|
shouldForwardProp: (prop) => prop !== 'tableMode',
|
|
10
|
-
})(({ tableMode }) => (Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '25ch', flex: 1 }, (tableMode === 'sheet' && { fontSize: '11px' }))));
|
|
10
|
+
})(({ theme, tableMode }) => (Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '25ch', flex: 1 }, (tableMode === 'sheet' && { fontSize: '11px', color: theme.palette.text.primary }))));
|
|
11
11
|
export const StyledCustomerIconContainer = styled('span')({
|
|
12
12
|
width: '11.6px',
|
|
13
13
|
height: '11.6px',
|
|
@@ -8,9 +8,9 @@ export const referenceIcons = {
|
|
|
8
8
|
export const REFERENCE_ORDER = ['order', 'payment', 'acquirer', 'generic', 'merchant', 'customer'];
|
|
9
9
|
export const REFERENCE_WIDTH_MAP = {
|
|
10
10
|
order: { width: '185px' },
|
|
11
|
-
payment: { width: '
|
|
12
|
-
acquirer: { width: '
|
|
13
|
-
generic: { width: '
|
|
11
|
+
payment: { width: '205px' },
|
|
12
|
+
acquirer: { width: '155px' },
|
|
13
|
+
generic: { width: '166px' },
|
|
14
14
|
merchant: { width: '140px' },
|
|
15
15
|
customer: { width: '140px' },
|
|
16
16
|
};
|
|
@@ -13,6 +13,18 @@ export declare const statusIcons: {
|
|
|
13
13
|
UNKNOWN: string;
|
|
14
14
|
AUTHORIZED: string;
|
|
15
15
|
};
|
|
16
|
+
export declare const sheetViewChipStyles: {
|
|
17
|
+
ABANDONED: {
|
|
18
|
+
color: string;
|
|
19
|
+
background: string;
|
|
20
|
+
border: string;
|
|
21
|
+
};
|
|
22
|
+
CANCELLED: {
|
|
23
|
+
color: string;
|
|
24
|
+
background: string;
|
|
25
|
+
border: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
16
28
|
export declare const unCapturedStatusesStyles: Record<(typeof unCapturedStatuses)[number], {
|
|
17
29
|
gatewayIcon: string;
|
|
18
30
|
acquirerIcon: string;
|
|
@@ -13,6 +13,18 @@ export const statusIcons = {
|
|
|
13
13
|
UNKNOWN: unknownIcon,
|
|
14
14
|
AUTHORIZED: authorizedIcon,
|
|
15
15
|
};
|
|
16
|
+
export const sheetViewChipStyles = {
|
|
17
|
+
ABANDONED: {
|
|
18
|
+
color: '#FFD600',
|
|
19
|
+
background: 'transparent',
|
|
20
|
+
border: '1px solid #FFD60080',
|
|
21
|
+
},
|
|
22
|
+
CANCELLED: {
|
|
23
|
+
color: '#EDC806',
|
|
24
|
+
background: '#FFD6001A',
|
|
25
|
+
border: 'none',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
16
28
|
export const unCapturedStatusesStyles = {
|
|
17
29
|
UNKNOWN: {
|
|
18
30
|
gatewayIcon: gatewayOrangeIcon,
|
|
@@ -72,7 +72,7 @@ export declare const chargeTableCellWidth: {
|
|
|
72
72
|
readonly status: {
|
|
73
73
|
readonly default: "70px";
|
|
74
74
|
readonly text: "300px";
|
|
75
|
-
readonly sheet: "
|
|
75
|
+
readonly sheet: "385px";
|
|
76
76
|
};
|
|
77
77
|
readonly merchant: {
|
|
78
78
|
readonly default: "100px";
|
|
@@ -107,7 +107,7 @@ export declare const chargeTableCellWidth: {
|
|
|
107
107
|
readonly metadata: {
|
|
108
108
|
readonly default: "180px";
|
|
109
109
|
readonly text: "180px";
|
|
110
|
-
readonly sheet: "
|
|
110
|
+
readonly sheet: "245px";
|
|
111
111
|
};
|
|
112
112
|
readonly settlement: {
|
|
113
113
|
readonly default: "200px";
|
|
@@ -72,7 +72,7 @@ export const chargeTableCellWidth = {
|
|
|
72
72
|
status: {
|
|
73
73
|
default: '70px',
|
|
74
74
|
text: '300px',
|
|
75
|
-
sheet: '
|
|
75
|
+
sheet: '385px',
|
|
76
76
|
},
|
|
77
77
|
merchant: {
|
|
78
78
|
default: '100px',
|
|
@@ -107,7 +107,7 @@ export const chargeTableCellWidth = {
|
|
|
107
107
|
metadata: {
|
|
108
108
|
default: '180px',
|
|
109
109
|
text: '180px',
|
|
110
|
-
sheet: '
|
|
110
|
+
sheet: '245px',
|
|
111
111
|
},
|
|
112
112
|
settlement: {
|
|
113
113
|
default: '200px',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.129-sheetview-component-ui-
|
|
4
|
+
"version": "0.0.129-sheetview-component-ui-v4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"module": "build/index.js",
|