@tap-payments/os-micro-frontend-shared 0.1.241-test.5 → 0.1.242
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/ActionMenu/ActionMenuDropDown.js +3 -4
- package/build/components/ActionMenu/ActionMenuItem.js +3 -3
- package/build/components/ActionMenu/style.d.ts +1 -0
- package/build/components/ActionMenu/style.js +4 -0
- package/build/components/ActivityAreaChart/components/ChartTooltip.js +3 -4
- package/build/components/ActivityAreaChart/styles.d.ts +1 -0
- package/build/components/ActivityAreaChart/styles.js +6 -0
- package/build/components/Chip/style.d.ts +1 -0
- package/build/components/CountBadge/style.d.ts +1 -0
- package/build/components/CountryFlag/CountryFlag.js +1 -1
- package/build/components/Dialog/style.d.ts +1 -0
- package/build/components/FlippingCard/style.d.ts +1 -0
- package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -0
- package/build/components/InputBase/PhoneInputBase/CountriesList/CountriesList.js +1 -2
- package/build/components/JSONViewer/style.d.ts +1 -0
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +1 -0
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +1 -0
- package/build/components/SearchButton/styles.d.ts +1 -0
- package/build/components/SelectDropdown/SelectDropdown.d.ts +3 -1
- package/build/components/SelectDropdown/SelectDropdown.js +4 -3
- package/build/components/SelectWithSearch/SelectWithSearch.d.ts +1 -1
- package/build/components/SelectWithSearch/SelectWithSearch.js +3 -3
- package/build/components/SelectWithSearch/type.d.ts +1 -0
- package/build/components/StatusIcons/AuthIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +1 -0
- package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.js +4 -2
- package/build/components/TableCells/CustomCells/AmountCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AmountCell/style.js +6 -0
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/CurrencyCell/CurrencyCell.js +3 -2
- package/build/components/TableCells/CustomCells/CurrencyCell/style.d.ts +2 -0
- package/build/components/TableCells/CustomCells/CurrencyCell/style.js +10 -0
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/style.d.ts +2 -0
- package/build/components/TableCells/CustomCells/style.js +4 -0
- package/build/components/VirtualTables/components/style.d.ts +1 -0
- package/build/components/index.d.ts +0 -1
- package/build/components/index.js +0 -1
- package/build/constants/assets.js +2 -2
- package/build/utils/currency.d.ts +1 -0
- package/build/utils/currency.js +6 -1
- package/package.json +3 -3
- package/build/components/CurrencyCountryFlag/CurrencyCountryFlag.d.ts +0 -8
- package/build/components/CurrencyCountryFlag/CurrencyCountryFlag.js +0 -22
- package/build/components/CurrencyCountryFlag/index.d.ts +0 -2
- package/build/components/CurrencyCountryFlag/index.js +0 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { intlCurrency } from '../../utils/index.js';
|
|
4
|
-
import { EnglishAmount, StyledCurrency, StyledIconRowContainer, StyledDropDownContainer, StyledDropdown, StyledMenuItem, StyledTextAmount, DropDownChargeGapColumn, } from './style';
|
|
5
|
-
import CurrencyCountryFlag from '../CurrencyCountryFlag';
|
|
3
|
+
import { getCurrencyCodeFlag, intlCurrency } from '../../utils/index.js';
|
|
4
|
+
import { EnglishAmount, StyledCurrency, StyledIconRowContainer, StyledDropDownContainer, StyledDropdown, StyledFlag, StyledMenuItem, StyledTextAmount, DropDownChargeGapColumn, } from './style';
|
|
6
5
|
const Menu = ({ selectedCurrency, option, closeDropdown, handleSelectOption }) => {
|
|
7
6
|
var _a, _b, _c;
|
|
8
7
|
const { t } = useTranslation();
|
|
@@ -11,7 +10,7 @@ const Menu = ({ selectedCurrency, option, closeDropdown, handleSelectOption }) =
|
|
|
11
10
|
handleSelectOption(option.value, option === null || option === void 0 ? void 0 : option.currency);
|
|
12
11
|
}
|
|
13
12
|
closeDropdown();
|
|
14
|
-
} }, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: false }, { children: t(option.name) })), _jsxs(DropDownChargeGapColumn, { children: [_jsxs(StyledIconRowContainer, Object.assign({ marginRightAuto: true }, { children: [_jsx(
|
|
13
|
+
} }, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: false }, { children: t(option.name) })), _jsxs(DropDownChargeGapColumn, { children: [_jsxs(StyledIconRowContainer, Object.assign({ marginRightAuto: true }, { children: [_jsx(StyledFlag, { src: getCurrencyCodeFlag((_a = option === null || option === void 0 ? void 0 : option.currency) !== null && _a !== void 0 ? _a : selectedCurrency), alt: `${option === null || option === void 0 ? void 0 : option.currency} flag` }), _jsx(StyledCurrency, { children: (_b = option === null || option === void 0 ? void 0 : option.currency) !== null && _b !== void 0 ? _b : selectedCurrency })] })), _jsx(StyledTextAmount, Object.assign({ showWarning: false }, { children: intlCurrency(option.value || 0, (_c = option === null || option === void 0 ? void 0 : option.currency) !== null && _c !== void 0 ? _c : selectedCurrency) }))] })] })));
|
|
15
14
|
};
|
|
16
15
|
function ActionMenuDropDown({ menuAnchor, showDropDown, selectedCurrency, options, closeDropdown, handleSelectOption }) {
|
|
17
16
|
if (options.length <= 1)
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { blueDropdownArrowIcon, greyDropdownIcon } from '../../constants/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getCurrencyCodeFlag } from '../../utils/index.js';
|
|
6
|
+
import { EnglishAmount, Charge, StyledIconRowContainer, StyledFlag, StyledCurrency, StyledDropDownIcon, StyledAmount, StyledMissingDiv, } from './style';
|
|
6
7
|
import Skeleton from '../Skeleton';
|
|
7
8
|
import CurrencyIcon from '../CurrencyIcon';
|
|
8
|
-
import CurrencyCountryFlag from '../CurrencyCountryFlag';
|
|
9
9
|
function ActionMenuItem({ showWarning, selectedCurrency, onAmountChange, amount, currencyConfig, toggleDropDown, showDropDown, showDropdownIcon, disabled, isLoading, }) {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
const { t } = useTranslation();
|
|
@@ -15,6 +15,6 @@ function ActionMenuItem({ showWarning, selectedCurrency, onAmountChange, amount,
|
|
|
15
15
|
iconRef.current.click();
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Charge, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: showWarning }, { children: t('amount') })), _jsxs(StyledIconRowContainer, Object.assign({ limited: true, paddingTop: true, onClick: onClickMissingDiv }, { children: [_jsx(
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Charge, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: showWarning }, { children: t('amount') })), _jsxs(StyledIconRowContainer, Object.assign({ limited: true, paddingTop: true, onClick: onClickMissingDiv }, { children: [_jsx(StyledFlag, { src: getCurrencyCodeFlag(selectedCurrency), alt: `${selectedCurrency} flag` }), _jsx(StyledCurrency, { children: _jsx(CurrencyIcon, { currency: selectedCurrency }) }), !showWarning && showDropdownIcon && (_jsx(StyledDropDownIcon, { src: !showDropDown ? blueDropdownArrowIcon : greyDropdownIcon, alt: "drop-down icon", currencyPadding: true }))] }))] }), _jsx(StyledMissingDiv, { ref: iconRef, onClick: toggleDropDown }), isLoading ? (_jsx(Skeleton, { variant: "text", width: "100%", height: "100%" })) : (_jsx(StyledAmount, { disabled: disabled, placeholder: currencyConfig[selectedCurrency] ? '0.000' : '0.00', onValueChange: onAmountChange, value: amount, decimalsLimit: (_a = currencyConfig[selectedCurrency]) !== null && _a !== void 0 ? _a : 2, showWarning: showWarning || false, decimalScale: (_b = currencyConfig[selectedCurrency]) !== null && _b !== void 0 ? _b : 2, autoFocus: true }))] }));
|
|
19
19
|
}
|
|
20
20
|
export default ActionMenuItem;
|
|
@@ -58,6 +58,7 @@ export declare const StyledIconRowContainer: import("@emotion/styled").StyledCom
|
|
|
58
58
|
}, {}, {}>;
|
|
59
59
|
export declare const StyledCurrency: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
60
60
|
export declare const StyledMissingDiv: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
61
|
+
export declare const StyledFlag: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
61
62
|
export declare const StyledPopover: import("@emotion/styled").StyledComponent<import("@mui/material").PopoverProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
62
63
|
export declare const IconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
63
64
|
disabled?: boolean | undefined;
|
|
@@ -129,6 +129,10 @@ export const StyledMissingDiv = styled('div')({
|
|
|
129
129
|
width: 0,
|
|
130
130
|
height: 0,
|
|
131
131
|
});
|
|
132
|
+
export const StyledFlag = styled('img')({
|
|
133
|
+
width: '0.76rem',
|
|
134
|
+
height: '0.56rem',
|
|
135
|
+
});
|
|
132
136
|
export const StyledPopover = styled(Popover)(({ theme }) => ({
|
|
133
137
|
backgroundColor: theme.palette.background.default,
|
|
134
138
|
boxShadow: theme.shadows[21],
|
|
@@ -2,11 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
-
import { getLocalizedUnitLabel } from '../../../utils/index.js';
|
|
5
|
+
import { getCurrencyCodeFlag, getLocalizedUnitLabel } from '../../../utils/index.js';
|
|
6
6
|
import { DATA_KEY } from '../../../constants/index.js';
|
|
7
|
-
import { TooltipContainer, TimeTypography, ValueTypography, CurrencyBox, CurrencyText } from '../styles';
|
|
7
|
+
import { TooltipContainer, TimeTypography, ValueTypography, CurrencyBox, CurrencyText, CurrencyIcon } from '../styles';
|
|
8
8
|
import { getTooltipFormattedValue, getFormattedDateWithTimezone } from '../utils';
|
|
9
|
-
import CurrencyCountryFlag from '../../CurrencyCountryFlag';
|
|
10
9
|
const ChartTooltip = ({ active, payload, dateRange, selectedCurrency }) => {
|
|
11
10
|
var _a, _b, _c, _d;
|
|
12
11
|
const { t } = useTranslation();
|
|
@@ -17,7 +16,7 @@ const ChartTooltip = ({ active, payload, dateRange, selectedCurrency }) => {
|
|
|
17
16
|
const point = payload[0];
|
|
18
17
|
const localizedUnitLabel = getLocalizedUnitLabel(point === null || point === void 0 ? void 0 : point.dataKey, point === null || point === void 0 ? void 0 : point.value);
|
|
19
18
|
const formattedDate = ((_a = point === null || point === void 0 ? void 0 : point.payload) === null || _a === void 0 ? void 0 : _a.date) && getFormattedDateWithTimezone((_b = point === null || point === void 0 ? void 0 : point.payload) === null || _b === void 0 ? void 0 : _b.date, isSingleDay, (_c = point === null || point === void 0 ? void 0 : point.payload) === null || _c === void 0 ? void 0 : _c.hour);
|
|
20
|
-
return (_jsxs(TooltipContainer, Object.assign({ className: "chart-tooltip" }, { children: [_jsx(TimeTypography, { children: formattedDate !== null && formattedDate !== void 0 ? formattedDate : (_d = point === null || point === void 0 ? void 0 : point.payload) === null || _d === void 0 ? void 0 : _d.date }), _jsxs(ValueTypography, { children: [(point === null || point === void 0 ? void 0 : point.dataKey) === DATA_KEY.AMOUNT && (_jsxs(CurrencyBox, { children: [_jsx(
|
|
19
|
+
return (_jsxs(TooltipContainer, Object.assign({ className: "chart-tooltip" }, { children: [_jsx(TimeTypography, { children: formattedDate !== null && formattedDate !== void 0 ? formattedDate : (_d = point === null || point === void 0 ? void 0 : point.payload) === null || _d === void 0 ? void 0 : _d.date }), _jsxs(ValueTypography, { children: [(point === null || point === void 0 ? void 0 : point.dataKey) === DATA_KEY.AMOUNT && (_jsxs(CurrencyBox, { children: [_jsx(CurrencyIcon, { src: getCurrencyCodeFlag(selectedCurrency), alt: `${selectedCurrency} flag` }), _jsx(CurrencyText, { children: selectedCurrency })] })), _jsx(Box, { children: `${getTooltipFormattedValue(point, t(localizedUnitLabel), selectedCurrency)}` })] })] })));
|
|
21
20
|
}
|
|
22
21
|
return null;
|
|
23
22
|
};
|
|
@@ -14,3 +14,4 @@ export declare const CurrencyBox: import("@emotion/styled").StyledComponent<impo
|
|
|
14
14
|
export declare const CurrencyText: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
15
15
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
16
16
|
}, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "classes" | "align" | "className" | "style" | "children" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export declare const CurrencyIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { GetSourceAnimationFunction } from './type';
|
|
3
4
|
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
5
|
variant?: import("./type").ChipVariant | undefined;
|
|
@@ -15,7 +15,7 @@ import Box from '@mui/material/Box';
|
|
|
15
15
|
import { defaultCountryIcon, getCountriesIcon } from '../../constants/index.js';
|
|
16
16
|
function CountryFlag(_a) {
|
|
17
17
|
var { code = '' } = _a, props = __rest(_a, ["code"]);
|
|
18
|
-
return (_jsx(Box, Object.assign({}, props, { component: "img", src: getCountriesIcon(code) || defaultCountryIcon, alt: code, loading: "lazy", onError: (e) => {
|
|
18
|
+
return (_jsx(Box, Object.assign({}, props, { component: "img", src: getCountriesIcon(code) || defaultCountryIcon, alt: code, sx: Object.assign(Object.assign({ width: 16 }, (code && { height: 12, borderRadius: '3px' })), props.sx), loading: "lazy", onError: (e) => {
|
|
19
19
|
e.currentTarget.src = defaultCountryIcon;
|
|
20
20
|
} })));
|
|
21
21
|
}
|
|
@@ -6,7 +6,6 @@ import CustomBackdrop from '../../../CustomBackdrop';
|
|
|
6
6
|
import { downArrowIcon, searchIcon } from '../../../../constants/index.js';
|
|
7
7
|
import { CountryStyled, CountriesWrapper, CountriesListStyled, InputStyled, CountryButton, Required } from './style';
|
|
8
8
|
import { ClickAwayListener } from '@mui/material';
|
|
9
|
-
import CountryFlag from '../../../CountryFlag';
|
|
10
9
|
function CountriesList({ isLoading, countries, value: countryValue, onCountryChange, required, disabled }) {
|
|
11
10
|
const [selectedCountry, setSelectedCountry] = useState();
|
|
12
11
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -59,7 +58,7 @@ function CountriesList({ isLoading, countries, value: countryValue, onCountryCha
|
|
|
59
58
|
}, sx: {
|
|
60
59
|
backgroundColor: isSelected ? '#F9F9F9' : 'transparent',
|
|
61
60
|
color: isSelected ? '#000' : '#8D8D94',
|
|
62
|
-
} }, { children: [_jsx(
|
|
61
|
+
} }, { children: [_jsx("img", { src: country.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${country.idd_prefix}` })] }), `country-code-${country.countryId}`));
|
|
63
62
|
}) }))] })) })))] })));
|
|
64
63
|
}
|
|
65
64
|
CountriesList.displayName = 'CountriesList';
|
|
@@ -10,7 +10,9 @@ interface DropdownI {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
listWrapperSx?: SxProps;
|
|
12
12
|
hideArrow?: boolean;
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
hasValue?: boolean;
|
|
13
15
|
}
|
|
14
|
-
declare function SelectDropdown({ onClose, open, anchorEl, trigger, onOpen, children, disabled, listWrapperSx, hideArrow }: DropdownI): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function SelectDropdown({ onClose, open, anchorEl, trigger, onOpen, children, disabled, listWrapperSx, hideArrow, onClear, hasValue }: DropdownI): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
declare const _default: import("react").MemoExoticComponent<typeof SelectDropdown>;
|
|
16
18
|
export default _default;
|
|
@@ -2,10 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import Popover from '@mui/material/Popover';
|
|
5
|
-
import { blueDropdownArrowIcon, downArrowIcon } from '../../constants/index.js';
|
|
5
|
+
import { blueDropdownArrowIcon, closeXIcon, downArrowIcon } from '../../constants/index.js';
|
|
6
6
|
import { HeaderWrapper, ListWrapper } from './style';
|
|
7
|
-
function SelectDropdown({ onClose, open, anchorEl, trigger, onOpen, children, disabled, listWrapperSx, hideArrow }) {
|
|
8
|
-
|
|
7
|
+
function SelectDropdown({ onClose, open, anchorEl, trigger, onOpen, children, disabled, listWrapperSx, hideArrow, onClear, hasValue }) {
|
|
8
|
+
const isClearButtonVisible = onClear && hasValue;
|
|
9
|
+
return (_jsxs(HeaderWrapper, Object.assign({ open: open, onClick: onOpen, "data-testid": "Dropdown", disabled: disabled }, { children: [_jsx(Box, Object.assign({ sx: { flex: 1, cursor: 'pointer' } }, { children: trigger })), !hideArrow && !isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8 } }, { children: _jsx(Box, { component: "img", src: open ? blueDropdownArrowIcon : downArrowIcon, alt: "arrow", sx: Object.assign({ width: 16, height: 16 }, (open && { width: 12, height: 12, padding: '2px' })) }) }))), isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8, cursor: 'pointer' } }, { children: _jsx(Box, { component: "img", src: closeXIcon, alt: "clear", onClick: onClear }) }))), _jsx(Popover, Object.assign({ open: open, anchorEl: anchorEl, sx: { width: anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth }, onClose: onClose, anchorOrigin: {
|
|
9
10
|
vertical: 'bottom',
|
|
10
11
|
horizontal: 'left',
|
|
11
12
|
}, slotProps: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectWithSearchProps } from './type';
|
|
2
|
-
declare function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder, label, isLoading, renderOption, iconUrl, disabled, }: SelectWithSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder, label, isLoading, renderOption, iconUrl, disabled, onClearValue, }: SelectWithSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default SelectWithSearch;
|
|
@@ -6,7 +6,7 @@ import { InputStyled, Container, ItemStyled } from './style';
|
|
|
6
6
|
import { InputBase } from '../InputBase';
|
|
7
7
|
import SelectDropdown from '../SelectDropdown';
|
|
8
8
|
import { CircularProgress } from '@mui/material';
|
|
9
|
-
function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder, label, isLoading, renderOption, iconUrl, disabled, }) {
|
|
9
|
+
function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder, label, isLoading, renderOption, iconUrl, disabled, onClearValue, }) {
|
|
10
10
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
11
|
const [searchValue, setSearchValue] = useState('');
|
|
12
12
|
const open = Boolean(anchorEl);
|
|
@@ -32,9 +32,9 @@ function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder
|
|
|
32
32
|
});
|
|
33
33
|
}, [options, searchValue]);
|
|
34
34
|
const startAdornment = useMemo(() => (_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', maxWidth: 16 } }, { children: _jsx(Box, { component: "img", src: iconUrl, alt: "icon", sx: { maxWidth: 12, height: 12 } }) }))), [iconUrl]);
|
|
35
|
-
return (_jsx(SelectDropdown, Object.assign({ disabled: disabled, open: open, anchorEl: anchorEl, onOpen: (e) => !disabled && openDropdown(e), onClose: closeDropdown, trigger: _jsx(InputBase, { name: "name", placeholder: "Please Select", hasError: false, label: label, sx: { cursor: 'pointer' }, value: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '', InputLabelProps: {
|
|
35
|
+
return (_jsx(SelectDropdown, Object.assign({ disabled: disabled, open: open, anchorEl: anchorEl, onOpen: (e) => !disabled && openDropdown(e), onClose: closeDropdown, hasValue: !!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value), onClear: onClearValue, trigger: _jsx(InputBase, { name: "name", placeholder: "Please Select", hasError: false, label: label, sx: { cursor: 'pointer' }, value: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '', InputLabelProps: {
|
|
36
36
|
filled: !!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label),
|
|
37
|
-
}, InputProps: Object.assign({ disableUnderline: true }, (!!iconUrl && {
|
|
37
|
+
}, disabled: disabled, InputProps: Object.assign({ disableUnderline: true }, (!!iconUrl && {
|
|
38
38
|
startAdornment,
|
|
39
39
|
})) }) }, { children: _jsxs(Container, { children: [_jsx(InputStyled, { placeholder: placeholder || 'Select', endAdornment: endAdornment, onClick: (e) => {
|
|
40
40
|
e.stopPropagation();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { TableMode } from '../../../../types/index.js';
|
|
3
4
|
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
4
5
|
tableMode?: TableMode | undefined;
|
|
@@ -15,11 +15,13 @@ import { TableCell } from '../../../TableCells';
|
|
|
15
15
|
import Tooltip from '../../../Tooltip';
|
|
16
16
|
import { CurrencyIcon } from '../../../index.js';
|
|
17
17
|
import { getCurrenciesIcon } from '../../../../constants/index.js';
|
|
18
|
-
import { AmountCellContainer } from './style';
|
|
18
|
+
import { AmountCellContainer, FlagContainer } from './style';
|
|
19
|
+
import { FlagIcon } from '../style';
|
|
19
20
|
import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
20
21
|
const tableMode = 'default';
|
|
21
22
|
function AmountCell(_a) {
|
|
22
23
|
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
|
|
23
|
-
|
|
24
|
+
const icon = currency && _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: "customer icon" });
|
|
25
|
+
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 }) }) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: _jsx(FlagContainer, { children: icon }) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
|
|
24
26
|
}
|
|
25
27
|
export default AmountCell;
|
|
@@ -4,6 +4,7 @@ export declare const AmountCellContainer: import("@emotion/styled").StyledCompon
|
|
|
4
4
|
export declare const ConversionBadge: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
5
|
tableMode?: TableMode | undefined;
|
|
6
6
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
7
|
+
export declare const FlagContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
7
8
|
export declare const CurrencySpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
8
9
|
tableMode?: TableMode | undefined;
|
|
9
10
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -15,6 +15,12 @@ export const ConversionBadge = styled('span')(({ theme, tableMode }) => ({
|
|
|
15
15
|
textTransform: 'uppercase',
|
|
16
16
|
fontWeight: theme.typography.fontWeightBold,
|
|
17
17
|
}));
|
|
18
|
+
export const FlagContainer = styled('span')(() => ({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
width: '16px',
|
|
21
|
+
height: '12px',
|
|
22
|
+
flexShrink: 0,
|
|
23
|
+
}));
|
|
18
24
|
export const CurrencySpan = styled('span')(({ theme, tableMode }) => ({
|
|
19
25
|
fontSize: tableMode === 'sheet' ? '11px' : theme.typography.body2.fontSize,
|
|
20
26
|
lineHeight: '17px',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
3
4
|
export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getCurrenciesIcon } from '../../../../constants/index.js';
|
|
3
|
-
import { Currency, Wrapper } from './style';
|
|
3
|
+
import { Currency, FlagContainer, Wrapper } from './style';
|
|
4
|
+
import { FlagIcon } from '../style';
|
|
4
5
|
export function CurrencyCell({ currency }) {
|
|
5
|
-
return (_jsxs(Wrapper, { children: [_jsx(
|
|
6
|
+
return (_jsxs(Wrapper, { children: [_jsx(FlagContainer, { children: _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: currency }) }), _jsx(Currency, { children: currency })] }));
|
|
6
7
|
}
|
|
@@ -5,3 +5,5 @@ export declare const Wrapper: import("@emotion/styled").StyledComponent<import("
|
|
|
5
5
|
export declare const Currency: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
6
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
7
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
+
export declare const FlagContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
9
|
+
export declare const FlagIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
@@ -10,3 +10,13 @@ export const Currency = styled(Box)(({ theme }) => ({
|
|
|
10
10
|
color: theme.palette.text.primary,
|
|
11
11
|
lineHeight: '16.8px',
|
|
12
12
|
}));
|
|
13
|
+
export const FlagContainer = styled('span')(() => ({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
width: '17px',
|
|
16
|
+
height: '12px',
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
}));
|
|
19
|
+
export const FlagIcon = styled('img')({
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
3
4
|
variant?: "Global" | "Regional" | "Local" | undefined;
|
|
4
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
6
|
+
export declare const FlagIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
7
|
export declare const TransparentButton: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
6
8
|
export declare const BadgeWrapper: import("@emotion/styled").StyledComponent<{
|
|
7
9
|
hidden?: boolean | undefined;
|
|
@@ -19,6 +19,10 @@ export const GeographyBox = styled('span', {
|
|
|
19
19
|
objectFit: 'cover',
|
|
20
20
|
},
|
|
21
21
|
}));
|
|
22
|
+
export const FlagIcon = styled('img')({
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: '100%',
|
|
25
|
+
});
|
|
22
26
|
export const TransparentButton = styled('button')({
|
|
23
27
|
background: 'transparent',
|
|
24
28
|
border: 'none',
|
|
@@ -7,9 +7,9 @@ export const videosUrl = `${cdnUrl}/videos`;
|
|
|
7
7
|
export const getLightUrlIcon = (source) => `${lightUrl}/${source}.svg`;
|
|
8
8
|
export const getPaymentMethodsIcon = (source) => `${lightUrl}/payment-method/v2/${source}.svg`;
|
|
9
9
|
export const getPaymentIssuersIcon = (source) => `${lightUrl}/payment-issuer/${source}.svg`;
|
|
10
|
-
export const getCountriesIcon = (source) => `${lightUrl}/country
|
|
10
|
+
export const getCountriesIcon = (source) => `${lightUrl}/country/${source}.svg`;
|
|
11
11
|
export const getServiceFunctionIcon = (functionCode) => `${lightUrl}/function/${functionCode}.svg`;
|
|
12
|
-
export const getCurrenciesIcon = (currency) => `${cdnUrl}/currency/
|
|
12
|
+
export const getCurrenciesIcon = (currency) => `${cdnUrl}/currency/v2/light/${currency}.svg`;
|
|
13
13
|
export const getAuthorityIcon = (authority) => {
|
|
14
14
|
const authorityWithoutSpaces = authority.replace(/\s/g, '');
|
|
15
15
|
return `${cdnUrl}/icons/dashboard/light/authority/v2/${authorityWithoutSpaces}.svg`;
|
|
@@ -5,6 +5,7 @@ export declare const conversionTypesLabels: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const currencyConfig: Record<string, number>;
|
|
7
7
|
export declare const intlCurrency: (charge: number, currencyType: CurrencyCodes) => string;
|
|
8
|
+
export declare const getCurrencyCodeFlag: (currency: string) => string;
|
|
8
9
|
export declare const isIntegerAmount: (charge: number) => boolean;
|
|
9
10
|
export declare const isDecimalWithOneDigit: (charge: number) => boolean;
|
|
10
11
|
export declare const hasOnlyOneDigitAfterDecimal: (charge: number) => boolean;
|
package/build/utils/currency.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SUPPORTED_CURRENCY_DETAILS } from '../constants/index.js';
|
|
1
|
+
import { getCurrenciesIcon, SUPPORTED_CURRENCY_DETAILS, SUPPORTED_CURRENCY_CODES } from '../constants/index.js';
|
|
2
|
+
import { CurrencyCodes } from '../types/index.js';
|
|
2
3
|
export const conversionTypesLabels = {
|
|
3
4
|
fx: 'Foreign Exchange',
|
|
4
5
|
dcc: 'Dynamic Currency Conversion',
|
|
@@ -27,6 +28,10 @@ export const intlCurrency = (charge, currencyType) => {
|
|
|
27
28
|
return '0';
|
|
28
29
|
}
|
|
29
30
|
};
|
|
31
|
+
export const getCurrencyCodeFlag = (currency) => {
|
|
32
|
+
const currencyMap = new Map(SUPPORTED_CURRENCY_CODES.map((selectedCurrency) => [selectedCurrency, getCurrenciesIcon(selectedCurrency)]));
|
|
33
|
+
return currencyMap.get(currency) || CurrencyCodes.SAR;
|
|
34
|
+
};
|
|
30
35
|
export const isIntegerAmount = (charge) => {
|
|
31
36
|
return charge % 1 === 0;
|
|
32
37
|
};
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.242",
|
|
5
|
+
"testVersion": 0,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -163,4 +163,4 @@
|
|
|
163
163
|
"publishConfig": {
|
|
164
164
|
"registry": "https://registry.npmjs.org/"
|
|
165
165
|
}
|
|
166
|
-
}
|
|
166
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BoxProps } from '@mui/material/Box';
|
|
3
|
-
interface CurrencyCountryFlagProps extends BoxProps {
|
|
4
|
-
code?: string;
|
|
5
|
-
}
|
|
6
|
-
declare function CurrencyCountryFlag({ code, ...props }: CurrencyCountryFlagProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const _default: import("react").MemoExoticComponent<typeof CurrencyCountryFlag>;
|
|
8
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
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";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
|
-
import { defaultCountryIcon, getCurrenciesIcon } from '../../constants/index.js';
|
|
16
|
-
function CurrencyCountryFlag(_a) {
|
|
17
|
-
var { code = '' } = _a, props = __rest(_a, ["code"]);
|
|
18
|
-
return (_jsx(Box, Object.assign({}, props, { component: "img", src: getCurrenciesIcon(code) || defaultCountryIcon, alt: code, loading: "lazy", onError: (e) => {
|
|
19
|
-
e.currentTarget.src = defaultCountryIcon;
|
|
20
|
-
} })));
|
|
21
|
-
}
|
|
22
|
-
export default memo(CurrencyCountryFlag);
|