tek-wallet 0.0.677 → 0.0.679
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/dist/components/TekWallet/SafeSvgRenderer.js +1 -1
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ActivityDetail/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ActivityItem/index.js +4 -2
- package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +7 -6
- package/dist/components/TekWallet/components/ui/AppBackDrop/index.js +1 -1
- package/dist/components/TekWallet/components/ui/BackArrow/index.js +3 -18
- package/dist/components/TekWallet/components/ui/CardHistorySwap/index.js +2 -1
- package/dist/components/TekWallet/components/ui/ConfirmInstruction/index.d.ts +17 -0
- package/dist/components/TekWallet/components/ui/ConfirmInstruction/index.js +102 -0
- package/dist/components/TekWallet/components/ui/ConfirmTransaction/index.js +2 -2
- package/dist/components/TekWallet/components/ui/CopyTextComponent/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.js +3 -2
- package/dist/components/TekWallet/components/ui/DialogContentLayout/index.js +1 -1
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +0 -1
- package/dist/components/TekWallet/components/ui/Fees/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/Fees/index.js +2 -3
- package/dist/components/TekWallet/components/ui/Formatter/functions/formatter.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/Formatter/functions/formatter.js +64 -0
- package/dist/components/TekWallet/components/ui/Formatter/functions/getStandardNumber.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/Formatter/functions/getStandardNumber.js +18 -0
- package/dist/components/TekWallet/components/ui/Formatter/functions/lengthFromDotToFirstNonZero.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/Formatter/functions/lengthFromDotToFirstNonZero.js +17 -0
- package/dist/components/TekWallet/components/ui/Formatter/index.d.ts +7 -15
- package/dist/components/TekWallet/components/ui/Formatter/index.js +65 -56
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +12 -4
- package/dist/components/TekWallet/components/ui/ModalCheckboxToken/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/ModalCheckboxToken/index.js +6 -2
- package/dist/components/TekWallet/components/ui/ModalDateFilter/index.js +3 -1
- package/dist/components/TekWallet/components/ui/ModalStatusFilter/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/ModalStatusFilter/index.js +6 -2
- package/dist/components/TekWallet/components/ui/NeonLineChart/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +3 -1
- package/dist/components/TekWallet/components/ui/OTP/index copy.js +1 -1
- package/dist/components/TekWallet/components/ui/OTP/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +47 -24
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +11 -6
- package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveCardHistory.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/ReceiveHistory/{DetailsReceiveHistory.d.ts → ReceiveHistoryDetails.d.ts} +3 -3
- package/dist/components/TekWallet/components/ui/ReceiveHistory/{DetailsReceiveHistory.js → ReceiveHistoryDetails.js} +17 -16
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.d.ts +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +10 -6
- package/dist/components/TekWallet/components/ui/SendExternalToken/index.js +5 -1
- package/dist/components/TekWallet/components/ui/SendInternalToken/index.js +1 -1
- package/dist/components/TekWallet/components/ui/StatusDisplay/index.js +1 -1
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +6 -5
- package/dist/components/TekWallet/components/ui/SwapToken/index.js +1 -1
- package/dist/components/TekWallet/components/ui/SwiperControlled/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TimeFilter/index.js +6 -2
- package/dist/components/TekWallet/components/ui/TokenSelection/index.js +3 -1
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.d.ts +22 -0
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.js +250 -0
- package/dist/components/TekWallet/components/ui/TransferConfirmation/type.d.ts +16 -0
- package/dist/components/TekWallet/components/ui/TransferConfirmation/type.js +2 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +9 -7
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.js +2 -2
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +1 -1
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +6 -2
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +7 -3
- package/dist/components/TekWallet/hooks/useBoolean.js +3 -1
- package/dist/components/TekWallet/hooks/useEventHandler.js +1 -1
- package/dist/components/TekWallet/hooks/useFormatter.js +1 -1
- package/dist/components/TekWallet/providers/ContentHiddenProvider/index.js +1 -1
- package/dist/components/TekWallet/providers/RealtimeProvider/index.d.ts +1 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +1 -1
- package/dist/components/TekWallet/providers/ThemeProvider/index.js +1 -1
- package/dist/components/TekWallet/services/axios/instructions-service/type.d.ts +1 -1
- package/dist/components/TekWallet/services/axios/send-internal-service/type.d.ts +1 -0
- package/dist/components/TekWallet/services/axios/swap-service/type.d.ts +1 -0
- package/dist/components/TekWallet/theme/mui/index.d.ts +1 -1
- package/dist/components/TekWallet/utils/compactWalletAddress.js +3 -1
- package/dist/components/TekWallet/utils/formatter.js +3 -1
- package/package.json +1 -1
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferAmount.d.ts +0 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferAmount.js +0 -58
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferInfo.d.ts +0 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferInfo.js +0 -152
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferTarget.d.ts +0 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferTarget.js +0 -65
|
@@ -13,6 +13,6 @@ var SafeSvgRenderer = function (_a) {
|
|
|
13
13
|
ADD_TAGS: ["use"],
|
|
14
14
|
ADD_ATTR: ["xlink:href"],
|
|
15
15
|
});
|
|
16
|
-
return (0, jsx_runtime_1.jsx)("div", { className: className, style: { width: width, height: height }, dangerouslySetInnerHTML: { __html: sanitizedSvg } });
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, style: { width: width, height: height }, dangerouslySetInnerHTML: { __html: sanitizedSvg } }));
|
|
17
17
|
};
|
|
18
18
|
exports.default = SafeSvgRenderer;
|
|
@@ -77,7 +77,7 @@ function ActivitiesTypeSlice(props) {
|
|
|
77
77
|
if (!activity)
|
|
78
78
|
return null;
|
|
79
79
|
var dataAsJson = JSON.stringify(activity);
|
|
80
|
-
return (0, jsx_runtime_1.jsx)(ActivityItem_1.default, { onClick: function () { return openDetail(activity); }, data: dataAsJson }, index);
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(ActivityItem_1.default, { onClick: function () { return openDetail(activity); }, data: dataAsJson }, index));
|
|
81
81
|
}) }) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_b = detailActivity === null || detailActivity === void 0 ? void 0 : detailActivity.transaction_type) === null || _b === void 0 ? void 0 : _b.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: detailActivity }) }) })] }))] }));
|
|
82
82
|
}
|
|
83
83
|
exports.default = ActivitiesTypeSlice;
|
|
@@ -84,7 +84,7 @@ function ActivityDetail(props) {
|
|
|
84
84
|
borderRadius: theme.mixins.customRadius.full,
|
|
85
85
|
border: isSwap ? "0.25rem white solid" : "none",
|
|
86
86
|
ml: "-0.5rem",
|
|
87
|
-
} }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: getAmountColor(), opacity: isSwap ? 0.5 : 1 }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat(currency === null || currency === void 0 ? void 0 : currency.name) }) }), isSwap && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: theme.palette.text.successStatus }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "+", value: swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.swap_total_amount, unit: " ".concat(swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.name) }) })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
87
|
+
} }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: getAmountColor(), opacity: isSwap ? 0.5 : 1 }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat(currency === null || currency === void 0 ? void 0 : currency.name) }) }), isSwap && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: theme.palette.text.successStatus }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "+", value: swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.swap_total_amount, unit: " ".concat(swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.name) }) })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
88
88
|
fontSize: theme.typography.fontSize12,
|
|
89
89
|
textTransform: "capitalize",
|
|
90
90
|
color: getStatusColor(),
|
|
@@ -65,7 +65,9 @@ function ActivityItem(props) {
|
|
|
65
65
|
if (isReceive) {
|
|
66
66
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["From: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.from_address)] });
|
|
67
67
|
}
|
|
68
|
-
var isSend = slug === type_1.TransactionSlug.Send ||
|
|
68
|
+
var isSend = slug === type_1.TransactionSlug.Send ||
|
|
69
|
+
slug === type_1.TransactionSlug.Withdrawn ||
|
|
70
|
+
slug === type_1.TransactionSlug.TransferInternal;
|
|
69
71
|
if (isSend) {
|
|
70
72
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["To: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.to_address)] });
|
|
71
73
|
}
|
|
@@ -93,7 +95,7 @@ function ActivityItem(props) {
|
|
|
93
95
|
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
94
96
|
width: "fit-content",
|
|
95
97
|
height: "fit-content",
|
|
96
|
-
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 12 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
98
|
+
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 12 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
97
99
|
fontSize: theme.typography.fontSize12,
|
|
98
100
|
textTransform: "capitalize",
|
|
99
101
|
color: getStatusColor(),
|
|
@@ -31,12 +31,13 @@ var fakeSeries = [
|
|
|
31
31
|
{
|
|
32
32
|
name: "All",
|
|
33
33
|
data: [
|
|
34
|
-
1003785.6864951615, 1003795.988344575, 1003827.99766239, 1003899.7426850981,
|
|
35
|
-
1003810.6439517767, 1003780.7195320514, 1003797.9506016063,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
1003785.6864951615, 1003795.988344575, 1003827.99766239, 1003899.7426850981,
|
|
35
|
+
1003891.7710159089, 1003810.6439517767, 1003780.7195320514, 1003797.9506016063,
|
|
36
|
+
1003781.455378438, 1003782.0072632281, 1003715.167883104, 1003724.9791682598,
|
|
37
|
+
1003716.6018329085, 1003711.3282671372, 1003686.1868489254, 1003625.4795220237,
|
|
38
|
+
1003584.3334449014, 1003498.9139435134, 1003310.7825506503, 1003339.72584186,
|
|
39
|
+
1003334.3069939599, 1003364.3540547496, 1003394.4011155394, 1003398.386950134,
|
|
40
|
+
1003233.005474726, 1003185.2981006557, 1003165.7981714085,
|
|
40
41
|
],
|
|
41
42
|
},
|
|
42
43
|
];
|
|
@@ -41,7 +41,7 @@ var AppBackDrop = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
41
41
|
}); });
|
|
42
42
|
return ((0, jsx_runtime_1.jsx)(material_2.Backdrop, __assign({ sx: __assign({ color: "text.white", zIndex: theme.zIndex.drawer + 1, "& .MuiBackdrop-root": {
|
|
43
43
|
backdropFilter: "blur(12px)",
|
|
44
|
-
} }, sx) }, rest, { open: open !== null && open !== void 0 ? open : isOpen, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "center", gap: theme.mixins.gaps.
|
|
44
|
+
} }, sx) }, rest, { open: open !== null && open !== void 0 ? open : isOpen, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "center", color: "white", gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 28, color: "inherit", value: 50, thickness: 4 }), message && (0, jsx_runtime_1.jsx)(Text_1.default, { children: message })] }) })));
|
|
45
45
|
});
|
|
46
46
|
AppBackDrop.displayName = "AppBackDrop";
|
|
47
47
|
exports.default = AppBackDrop;
|
|
@@ -10,26 +10,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
-
var
|
|
30
|
-
var
|
|
15
|
+
var material_1 = require("@mui/material");
|
|
16
|
+
var SvgPath_1 = require("../SvgPath");
|
|
31
17
|
var BackArrow = function (props) {
|
|
32
|
-
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ src: (0, getIcon_1.default)("arrow_back"), width: 24, sx: __assign({}, props.sx) }, rest)));
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: __assign({}, props.sx), children: SvgPath_1.IC_BACK }));
|
|
34
19
|
};
|
|
35
20
|
exports.default = BackArrow;
|
|
@@ -45,7 +45,8 @@ var CardHistorySwap = function (_a) {
|
|
|
45
45
|
maxHeight: "fit-content",
|
|
46
46
|
px: theme.mixins.customPadding.p4,
|
|
47
47
|
py: "2px",
|
|
48
|
-
}, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.row), { color: theme.palette.text.white, justifyContent: "center", fontSize: "9px", fontWeight: theme.typography.fontWeight600 }), children: status &&
|
|
48
|
+
}, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.row), { color: theme.palette.text.white, justifyContent: "center", fontSize: "9px", fontWeight: theme.typography.fontWeight600 }), children: status &&
|
|
49
|
+
(status === null || status === void 0 ? void 0 : status.charAt(0).toUpperCase()) + ((_b = status === null || status === void 0 ? void 0 : status.slice(1)) === null || _b === void 0 ? void 0 : _b.toLowerCase().replace(/_/g, " ")) }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight500, color: theme.palette.text.accent2 }), children: ["Amount:", (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: {
|
|
49
50
|
fontSize: theme.typography.fontSize12,
|
|
50
51
|
fontWeight: theme.typography.fontWeight500,
|
|
51
52
|
color: theme.palette.text.blackContrast,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { PropsWithChildren, HTMLAttributes } from "react";
|
|
2
|
+
import { BUTTON_STATUS } from "../Button";
|
|
3
|
+
import { InstructionBody } from "../../../services/axios/instructions-service/type";
|
|
4
|
+
import { GeneralProps } from "../../../types/ui";
|
|
5
|
+
type ConfirmInstructionProps = {
|
|
6
|
+
transactionSlug: string;
|
|
7
|
+
transactionData: Omit<InstructionBody, "passcode">;
|
|
8
|
+
renderChildren: (props: PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
|
9
|
+
status: BUTTON_STATUS;
|
|
10
|
+
}) => React.ReactElement<any>;
|
|
11
|
+
onStart?: (data: any) => void;
|
|
12
|
+
onSuccess?: (data: any) => void;
|
|
13
|
+
onError?: (data: any) => void;
|
|
14
|
+
onFinal?: (data: any) => void;
|
|
15
|
+
} & GeneralProps;
|
|
16
|
+
export declare function ConfirmInstructions({ renderChildren, transactionSlug, transactionData, onStart, onError, onFinal, onSuccess, }: ConfirmInstructionProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ConfirmInstructions;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
"use client";
|
|
4
|
+
var __assign = (this && this.__assign) || function () {
|
|
5
|
+
__assign = Object.assign || function(t) {
|
|
6
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7
|
+
s = arguments[i];
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
9
|
+
t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
26
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
+
function step(op) {
|
|
29
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
32
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
+
switch (op[0]) {
|
|
34
|
+
case 0: case 1: t = op; break;
|
|
35
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
+
default:
|
|
39
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
+
if (t[2]) _.ops.pop();
|
|
44
|
+
_.trys.pop(); continue;
|
|
45
|
+
}
|
|
46
|
+
op = body.call(thisArg, _);
|
|
47
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.ConfirmInstructions = ConfirmInstructions;
|
|
56
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
57
|
+
var react_1 = require("react");
|
|
58
|
+
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
59
|
+
var Button_1 = require("../Button");
|
|
60
|
+
var instructions_service_1 = __importDefault(require("../../../services/axios/instructions-service"));
|
|
61
|
+
function ConfirmInstructions(_a) {
|
|
62
|
+
var _this = this;
|
|
63
|
+
var renderChildren = _a.renderChildren, transactionSlug = _a.transactionSlug, transactionData = _a.transactionData, onStart = _a.onStart, onError = _a.onError, onFinal = _a.onFinal, onSuccess = _a.onSuccess;
|
|
64
|
+
var _b = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _b[0], setButtonStatus = _b[1];
|
|
65
|
+
var handleConfirmPasscode = function (passcode) { return __awaiter(_this, void 0, void 0, function () {
|
|
66
|
+
var response, err_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
_a.trys.push([0, 2, 3, 4]);
|
|
71
|
+
onStart === null || onStart === void 0 ? void 0 : onStart(transactionData);
|
|
72
|
+
setButtonStatus(Button_1.BUTTON_STATUS.LOADING);
|
|
73
|
+
return [4 /*yield*/, (0, instructions_service_1.default)(__assign(__assign({}, transactionData), { passcode: passcode }))];
|
|
74
|
+
case 1:
|
|
75
|
+
response = _a.sent();
|
|
76
|
+
if (response.success) {
|
|
77
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
78
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(response);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
82
|
+
onError === null || onError === void 0 ? void 0 : onError(response);
|
|
83
|
+
}
|
|
84
|
+
return [3 /*break*/, 4];
|
|
85
|
+
case 2:
|
|
86
|
+
err_1 = _a.sent();
|
|
87
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
88
|
+
onError === null || onError === void 0 ? void 0 : onError(err_1);
|
|
89
|
+
setTimeout(function () {
|
|
90
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
91
|
+
}, 1200);
|
|
92
|
+
return [3 /*break*/, 4];
|
|
93
|
+
case 3:
|
|
94
|
+
onFinal === null || onFinal === void 0 ? void 0 : onFinal(transactionData);
|
|
95
|
+
return [7 /*endfinally*/];
|
|
96
|
+
case 4: return [2 /*return*/];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}); };
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { customAction: transactionSlug, onConfirmSuccess: handleConfirmPasscode, children: renderChildren({ status: buttonStatus }) }));
|
|
101
|
+
}
|
|
102
|
+
exports.default = ConfirmInstructions;
|
|
@@ -61,7 +61,7 @@ function ConfirmTransaction(_a) {
|
|
|
61
61
|
var _this = this;
|
|
62
62
|
var renderChildren = _a.renderChildren, transactionSlug = _a.transactionSlug, transactionData = _a.transactionData, onTransferSuccess = _a.onTransferSuccess;
|
|
63
63
|
var _b = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _b[0], setButtonStatus = _b[1];
|
|
64
|
-
var
|
|
64
|
+
var handleConfirmPasscode = function (passcode) { return __awaiter(_this, void 0, void 0, function () {
|
|
65
65
|
var response, err_1;
|
|
66
66
|
return __generator(this, function (_a) {
|
|
67
67
|
switch (_a.label) {
|
|
@@ -91,6 +91,6 @@ function ConfirmTransaction(_a) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}); };
|
|
94
|
-
return ((0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { customAction: transactionSlug, onConfirmSuccess:
|
|
94
|
+
return ((0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { customAction: transactionSlug, onConfirmSuccess: handleConfirmPasscode, children: renderChildren({ status: buttonStatus }) }));
|
|
95
95
|
}
|
|
96
96
|
exports.default = ConfirmTransaction;
|
|
@@ -4,5 +4,5 @@ interface CopyTextComponentProps extends GeneralProps {
|
|
|
4
4
|
iconSuccess?: React.ReactNode;
|
|
5
5
|
hideTextMessage?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const CopyTextComponent: ({ value, iconSuccess, children, hideTextMessage, sx }: CopyTextComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const CopyTextComponent: ({ value, iconSuccess, children, hideTextMessage, sx, }: CopyTextComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default CopyTextComponent;
|
|
@@ -42,11 +42,12 @@ var DetailSwapResult = function (_a) {
|
|
|
42
42
|
var getInfoDetailOutputs = (0, react_1.useMemo)(function () {
|
|
43
43
|
return (getDetailOutputs === null || getDetailOutputs === void 0 ? void 0 : getDetailOutputs[0]) || {};
|
|
44
44
|
}, [getDetailOutputs]);
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: __assign({ color: theme.palette.text.black }, theme.mixins.pagePadding), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: __assign({ color: theme.palette.text.black, width: "100%" }, theme.mixins.pagePadding), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
46
46
|
px: theme.mixins.customPadding.p12,
|
|
47
47
|
position: "relative",
|
|
48
48
|
bottom: theme.typography.fontSize24,
|
|
49
|
-
}, children: (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "processing" ||
|
|
49
|
+
}, children: (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "processing" ||
|
|
50
|
+
(resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "failed" ? ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: onClose, sx: __assign(__assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), { color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, height: "40px" }), fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
50
51
|
fontSize: theme.typography.fontSize12,
|
|
51
52
|
fontWeight: theme.typography.fontWeight600,
|
|
52
53
|
leading: theme.typography.leading160,
|
|
@@ -34,7 +34,7 @@ function DialogContentLayout(props) {
|
|
|
34
34
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
35
35
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: __assign(__assign(__assign(__assign({}, theme.mixins.column), { borderRadius: theme.mixins.customRadius.r12, backgroundColor: theme.palette.background.black, boxShadow: theme.shadows[1], minWidth: "12rem" }), theme.mixins.dialogContent), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
36
36
|
padding: theme.mixins.customPadding.p12,
|
|
37
|
-
}, children: content }), !!actions && (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", height: "1px", backgroundColor: theme.palette.border.white16 } }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
37
|
+
}, children: content }), !!actions && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", height: "1px", backgroundColor: theme.palette.border.white16 } })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
38
38
|
px: theme.mixins.customPadding.p12,
|
|
39
39
|
width: "100%",
|
|
40
40
|
height: "fit-content",
|
|
@@ -87,7 +87,6 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
87
87
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
|
|
88
88
|
};
|
|
89
89
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ display: "block" }, sx), className: className, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(DrawerComponent, __assign({}, rest, { sx: {
|
|
90
|
-
border: "2px solid red",
|
|
91
90
|
"& .MuiDrawer-paper": {
|
|
92
91
|
backgroundColor: "transparent",
|
|
93
92
|
overflow: "hidden",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AccordionProps } from "@mui/material";
|
|
2
|
+
import { FeesDataType } from "../../../services/axios/get-est-fee-service/type";
|
|
2
3
|
export declare enum FeesStyle {
|
|
3
4
|
DEFAULT = "default",
|
|
4
5
|
WITH_BACKGROUND = "withBackground"
|
|
5
6
|
}
|
|
6
7
|
export interface FeesProps extends Omit<AccordionProps, "children"> {
|
|
7
|
-
feesData
|
|
8
|
+
feesData?: FeesDataType;
|
|
8
9
|
amount: number;
|
|
9
10
|
isFeePaidByAmount?: boolean;
|
|
10
11
|
setIsEnoughBalanceToPayFee?: (isEnough: boolean) => void;
|
|
@@ -33,7 +33,6 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
|
33
33
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
34
34
|
var Text_1 = __importDefault(require("../Text"));
|
|
35
35
|
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
36
|
-
var parsePropsData_1 = __importDefault(require("../../../utils/parsePropsData"));
|
|
37
36
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
38
37
|
var react_1 = require("react");
|
|
39
38
|
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
@@ -44,9 +43,9 @@ var FeesStyle;
|
|
|
44
43
|
FeesStyle["WITH_BACKGROUND"] = "withBackground";
|
|
45
44
|
})(FeesStyle || (exports.FeesStyle = FeesStyle = {}));
|
|
46
45
|
function Fees(props) {
|
|
47
|
-
var sx = props.sx, amount = props.amount,
|
|
46
|
+
var sx = props.sx, amount = props.amount, feesData = props.feesData, isFeePaidByAmount = props.isFeePaidByAmount, tokenSlug = props.tokenSlug, setIsEnoughBalanceToPayFee = props.setIsEnoughBalanceToPayFee, feesStyle = props.feesStyle, estimateReceive = props.estimateReceive, rest = __rest(props, ["sx", "amount", "feesData", "isFeePaidByAmount", "tokenSlug", "setIsEnoughBalanceToPayFee", "feesStyle", "estimateReceive"]);
|
|
48
47
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
49
|
-
|
|
48
|
+
// const feesData = parsePropsData<FeesDataType>(feesDataString);
|
|
50
49
|
var tokens = (0, useWalletData_1.default)().tokens;
|
|
51
50
|
var getBalanceUseToPaidFee = (0, react_1.useCallback)(function (tokenSlugMustBePaidFee) {
|
|
52
51
|
var _a;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatNumber = formatNumber;
|
|
7
|
+
var getStandardNumber_1 = __importDefault(require("./getStandardNumber"));
|
|
8
|
+
function formatNumber(num) {
|
|
9
|
+
if (num >= 1000000000000) {
|
|
10
|
+
return formatter((num / 1000000000000).toFixed(2)) + "T";
|
|
11
|
+
}
|
|
12
|
+
else if (num >= 1000000000) {
|
|
13
|
+
return formatter((num / 1000000000).toFixed(2)) + "B";
|
|
14
|
+
}
|
|
15
|
+
else if (num >= 1000000) {
|
|
16
|
+
return formatter((num / 1000000).toFixed(2)) + "M";
|
|
17
|
+
}
|
|
18
|
+
else if (num >= 1000) {
|
|
19
|
+
return formatter((num / 1000).toFixed(2)) + "K";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return num.toString();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
var formatter = function (value, useCompact, useCompactOnThousand, lengthAllowedPassed) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if (useCompact === void 0) { useCompact = true; }
|
|
28
|
+
if (useCompactOnThousand === void 0) { useCompactOnThousand = false; }
|
|
29
|
+
try {
|
|
30
|
+
if (value == undefined)
|
|
31
|
+
return "";
|
|
32
|
+
var lengthAllowed = lengthAllowedPassed !== null && lengthAllowedPassed !== void 0 ? lengthAllowedPassed : 8;
|
|
33
|
+
var thousandsSeparator = ",";
|
|
34
|
+
var number = Number(value.toString());
|
|
35
|
+
if (number > 1000 && useCompactOnThousand) {
|
|
36
|
+
return formatNumber(number);
|
|
37
|
+
}
|
|
38
|
+
if (number > 1000000 && useCompact) {
|
|
39
|
+
return formatNumber(number);
|
|
40
|
+
}
|
|
41
|
+
var numberToString = (0, getStandardNumber_1.default)(number);
|
|
42
|
+
if (numberToString.includes(".")) {
|
|
43
|
+
// is not natural number
|
|
44
|
+
var indexOfDecimalDot = numberToString.indexOf(".");
|
|
45
|
+
var before = numberToString.slice(0, indexOfDecimalDot);
|
|
46
|
+
var after = numberToString.slice(indexOfDecimalDot + 1, indexOfDecimalDot +
|
|
47
|
+
1 +
|
|
48
|
+
(lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1 <= 1 ? 2 : lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1));
|
|
49
|
+
var beforeFormatted = before.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator);
|
|
50
|
+
var afterFormatted = (_b = (_a = Number("0.".concat(after))) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.replace("0.", "");
|
|
51
|
+
return "".concat(beforeFormatted).concat(+afterFormatted ? "." + afterFormatted : "");
|
|
52
|
+
// return afterFormatted;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
//is natural number
|
|
56
|
+
return "".concat(number).replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.error(err);
|
|
61
|
+
return "--";
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.default = formatter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getStandardNumber(value: number | string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = getStandardNumber;
|
|
4
|
+
function getStandardNumber(value) {
|
|
5
|
+
var stringValue = "" + value;
|
|
6
|
+
if (!stringValue.includes("e-")) {
|
|
7
|
+
return stringValue;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
var beforeE = stringValue.slice(0, stringValue.indexOf("e-")).replace(".", "");
|
|
11
|
+
var afterE = stringValue.slice(stringValue.indexOf("e-") + 2);
|
|
12
|
+
var result = "";
|
|
13
|
+
for (var i = 0; i < +afterE + 1; i++) {
|
|
14
|
+
result += i != 1 ? "0" : ".";
|
|
15
|
+
}
|
|
16
|
+
return result + beforeE;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/components/TekWallet/components/ui/Formatter/functions/lengthFromDotToFirstNonZero.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function lengthFromDotToFirstNonZero(numString: string): number;
|
package/dist/components/TekWallet/components/ui/Formatter/functions/lengthFromDotToFirstNonZero.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = lengthFromDotToFirstNonZero;
|
|
4
|
+
function lengthFromDotToFirstNonZero(numString) {
|
|
5
|
+
var dotIndex = numString.indexOf(".");
|
|
6
|
+
if (dotIndex === -1) {
|
|
7
|
+
return -1;
|
|
8
|
+
}
|
|
9
|
+
var firstNonZeroIndex = dotIndex + 1;
|
|
10
|
+
while (firstNonZeroIndex < (numString === null || numString === void 0 ? void 0 : numString.length) && numString[firstNonZeroIndex] === "0") {
|
|
11
|
+
firstNonZeroIndex++;
|
|
12
|
+
}
|
|
13
|
+
if (firstNonZeroIndex >= (numString === null || numString === void 0 ? void 0 : numString.length)) {
|
|
14
|
+
return -1;
|
|
15
|
+
}
|
|
16
|
+
return firstNonZeroIndex - dotIndex - 1;
|
|
17
|
+
}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
interface FormatterProps extends
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BoxProps } from "@mui/material";
|
|
3
|
+
interface FormatterProps extends BoxProps {
|
|
4
4
|
value?: number | string;
|
|
5
5
|
start?: string;
|
|
6
6
|
unit?: string;
|
|
7
|
-
unitCustomStyle?: string;
|
|
8
7
|
lengthValueAllowed?: number;
|
|
9
|
-
noUnitSpacing?: boolean;
|
|
10
8
|
allowShowZero?: boolean;
|
|
11
9
|
useCompact?: boolean;
|
|
12
|
-
disableTooltip?: boolean;
|
|
13
|
-
isUnitStyle?: boolean;
|
|
14
|
-
disableAdjustUnitColor?: boolean;
|
|
15
|
-
isLessThan?: boolean;
|
|
16
|
-
overrideLessThanClass?: string;
|
|
17
|
-
unitStyle?: CSSProperties;
|
|
18
10
|
useCompactOnThousand?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
disableTooltip?: boolean;
|
|
12
|
+
showLessThan?: boolean;
|
|
13
|
+
isNotCurrency?: boolean;
|
|
14
|
+
className?: string;
|
|
23
15
|
}
|
|
24
16
|
declare const Formatter: React.FC<FormatterProps>;
|
|
25
17
|
export default Formatter;
|