@tap-payments/os-micro-frontend-shared 0.1.271-test.6 → 0.1.271-test.8
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/CountryFlag/CountryFlag.d.ts +2 -1
- package/build/components/CountryFlag/CountryFlag.js +6 -6
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.js +2 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/AmountConversionTooltipLabel.d.ts +1 -2
- package/build/components/TableCells/CustomCells/AmountCell/components/AmountConversionTooltipLabel.js +6 -4
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts +1 -2
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.js +3 -4
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.d.ts +1 -2
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.js +4 -5
- package/build/components/Tooltip/Tooltip.d.ts +8 -1
- package/build/components/Tooltip/Tooltip.js +3 -2
- package/build/components/Tooltip/styles.d.ts +2 -1
- package/build/components/Tooltip/styles.js +16 -1
- package/package.json +2 -2
|
@@ -4,5 +4,6 @@ interface CountryFlagProps extends BoxProps {
|
|
|
4
4
|
countryCode?: string;
|
|
5
5
|
currencyCode?: string;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
7
|
+
declare function CountryFlag({ countryCode, currencyCode, ...props }: CountryFlagProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof CountryFlag>;
|
|
8
9
|
export default _default;
|
|
@@ -10,14 +10,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { memo
|
|
13
|
+
import { memo } from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import { defaultCountryIcon, getCountriesIcon, getCurrenciesIcon } from '../../constants/index.js';
|
|
16
|
-
|
|
16
|
+
function CountryFlag(_a) {
|
|
17
17
|
var _b;
|
|
18
|
-
var { countryCode, currencyCode
|
|
19
|
-
return (_jsx(Box, Object.assign({
|
|
18
|
+
var { countryCode, currencyCode } = _a, props = __rest(_a, ["countryCode", "currencyCode"]);
|
|
19
|
+
return (_jsx(Box, Object.assign({}, props, { component: "img", src: (countryCode && getCountriesIcon(countryCode)) || (currencyCode && getCurrenciesIcon(currencyCode)) || defaultCountryIcon, width: props.width || 16, alt: (_b = countryCode !== null && countryCode !== void 0 ? countryCode : currencyCode) !== null && _b !== void 0 ? _b : 'flag', loading: "lazy", onError: (e) => {
|
|
20
20
|
e.currentTarget.src = defaultCountryIcon;
|
|
21
|
-
} }
|
|
22
|
-
}
|
|
21
|
+
} })));
|
|
22
|
+
}
|
|
23
23
|
export default memo(CountryFlag);
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Box } from '@mui/material';
|
|
13
14
|
import { TableCell } from '../../../TableCells';
|
|
14
15
|
import Tooltip from '../../../Tooltip';
|
|
15
16
|
import { CountryFlag, CurrencySymbol } from '../../../index.js';
|
|
@@ -18,6 +19,6 @@ import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
|
18
19
|
const tableMode = 'default';
|
|
19
20
|
function AmountCell(_a) {
|
|
20
21
|
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
|
|
21
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) })), currency && (_jsx(Tooltip, Object.assign({ title: _jsx(CurrencySymbol, { currency: currency }) }, { children: _jsx(CountryFlag, { currencyCode: currency }) }))), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
|
|
22
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(Box, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) }) })), currency && (_jsx(Tooltip, Object.assign({ title: _jsx(CurrencySymbol, { currency: currency }) }, { children: _jsx(CountryFlag, { currencyCode: currency }) }))), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
|
|
22
23
|
}
|
|
23
24
|
export default AmountCell;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
type Props = {
|
|
3
2
|
type: 'fx' | 'dcc' | undefined;
|
|
4
3
|
selectAmount?: number;
|
|
@@ -8,5 +7,5 @@ type Props = {
|
|
|
8
7
|
merchantAmount?: number;
|
|
9
8
|
merchantCurrency?: string;
|
|
10
9
|
};
|
|
11
|
-
export declare const AmountConversionTooltipLabel:
|
|
10
|
+
export declare const AmountConversionTooltipLabel: ({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -2,12 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { conversionTypesLabels, formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
3
3
|
import { CurrencySymbol } from '../../../../index.js';
|
|
4
4
|
import { ConversionTooltip, ConversionTooltipRow } from '../style';
|
|
5
|
-
|
|
6
|
-
export const AmountConversionTooltipLabel = forwardRef(({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency }, ref) => {
|
|
5
|
+
export const AmountConversionTooltipLabel = ({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, }) => {
|
|
7
6
|
const customerSelectValue = formatAmountWithCurrency(selectAmount, selectCurrency);
|
|
8
7
|
const chargeValue = formatAmountWithCurrency(requestAmount, requestCurrency);
|
|
9
8
|
const settlementValue = formatAmountWithCurrency(merchantAmount, merchantCurrency);
|
|
10
|
-
return (_jsxs(ConversionTooltip, Object.assign({
|
|
9
|
+
return (_jsxs(ConversionTooltip, Object.assign({ sx: {
|
|
10
|
+
textAlign: 'right',
|
|
11
|
+
justifyContent: 'flex-end',
|
|
12
|
+
} }, { children: [_jsx("span", Object.assign({ style: {
|
|
11
13
|
fontWeight: 'bold',
|
|
12
14
|
} }, { children: type ? conversionTypesLabels[type] : '' })), _jsxs(ConversionTooltip, { children: [type !== 'fx' && (_jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Customer Selected" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: selectCurrency }), " ", customerSelectValue.integerAmount, ".", customerSelectValue.decimalAmount] })] })), _jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Charge" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: requestCurrency }), " ", chargeValue.integerAmount, ".", chargeValue.decimalAmount] })] }), _jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Settlement" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: merchantCurrency }), " ", settlementValue.integerAmount, ".", settlementValue.decimalAmount] })] })] })] })));
|
|
13
|
-
}
|
|
15
|
+
};
|
package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableMode } from '../../../../../types/index.js';
|
|
3
2
|
import { AmountCellProps } from '../type';
|
|
4
3
|
interface ConversionTypeLabelProps extends Pick<AmountCellProps, 'conversionType'> {
|
|
5
4
|
tableMode: TableMode;
|
|
6
5
|
}
|
|
7
|
-
export declare const ConversionTypeLabel:
|
|
6
|
+
export declare const ConversionTypeLabel: ({ tableMode, conversionType }: ConversionTypeLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ConversionBadge } from '../style';
|
|
3
|
-
|
|
4
|
-
export const ConversionTypeLabel = forwardRef(({ tableMode, conversionType }, ref) => {
|
|
3
|
+
export const ConversionTypeLabel = ({ tableMode, conversionType }) => {
|
|
5
4
|
if (!conversionType)
|
|
6
5
|
return _jsx(_Fragment, {});
|
|
7
|
-
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type"
|
|
8
|
-
}
|
|
6
|
+
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType })));
|
|
7
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableMode } from '../../../../../types/index.js';
|
|
3
2
|
import { AmountCellProps } from '../type';
|
|
4
3
|
interface CurrencyInfoProps extends Pick<AmountCellProps, 'amount' | 'currency'> {
|
|
5
4
|
tableMode: TableMode;
|
|
6
5
|
}
|
|
7
|
-
export declare const CurrencyInfo:
|
|
6
|
+
export declare const CurrencyInfo: ({ tableMode, amount, currency }: CurrencyInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
2
|
import { CurrencySymbol } from '../../../../index.js';
|
|
4
|
-
import { formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
5
3
|
import { CurrencySpan, DecimalSpan } from '../style';
|
|
6
|
-
|
|
4
|
+
import { formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
5
|
+
export const CurrencyInfo = ({ tableMode, amount, currency }) => {
|
|
7
6
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
8
|
-
return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode
|
|
9
|
-
}
|
|
7
|
+
return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode }, { children: amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencySymbol, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, decimalAmount && (_jsxs(_Fragment, { children: [".", _jsx(DecimalSpan, { children: decimalAmount })] }))] })) : (_jsx("span", { children: "-" })) })));
|
|
8
|
+
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
1
2
|
import type { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
-
|
|
3
|
+
interface Props extends Omit<TooltipProps, 'children'> {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
placement?: TooltipProps['placement'];
|
|
6
|
+
children?: ReactElement;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Tooltip({ className, title, placement, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
3
10
|
export default Tooltip;
|
|
@@ -10,9 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
13
14
|
import { StyledTooltip } from './styles';
|
|
14
15
|
function Tooltip(_a) {
|
|
15
|
-
var { className, placement = 'top', children } = _a, rest = __rest(_a, ["className", "placement", "children"]);
|
|
16
|
-
return (_jsx(StyledTooltip, Object.assign({ classes: { popper: className }, placement: placement, arrow: true }, rest, { children: children })));
|
|
16
|
+
var { className, title, placement = 'top', children } = _a, rest = __rest(_a, ["className", "title", "placement", "children"]);
|
|
17
|
+
return (_jsx(StyledTooltip, Object.assign({ classes: { popper: className }, title: title, placement: placement, arrow: true }, rest, { children: _jsx(Box, Object.assign({ display: "flex", component: "span" }, { children: children })) })));
|
|
17
18
|
}
|
|
18
19
|
export default Tooltip;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
export declare const StyledTooltip: import("@emotion/styled").StyledComponent<TooltipProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
13
|
import { styled } from '@mui/material/styles';
|
|
2
14
|
import TooltipComponent, { tooltipClasses } from '@mui/material/Tooltip';
|
|
3
|
-
export const StyledTooltip = styled(
|
|
15
|
+
export const StyledTooltip = styled((_a) => {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return _jsx(TooltipComponent, Object.assign({}, props, { classes: { popper: className } }));
|
|
18
|
+
})(({ theme }) => ({
|
|
4
19
|
zIndex: 999999,
|
|
5
20
|
[`& .${tooltipClasses.arrow}`]: {
|
|
6
21
|
'&:before': {
|
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.271-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.271-test.8",
|
|
5
|
+
"testVersion": 8,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|