@tap-payments/os-micro-frontend-shared 0.1.271-test.1 → 0.1.271-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.
|
@@ -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);
|
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.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|