@orderly.network/ui-tpsl 2.8.10 → 2.8.11-alpha.0
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/index.js +9 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -300,8 +300,7 @@ var usePNLInputBuilder = (props) => {
|
|
|
300
300
|
return {
|
|
301
301
|
onRenderBefore: (value2, options2) => {
|
|
302
302
|
value2 = `${value2}`;
|
|
303
|
-
if (value2 === "" || value2 === "-")
|
|
304
|
-
return "";
|
|
303
|
+
if (value2 === "" || value2 === "-") return "";
|
|
305
304
|
if (mode === "Offset%" /* PERCENTAGE */) {
|
|
306
305
|
return `${new utils.Decimal(
|
|
307
306
|
value2.replace(
|
|
@@ -335,8 +334,7 @@ var usePNLInputBuilder = (props) => {
|
|
|
335
334
|
} else {
|
|
336
335
|
value2 = utils.todpIfNeed(value2, dp);
|
|
337
336
|
}
|
|
338
|
-
if (value2 === "" || value2 === "-")
|
|
339
|
-
return "";
|
|
337
|
+
if (value2 === "" || value2 === "-") return "";
|
|
340
338
|
return value2;
|
|
341
339
|
}
|
|
342
340
|
};
|
|
@@ -374,12 +372,9 @@ var PNLInput = (props) => {
|
|
|
374
372
|
);
|
|
375
373
|
const color = react.useMemo(() => {
|
|
376
374
|
const num = Number(pnl);
|
|
377
|
-
if (isNaN(num) || num === 0)
|
|
378
|
-
|
|
379
|
-
if (num
|
|
380
|
-
return "oui-text-trade-profit";
|
|
381
|
-
if (num < 0)
|
|
382
|
-
return "oui-text-trade-loss";
|
|
375
|
+
if (isNaN(num) || num === 0) return "";
|
|
376
|
+
if (num > 0) return "oui-text-trade-profit";
|
|
377
|
+
if (num < 0) return "oui-text-trade-loss";
|
|
383
378
|
}, [pnl]);
|
|
384
379
|
react.useEffect(() => {
|
|
385
380
|
const label = modes.find((item) => item.value === mode)?.label;
|
|
@@ -891,14 +886,12 @@ var TPSL = (props) => {
|
|
|
891
886
|
const { t } = i18n.useTranslation();
|
|
892
887
|
const { isMobile } = ui.useScreen();
|
|
893
888
|
const tpErrors = react.useMemo(() => {
|
|
894
|
-
if (!errors)
|
|
895
|
-
return null;
|
|
889
|
+
if (!errors) return null;
|
|
896
890
|
const { sl_trigger_price, ...rest } = errors;
|
|
897
891
|
return rest;
|
|
898
892
|
}, [errors]);
|
|
899
893
|
const slErrors = react.useMemo(() => {
|
|
900
|
-
if (!errors)
|
|
901
|
-
return null;
|
|
894
|
+
if (!errors) return null;
|
|
902
895
|
const { tp_trigger_price, ...rest } = errors;
|
|
903
896
|
return rest;
|
|
904
897
|
}, [errors]);
|
|
@@ -2244,8 +2237,7 @@ var CloseToLiqPriceIcon = ({
|
|
|
2244
2237
|
)
|
|
2245
2238
|
}
|
|
2246
2239
|
);
|
|
2247
|
-
if (!isSlPriceWarning || !slPriceError)
|
|
2248
|
-
return null;
|
|
2240
|
+
if (!isSlPriceWarning || !slPriceError) return null;
|
|
2249
2241
|
if (isMobile) {
|
|
2250
2242
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2251
2243
|
"button",
|
|
@@ -3639,5 +3631,5 @@ exports.TPSLWidget = TPSLWidget;
|
|
|
3639
3631
|
exports.useTPSLAdvanced = useTPSLAdvanced;
|
|
3640
3632
|
exports.useTPSLBuilder = useTPSLBuilder;
|
|
3641
3633
|
exports.useTPSLSimpleDialog = useTPSLSimpleDialog;
|
|
3642
|
-
//# sourceMappingURL=
|
|
3634
|
+
//# sourceMappingURL=index.js.map
|
|
3643
3635
|
//# sourceMappingURL=index.js.map
|