@tap-payments/os-micro-frontend-shared 0.1.70-test.33 → 0.1.70-test.34
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AmountCellProps } from '../type';
|
|
2
|
-
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode, isSheetViewShown, selectionProps, chipIndex, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default AmountCell;
|
|
@@ -12,15 +12,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { TableCell } from '../../../TableCells';
|
|
14
14
|
import Tooltip from '../../../Tooltip';
|
|
15
|
-
import { CurrencyIcon } from '../../../index.js';
|
|
15
|
+
import { CurrencyIcon, StatusChipWithCopy } from '../../../index.js';
|
|
16
16
|
import { getCurrenciesIcon } from '../../../../constants/index.js';
|
|
17
17
|
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
18
18
|
import { AmountCellContainer, ConversionBadge, CurrencySpan, DecimalSpan, FlagContainer } from './style';
|
|
19
19
|
import { FlagIcon } from '../style';
|
|
20
20
|
function AmountCell(_a) {
|
|
21
|
-
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown", "tableMode"]);
|
|
21
|
+
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode, isSheetViewShown, selectionProps = {}, chipIndex = 0 } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown", "tableMode", "isSheetViewShown", "selectionProps", "chipIndex"]);
|
|
22
22
|
const icon = currency && _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: "customer icon" });
|
|
23
23
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
24
|
+
if (isSheetViewShown) {
|
|
25
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: amount ? `${integerAmount}.${decimalAmount}` : '-', selectionProps: selectionProps }, { children: [conversionType && (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType }))), _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: "-" })) }))] })));
|
|
26
|
+
}
|
|
24
27
|
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: conversionType && (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType }))) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: isTextShown ? _jsx("span", {}) : _jsx(FlagContainer, { children: icon }) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _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: "-" })) })) }))] }) })));
|
|
25
28
|
}
|
|
26
29
|
export default AmountCell;
|
|
@@ -60,7 +60,10 @@ export interface AmountCellProps extends TableCellProps {
|
|
|
60
60
|
tooltipLabel?: React.ReactNode;
|
|
61
61
|
amountTooltipLabel?: React.ReactNode;
|
|
62
62
|
isTextShown?: boolean;
|
|
63
|
+
isSheetViewShown?: boolean;
|
|
63
64
|
tableMode?: TableMode;
|
|
65
|
+
selectionProps?: SelectionProps;
|
|
66
|
+
chipIndex?: number;
|
|
64
67
|
}
|
|
65
68
|
export interface DestinationCellProps extends TableCellProps {
|
|
66
69
|
destinationsCount?: number;
|
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.70-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.70-test.34",
|
|
5
|
+
"testVersion": 34,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|