@tap-payments/os-micro-frontend-shared 0.0.232-test.18-test.19 → 0.0.233-test.20
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/TableCells/CustomCells/ReferenceCell/ReferenceCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/ReferenceCell.js +2 -19
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.d.ts +0 -20
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.js +0 -8
- package/build/components/TableCells/CustomCells/ReferenceCell/type.d.ts +0 -1
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +20 -0
- package/build/constants/table/cell/chargeTableCellWidth.js +20 -0
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReferenceCellProps } from './type';
|
|
2
|
-
declare function ReferenceCell({ isTextShown,
|
|
2
|
+
declare function ReferenceCell({ isTextShown, ...props }: ReferenceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ReferenceCell;
|
|
@@ -16,12 +16,10 @@ import startCase from 'lodash/startCase';
|
|
|
16
16
|
import Tooltip from '../../../Tooltip';
|
|
17
17
|
import { ImageWrapper } from '../../../index.js';
|
|
18
18
|
import { TableCell } from '../../../TableCells';
|
|
19
|
-
import
|
|
20
|
-
import { referenceIcons, REFERENCE_WIDTH_MAP } from './constant';
|
|
19
|
+
import { referenceIcons } from './constant';
|
|
21
20
|
import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, StyledSourceImage, referenceSourceAnimation, } from './style';
|
|
22
|
-
import { Box } from '@mui/material';
|
|
23
21
|
function ReferenceCell(_a) {
|
|
24
|
-
var { isTextShown
|
|
22
|
+
var { isTextShown } = _a, props = __rest(_a, ["isTextShown"]);
|
|
25
23
|
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
|
26
24
|
const theme = useTheme();
|
|
27
25
|
const references = useMemo(() => Object.keys(referenceIcons).filter((key) => !!props[key]), [props]);
|
|
@@ -36,21 +34,6 @@ function ReferenceCell(_a) {
|
|
|
36
34
|
} }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(reference) }) })) : (_jsx(StyledSourceImage, { src: referenceIcons[reference], alt: reference, sx: Object.assign({}, (reference === 'order' && { width: '11.82px' })) })) })) }), `${reference}-${index}`));
|
|
37
35
|
}), [props, references, isTextShown, theme]);
|
|
38
36
|
const referenceSourcesCount = (ReferenceSources === null || ReferenceSources === void 0 ? void 0 : ReferenceSources.length) || 0;
|
|
39
|
-
if (tableMode === 'sheet') {
|
|
40
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, Object.assign({ sx: { gap: '4px', display: 'flex', flexWrap: 'nowrap' } }, { children: references.map((referenceKey) => {
|
|
41
|
-
const referenceValue = props[referenceKey];
|
|
42
|
-
const widthConfig = REFERENCE_WIDTH_MAP[referenceKey];
|
|
43
|
-
return (_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(StatusChip, Object.assign({ sx: {
|
|
44
|
-
maxWidth: widthConfig.width,
|
|
45
|
-
overflow: 'hidden',
|
|
46
|
-
textOverflow: 'ellipsis',
|
|
47
|
-
whiteSpace: 'nowrap',
|
|
48
|
-
boxSizing: 'border-box',
|
|
49
|
-
display: 'inline-block',
|
|
50
|
-
padding: '0.75px 12px',
|
|
51
|
-
} }, { children: `${startCase(referenceKey)}: ${referenceValue}` })) }), referenceKey));
|
|
52
|
-
}) })) })));
|
|
53
|
-
}
|
|
54
37
|
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: {
|
|
55
38
|
zIndex: 29,
|
|
56
39
|
} }, { children: ReferenceSources }))) : null }) })));
|
|
@@ -4,23 +4,3 @@ export declare const referenceIcons: {
|
|
|
4
4
|
payment: string;
|
|
5
5
|
order: string;
|
|
6
6
|
};
|
|
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,11 +5,3 @@ export const referenceIcons = {
|
|
|
5
5
|
payment: transactionIcon,
|
|
6
6
|
order: orderIcon,
|
|
7
7
|
};
|
|
8
|
-
export const REFERENCE_WIDTH_MAP = {
|
|
9
|
-
order: { width: '185px' },
|
|
10
|
-
payment: { width: '205px' },
|
|
11
|
-
acquirer: { width: '155px' },
|
|
12
|
-
generic: { width: '166px' },
|
|
13
|
-
merchant: { width: '140px' },
|
|
14
|
-
customer: { width: '140px' },
|
|
15
|
-
};
|
|
@@ -179,4 +179,24 @@ export declare const chargeTableCellWidth: {
|
|
|
179
179
|
readonly text: "140px";
|
|
180
180
|
readonly sheet: "140px";
|
|
181
181
|
};
|
|
182
|
+
readonly acquirer_ref: {
|
|
183
|
+
readonly default: "125px";
|
|
184
|
+
readonly text: "125px";
|
|
185
|
+
readonly sheet: "125px";
|
|
186
|
+
};
|
|
187
|
+
readonly order_ref: {
|
|
188
|
+
readonly default: "200px";
|
|
189
|
+
readonly text: "200px";
|
|
190
|
+
readonly sheet: "200px";
|
|
191
|
+
};
|
|
192
|
+
readonly payment_ref: {
|
|
193
|
+
readonly default: "150px";
|
|
194
|
+
readonly text: "150px";
|
|
195
|
+
readonly sheet: "150px";
|
|
196
|
+
};
|
|
197
|
+
readonly generic_ref: {
|
|
198
|
+
readonly default: "125px";
|
|
199
|
+
readonly text: "125px";
|
|
200
|
+
readonly sheet: "125px";
|
|
201
|
+
};
|
|
182
202
|
};
|
|
@@ -179,4 +179,24 @@ export const chargeTableCellWidth = {
|
|
|
179
179
|
text: '140px',
|
|
180
180
|
sheet: '140px',
|
|
181
181
|
},
|
|
182
|
+
acquirer_ref: {
|
|
183
|
+
default: '125px',
|
|
184
|
+
text: '125px',
|
|
185
|
+
sheet: '125px',
|
|
186
|
+
},
|
|
187
|
+
order_ref: {
|
|
188
|
+
default: '200px',
|
|
189
|
+
text: '200px',
|
|
190
|
+
sheet: '200px',
|
|
191
|
+
},
|
|
192
|
+
payment_ref: {
|
|
193
|
+
default: '150px',
|
|
194
|
+
text: '150px',
|
|
195
|
+
sheet: '150px',
|
|
196
|
+
},
|
|
197
|
+
generic_ref: {
|
|
198
|
+
default: '125px',
|
|
199
|
+
text: '125px',
|
|
200
|
+
sheet: '125px',
|
|
201
|
+
},
|
|
182
202
|
};
|
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.233-test.20",
|
|
5
|
+
"testVersion": 20,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|