@orderly.network/ui-tpsl 2.8.10 → 2.8.11-alpha.1
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.mjs
CHANGED
|
@@ -298,8 +298,7 @@ var usePNLInputBuilder = (props) => {
|
|
|
298
298
|
return {
|
|
299
299
|
onRenderBefore: (value2, options2) => {
|
|
300
300
|
value2 = `${value2}`;
|
|
301
|
-
if (value2 === "" || value2 === "-")
|
|
302
|
-
return "";
|
|
301
|
+
if (value2 === "" || value2 === "-") return "";
|
|
303
302
|
if (mode === "Offset%" /* PERCENTAGE */) {
|
|
304
303
|
return `${new Decimal(
|
|
305
304
|
value2.replace(
|
|
@@ -333,8 +332,7 @@ var usePNLInputBuilder = (props) => {
|
|
|
333
332
|
} else {
|
|
334
333
|
value2 = todpIfNeed(value2, dp);
|
|
335
334
|
}
|
|
336
|
-
if (value2 === "" || value2 === "-")
|
|
337
|
-
return "";
|
|
335
|
+
if (value2 === "" || value2 === "-") return "";
|
|
338
336
|
return value2;
|
|
339
337
|
}
|
|
340
338
|
};
|
|
@@ -372,12 +370,9 @@ var PNLInput = (props) => {
|
|
|
372
370
|
);
|
|
373
371
|
const color = useMemo(() => {
|
|
374
372
|
const num = Number(pnl);
|
|
375
|
-
if (isNaN(num) || num === 0)
|
|
376
|
-
|
|
377
|
-
if (num
|
|
378
|
-
return "oui-text-trade-profit";
|
|
379
|
-
if (num < 0)
|
|
380
|
-
return "oui-text-trade-loss";
|
|
373
|
+
if (isNaN(num) || num === 0) return "";
|
|
374
|
+
if (num > 0) return "oui-text-trade-profit";
|
|
375
|
+
if (num < 0) return "oui-text-trade-loss";
|
|
381
376
|
}, [pnl]);
|
|
382
377
|
useEffect(() => {
|
|
383
378
|
const label = modes.find((item) => item.value === mode)?.label;
|
|
@@ -889,14 +884,12 @@ var TPSL = (props) => {
|
|
|
889
884
|
const { t } = useTranslation();
|
|
890
885
|
const { isMobile } = useScreen();
|
|
891
886
|
const tpErrors = useMemo(() => {
|
|
892
|
-
if (!errors)
|
|
893
|
-
return null;
|
|
887
|
+
if (!errors) return null;
|
|
894
888
|
const { sl_trigger_price, ...rest } = errors;
|
|
895
889
|
return rest;
|
|
896
890
|
}, [errors]);
|
|
897
891
|
const slErrors = useMemo(() => {
|
|
898
|
-
if (!errors)
|
|
899
|
-
return null;
|
|
892
|
+
if (!errors) return null;
|
|
900
893
|
const { tp_trigger_price, ...rest } = errors;
|
|
901
894
|
return rest;
|
|
902
895
|
}, [errors]);
|
|
@@ -2242,8 +2235,7 @@ var CloseToLiqPriceIcon = ({
|
|
|
2242
2235
|
)
|
|
2243
2236
|
}
|
|
2244
2237
|
);
|
|
2245
|
-
if (!isSlPriceWarning || !slPriceError)
|
|
2246
|
-
return null;
|
|
2238
|
+
if (!isSlPriceWarning || !slPriceError) return null;
|
|
2247
2239
|
if (isMobile) {
|
|
2248
2240
|
return /* @__PURE__ */ jsx(
|
|
2249
2241
|
"button",
|
|
@@ -3611,5 +3603,5 @@ registerSimpleDialog(EditBracketOrderDialogId, EditBracketOrderWidget, {
|
|
|
3611
3603
|
});
|
|
3612
3604
|
|
|
3613
3605
|
export { ArrowRightIcon, CloseToLiqPriceIcon, EditBracketOrderDialogId, EditBracketOrderSheetId, EditBracketOrderWidget, PositionTPSLConfirm, PositionTPSLPopover, PositionTPSLSheet, TPSL, TPSLAdvancedDialogId, TPSLAdvancedSheetId, TPSLAdvancedUI, TPSLAdvancedWidget, TPSLDetailDialogId, TPSLDetailSheetId, TPSLDetailWidget, TPSLDialogId, TPSLPositionTypeWidget, TPSLSheetId, TPSLSimpleDialogId, TPSLSimpleDialogUI, TPSLSimpleDialogWidget, TPSLSimpleSheetId, TPSLWidget, useTPSLAdvanced, useTPSLBuilder, useTPSLSimpleDialog };
|
|
3614
|
-
//# sourceMappingURL=
|
|
3606
|
+
//# sourceMappingURL=index.mjs.map
|
|
3615
3607
|
//# sourceMappingURL=index.mjs.map
|