@tap-payments/os-micro-frontend-shared 0.0.197 → 0.0.199

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.
@@ -8,7 +8,6 @@ export const StyledContainer = styled(Box)(() => ({
8
8
  }));
9
9
  export const StyledStatusChip = styled(StatusChip)(() => ({
10
10
  padding: '0.75px 12px',
11
- maxWidth: '120px',
12
11
  overflow: 'hidden',
13
12
  textOverflow: 'ellipsis',
14
13
  whiteSpace: 'nowrap',
@@ -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, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default AmountCell;
@@ -17,10 +17,14 @@ 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
+ import { SheetviewAmountCell } from './SheetviewAmountCell';
20
21
  function AmountCell(_a) {
21
- var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown", "tableMode"]);
22
+ var { conversionType, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode } = _a, props = __rest(_a, ["conversionType", "selectAmount", "selectCurrency", "requestAmount", "requestCurrency", "merchantAmount", "merchantCurrency", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown", "tableMode"]);
22
23
  const icon = currency && _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: "customer icon" });
23
24
  const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
25
+ if (tableMode === 'sheet') {
26
+ return (_jsx(SheetviewAmountCell, { selectAmount: selectAmount, selectCurrency: selectCurrency, requestAmount: requestAmount, requestCurrency: requestCurrency, merchantAmount: merchantAmount, merchantCurrency: merchantCurrency }));
27
+ }
24
28
  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
29
  }
26
30
  export default AmountCell;
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ selectAmount?: number;
3
+ selectCurrency?: string;
4
+ requestAmount?: number;
5
+ requestCurrency?: string;
6
+ merchantAmount?: number;
7
+ merchantCurrency?: string;
8
+ };
9
+ export declare const SheetviewAmountCell: ({ selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,32 @@
1
+ import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from 'react-i18next';
3
+ import { formatAmountWithCurrency } from '../../../../utils/index.js';
4
+ import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
5
+ export const SheetviewAmountCell = ({ selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency }) => {
6
+ const customerSelectValue = formatAmountWithCurrency(selectAmount, selectCurrency);
7
+ const chargeValue = formatAmountWithCurrency(requestAmount, requestCurrency);
8
+ const settlementValue = formatAmountWithCurrency(merchantAmount, merchantCurrency);
9
+ const { t } = useTranslation();
10
+ const chipSx = {
11
+ backgroundColor: '#EFF1F2',
12
+ border: 'none',
13
+ };
14
+ const chips = [
15
+ {
16
+ key: 'selected',
17
+ content: (_jsxs(_Fragment, { children: [_jsxs("span", { children: [t('customerSelected'), ": ", selectCurrency] }), customerSelectValue.integerAmount, ".", customerSelectValue.decimalAmount] })),
18
+ sx: chipSx,
19
+ },
20
+ {
21
+ key: 'charge',
22
+ content: (_jsxs(_Fragment, { children: [_jsxs("span", { children: [t('charge'), ": ", requestCurrency] }), chargeValue.integerAmount, ".", chargeValue.decimalAmount] })),
23
+ sx: chipSx,
24
+ },
25
+ {
26
+ key: 'settlement',
27
+ content: (_jsxs(_Fragment, { children: [_jsxs("span", { children: [t('settled'), ":"] }), _jsx(CurrencyIcon, { currency: merchantCurrency }), settlementValue.integerAmount, ".", settlementValue.decimalAmount] })),
28
+ sx: chipSx,
29
+ },
30
+ ];
31
+ return _jsx(StatusGroupChips, { chips: chips });
32
+ };
@@ -51,6 +51,12 @@ export interface AmountCellProps extends TableCellProps {
51
51
  currency?: string;
52
52
  conversionType?: 'fx' | 'dcc';
53
53
  amount?: number;
54
+ selectAmount?: number;
55
+ selectCurrency?: string;
56
+ requestAmount?: number;
57
+ requestCurrency?: string;
58
+ merchantAmount?: number;
59
+ merchantCurrency?: string;
54
60
  tooltipLabel?: React.ReactNode;
55
61
  amountTooltipLabel?: React.ReactNode;
56
62
  isTextShown?: boolean;
@@ -57,7 +57,7 @@ export declare const chargeTableCellWidth: {
57
57
  readonly amount: {
58
58
  readonly default: "170px";
59
59
  readonly text: "195px";
60
- readonly sheet: "141px";
60
+ readonly sheet: "550px";
61
61
  };
62
62
  readonly destinations: {
63
63
  readonly default: "70px";
@@ -57,7 +57,7 @@ export const chargeTableCellWidth = {
57
57
  amount: {
58
58
  default: '170px',
59
59
  text: '195px',
60
- sheet: '141px',
60
+ sheet: '550px',
61
61
  },
62
62
  destinations: {
63
63
  default: '70px',
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.0.197",
4
+ "version": "0.0.199",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",
@@ -90,7 +90,7 @@
90
90
  "react-hot-toast": "^2.4.1",
91
91
  "react-i18next": "^12.2.2",
92
92
  "react-multi-date-picker": "^4.1.2",
93
- "react-router-dom": "^6.14.2",
93
+ "react-router-dom": "^7.7.0",
94
94
  "react-virtualized-auto-sizer": "^1.0.20",
95
95
  "react-window": "^1.8.9",
96
96
  "react-window-infinite-loader": "^1.0.9",