@tap-payments/os-micro-frontend-shared 0.1.245-test.1 → 0.1.245-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.
- package/build/components/ActionMenu/ActionMenuDropDown.js +2 -2
- package/build/components/ActionMenu/ActionMenuItem.js +2 -2
- package/build/components/ActivityAreaChart/components/ChartTooltip.js +2 -2
- package/build/components/CountryFlag/CountryFlag.d.ts +3 -2
- package/build/components/CountryFlag/CountryFlag.js +4 -3
- package/build/components/RangeCalender/components/Timezone/Timezone.js +1 -1
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.js +2 -2
- package/build/components/RangeCalender/components/Timezone/components/UserTimezone.js +1 -1
- package/build/components/StatusIcons/GeographyIcon/GeographyIcon.js +1 -1
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.js +2 -2
- package/build/components/TableCells/CustomCells/BankCell/BankCell.js +1 -1
- package/build/components/TableCells/CustomCells/CurrencyCell/CurrencyCell.js +2 -2
- package/build/components/TableCells/CustomCells/DateCell/DateCell.js +1 -1
- package/build/components/TableCells/CustomCells/EntityCell/EntityCell.js +1 -1
- package/build/components/TableCells/CustomCells/SourceCell/SourceCell.js +1 -1
- package/build/components/TableCells/CustomCells/WalletCell/WalletCell.js +1 -1
- package/build/components/index.d.ts +0 -1
- package/build/components/index.js +0 -1
- package/package.json +2 -2
- package/build/components/CountryFlagByCurrencyCode/CountryFlagByCurrencyCode.d.ts +0 -8
- package/build/components/CountryFlagByCurrencyCode/CountryFlagByCurrencyCode.js +0 -22
- package/build/components/CountryFlagByCurrencyCode/index.d.ts +0 -2
- package/build/components/CountryFlagByCurrencyCode/index.js +0 -2
|
@@ -1,7 +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
3
|
import { intlCurrency } from '../../utils/index.js';
|
|
4
|
-
import
|
|
4
|
+
import CountryFlag from '../CountryFlag';
|
|
5
5
|
import { EnglishAmount, StyledCurrency, StyledIconRowContainer, StyledDropDownContainer, StyledDropdown, StyledMenuItem, StyledTextAmount, DropDownChargeGapColumn, } from './style';
|
|
6
6
|
const Menu = ({ selectedCurrency, option, closeDropdown, handleSelectOption }) => {
|
|
7
7
|
var _a, _b, _c;
|
|
@@ -11,7 +11,7 @@ const Menu = ({ selectedCurrency, option, closeDropdown, handleSelectOption }) =
|
|
|
11
11
|
handleSelectOption(option.value, option === null || option === void 0 ? void 0 : option.currency);
|
|
12
12
|
}
|
|
13
13
|
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(
|
|
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(CountryFlag, { currencyCode: (_a = option === null || option === void 0 ? void 0 : option.currency) !== null && _a !== void 0 ? _a : selectedCurrency, width: "0.76rem" }), _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
15
|
};
|
|
16
16
|
function ActionMenuDropDown({ menuAnchor, showDropDown, selectedCurrency, options, closeDropdown, handleSelectOption }) {
|
|
17
17
|
if (options.length <= 1)
|
|
@@ -2,7 +2,7 @@ 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 CountryFlag from '../CountryFlag';
|
|
6
6
|
import { EnglishAmount, Charge, StyledIconRowContainer, StyledCurrency, StyledDropDownIcon, StyledAmount, StyledMissingDiv } from './style';
|
|
7
7
|
import Skeleton from '../Skeleton';
|
|
8
8
|
import CurrencySymbol from '../CurrencySymbol';
|
|
@@ -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(CountryFlag, { currencyCode: selectedCurrency, width: "0.76rem" }), _jsx(StyledCurrency, { children: _jsx(CurrencySymbol, { 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;
|
|
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import { getLocalizedUnitLabel } from '../../../utils/index.js';
|
|
6
6
|
import { DATA_KEY } from '../../../constants/index.js';
|
|
7
|
-
import
|
|
7
|
+
import CountryFlag from '../../CountryFlag';
|
|
8
8
|
import { TooltipContainer, TimeTypography, ValueTypography, CurrencyBox, CurrencyText } from '../styles';
|
|
9
9
|
import { getTooltipFormattedValue, getFormattedDateWithTimezone } from '../utils';
|
|
10
10
|
const ChartTooltip = ({ active, payload, dateRange, selectedCurrency }) => {
|
|
@@ -17,7 +17,7 @@ const ChartTooltip = ({ active, payload, dateRange, selectedCurrency }) => {
|
|
|
17
17
|
const point = payload[0];
|
|
18
18
|
const localizedUnitLabel = getLocalizedUnitLabel(point === null || point === void 0 ? void 0 : point.dataKey, point === null || point === void 0 ? void 0 : point.value);
|
|
19
19
|
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(
|
|
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(CountryFlag, { currencyCode: selectedCurrency, width: 12 }), _jsx(CurrencyText, { children: selectedCurrency })] })), _jsx(Box, { children: `${getTooltipFormattedValue(point, t(localizedUnitLabel), selectedCurrency)}` })] })] })));
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
3
|
interface CountryFlagProps extends BoxProps {
|
|
4
|
-
|
|
4
|
+
countryCode?: string;
|
|
5
|
+
currencyCode?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function CountryFlag({
|
|
7
|
+
declare function CountryFlag({ countryCode, currencyCode, ...props }: CountryFlagProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
declare const _default: import("react").MemoExoticComponent<typeof CountryFlag>;
|
|
8
9
|
export default _default;
|
|
@@ -12,10 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo } from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
|
-
import { defaultCountryIcon, getCountriesIcon } from '../../constants/index.js';
|
|
15
|
+
import { defaultCountryIcon, getCountriesIcon, getCurrenciesIcon } from '../../constants/index.js';
|
|
16
16
|
function CountryFlag(_a) {
|
|
17
|
-
var
|
|
18
|
-
|
|
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: 16, alt: (_b = countryCode !== null && countryCode !== void 0 ? countryCode : currencyCode) !== null && _b !== void 0 ? _b : 'flag', loading: "lazy", onError: (e) => {
|
|
19
20
|
e.currentTarget.src = defaultCountryIcon;
|
|
20
21
|
} })));
|
|
21
22
|
}
|
|
@@ -27,6 +27,6 @@ function CustomTimezone({ onChange, selectedTimezone, browserTimezone, defaultCo
|
|
|
27
27
|
return entityTimezoneIcon;
|
|
28
28
|
return savedTimezoneIcon;
|
|
29
29
|
}, [browserTimezone, defaultCountryTimezone.timezone, selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone]);
|
|
30
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(TimezoneWrapper, Object.assign({ "data-testid": "CustomTimezone" }, { children: [_jsxs(SelectedTimezone, Object.assign({ open: open, onClick: onOpen }, { children: [_jsx("img", { src: selectedTimezoneIcon, alt: "timezone-icon" }), _jsx(CountryFlag, {
|
|
30
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(TimezoneWrapper, Object.assign({ "data-testid": "CustomTimezone" }, { children: [_jsxs(SelectedTimezone, Object.assign({ open: open, onClick: onOpen }, { children: [_jsx("img", { src: selectedTimezoneIcon, alt: "timezone-icon" }), _jsx(CountryFlag, { countryCode: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.countryCode }), _jsx("span", { children: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label })] })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "top-start", sx: { zIndex: 1400 } }, { children: _jsxs(TimezoneDropdown, Object.assign({ "data-testid": "CustomTimezone_dropdown" }, { children: [_jsx(EntitiesTimezone, { onChange: updateTimezone, selectedTimezone: selectedTimezone, defaultCountryTimezone: defaultCountryTimezone, timezoneCountriesCodes: timezoneCountriesCodes }), _jsx(UserTimezone, { onChange: updateTimezone, selectedTimezone: selectedTimezone, browserTimezone: browserTimezone })] })) }))] })) })));
|
|
31
31
|
}
|
|
32
32
|
export default memo(CustomTimezone);
|
|
@@ -29,10 +29,10 @@ export default function EntitiesTimezone({ selectedTimezone, onChange, timezoneC
|
|
|
29
29
|
return (_jsxs(TimezoneElement, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: () => {
|
|
30
30
|
if (selectedTimezone)
|
|
31
31
|
onChange(entityTimezone);
|
|
32
|
-
} }, { children: [isSelectedTimezoneOneOFTheAvailable ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: entityTimezoneIcon, alt: "entity-timezone" }), _jsx(CountryFlag, {
|
|
32
|
+
} }, { children: [isSelectedTimezoneOneOFTheAvailable ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: entityTimezoneIcon, alt: "entity-timezone" }), _jsx(CountryFlag, { countryCode: entityTimezone === null || entityTimezone === void 0 ? void 0 : entityTimezone.countryCode }), _jsx(Label, Object.assign({ className: isSelectedTimezoneOneOFTheAvailable ? 'selected' : '' }, { children: isSelectedTimezoneOneOFTheAvailable ? selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label : defaultCountryTimezone === null || defaultCountryTimezone === void 0 ? void 0 : defaultCountryTimezone.label })), _jsx(Popper, Object.assign({ open: Boolean(entitiesEl), anchorEl: entitiesEl, placement: "right-start", sx: { zIndex: 3 }, disablePortal: true }, { children: _jsx(TimezoneDropdown, Object.assign({ sx: { maxHeight: 300 } }, { children: availableTimezones === null || availableTimezones === void 0 ? void 0 : availableTimezones.map((timeZone, idx) => {
|
|
33
33
|
const isActive = (timeZone === null || timeZone === void 0 ? void 0 : timeZone.timezone) === (selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone);
|
|
34
34
|
return (_jsxs(TimezoneElement, Object.assign({ onClick: (e) => {
|
|
35
35
|
onSelectTimezone(e, timeZone);
|
|
36
|
-
}, sx: { gap: '4px' } }, { children: [isActive ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx(CountryFlag, {
|
|
36
|
+
}, sx: { gap: '4px' } }, { children: [isActive ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx(CountryFlag, { countryCode: timeZone === null || timeZone === void 0 ? void 0 : timeZone.countryCode }), _jsx(Label, Object.assign({ className: isActive ? 'selected' : '' }, { children: timeZone === null || timeZone === void 0 ? void 0 : timeZone.label }))] }), `timezone-item-${idx}`));
|
|
37
37
|
}) })) }))] })));
|
|
38
38
|
}
|
|
@@ -10,5 +10,5 @@ export default function UserTimezone({ onChange, selectedTimezone, browserTimezo
|
|
|
10
10
|
onChange(browserTimezoneInfo);
|
|
11
11
|
};
|
|
12
12
|
const isBrowserTimezoneActive = (browserTimezoneInfo === null || browserTimezoneInfo === void 0 ? void 0 : browserTimezoneInfo.timezone) === (selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone);
|
|
13
|
-
return (_jsxs(TimezoneElement, Object.assign({ onClick: onSelectTimezone }, { children: [isBrowserTimezoneActive ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: userTimezoneIcon, alt: "user-timezone" }), _jsx(CountryFlag, {
|
|
13
|
+
return (_jsxs(TimezoneElement, Object.assign({ onClick: onSelectTimezone }, { children: [isBrowserTimezoneActive ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: userTimezoneIcon, alt: "user-timezone" }), _jsx(CountryFlag, { countryCode: browserTimezoneInfo === null || browserTimezoneInfo === void 0 ? void 0 : browserTimezoneInfo.countryCode }), _jsx(Label, Object.assign({ className: isBrowserTimezoneActive ? 'selected' : '' }, { children: browserTimezoneInfo === null || browserTimezoneInfo === void 0 ? void 0 : browserTimezoneInfo.label }))] })));
|
|
14
14
|
}
|
|
@@ -13,5 +13,5 @@ export const GeographyIcon = ({ geographyVariant, countryCode, isTextShown, }) =
|
|
|
13
13
|
: undefined;
|
|
14
14
|
if (isTextShown || !countryCode)
|
|
15
15
|
return null;
|
|
16
|
-
return (_jsx(Tooltip, Object.assign({ title: tooltip }, { children: _jsx(CountryFlag, {
|
|
16
|
+
return (_jsx(Tooltip, Object.assign({ title: tooltip }, { children: _jsx(CountryFlag, { countryCode: countryCode }) })));
|
|
17
17
|
};
|
|
@@ -13,12 +13,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { Box } from '@mui/material';
|
|
14
14
|
import { TableCell } from '../../../TableCells';
|
|
15
15
|
import Tooltip from '../../../Tooltip';
|
|
16
|
-
import {
|
|
16
|
+
import { CountryFlag, CurrencySymbol } from '../../../index.js';
|
|
17
17
|
import { AmountCellContainer } from './style';
|
|
18
18
|
import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
19
19
|
const tableMode = 'default';
|
|
20
20
|
function AmountCell(_a) {
|
|
21
21
|
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
|
|
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(
|
|
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 }) }))] }) })));
|
|
23
23
|
}
|
|
24
24
|
export default AmountCell;
|
|
@@ -21,6 +21,6 @@ function BankCell(_a) {
|
|
|
21
21
|
return (_jsx(TableCell, Object.assign({ style: {
|
|
22
22
|
textAlign: 'center',
|
|
23
23
|
overflow: 'visible',
|
|
24
|
-
} }, props, { children: _jsxs(BankCellContainer, { children: [country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, {
|
|
24
|
+
} }, props, { children: _jsxs(BankCellContainer, { children: [country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { countryCode: country }) }))), _jsxs(BankWrapper, { children: [_jsx(BankIcon, { src: bankIcon, alt: "bank-icon" }), walletId && (_jsxs(BankIdContainer, { children: [name, " \u00B7\u00B7\u00B7\u00B7 ", walletId === null || walletId === void 0 ? void 0 : walletId.substring(((walletId === null || walletId === void 0 ? void 0 : walletId.length) || 0) - 4)] }))] })] }) })));
|
|
25
25
|
}
|
|
26
26
|
export default BankCell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import CountryFlag from '../../../CountryFlag';
|
|
3
3
|
import { Currency, Wrapper } from './style';
|
|
4
4
|
export function CurrencyCell({ currency }) {
|
|
5
|
-
return (_jsxs(Wrapper, { children: [_jsx(
|
|
5
|
+
return (_jsxs(Wrapper, { children: [_jsx(CountryFlag, { currencyCode: currency }), _jsx(Currency, { children: currency })] }));
|
|
6
6
|
}
|
|
@@ -20,7 +20,7 @@ import { GeographyBox } from '../style';
|
|
|
20
20
|
import { Box } from '@mui/material';
|
|
21
21
|
function DateCell(_a) {
|
|
22
22
|
var { value, format: dateFormat, flagIcon, hasFlag, tableMode } = _a, props = __rest(_a, ["value", "format", "flagIcon", "hasFlag", "tableMode"]);
|
|
23
|
-
const icon = flagIcon && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(flagIcon || '') }, { children: _jsx(CountryFlag, {
|
|
23
|
+
const icon = flagIcon && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(flagIcon || '') }, { children: _jsx(CountryFlag, { countryCode: flagIcon }) })));
|
|
24
24
|
const renderedValue = useMemo(() => formatCellDate(value, dateFormat), [value]);
|
|
25
25
|
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(DateCellContainer, { children: [hasFlag && (_jsx(GeographyBox, Object.assign({ sx: {
|
|
26
26
|
visibility: 'visible',
|
|
@@ -20,5 +20,5 @@ import { Box } from '@mui/material';
|
|
|
20
20
|
export default function EntityCell(_a) {
|
|
21
21
|
var { entity, country, verificationStatus, licenseNumber, hideStatus } = _a, props = __rest(_a, ["entity", "country", "verificationStatus", "licenseNumber", "hideStatus"]);
|
|
22
22
|
const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
|
|
23
|
-
return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, {
|
|
23
|
+
return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { countryCode: country }) })), _jsx(EntityName, { children: licenseNumber }), !hideStatus && (_jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) }))] })) })) })) })));
|
|
24
24
|
}
|
|
@@ -41,7 +41,7 @@ function SourceCell(_a) {
|
|
|
41
41
|
const customerInitiatedTooltip = customerInitiated === false ? t('merchantInitiated') : '';
|
|
42
42
|
const geographyTooltip = geographyVariant ? geographyMap[geographyVariant] : undefined;
|
|
43
43
|
const tooltip = geographyTooltip || flagIcon ? `${geographyTooltip || ''} ${geographyTooltip && flagIcon ? `-` : ''} ${flagIcon ? `${flagIcon}` : ''}` : undefined;
|
|
44
|
-
const icon = flagIcon && _jsx(CountryFlag, {
|
|
44
|
+
const icon = flagIcon && _jsx(CountryFlag, { countryCode: flagIcon });
|
|
45
45
|
const sources = [];
|
|
46
46
|
const walletTypeIcon = (payment === null || payment === void 0 ? void 0 : payment.wallet) === 'SV Wallet' ? 'walletStoredValue' : 'walletPassThru';
|
|
47
47
|
const type = (payment === null || payment === void 0 ? void 0 : payment.type) === 'Wallet' ? walletTypeIcon : payment === null || payment === void 0 ? void 0 : payment.type;
|
|
@@ -21,6 +21,6 @@ function WalletCell(_a) {
|
|
|
21
21
|
return (_jsx(TableCell, Object.assign({ style: {
|
|
22
22
|
textAlign: 'center',
|
|
23
23
|
overflow: 'visible',
|
|
24
|
-
} }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, {
|
|
24
|
+
} }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { countryCode: country }) }))), _jsxs(WalletWrapper, { children: [_jsx(WalletIcon, { src: walletIcon, alt: "wallet-icon" }), walletId && _jsxs(WalletIdContainer, { children: ["\u00B7\u00B7\u00B7\u00B7 ", walletId === null || walletId === void 0 ? void 0 : walletId.substring(((walletId === null || walletId === void 0 ? void 0 : walletId.length) || 0) - 4)] })] })] }) })));
|
|
25
25
|
}
|
|
26
26
|
export default WalletCell;
|
|
@@ -122,4 +122,3 @@ export * from './ListLayout';
|
|
|
122
122
|
export { default as MFWidgetLoader } from './MFWidgetLoader';
|
|
123
123
|
export { default as BetaBanner } from './BetaBanner';
|
|
124
124
|
export * from './Autocomplete';
|
|
125
|
-
export { default as CountryFlagByCurrencyCode } from './CountryFlagByCurrencyCode';
|
|
@@ -122,4 +122,3 @@ export * from './ListLayout';
|
|
|
122
122
|
export { default as MFWidgetLoader } from './MFWidgetLoader';
|
|
123
123
|
export { default as BetaBanner } from './BetaBanner';
|
|
124
124
|
export * from './Autocomplete';
|
|
125
|
-
export { default as CountryFlagByCurrencyCode } from './CountryFlagByCurrencyCode';
|
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.245-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.245-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BoxProps } from '@mui/material/Box';
|
|
3
|
-
interface CountryFlagByCurrencyCodeProps extends BoxProps {
|
|
4
|
-
code?: string;
|
|
5
|
-
}
|
|
6
|
-
declare function CountryFlagByCurrencyCode({ code, ...props }: CountryFlagByCurrencyCodeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const _default: import("react").MemoExoticComponent<typeof CountryFlagByCurrencyCode>;
|
|
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 CountryFlagByCurrencyCode(_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(CountryFlagByCurrencyCode);
|