@tap-payments/os-micro-frontend-shared 0.1.48-test.1 → 0.1.48-test.2
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/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/style.js +2 -0
- package/build/components/StatusIcons/SourceIcons/SourceIcons.js +6 -3
- package/build/utils/columns.d.ts +2 -2
- package/build/utils/columns.js +3 -4
- package/package.json +2 -2
|
@@ -20,6 +20,7 @@ function RightLeftExpandingCenterChip(_a) {
|
|
|
20
20
|
return (_jsx(Box, Object.assign({}, props, { "data-testid": "RightLeftExpandingCenterChipBox", sx: tableCellSx }, { children: _jsx(CenterShiftWrapper, Object.assign({ "data-testid": "CenterShiftWrapper", initial: false, style: { x: shiftX } }, { children: _jsxs(CenterIconWrapper, Object.assign({ "data-testid": "CenterIconWrapper", ref: centerWrapRef, onMouseLeave: handleMouseLeave }, { children: [_jsxs(PeekContainer, Object.assign({ "data-testid": "PeekContainer" }, { children: [_jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(LeftPeekChip, { "data-testid": "LeftPeekChip", initial: { opacity: 0, scale: 0.95, x: -4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: -6 } : { opacity: 1, scale: 1, x: -5 }, exit: { opacity: 0, scale: 0.95, x: -4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "left-peek")) })), _jsx(CenterChip, Object.assign({ "data-testid": "CenterChip", ref: centerChipRef, onMouseEnter: handleMouseEnter, style: {
|
|
21
21
|
borderRadius: expandableCenter && isHovering ? '12px 0 0 12px' : '12px',
|
|
22
22
|
borderRight: expandableCenter && isHovering ? 'none' : undefined,
|
|
23
|
+
paddingInlineEnd: '2px',
|
|
23
24
|
} }, { children: _jsx(CenterContent, Object.assign({ "data-testid": "CenterContent", ref: centerContentRef }, { children: centerIcon })) })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: expandableCenter && (_jsx(ExpandableContainer, Object.assign({ "data-testid": "ExpandableContainer", style: {
|
|
24
25
|
width: expandedMV,
|
|
25
26
|
position: 'absolute',
|
|
@@ -29,7 +30,6 @@ function RightLeftExpandingCenterChip(_a) {
|
|
|
29
30
|
zIndex: 1,
|
|
30
31
|
opacity: isHovering ? 1 : 0,
|
|
31
32
|
pointerEvents: isHovering ? 'auto' : 'none',
|
|
32
|
-
paddingRight: '2px',
|
|
33
33
|
}, initial: false, transition: { duration: 0.2, ease: 'easeOut' } }, { children: _jsx(ExpandableInner, Object.assign({ "data-testid": "ExpandableInner", ref: expandableInnerRef }, { children: expandableCenter })) }))) })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: rightIcons.length > 0 && (_jsx(RightPeekChip, { "data-testid": "RightPeekChip", initial: { opacity: 0, scale: 0.95, x: 4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: 6 } : { opacity: 1, scale: 1, x: 5 }, exit: { opacity: 0, scale: 0.95, x: 4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "right-peek")) }))] })), isHovering && leftIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "LeftHoverBridge", side: "left", style: { width: leftHoverWidth, right: `calc(100% - ${anchors.left}px)`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), isHovering && rightIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "RightHoverBridge", side: "right", style: { width: rightHoverWidth, left: `${anchors.right}px`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(ExpandedSection, Object.assign({ "data-testid": "LeftExpandedSection", side: "left", style: {
|
|
34
34
|
right: `calc(100% - ${anchors.left}px)`,
|
|
35
35
|
top: '50%',
|
|
@@ -29,6 +29,7 @@ export const LeftExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
|
29
29
|
fontSize: '10px',
|
|
30
30
|
lineHeight: 1,
|
|
31
31
|
color: theme.palette.text.secondary,
|
|
32
|
+
fontWeight: 'bold',
|
|
32
33
|
userSelect: 'none',
|
|
33
34
|
}));
|
|
34
35
|
export const RightExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
@@ -43,6 +44,7 @@ export const RightExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
|
43
44
|
fontSize: '10px',
|
|
44
45
|
lineHeight: 1,
|
|
45
46
|
color: theme.palette.text.secondary,
|
|
47
|
+
fontWeight: 'bold',
|
|
46
48
|
userSelect: 'none',
|
|
47
49
|
}));
|
|
48
50
|
export const ExpandedSection = styled(motion.div)(({ side }) => (Object.assign(Object.assign(Object.assign({ position: 'absolute', display: 'flex', alignItems: 'center' }, (side === 'left' ? { right: '100%', flexDirection: 'row-reverse', transformOrigin: 'right center' } : {})), (side === 'right' ? { left: '100%', flexDirection: 'row', transformOrigin: 'left center' } : {})), { top: '50%', transform: 'translateY(-50%)', gap: 0, pointerEvents: 'auto', overflow: 'visible' })));
|
|
@@ -16,13 +16,16 @@ export function SourceIcons({ payment, card, isTextShown, firstIcon }) {
|
|
|
16
16
|
const method = payment === null || payment === void 0 ? void 0 : payment.method;
|
|
17
17
|
const scheme = payment === null || payment === void 0 ? void 0 : payment.scheme;
|
|
18
18
|
if (((_a = getPaymentMethodKey(method)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = getPaymentMethodKey(scheme)) === null || _b === void 0 ? void 0 : _b.toLowerCase())) {
|
|
19
|
-
initialSources.push(...[getPaymentMethodKey(
|
|
19
|
+
initialSources.push(...[getPaymentMethodKey(method), getPaymentMethodKey(type)]);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
initialSources.push(...[getPaymentMethodKey(
|
|
22
|
+
initialSources.push(...[getPaymentMethodKey(method), getPaymentMethodKey(type), getPaymentMethodKey(scheme)]);
|
|
23
23
|
}
|
|
24
24
|
return initialSources;
|
|
25
25
|
}, [payment]);
|
|
26
|
+
const firstIconSource = useMemo(() => {
|
|
27
|
+
return _jsx(SourceIcon, { source: firstIcon, isTextShown: isTextShown, title: t(camelCase(firstIcon)) }, firstIcon);
|
|
28
|
+
}, [firstIcon, isTextShown, t]);
|
|
26
29
|
const paymentSources = useMemo(() => {
|
|
27
30
|
var _a, _b;
|
|
28
31
|
return (_b = (_a = sources()) === null || _a === void 0 ? void 0 : _a.filter((s) => !!s && s !== firstIcon)) === null || _b === void 0 ? void 0 : _b.map((source, index, sourcesList) => {
|
|
@@ -31,5 +34,5 @@ export function SourceIcons({ payment, card, isTextShown, firstIcon }) {
|
|
|
31
34
|
return (_jsx(SourceIcon, { source: source, isTextShown: isTextShown, title: index === 0 && source === 'Wallet' ? walletTooltip : sourceTooltip }, `${source}-${index}`));
|
|
32
35
|
});
|
|
33
36
|
}, [sources, payment, card, isTextShown, t, firstIcon]);
|
|
34
|
-
return (_jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: 0.5 }, { children: [paymentSources, (card === null || card === void 0 ? void 0 : card.last_four) && _jsxs(CardNumber, { children: ["\u00B7\u00B7\u00B7 ", card === null || card === void 0 ? void 0 : card.last_four] })] })));
|
|
37
|
+
return (_jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: 0.5 }, { children: [firstIcon && firstIconSource, paymentSources, (card === null || card === void 0 ? void 0 : card.last_four) && _jsxs(CardNumber, { children: ["\u00B7\u00B7\u00B7 ", card === null || card === void 0 ? void 0 : card.last_four] })] })));
|
|
35
38
|
}
|
package/build/utils/columns.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export declare function filterShownColumns<T>(columns: Array<IColumnProps<T & {
|
|
|
9
9
|
export declare function isParameterSelected(columns: ColumnViewProps[], columnId: string, parameter: string): boolean;
|
|
10
10
|
export declare function mapDataToViews(columnData?: ColumnsView[], language?: string): ColumnViewProps[];
|
|
11
11
|
export declare function mapViewsToData(columns: ColumnViewProps[]): ColumnsView[];
|
|
12
|
-
export declare const updateColumnSelection: ({ columnsViewData,
|
|
12
|
+
export declare const updateColumnSelection: ({ columnsViewData, columnsName, selected, }: {
|
|
13
13
|
columnsViewData: ColumnsView[];
|
|
14
|
-
|
|
14
|
+
columnsName: string[];
|
|
15
15
|
selected: boolean;
|
|
16
16
|
}) => ColumnsView[];
|
package/build/utils/columns.js
CHANGED
|
@@ -65,11 +65,10 @@ export function mapViewsToData(columns) {
|
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
export const updateColumnSelection = ({ columnsViewData,
|
|
68
|
+
export const updateColumnSelection = ({ columnsViewData, columnsName, selected, }) => {
|
|
69
69
|
return columnsViewData.map((column) => {
|
|
70
|
-
var _a
|
|
71
|
-
|
|
72
|
-
if (columnText === columnName.toLowerCase()) {
|
|
70
|
+
var _a;
|
|
71
|
+
if (columnsName.includes((_a = column.name[0]) === null || _a === void 0 ? void 0 : _a.text)) {
|
|
73
72
|
return Object.assign(Object.assign({}, column), { selected });
|
|
74
73
|
}
|
|
75
74
|
return column;
|
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.48-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.48-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|