@tap-payments/os-micro-frontend-shared 0.1.271-test.1 → 0.1.271-test.3
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 +1 -2
- package/build/components/CountryFlag/CountryFlag.js +5 -5
- 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
|
@@ -4,6 +4,5 @@ interface CountryFlagProps extends BoxProps {
|
|
|
4
4
|
countryCode?: string;
|
|
5
5
|
currencyCode?: string;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
8
|
-
declare const _default: import("react").MemoExoticComponent<typeof CountryFlag>;
|
|
7
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<CountryFlagProps, "ref"> & import("react").RefAttributes<HTMLImageElement>>>;
|
|
9
8
|
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 } from 'react';
|
|
13
|
+
import { memo, forwardRef } from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import { defaultCountryIcon, getCountriesIcon, getCurrenciesIcon } from '../../constants/index.js';
|
|
16
|
-
|
|
16
|
+
const CountryFlag = forwardRef((_a, ref) => {
|
|
17
17
|
var _b;
|
|
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:
|
|
18
|
+
var { countryCode, currencyCode, width = 16 } = _a, props = __rest(_a, ["countryCode", "currencyCode", "width"]);
|
|
19
|
+
return (_jsx(Box, Object.assign({}, props, { ref: ref, component: "img", src: (countryCode && getCountriesIcon(countryCode)) || (currencyCode && getCurrenciesIcon(currencyCode)) || defaultCountryIcon, width: width, 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
21
|
} })));
|
|
22
|
-
}
|
|
22
|
+
});
|
|
23
23
|
export default memo(CountryFlag);
|
|
@@ -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.3",
|
|
5
|
+
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|