@tap-payments/os-micro-frontend-shared 0.1.222 → 0.1.223
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/BalanceCell/BalanceCell.js +1 -1
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellSheet.d.ts +1 -1
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellSheet.js +2 -4
- package/build/components/TableCells/CustomCells/BalanceCell/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/index.js +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/type.d.ts +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.js +1 -1
- package/build/constants/table/cell/refundTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/refundTableCellWidth.js +1 -1
- package/package.json +1 -1
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellText.d.ts +0 -3
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellText.js +0 -44
|
@@ -21,7 +21,7 @@ import { BalanceCellContainer, PercentageContainer } from './style';
|
|
|
21
21
|
import { formatPercentage } from './utils';
|
|
22
22
|
import { PiePercentage } from '../style';
|
|
23
23
|
function BalanceCell(_a) {
|
|
24
|
-
var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
24
|
+
var { percentage = 0, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
27
27
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BalanceCellSheetProps } from './type';
|
|
2
|
-
declare function BalanceCellSheet({
|
|
2
|
+
declare function BalanceCellSheet({ remainingAmount, currency, selectionProps }: BalanceCellSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BalanceCellSheet;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CurrencyIcon, StatusChipWithCopy } from '../../../index.js';
|
|
3
3
|
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
4
|
-
function BalanceCellSheet({
|
|
4
|
+
function BalanceCellSheet({ remainingAmount, currency, selectionProps }) {
|
|
5
5
|
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
6
6
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
7
7
|
const amount = `${integerAmount}.${decimalAmount}`;
|
|
8
|
-
|
|
9
|
-
return null;
|
|
10
|
-
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [percentage, "% | Remaining balance - ", currencyIcon, " ", amount] })));
|
|
8
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [currencyIcon, " ", amount] })));
|
|
11
9
|
}
|
|
12
10
|
export default BalanceCellSheet;
|
package/package.json
CHANGED
|
@@ -1,44 +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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useMemo } from 'react';
|
|
14
|
-
import { useTheme } from '@mui/material/styles';
|
|
15
|
-
import Tooltip from '../../../Tooltip';
|
|
16
|
-
import { TableCell } from '../../../TableCells';
|
|
17
|
-
import { CurrencyIcon } from '../../../index.js';
|
|
18
|
-
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
19
|
-
import { BalanceCellContainer } from './style';
|
|
20
|
-
import { TextLabel } from '../style';
|
|
21
|
-
function BalanceCellText(_a) {
|
|
22
|
-
var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
23
|
-
const theme = useTheme();
|
|
24
|
-
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
25
|
-
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
26
|
-
const amount = `${integerAmount}.${decimalAmount}`;
|
|
27
|
-
const generatedTooltip = useMemo(() => {
|
|
28
|
-
return (_jsxs(_Fragment, { children: ["Remaining Authorized Balance - ", currencyIcon, " ", amount] }));
|
|
29
|
-
}, [remainingAmount, currency]);
|
|
30
|
-
if (percentage === 0)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx("div", Object.assign({ style: {
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'flex-start',
|
|
36
|
-
gap: '8px',
|
|
37
|
-
} }, { children: _jsx(Tooltip, Object.assign({ title: generatedTooltip }, { children: _jsx(BalanceCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", sx: {
|
|
38
|
-
zIndex: 22,
|
|
39
|
-
height: 'auto',
|
|
40
|
-
padding: '0',
|
|
41
|
-
backgroundColor: `${theme.palette.grey.A700}1a`,
|
|
42
|
-
} }, { children: _jsxs(TextLabel, { children: [percentage, "%"] }) })) })) })) })));
|
|
43
|
-
}
|
|
44
|
-
export default BalanceCellText;
|