@tap-payments/os-micro-frontend-shared 0.1.271-test.2 → 0.1.271-test.4
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/AmountCell/components/AmountConversionTooltipLabel.d.ts +2 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/AmountConversionTooltipLabel.js +4 -6
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts +2 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.js +4 -3
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.d.ts +2 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.js +5 -4
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
type Props = {
|
|
2
3
|
type: 'fx' | 'dcc' | undefined;
|
|
3
4
|
selectAmount?: number;
|
|
@@ -7,5 +8,5 @@ type Props = {
|
|
|
7
8
|
merchantAmount?: number;
|
|
8
9
|
merchantCurrency?: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const AmountConversionTooltipLabel: (
|
|
11
|
+
export declare const AmountConversionTooltipLabel: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
12
|
export {};
|
|
@@ -2,14 +2,12 @@ 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
|
-
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
export const AmountConversionTooltipLabel = forwardRef(({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency }, ref) => {
|
|
6
7
|
const customerSelectValue = formatAmountWithCurrency(selectAmount, selectCurrency);
|
|
7
8
|
const chargeValue = formatAmountWithCurrency(requestAmount, requestCurrency);
|
|
8
9
|
const settlementValue = formatAmountWithCurrency(merchantAmount, merchantCurrency);
|
|
9
|
-
return (_jsxs(ConversionTooltip, Object.assign({ sx: {
|
|
10
|
-
textAlign: 'right',
|
|
11
|
-
justifyContent: 'flex-end',
|
|
12
|
-
} }, { children: [_jsx("span", Object.assign({ style: {
|
|
10
|
+
return (_jsxs(ConversionTooltip, Object.assign({ ref: ref, sx: { textAlign: 'right', justifyContent: 'flex-end' } }, { children: [_jsx("span", Object.assign({ style: {
|
|
13
11
|
fontWeight: 'bold',
|
|
14
12
|
} }, { 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] })] })] })] })));
|
|
15
|
-
};
|
|
13
|
+
});
|
package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TableMode } from '../../../../../types/index.js';
|
|
2
3
|
import { AmountCellProps } from '../type';
|
|
3
4
|
interface ConversionTypeLabelProps extends Pick<AmountCellProps, 'conversionType'> {
|
|
4
5
|
tableMode: TableMode;
|
|
5
6
|
}
|
|
6
|
-
export declare const ConversionTypeLabel: (
|
|
7
|
+
export declare const ConversionTypeLabel: import("react").ForwardRefExoticComponent<ConversionTypeLabelProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
8
|
export {};
|
package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ConversionBadge } from '../style';
|
|
3
|
-
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
export const ConversionTypeLabel = forwardRef(({ tableMode, conversionType }, ref) => {
|
|
4
5
|
if (!conversionType)
|
|
5
6
|
return _jsx(_Fragment, {});
|
|
6
|
-
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType })));
|
|
7
|
-
};
|
|
7
|
+
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type", ref: ref }, { children: conversionType })));
|
|
8
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TableMode } from '../../../../../types/index.js';
|
|
2
3
|
import { AmountCellProps } from '../type';
|
|
3
4
|
interface CurrencyInfoProps extends Pick<AmountCellProps, 'amount' | 'currency'> {
|
|
4
5
|
tableMode: TableMode;
|
|
5
6
|
}
|
|
6
|
-
export declare const CurrencyInfo: (
|
|
7
|
+
export declare const CurrencyInfo: import("react").ForwardRefExoticComponent<CurrencyInfoProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
8
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { CurrencySymbol } from '../../../../index.js';
|
|
3
|
-
import { CurrencySpan, DecimalSpan } from '../style';
|
|
4
4
|
import { formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
5
|
-
|
|
5
|
+
import { CurrencySpan, DecimalSpan } from '../style';
|
|
6
|
+
export const CurrencyInfo = forwardRef(({ tableMode, amount, currency }, ref) => {
|
|
6
7
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
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
|
-
};
|
|
8
|
+
return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode, ref: ref }, { 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: "-" })) })));
|
|
9
|
+
});
|
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.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|