@tap-payments/os-micro-frontend-shared 0.0.192 → 0.0.194
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/PayoutIcon/PayoutIcon.js +2 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/ReferenceCell.js +5 -11
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.d.ts +20 -5
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.js +0 -1
- package/package.json +1 -1
|
@@ -10,7 +10,8 @@ export const PayoutIcon = ({ payoutStatus = 'PENDING', tableMode, isTextShown, p
|
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const payoutStatusStyle = payoutStatusStyles[payoutStatus];
|
|
12
12
|
if (tableMode === 'sheet') {
|
|
13
|
-
|
|
13
|
+
const chipText = payoutStatus === 'PENDING' ? t('scheduledPayout') : t(camelCase(payoutStatus));
|
|
14
|
+
return _jsx(StatusChip, Object.assign({ sx: Object.assign({}, payoutStatusStyle) }, { children: chipText }));
|
|
14
15
|
}
|
|
15
16
|
const title = payoutTooltip ? payoutTooltip : t(camelCase(payoutStatus));
|
|
16
17
|
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_PayoutStatusLabel" }, { children: t(camelCase(payoutStatus)) }))) : (_jsx(StatusIcon, { src: payoutStatusIcons[payoutStatus], alt: "settled-icon", "data-testid": "StatusCell_PayoutStatusIcon", style: iconStyles })) })));
|
|
@@ -17,7 +17,7 @@ import Tooltip from '../../../Tooltip';
|
|
|
17
17
|
import { ImageWrapper } from '../../../index.js';
|
|
18
18
|
import { TableCell } from '../../../TableCells';
|
|
19
19
|
import StatusChip from '../../../StatusChip';
|
|
20
|
-
import { referenceIcons,
|
|
20
|
+
import { referenceIcons, REFERENCE_WIDTH_MAP } from './constant';
|
|
21
21
|
import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, StyledSourceImage, referenceSourceAnimation, } from './style';
|
|
22
22
|
import { Box } from '@mui/material';
|
|
23
23
|
function ReferenceCell(_a) {
|
|
@@ -37,24 +37,18 @@ function ReferenceCell(_a) {
|
|
|
37
37
|
}), [props, references, isTextShown, theme]);
|
|
38
38
|
const referenceSourcesCount = (ReferenceSources === null || ReferenceSources === void 0 ? void 0 : ReferenceSources.length) || 0;
|
|
39
39
|
if (tableMode === 'sheet') {
|
|
40
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, Object.assign({ sx: { gap: '4px', display: 'flex', flexWrap: 'nowrap' } }, { children:
|
|
40
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, Object.assign({ sx: { gap: '4px', display: 'flex', flexWrap: 'nowrap' } }, { children: references.map((referenceKey) => {
|
|
41
41
|
const referenceValue = props[referenceKey];
|
|
42
|
-
const hasValue = !!referenceValue;
|
|
43
42
|
const widthConfig = REFERENCE_WIDTH_MAP[referenceKey];
|
|
44
|
-
return (_jsx(Box, Object.assign({ sx: {
|
|
45
|
-
|
|
46
|
-
minWidth: widthConfig.width,
|
|
47
|
-
maxWidth: widthConfig.width,
|
|
48
|
-
flexShrink: 0,
|
|
49
|
-
} }, { children: hasValue ? (_jsx(StatusChip, Object.assign({ sx: {
|
|
50
|
-
maxWidth: '100%',
|
|
43
|
+
return (_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(StatusChip, Object.assign({ sx: {
|
|
44
|
+
maxWidth: widthConfig.width,
|
|
51
45
|
overflow: 'hidden',
|
|
52
46
|
textOverflow: 'ellipsis',
|
|
53
47
|
whiteSpace: 'nowrap',
|
|
54
48
|
boxSizing: 'border-box',
|
|
55
49
|
display: 'inline-block',
|
|
56
50
|
padding: '0.75px 12px',
|
|
57
|
-
} }, { children: `${startCase(referenceKey)}: ${referenceValue}` }))
|
|
51
|
+
} }, { children: `${startCase(referenceKey)}: ${referenceValue}` })) }), referenceKey));
|
|
58
52
|
}) })) })));
|
|
59
53
|
}
|
|
60
54
|
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, { children: referenceSourcesCount > 0 ? (_jsx(ReferenceSourcesContainer, Object.assign({ layout: true, className: "reference-sources-container", whileHover: "animate", animate: isTooltipOpen ? 'animate' : 'start', sourcesCount: referenceSourcesCount, variants: { animate: { width: referenceSourcesCount * (6 + 32) } }, style: {
|
|
@@ -4,8 +4,23 @@ export declare const referenceIcons: {
|
|
|
4
4
|
payment: string;
|
|
5
5
|
order: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export declare const REFERENCE_WIDTH_MAP: {
|
|
8
|
+
order: {
|
|
9
|
+
width: string;
|
|
10
|
+
};
|
|
11
|
+
payment: {
|
|
12
|
+
width: string;
|
|
13
|
+
};
|
|
14
|
+
acquirer: {
|
|
15
|
+
width: string;
|
|
16
|
+
};
|
|
17
|
+
generic: {
|
|
18
|
+
width: string;
|
|
19
|
+
};
|
|
20
|
+
merchant: {
|
|
21
|
+
width: string;
|
|
22
|
+
};
|
|
23
|
+
customer: {
|
|
24
|
+
width: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -5,7 +5,6 @@ export const referenceIcons = {
|
|
|
5
5
|
payment: transactionIcon,
|
|
6
6
|
order: orderIcon,
|
|
7
7
|
};
|
|
8
|
-
export const REFERENCE_ORDER = ['order', 'payment', 'acquirer', 'generic', 'merchant', 'customer'];
|
|
9
8
|
export const REFERENCE_WIDTH_MAP = {
|
|
10
9
|
order: { width: '185px' },
|
|
11
10
|
payment: { width: '205px' },
|
package/package.json
CHANGED