@tap-payments/os-micro-frontend-shared 0.1.139 → 0.1.140-test.10
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/AmountCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.js +7 -19
- package/build/components/TableCells/CustomCells/AmountCell/AmountCellSheet.d.ts +3 -0
- package/build/components/TableCells/CustomCells/AmountCell/AmountCellSheet.js +10 -0
- package/build/components/TableCells/CustomCells/AmountCell/AmountCellText.d.ts +3 -0
- package/build/components/TableCells/CustomCells/AmountCell/AmountCellText.js +23 -0
- package/build/components/TableCells/CustomCells/AmountCell/{AmountConversionTooltipLabel.js → components/AmountConversionTooltipLabel.js} +3 -3
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts +7 -0
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.js +7 -0
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.d.ts +7 -0
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.js +8 -0
- package/build/components/TableCells/CustomCells/AmountCell/components/index.d.ts +3 -0
- package/build/components/TableCells/CustomCells/AmountCell/components/index.js +3 -0
- package/build/components/TableCells/CustomCells/AmountCell/index.d.ts +3 -1
- package/build/components/TableCells/CustomCells/AmountCell/index.js +3 -1
- package/build/components/TableCells/CustomCells/AmountCell/type.d.ts +22 -0
- package/build/components/TableCells/CustomCells/AmountCell/type.js +1 -0
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCell.js +2 -5
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCellSheet.d.ts +3 -0
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCellSheet.js +8 -0
- package/build/components/TableCells/CustomCells/CustomerCell/index.d.ts +1 -0
- package/build/components/TableCells/CustomCells/CustomerCell/index.js +1 -0
- package/build/components/TableCells/CustomCells/CustomerCell/type.d.ts +15 -0
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +5 -31
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCellSheet.d.ts +3 -0
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCellSheet.js +31 -0
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCellText.d.ts +3 -0
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCellText.js +35 -0
- package/build/components/TableCells/CustomCells/DestinationCell/index.d.ts +2 -0
- package/build/components/TableCells/CustomCells/DestinationCell/index.js +2 -0
- package/build/components/TableCells/CustomCells/DestinationCell/type.d.ts +34 -0
- package/build/components/TableCells/CustomCells/DestinationCell/type.js +1 -0
- package/build/components/TableCells/CustomCells/OrderCell/OrderCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/OrderCell/OrderCell.js +1 -4
- package/build/components/TableCells/CustomCells/OrderCell/OrderCellSheet.d.ts +3 -0
- package/build/components/TableCells/CustomCells/OrderCell/OrderCellSheet.js +20 -0
- package/build/components/TableCells/CustomCells/OrderCell/index.d.ts +1 -0
- package/build/components/TableCells/CustomCells/OrderCell/index.js +1 -0
- package/build/components/TableCells/CustomCells/StatusCell/StatusCell.d.ts +1 -4
- package/build/components/TableCells/CustomCells/StatusCell/StatusCell.js +5 -10
- package/build/components/TableCells/CustomCells/StatusCell/StatusCellSheet.d.ts +4 -0
- package/build/components/TableCells/CustomCells/StatusCell/StatusCellSheet.js +21 -0
- package/build/components/TableCells/CustomCells/StatusCell/StatusCellText.d.ts +6 -0
- package/build/components/TableCells/CustomCells/StatusCell/StatusCellText.js +42 -0
- package/build/components/TableCells/CustomCells/StatusCell/index.d.ts +2 -0
- package/build/components/TableCells/CustomCells/StatusCell/index.js +2 -0
- package/build/components/TableCells/CustomCells/StatusCell/type.d.ts +2 -4
- package/build/components/TableCells/CustomCells/StatusCell/useStatusCell.d.ts +6 -0
- package/build/components/TableCells/CustomCells/StatusCell/useStatusCell.js +8 -0
- package/build/components/TableCells/CustomCells/StatusCell/utils.d.ts +2 -1
- package/build/components/TableCells/CustomCells/StatusCell/utils.js +2 -1
- package/build/components/TableCells/CustomCells/type.d.ts +2 -65
- package/package.json +3 -3
- /package/build/components/TableCells/CustomCells/AmountCell/{AmountConversionTooltipLabel.d.ts → components/AmountConversionTooltipLabel.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AmountCellProps } from '
|
|
2
|
-
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel,
|
|
1
|
+
import { AmountCellProps } from './type';
|
|
2
|
+
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default AmountCell;
|
|
@@ -9,30 +9,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
13
|
-
import { useMemo } from 'react';
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { TableCell } from '../../../TableCells';
|
|
15
14
|
import Tooltip from '../../../Tooltip';
|
|
16
|
-
import { CurrencyIcon
|
|
15
|
+
import { CurrencyIcon } from '../../../index.js';
|
|
17
16
|
import { getCurrenciesIcon } from '../../../../constants/index.js';
|
|
18
|
-
import {
|
|
19
|
-
import { AmountCellContainer, ConversionBadge, CurrencySpan, DecimalSpan, FlagContainer } from './style';
|
|
17
|
+
import { AmountCellContainer, FlagContainer } from './style';
|
|
20
18
|
import { FlagIcon } from '../style';
|
|
19
|
+
import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
20
|
+
const tableMode = 'default';
|
|
21
21
|
function AmountCell(_a) {
|
|
22
|
-
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel
|
|
22
|
+
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
|
|
23
23
|
const icon = currency && _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: "customer icon" });
|
|
24
|
-
|
|
25
|
-
const conversionTypeLabel = useMemo(() => {
|
|
26
|
-
if (!conversionType)
|
|
27
|
-
return _jsx(_Fragment, {});
|
|
28
|
-
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType })));
|
|
29
|
-
}, [conversionType, tableMode]);
|
|
30
|
-
const currencyInfo = useMemo(() => {
|
|
31
|
-
return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode }, { children: amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencyIcon, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, decimalAmount && (_jsxs(_Fragment, { children: [".", _jsx(DecimalSpan, { children: decimalAmount })] }))] })) : (_jsx("span", { children: "-" })) })));
|
|
32
|
-
}, [amount, tableMode, currency, integerAmount, decimalAmount]);
|
|
33
|
-
if (tableMode === 'sheet') {
|
|
34
|
-
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: amount ? `${integerAmount}.${decimalAmount}` : '-', selectionProps: selectionProps }, { children: [conversionTypeLabel, currencyInfo] })));
|
|
35
|
-
}
|
|
36
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: conversionTypeLabel })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: isTextShown ? _jsx("span", {}) : _jsx(FlagContainer, { children: icon }) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: currencyInfo }))] }) })));
|
|
24
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { 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 }) }))] }) })));
|
|
37
25
|
}
|
|
38
26
|
export default AmountCell;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StatusChipWithCopy } from '../../../index.js';
|
|
3
|
+
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
4
|
+
import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
5
|
+
const tableMode = 'sheet';
|
|
6
|
+
function AmountCellSheet({ conversionType, amount, currency, selectionProps = {}, chipIndex = 0 }) {
|
|
7
|
+
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
8
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: amount ? `${integerAmount}.${decimalAmount}` : '-', selectionProps: selectionProps }, { children: [_jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }), _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency })] })));
|
|
9
|
+
}
|
|
10
|
+
export default AmountCellSheet;
|
|
@@ -0,0 +1,23 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { TableCell } from '../../../TableCells';
|
|
14
|
+
import Tooltip from '../../../Tooltip';
|
|
15
|
+
import { CurrencyIcon } from '../../../index.js';
|
|
16
|
+
import { AmountCellContainer } from './style';
|
|
17
|
+
import { ConversionTypeLabel, CurrencyInfo } from './components';
|
|
18
|
+
const tableMode = 'text';
|
|
19
|
+
function AmountCellText(_a) {
|
|
20
|
+
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
|
|
21
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: _jsx("span", {}) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
|
|
22
|
+
}
|
|
23
|
+
export default AmountCellText;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { conversionTypesLabels, formatAmountWithCurrency } from '
|
|
3
|
-
import { CurrencyIcon } from '
|
|
4
|
-
import { ConversionTooltip, ConversionTooltipRow } from '
|
|
2
|
+
import { conversionTypesLabels, formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
3
|
+
import { CurrencyIcon } from '../../../../index.js';
|
|
4
|
+
import { ConversionTooltip, ConversionTooltipRow } from '../style';
|
|
5
5
|
export const AmountConversionTooltipLabel = ({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, }) => {
|
|
6
6
|
const customerSelectValue = formatAmountWithCurrency(selectAmount, selectCurrency);
|
|
7
7
|
const chargeValue = formatAmountWithCurrency(requestAmount, requestCurrency);
|
package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableMode } from '../../../../../types/index.js';
|
|
2
|
+
import { AmountCellProps } from '../type';
|
|
3
|
+
interface ConversionTypeLabelProps extends Pick<AmountCellProps, 'conversionType'> {
|
|
4
|
+
tableMode: TableMode;
|
|
5
|
+
}
|
|
6
|
+
export declare const ConversionTypeLabel: ({ tableMode, conversionType }: ConversionTypeLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ConversionBadge } from '../style';
|
|
3
|
+
export const ConversionTypeLabel = ({ tableMode, conversionType }) => {
|
|
4
|
+
if (!conversionType)
|
|
5
|
+
return _jsx(_Fragment, {});
|
|
6
|
+
return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType })));
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableMode } from '../../../../../types/index.js';
|
|
2
|
+
import { AmountCellProps } from '../type';
|
|
3
|
+
interface CurrencyInfoProps extends Pick<AmountCellProps, 'amount' | 'currency'> {
|
|
4
|
+
tableMode: TableMode;
|
|
5
|
+
}
|
|
6
|
+
export declare const CurrencyInfo: ({ tableMode, amount, currency }: CurrencyInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CurrencyIcon } from '../../../../index.js';
|
|
3
|
+
import { CurrencySpan, DecimalSpan } from '../style';
|
|
4
|
+
import { formatAmountWithCurrency } from '../../../../../utils/index.js';
|
|
5
|
+
export const CurrencyInfo = ({ tableMode, amount, currency }) => {
|
|
6
|
+
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
7
|
+
return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode }, { children: amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencyIcon, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, decimalAmount && (_jsxs(_Fragment, { children: [".", _jsx(DecimalSpan, { children: decimalAmount })] }))] })) : (_jsx("span", { children: "-" })) })));
|
|
8
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default as AmountCell } from './AmountCell';
|
|
2
|
-
export { AmountConversionTooltipLabel } from './
|
|
2
|
+
export { AmountConversionTooltipLabel } from './components';
|
|
3
|
+
export { default as AmountCellText } from './AmountCellText';
|
|
4
|
+
export { default as AmountCellSheet } from './AmountCellSheet';
|
|
3
5
|
export * from './style';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default as AmountCell } from './AmountCell';
|
|
2
|
-
export { AmountConversionTooltipLabel } from './
|
|
2
|
+
export { AmountConversionTooltipLabel } from './components';
|
|
3
|
+
export { default as AmountCellText } from './AmountCellText';
|
|
4
|
+
export { default as AmountCellSheet } from './AmountCellSheet';
|
|
3
5
|
export * from './style';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TableCellProps } from '@mui/material';
|
|
3
|
+
import { SelectionProps } from '../../../../types/index.js';
|
|
4
|
+
export interface AmountCellCommonProps extends TableCellProps {
|
|
5
|
+
currency?: string;
|
|
6
|
+
conversionType?: 'fx' | 'dcc';
|
|
7
|
+
amount?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AmountCellSheetProps extends AmountCellCommonProps {
|
|
10
|
+
selectionProps?: SelectionProps;
|
|
11
|
+
chipIndex?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface AmountCellProps extends AmountCellCommonProps {
|
|
14
|
+
selectAmount?: number;
|
|
15
|
+
selectCurrency?: string;
|
|
16
|
+
requestAmount?: number;
|
|
17
|
+
requestCurrency?: string;
|
|
18
|
+
merchantAmount?: number;
|
|
19
|
+
merchantCurrency?: string;
|
|
20
|
+
tooltipLabel?: React.ReactNode;
|
|
21
|
+
amountTooltipLabel?: React.ReactNode;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CustomerCellProps } from '
|
|
2
|
-
declare function CustomerCell({ customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id,
|
|
1
|
+
import type { CustomerCellProps } from './type';
|
|
2
|
+
declare function CustomerCell({ customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id, ...props }: Readonly<CustomerCellProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CustomerCell;
|
|
@@ -15,12 +15,12 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import Tooltip from '../../../Tooltip';
|
|
16
16
|
import { merchantInitiatedIcon, timezoneIcon } from '../../../../constants/index.js';
|
|
17
17
|
import { getRandomGradientColor, isArabic } from '../../../../utils/index.js';
|
|
18
|
-
import { StyledCustomerCell, StyledCustomerIcon, StyledCustomerIconContainer, StyledCustomerName } from './style';
|
|
19
18
|
import { TableCell } from '../../../TableCells';
|
|
19
|
+
import { StyledCustomerCell, StyledCustomerIcon, StyledCustomerIconContainer, StyledCustomerName } from './style';
|
|
20
20
|
import { AvatarStyled, StarBadgeWrapper } from '../style';
|
|
21
21
|
function CustomerCell(_a) {
|
|
22
22
|
var _b;
|
|
23
|
-
var { customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id
|
|
23
|
+
var { customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id } = _a, props = __rest(_a, ["customerInitiated", "children", "isTimezoneIconShown", "hasCustomerIcon", "customerIcon", "customerName", "hideCustomerInitiatedIcon", "hideTimezoneIcon", "phone", "email", "id"]);
|
|
24
24
|
const { t } = useTranslation();
|
|
25
25
|
const customerInitiatedTooltip = customerInitiated === false ? t('merchantInitiated') : '';
|
|
26
26
|
const isArabicCustomerName = isArabic(customerName);
|
|
@@ -38,9 +38,6 @@ function CustomerCell(_a) {
|
|
|
38
38
|
return null;
|
|
39
39
|
return (_jsx("div", Object.assign({ "data-testid": "CustomerCell_customerTooltip" }, { children: tooltipOptions.map(({ name, value }) => value && (_jsx("div", Object.assign({ "data-testid": `CustomerCell_customerTooltip_${name}` }, { children: name === 'Name' ? value : `${name}: ${value}` }), value))) })));
|
|
40
40
|
}, [tooltipOptions]);
|
|
41
|
-
if (tableMode === 'sheet') {
|
|
42
|
-
return (_jsx(StyledCustomerName, Object.assign({ tableMode: tableMode, "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })));
|
|
43
|
-
}
|
|
44
41
|
return (_jsx(TableCell, Object.assign({}, props, { "data-testid": "CustomerCell_TableCell" }, { children: _jsxs(StyledCustomerCell, Object.assign({ "data-testid": "CustomerCell_StyledCustomerCell" }, { children: [customerShownIcon, _jsx(Tooltip, Object.assign({ title: customerTooltip }, { children: _jsx(StyledCustomerName, Object.assign({ "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })) })), !hideTimezoneIcon && (_jsx(StyledCustomerIconContainer, Object.assign({ "data-testid": "CustomerCell_StyledCustomerIconContainer" }, { children: isTimezoneIconShown && _jsx(StyledCustomerIcon, { src: timezoneIcon, "data-testid": "CustomerCell_StyledCustomerIcon" }) }))), !hideCustomerInitiatedIcon && (_jsx(Tooltip, Object.assign({ title: customerInitiatedTooltip }, { children: _jsx(StarBadgeWrapper, Object.assign({ "data-testid": "CustomerCell_StarBadgeWrapper", className: "geography-box", isShown: !!customerInitiatedTooltip }, { children: customerInitiatedTooltip && (_jsx("img", { "data-testid": "CustomerCell_merchantInitiatedIcon", src: merchantInitiatedIcon, alt: "merchant", style: {
|
|
45
42
|
width: '16px',
|
|
46
43
|
height: '16px',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isArabic } from '../../../../utils/index.js';
|
|
3
|
+
import { StyledCustomerName } from './style';
|
|
4
|
+
function CustomerCellSheet({ children, customerName }) {
|
|
5
|
+
const isArabicCustomerName = isArabic(customerName);
|
|
6
|
+
return (_jsx(StyledCustomerName, Object.assign({ tableMode: "sheet", "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })));
|
|
7
|
+
}
|
|
8
|
+
export default CustomerCellSheet;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import type { TableCellProps } from '@mui/material';
|
|
1
2
|
export type TooltipOption = {
|
|
2
3
|
name: string;
|
|
3
4
|
value?: string;
|
|
4
5
|
};
|
|
6
|
+
export interface CustomerCellProps extends TableCellProps {
|
|
7
|
+
customerInitiated?: boolean;
|
|
8
|
+
flagIcon?: string;
|
|
9
|
+
isTimezoneIconShown?: boolean;
|
|
10
|
+
hasCustomerIcon?: boolean;
|
|
11
|
+
customerIcon?: string;
|
|
12
|
+
customerName: string;
|
|
13
|
+
hideCustomerInitiatedIcon?: boolean;
|
|
14
|
+
hideTimezoneIcon?: boolean;
|
|
15
|
+
email?: string;
|
|
16
|
+
phone?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
}
|
|
19
|
+
export type CustomerCellSheetProps = Pick<CustomerCellProps, 'customerName' | 'children'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DestinationCellProps } from '
|
|
2
|
-
declare function DestinationCell({ destinationsCount, destinationsTooltip,
|
|
1
|
+
import { DestinationCellProps } from './type';
|
|
2
|
+
declare function DestinationCell({ destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection, ...props }: DestinationCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default DestinationCell;
|
|
@@ -9,45 +9,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import Box from '@mui/material/Box';
|
|
14
14
|
import Tooltip from '../../../Tooltip';
|
|
15
15
|
import { destinationSolidIcon } from '../../../../constants/index.js';
|
|
16
|
-
import { formatAmount } from '../../../../utils/index.js';
|
|
17
16
|
import { DestinationCellContainer, DestinationCount, StyledDestinationCell, StyledDestinationIcon } from './styled';
|
|
18
|
-
|
|
19
|
-
import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
|
|
17
|
+
const tableMode = 'default';
|
|
20
18
|
function DestinationCell(_a) {
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
24
|
-
const formattedAmount = formatAmount(destinationsAmount || 0);
|
|
25
|
-
const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
|
|
26
|
-
const isSheetView = tableMode === 'sheet';
|
|
27
|
-
if (isSheetView) {
|
|
28
|
-
const sheetViewChips = destinations === null || destinations === void 0 ? void 0 : destinations.map((dest, index) => {
|
|
29
|
-
const formattedDestAmount = formatAmount((dest === null || dest === void 0 ? void 0 : dest.amount) || 0);
|
|
30
|
-
return {
|
|
31
|
-
key: `destination-${(dest === null || dest === void 0 ? void 0 : dest.id) || index}`,
|
|
32
|
-
content: (_jsxs(_Fragment, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
|
|
33
|
-
chipIndex: index,
|
|
34
|
-
selectionProps: selectionProps !== null && selectionProps !== void 0 ? selectionProps : {},
|
|
35
|
-
copyText: `${formattedDestAmount.integerAmount}.${formattedDestAmount.decimalAmount}`,
|
|
36
|
-
};
|
|
37
|
-
}, [selectionProps]);
|
|
38
|
-
return (_jsx(Box, Object.assign({}, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
39
|
-
}
|
|
40
|
-
if (!destinationsCount || hidden) {
|
|
19
|
+
var { destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "destination", "destinationsAmount", "hidden", "iconDirection"]);
|
|
20
|
+
if (!destinationsCount || hidden)
|
|
41
21
|
return null;
|
|
42
|
-
}
|
|
43
|
-
const textView = (_jsx(TextLabel, Object.assign({ sx: {
|
|
44
|
-
textAlign: 'left',
|
|
45
|
-
justifyContent: 'flex-start',
|
|
46
|
-
height: 'auto',
|
|
47
|
-
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id, " - ", _jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", destinationsCount - 1] })) : (_jsxs("div", { children: ["Destination ", (_e = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _e === void 0 ? void 0 : _e.id, " - ", _jsx(CurrencyIcon, { currency: (_f = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _f === void 0 ? void 0 : _f.currency }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })));
|
|
48
22
|
return (_jsx(Box, Object.assign({ sx: {
|
|
49
23
|
width: 'fit-content',
|
|
50
24
|
overflow: 'visible',
|
|
51
|
-
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children:
|
|
25
|
+
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: _jsxs(StyledDestinationCell, Object.assign({ tableMode: tableMode }, { children: [_jsx(StyledDestinationIcon, { src: destinationSolidIcon, pointLeft: iconDirection === 'left' }), destinationsCount > 1 && (_jsx(DestinationCellContainer, Object.assign({ destinationsCount: 1 }, { children: _jsx(DestinationCount, { children: destinationsCount }) })))] })) })) })));
|
|
52
26
|
}
|
|
53
27
|
export default DestinationCell;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DestinationCellSheetProps } from './type';
|
|
2
|
+
declare function DestinationCellSheet({ destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection, selectionProps, ...props }: DestinationCellSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DestinationCellSheet;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
14
|
+
import { formatAmount } from '../../../../utils/index.js';
|
|
15
|
+
import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
|
|
16
|
+
function DestinationCellSheet(_a) {
|
|
17
|
+
var { destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection, selectionProps } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "destination", "destinationsAmount", "hidden", "iconDirection", "selectionProps"]);
|
|
18
|
+
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
19
|
+
const sheetViewChips = destinations === null || destinations === void 0 ? void 0 : destinations.map((dest, index) => {
|
|
20
|
+
const formattedDestAmount = formatAmount((dest === null || dest === void 0 ? void 0 : dest.amount) || 0);
|
|
21
|
+
return {
|
|
22
|
+
key: `destination-${(dest === null || dest === void 0 ? void 0 : dest.id) || index}`,
|
|
23
|
+
content: (_jsxs(_Fragment, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
|
|
24
|
+
chipIndex: index,
|
|
25
|
+
selectionProps: selectionProps !== null && selectionProps !== void 0 ? selectionProps : {},
|
|
26
|
+
copyText: `${formattedDestAmount.integerAmount}.${formattedDestAmount.decimalAmount}`,
|
|
27
|
+
};
|
|
28
|
+
}, [selectionProps]);
|
|
29
|
+
return (_jsx(Box, Object.assign({}, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
30
|
+
}
|
|
31
|
+
export default DestinationCellSheet;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DestinationCellProps } from './type';
|
|
2
|
+
declare function DestinationCell({ destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection, ...props }: DestinationCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export default DestinationCell;
|
|
@@ -0,0 +1,35 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
14
|
+
import Tooltip from '../../../Tooltip';
|
|
15
|
+
import { formatAmount } from '../../../../utils/index.js';
|
|
16
|
+
import { CurrencyIcon } from '../../../index.js';
|
|
17
|
+
import { TextLabel } from '../style';
|
|
18
|
+
function DestinationCell(_a) {
|
|
19
|
+
var _b, _c, _d, _e, _f;
|
|
20
|
+
var { destinationsCount, destinationsTooltip, destination, destinationsAmount, hidden, iconDirection } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "destination", "destinationsAmount", "hidden", "iconDirection"]);
|
|
21
|
+
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
22
|
+
const formattedAmount = formatAmount(destinationsAmount || 0);
|
|
23
|
+
const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
|
|
24
|
+
if (!destinationsCount || hidden)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsx(Box, Object.assign({ sx: {
|
|
27
|
+
width: 'fit-content',
|
|
28
|
+
overflow: 'visible',
|
|
29
|
+
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: _jsx(TextLabel, Object.assign({ sx: {
|
|
30
|
+
textAlign: 'left',
|
|
31
|
+
justifyContent: 'flex-start',
|
|
32
|
+
height: 'auto',
|
|
33
|
+
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id, " - ", _jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", destinationsCount - 1] })) : (_jsxs("div", { children: ["Destination ", (_e = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _e === void 0 ? void 0 : _e.id, " - ", _jsx(CurrencyIcon, { currency: (_f = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _f === void 0 ? void 0 : _f.currency }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })) })) })));
|
|
34
|
+
}
|
|
35
|
+
export default DestinationCell;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
|
+
import { SelectionProps } from '../../../../types/index.js';
|
|
4
|
+
export interface DestinationCellProps extends TableCellProps {
|
|
5
|
+
destinationsCount?: number;
|
|
6
|
+
flagIcon?: string;
|
|
7
|
+
destinationsTooltip?: React.ReactNode;
|
|
8
|
+
destinationsAmount?: number;
|
|
9
|
+
destination?: {
|
|
10
|
+
reverse_destinations?: boolean;
|
|
11
|
+
amount: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
count: number;
|
|
14
|
+
destination: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
amount: number;
|
|
17
|
+
currency: string;
|
|
18
|
+
transfer?: {
|
|
19
|
+
id: string;
|
|
20
|
+
amount: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
};
|
|
23
|
+
reverse_transfer?: {
|
|
24
|
+
id: string;
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
iconDirection?: 'left' | 'right';
|
|
31
|
+
}
|
|
32
|
+
export interface DestinationCellSheetProps extends DestinationCellProps {
|
|
33
|
+
selectionProps?: SelectionProps;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OrderCellProps } from '../type';
|
|
2
|
-
declare function OrderCell({ value, label, items,
|
|
2
|
+
declare function OrderCell({ value, label, items, ...props }: OrderCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default OrderCell;
|
|
@@ -14,7 +14,7 @@ import { TableCell } from '../../../TableCells';
|
|
|
14
14
|
import Tooltip from '../../../Tooltip';
|
|
15
15
|
import { MAX_TOOLTIP_ITEM_LENGTH } from './constant';
|
|
16
16
|
function OrderCell(_a) {
|
|
17
|
-
var { value, label, items
|
|
17
|
+
var { value, label, items } = _a, props = __rest(_a, ["value", "label", "items"]);
|
|
18
18
|
const orderDiscriminator = Number.isInteger(value) && Number(value) > 1 && label.charAt(label.length - 1) !== 's' ? `${label}s` : label;
|
|
19
19
|
const orderLabel = `${value} ${orderDiscriminator}`;
|
|
20
20
|
const orderTooltip = (_jsx(_Fragment, { children: items === null || items === void 0 ? void 0 : items.map((item) => {
|
|
@@ -22,9 +22,6 @@ function OrderCell(_a) {
|
|
|
22
22
|
const truncatedItemContent = ((itemContent === null || itemContent === void 0 ? void 0 : itemContent.length) || 0) > MAX_TOOLTIP_ITEM_LENGTH ? `${itemContent === null || itemContent === void 0 ? void 0 : itemContent.slice(0, MAX_TOOLTIP_ITEM_LENGTH)}...` : itemContent;
|
|
23
23
|
return _jsx("div", { children: truncatedItemContent }, item.id);
|
|
24
24
|
}) }));
|
|
25
|
-
if (tableMode === 'sheet') {
|
|
26
|
-
return (_jsx(TableCell, Object.assign({ sx: { fontSize: '11px' } }, props, { children: orderLabel })));
|
|
27
|
-
}
|
|
28
25
|
return (_jsx(Tooltip, Object.assign({ title: (items || []).length > 1 ? orderTooltip : undefined }, { children: _jsx(TableCell, Object.assign({}, props, { children: _jsx("span", { children: orderLabel }) })) })));
|
|
29
26
|
}
|
|
30
27
|
export default OrderCell;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { TableCell } from '../../../TableCells';
|
|
14
|
+
function OrderCellSheet(_a) {
|
|
15
|
+
var { value, label, items } = _a, props = __rest(_a, ["value", "label", "items"]);
|
|
16
|
+
const orderDiscriminator = Number.isInteger(value) && Number(value) > 1 && label.charAt(label.length - 1) !== 's' ? `${label}s` : label;
|
|
17
|
+
const orderLabel = `${value} ${orderDiscriminator}`;
|
|
18
|
+
return (_jsx(TableCell, Object.assign({ sx: { fontSize: '11px' } }, props, { children: orderLabel })));
|
|
19
|
+
}
|
|
20
|
+
export default OrderCellSheet;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { StatusCellProps } from './type';
|
|
2
|
-
declare function StatusCell({ statuses,
|
|
3
|
-
isChargesService?: boolean;
|
|
4
|
-
isAuthorizationsService?: boolean;
|
|
5
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function StatusCell({ statuses, centerIconKey, ...props }: StatusCellProps): import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
export default StatusCell;
|
|
@@ -12,16 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { TableCell } from '../../../TableCells';
|
|
14
14
|
import { StatusIcon, StatusContainer, StatusWrapper } from './style';
|
|
15
|
-
import {
|
|
15
|
+
import { useStatusCell } from './useStatusCell';
|
|
16
16
|
function StatusCell(_a) {
|
|
17
|
-
var { statuses,
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
if (tableMode === 'sheet') {
|
|
21
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StatusContainer, Object.assign({ sx: { paddingRight: '30px' } }, { children: statusesList.map((status) => status) })) })));
|
|
22
|
-
}
|
|
23
|
-
const xGapValue = isTextShown ? xGap || 120 : 40;
|
|
24
|
-
const centerIconIndex = centerIconKey ? Object.entries(statusesFilteredObject).findIndex(([key]) => key === centerIconKey) : 0;
|
|
17
|
+
var { statuses, centerIconKey } = _a, props = __rest(_a, ["statuses", "centerIconKey"]);
|
|
18
|
+
const { centerIconIndex, statusesList } = useStatusCell({ statuses, centerIconKey });
|
|
19
|
+
const xGapValue = 40;
|
|
25
20
|
return (_jsx(TableCell, Object.assign({}, props, { "data-testid": "StatusCell", sx: {
|
|
26
21
|
position: 'relative',
|
|
27
22
|
overflow: 'visible',
|
|
@@ -41,7 +36,7 @@ function StatusCell(_a) {
|
|
|
41
36
|
x: xHoverPosition,
|
|
42
37
|
zIndex: 100 - Math.abs(centerIconIndex - index),
|
|
43
38
|
},
|
|
44
|
-
}, transition: { duration: 0.3, type: 'tween', ease: 'easeOut' }, statusesCount: statusesList.length || 0 }, { children: _jsx(StatusIcon,
|
|
39
|
+
}, transition: { duration: 0.3, type: 'tween', ease: 'easeOut' }, statusesCount: statusesList.length || 0 }, { children: _jsx(StatusIcon, { children: status }) }), index));
|
|
45
40
|
}) })) })));
|
|
46
41
|
}
|
|
47
42
|
export default StatusCell;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TableCellProps } from '@mui/material/TableCell';
|
|
2
|
+
import type { StatusCellProps } from './type';
|
|
3
|
+
declare function StatusCellSheet({ statuses, ...props }: Pick<StatusCellProps, 'statuses'> & TableCellProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default StatusCellSheet;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { TableCell } from '../../../TableCells';
|
|
14
|
+
import { StatusContainer } from './style';
|
|
15
|
+
import { useStatusCell } from './useStatusCell';
|
|
16
|
+
function StatusCellSheet(_a) {
|
|
17
|
+
var { statuses } = _a, props = __rest(_a, ["statuses"]);
|
|
18
|
+
const { statusesList } = useStatusCell({ statuses });
|
|
19
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StatusContainer, Object.assign({ sx: { paddingRight: '30px' } }, { children: statusesList.map((status) => status) })) })));
|
|
20
|
+
}
|
|
21
|
+
export default StatusCellSheet;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StatusCellProps } from './type';
|
|
2
|
+
interface StatusCellTextProps extends StatusCellProps {
|
|
3
|
+
xGap?: number;
|
|
4
|
+
}
|
|
5
|
+
declare function StatusCellText({ statuses, centerIconKey, xGap, ...props }: StatusCellTextProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default StatusCellText;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { TableCell } from '../../../TableCells';
|
|
14
|
+
import { StatusIcon, StatusContainer, StatusWrapper } from './style';
|
|
15
|
+
import { useStatusCell } from './useStatusCell';
|
|
16
|
+
function StatusCellText(_a) {
|
|
17
|
+
var { statuses, centerIconKey, xGap } = _a, props = __rest(_a, ["statuses", "centerIconKey", "xGap"]);
|
|
18
|
+
const { statusesList, centerIconIndex } = useStatusCell({ statuses, centerIconKey });
|
|
19
|
+
const xGapValue = xGap || 120;
|
|
20
|
+
return (_jsx(TableCell, Object.assign({}, props, { "data-testid": "StatusCell", sx: {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
overflow: 'visible',
|
|
23
|
+
} }, { children: _jsx(StatusContainer, Object.assign({ initial: "initial", whileHover: "hover", animate: "start" }, { children: statusesList.map((status, index) => {
|
|
24
|
+
if (!status)
|
|
25
|
+
return;
|
|
26
|
+
// To keep x position of each icon while hovering consistent
|
|
27
|
+
const xHoverPosition = (index - centerIconIndex) * xGapValue;
|
|
28
|
+
const isIconAfterCenterIcon = index > centerIconIndex;
|
|
29
|
+
const isIconBeforeCenterIcon = index < centerIconIndex;
|
|
30
|
+
return (_jsx(StatusWrapper, Object.assign({ variants: {
|
|
31
|
+
initial: {
|
|
32
|
+
x: isIconBeforeCenterIcon ? -5 : isIconAfterCenterIcon ? 5 : 0,
|
|
33
|
+
zIndex: isIconBeforeCenterIcon ? 100 - index : isIconAfterCenterIcon ? index : 100,
|
|
34
|
+
},
|
|
35
|
+
hover: {
|
|
36
|
+
x: xHoverPosition,
|
|
37
|
+
zIndex: 100 - Math.abs(centerIconIndex - index),
|
|
38
|
+
},
|
|
39
|
+
}, transition: { duration: 0.3, type: 'tween', ease: 'easeOut' }, statusesCount: statusesList.length || 0 }, { children: _jsx(StatusIcon, Object.assign({ isTextShown: true }, { children: status })) }), index));
|
|
40
|
+
}) })) })));
|
|
41
|
+
}
|
|
42
|
+
export default StatusCellText;
|
|
@@ -4,10 +4,8 @@ import { authorizedStatusIcons, payoutStatusIcons, refundStatusIcons } from './c
|
|
|
4
4
|
export type RefundStatusType = keyof typeof refundStatusIcons;
|
|
5
5
|
export type PayoutStatusType = keyof typeof payoutStatusIcons;
|
|
6
6
|
export type AuthorizedStatusType = keyof typeof authorizedStatusIcons;
|
|
7
|
+
export type Statuses = Record<string, React.ReactNode | undefined | null>;
|
|
7
8
|
export interface StatusCellProps extends TableCellProps {
|
|
8
|
-
statuses:
|
|
9
|
-
isTextShown?: boolean;
|
|
9
|
+
statuses: Statuses;
|
|
10
10
|
centerIconKey?: string;
|
|
11
|
-
xGap?: number;
|
|
12
|
-
tableMode?: 'default' | 'text' | 'sheet';
|
|
13
11
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StatusCellProps } from './type';
|
|
3
|
+
export declare const useStatusCell: ({ statuses, centerIconKey }: Pick<StatusCellProps, 'statuses' | 'centerIconKey'>) => {
|
|
4
|
+
statusesList: import("react").ReactNode[];
|
|
5
|
+
centerIconIndex: number;
|
|
6
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { getStatusesFilteredObject } from './utils';
|
|
3
|
+
export const useStatusCell = ({ statuses, centerIconKey }) => {
|
|
4
|
+
const statusesFilteredObject = useMemo(() => getStatusesFilteredObject(statuses), [statuses]);
|
|
5
|
+
const statusesList = useMemo(() => Object.values(statusesFilteredObject).filter(Boolean), [statusesFilteredObject]);
|
|
6
|
+
const centerIconIndex = useMemo(() => (centerIconKey ? Object.entries(statusesFilteredObject).findIndex(([key]) => key === centerIconKey) : 0), [statusesFilteredObject, centerIconKey]);
|
|
7
|
+
return { statusesList, centerIconIndex };
|
|
8
|
+
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { Statuses } from './type';
|
|
3
|
+
export declare const getStatusesFilteredObject: (statuses: Statuses) => Record<string, import("react").ReactNode>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const getStatusesFilteredObject = (statuses) => {
|
|
2
|
-
|
|
2
|
+
const filteredList = Object.keys(statuses)
|
|
3
3
|
.filter((key) => statuses[key])
|
|
4
4
|
.reduce((acc, key) => {
|
|
5
5
|
acc[key] = statuses[key];
|
|
6
6
|
return acc;
|
|
7
7
|
}, {});
|
|
8
|
+
return statuses ? filteredList : {};
|
|
8
9
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { TableCellProps } from '@mui/material';
|
|
3
|
-
import type { Charge,
|
|
4
|
-
import type { ActionType, FlagType } from './ActionCell';
|
|
3
|
+
import type { Charge, TableMode } from '../../../types/index.js';
|
|
5
4
|
import { getGeographyBoxColor } from '../../../utils/index.js';
|
|
5
|
+
import type { ActionType, FlagType } from './ActionCell';
|
|
6
6
|
export type GeographyBoxVariant = keyof ReturnType<typeof getGeographyBoxColor>;
|
|
7
7
|
export type PaymentMethod = 'VISA' | 'card' | 'MASTERCARD' | 'APPLE_PAY' | 'KNET' | 'MADA';
|
|
8
8
|
export interface DateCellProps extends TableCellProps {
|
|
@@ -20,21 +20,6 @@ export interface OrderCellProps extends TableCellProps {
|
|
|
20
20
|
description?: string;
|
|
21
21
|
name?: string;
|
|
22
22
|
}>;
|
|
23
|
-
tableMode?: TableMode;
|
|
24
|
-
}
|
|
25
|
-
export interface CustomerCellProps extends TableCellProps {
|
|
26
|
-
customerInitiated?: boolean;
|
|
27
|
-
flagIcon?: string;
|
|
28
|
-
isTimezoneIconShown?: boolean;
|
|
29
|
-
hasCustomerIcon?: boolean;
|
|
30
|
-
customerIcon?: string;
|
|
31
|
-
customerName: string;
|
|
32
|
-
hideCustomerInitiatedIcon?: boolean;
|
|
33
|
-
hideTimezoneIcon?: boolean;
|
|
34
|
-
email?: string;
|
|
35
|
-
phone?: string;
|
|
36
|
-
id?: string;
|
|
37
|
-
tableMode?: TableMode;
|
|
38
23
|
}
|
|
39
24
|
export interface SourceCellProps extends TableCellProps {
|
|
40
25
|
geographyVariant?: 'G' | 'L' | 'R';
|
|
@@ -47,54 +32,6 @@ export interface SourceCellProps extends TableCellProps {
|
|
|
47
32
|
showGeographyBox?: boolean;
|
|
48
33
|
customerInitiated?: boolean;
|
|
49
34
|
}
|
|
50
|
-
export interface AmountCellProps extends TableCellProps {
|
|
51
|
-
currency?: string;
|
|
52
|
-
conversionType?: 'fx' | 'dcc';
|
|
53
|
-
amount?: number;
|
|
54
|
-
selectAmount?: number;
|
|
55
|
-
selectCurrency?: string;
|
|
56
|
-
requestAmount?: number;
|
|
57
|
-
requestCurrency?: string;
|
|
58
|
-
merchantAmount?: number;
|
|
59
|
-
merchantCurrency?: string;
|
|
60
|
-
tooltipLabel?: React.ReactNode;
|
|
61
|
-
amountTooltipLabel?: React.ReactNode;
|
|
62
|
-
isTextShown?: boolean;
|
|
63
|
-
tableMode?: TableMode;
|
|
64
|
-
selectionProps?: SelectionProps;
|
|
65
|
-
chipIndex?: number;
|
|
66
|
-
}
|
|
67
|
-
export interface DestinationCellProps extends TableCellProps {
|
|
68
|
-
destinationsCount?: number;
|
|
69
|
-
flagIcon?: string;
|
|
70
|
-
destinationsTooltip?: React.ReactNode;
|
|
71
|
-
isTextShown?: boolean;
|
|
72
|
-
destinationsAmount?: number;
|
|
73
|
-
destination?: {
|
|
74
|
-
reverse_destinations?: boolean;
|
|
75
|
-
amount: number;
|
|
76
|
-
currency: string;
|
|
77
|
-
count: number;
|
|
78
|
-
destination: Array<{
|
|
79
|
-
id: string;
|
|
80
|
-
amount: number;
|
|
81
|
-
currency: string;
|
|
82
|
-
transfer?: {
|
|
83
|
-
id: string;
|
|
84
|
-
amount: number;
|
|
85
|
-
currency: string;
|
|
86
|
-
};
|
|
87
|
-
reverse_transfer?: {
|
|
88
|
-
id: string;
|
|
89
|
-
amount: number;
|
|
90
|
-
currency: string;
|
|
91
|
-
};
|
|
92
|
-
}>;
|
|
93
|
-
};
|
|
94
|
-
iconDirection?: 'left' | 'right';
|
|
95
|
-
tableMode?: TableMode;
|
|
96
|
-
selectionProps?: SelectionProps;
|
|
97
|
-
}
|
|
98
35
|
export interface ActionCellProps extends TableCellProps {
|
|
99
36
|
row?: unknown;
|
|
100
37
|
flag?: FlagType;
|
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.140-test.10",
|
|
5
|
+
"testVersion": 10,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
"publishConfig": {
|
|
137
137
|
"registry": "https://registry.npmjs.org/"
|
|
138
138
|
}
|
|
139
|
-
}
|
|
139
|
+
}
|