@tap-payments/os-micro-frontend-shared 0.1.324-test.4 → 0.1.324-test.6
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/PaymentSourceFilter/PaymentIcon.d.ts +2 -2
- package/build/components/PaymentSourceFilter/PaymentIcon.js +2 -2
- package/build/components/PaymentSourceFilter/PaymentMethod.js +1 -1
- package/build/components/PaymentSourceFilter/PaymentSchemes.js +1 -1
- package/build/components/PaymentSourceFilter/style.d.ts +4 -1
- package/build/components/PaymentSourceFilter/style.js +2 -1
- package/build/utils/merchantSource.d.ts +0 -2
- package/build/utils/merchantSource.js +3 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface PaymentIconProps {
|
|
2
|
-
|
|
2
|
+
code: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function PaymentIcon({
|
|
4
|
+
export declare function PaymentIcon({ code }: PaymentIconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import { getPaymentMethodsIcon } from '../../constants/index.js';
|
|
4
4
|
import { PaymentChip } from './style';
|
|
5
|
-
export function PaymentIcon({
|
|
6
|
-
return (_jsx(PaymentChip, { children: _jsx(Box, { component: "img", src:
|
|
5
|
+
export function PaymentIcon({ code }) {
|
|
6
|
+
return (_jsx(PaymentChip, { children: _jsx(Box, { component: "img", src: getPaymentMethodsIcon(code), sx: { width: 18 }, onError: (e) => {
|
|
7
7
|
e.currentTarget.src = getPaymentMethodsIcon('card');
|
|
8
8
|
} }) }));
|
|
9
9
|
}
|
|
@@ -51,5 +51,5 @@ export default function PaymentMethod({ icon, name, options = [], filters, setFi
|
|
|
51
51
|
setFilters(Object.assign(Object.assign({}, filters), { payment_methods: [...(paymentMethods !== null && paymentMethods !== void 0 ? paymentMethods : []), selectedPaymentMethod] }));
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("img", { src: icon, alt: name }), _jsx("span", Object.assign({ className: "label" }, { children: name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-end" }, { children: options === null || options === void 0 ? void 0 : options.map((option) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentMethod(option.type), onClick: (e) => onClickPaymentMethod(e, option.type) }, { children: _jsx(PaymentIcon, {
|
|
54
|
+
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("img", { src: icon, alt: name }), _jsx("span", Object.assign({ className: "label" }, { children: name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-end" }, { children: options === null || options === void 0 ? void 0 : options.map((option) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentMethod(option.type), onClick: (e) => onClickPaymentMethod(e, option.type) }, { children: _jsx(PaymentIcon, { code: option.type }) }), option.type))) }))] })));
|
|
55
55
|
}
|
|
@@ -50,5 +50,5 @@ export default function PaymentSchemes({ paymentSchemesSource, filters, setFilte
|
|
|
50
50
|
setFilters(Object.assign(Object.assign({}, filters), { payment_scheme: [...((_b = filters === null || filters === void 0 ? void 0 : filters.payment_scheme) !== null && _b !== void 0 ? _b : []), selectedPaymentScheme] }));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_d = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _d === void 0 ? void 0 : _d.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx(PaymentIcon, {
|
|
53
|
+
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_d = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _d === void 0 ? void 0 : _d.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx(PaymentIcon, { code: scheme.type }) }), scheme.type))) }))] })));
|
|
54
54
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const MenuItemStyled: import("@emotion/styled").StyledComponent<import("../MenuItem/MenuItem").MenuItemProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
2
|
-
export declare const PaymentChip: import("@emotion/styled").StyledComponent<import("
|
|
3
|
+
export declare const PaymentChip: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from '@mui/material/styles';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
2
3
|
import { MenuItem } from '../index.js';
|
|
3
4
|
export const MenuItemStyled = styled(MenuItem)(({ theme }) => ({
|
|
4
5
|
height: 40,
|
|
@@ -10,7 +11,7 @@ export const MenuItemStyled = styled(MenuItem)(({ theme }) => ({
|
|
|
10
11
|
flexGrow: 1,
|
|
11
12
|
},
|
|
12
13
|
}));
|
|
13
|
-
export const PaymentChip = styled(
|
|
14
|
+
export const PaymentChip = styled(Box)(({ theme }) => ({
|
|
14
15
|
width: 36,
|
|
15
16
|
height: 24,
|
|
16
17
|
border: `1px solid ${theme.palette.divider}`,
|
|
@@ -16,7 +16,6 @@ export declare function transformPaymentMethodsData(data?: PaymentMethod[]): {
|
|
|
16
16
|
options: {
|
|
17
17
|
name: string | undefined;
|
|
18
18
|
type: string;
|
|
19
|
-
icon: string;
|
|
20
19
|
}[];
|
|
21
20
|
}[] | undefined;
|
|
22
21
|
};
|
|
@@ -26,7 +25,6 @@ export declare function transformPaymentSchemesData(data?: Source[]): {
|
|
|
26
25
|
options: {
|
|
27
26
|
name: string | undefined;
|
|
28
27
|
type: string;
|
|
29
|
-
icon: string;
|
|
30
28
|
}[];
|
|
31
29
|
};
|
|
32
30
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import capitalize from 'lodash/capitalize';
|
|
2
|
-
import {
|
|
2
|
+
import { PAYMENT_TYPES_ICONS } from '../constants/index.js';
|
|
3
3
|
import { getNameText } from './language';
|
|
4
4
|
export function transformPaymentMethodsData(data) {
|
|
5
5
|
return {
|
|
@@ -14,7 +14,7 @@ export function transformPaymentMethodsData(data) {
|
|
|
14
14
|
options: (_b = category.payment_methods) === null || _b === void 0 ? void 0 : _b.map((method) => ({
|
|
15
15
|
name: getNameText(method.name),
|
|
16
16
|
type: method.code,
|
|
17
|
-
icon: getPaymentMethodsIcon(method.code),
|
|
17
|
+
// icon: getPaymentMethodsIcon(method.code),
|
|
18
18
|
})),
|
|
19
19
|
};
|
|
20
20
|
}),
|
|
@@ -30,7 +30,7 @@ export function transformPaymentSchemesData(data = []) {
|
|
|
30
30
|
return {
|
|
31
31
|
name: getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name),
|
|
32
32
|
type: scheme === null || scheme === void 0 ? void 0 : scheme.code,
|
|
33
|
-
icon: getPaymentMethodsIcon(scheme.code),
|
|
33
|
+
// icon: getPaymentMethodsIcon(scheme.code),
|
|
34
34
|
};
|
|
35
35
|
}),
|
|
36
36
|
};
|
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.324-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.324-test.6",
|
|
5
|
+
"testVersion": 6,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|