@orderly.network/ui-order-entry 3.0.4 → 3.1.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 +143 -131
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -131
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -76,7 +76,7 @@ var AdditionalInfo = (props) => {
|
|
|
76
76
|
htmlFor: "toggle_order_post_only",
|
|
77
77
|
className: ui.cn(
|
|
78
78
|
"oui-postOnly-label",
|
|
79
|
-
"oui-
|
|
79
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
80
80
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
81
81
|
),
|
|
82
82
|
children: t("orderEntry.orderType.postOnly")
|
|
@@ -110,7 +110,7 @@ var AdditionalInfo = (props) => {
|
|
|
110
110
|
htmlFor: "toggle_order_iov",
|
|
111
111
|
className: ui.cn(
|
|
112
112
|
"oui-ioc-label",
|
|
113
|
-
"oui-
|
|
113
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
114
114
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
115
115
|
),
|
|
116
116
|
children: t("orderEntry.orderType.ioc")
|
|
@@ -144,7 +144,7 @@ var AdditionalInfo = (props) => {
|
|
|
144
144
|
htmlFor: "toggle_order_fok",
|
|
145
145
|
className: ui.cn(
|
|
146
146
|
"oui-fok-label",
|
|
147
|
-
"oui-
|
|
147
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
148
148
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
149
149
|
),
|
|
150
150
|
children: t("orderEntry.orderType.fok")
|
|
@@ -175,7 +175,7 @@ var AdditionalInfo = (props) => {
|
|
|
175
175
|
"label",
|
|
176
176
|
{
|
|
177
177
|
htmlFor: "toggle_order_confirm",
|
|
178
|
-
className: "oui-orderConfirm-label oui-
|
|
178
|
+
className: "oui-orderConfirm-label oui-ms-1 oui-text-2xs",
|
|
179
179
|
children: t("orderEntry.orderConfirm")
|
|
180
180
|
}
|
|
181
181
|
)
|
|
@@ -203,7 +203,7 @@ var AdditionalInfo = (props) => {
|
|
|
203
203
|
"label",
|
|
204
204
|
{
|
|
205
205
|
htmlFor: "toggle_order_hidden",
|
|
206
|
-
className: "oui-orderHidden-label oui-
|
|
206
|
+
className: "oui-orderHidden-label oui-ms-1 oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-text-2xs",
|
|
207
207
|
children: t("orderEntry.hidden")
|
|
208
208
|
}
|
|
209
209
|
)
|
|
@@ -229,7 +229,7 @@ var AdditionalInfo = (props) => {
|
|
|
229
229
|
"label",
|
|
230
230
|
{
|
|
231
231
|
htmlFor: "toggle_order_keep_visible",
|
|
232
|
-
className: "oui-keepVisible-label oui-
|
|
232
|
+
className: "oui-keepVisible-label oui-ms-1 oui-text-2xs",
|
|
233
233
|
children: t("orderEntry.keepVisible")
|
|
234
234
|
}
|
|
235
235
|
)
|
|
@@ -341,7 +341,7 @@ function AdvancedTPSLResult(props) {
|
|
|
341
341
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
342
342
|
ui.Text.numeral,
|
|
343
343
|
{
|
|
344
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
344
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
345
345
|
className: "oui-text-base-contrast",
|
|
346
346
|
dp: symbolInfo.quote_dp,
|
|
347
347
|
children: formattedOrder.tp_trigger_price ?? ""
|
|
@@ -353,7 +353,7 @@ function AdvancedTPSLResult(props) {
|
|
|
353
353
|
formattedOrder.tp_order_type === types.OrderType.LIMIT ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
354
354
|
ui.Text.numeral,
|
|
355
355
|
{
|
|
356
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
356
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
357
357
|
className: "oui-text-base-contrast",
|
|
358
358
|
dp: symbolInfo.quote_dp,
|
|
359
359
|
children: formattedOrder.tp_order_price ?? ""
|
|
@@ -365,7 +365,7 @@ function AdvancedTPSLResult(props) {
|
|
|
365
365
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
366
366
|
ui.Text.numeral,
|
|
367
367
|
{
|
|
368
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
368
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
369
369
|
coloring: true,
|
|
370
370
|
dp: 2,
|
|
371
371
|
children: Number(formattedOrder.tp_pnl)
|
|
@@ -418,7 +418,7 @@ function AdvancedTPSLResult(props) {
|
|
|
418
418
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
419
419
|
ui.Text.numeral,
|
|
420
420
|
{
|
|
421
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
421
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
422
422
|
className: "oui-text-base-contrast",
|
|
423
423
|
dp: symbolInfo.quote_dp,
|
|
424
424
|
children: formattedOrder.sl_trigger_price ?? ""
|
|
@@ -430,7 +430,7 @@ function AdvancedTPSLResult(props) {
|
|
|
430
430
|
formattedOrder.sl_order_type === types.OrderType.LIMIT ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
431
431
|
ui.Text.numeral,
|
|
432
432
|
{
|
|
433
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
433
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
434
434
|
className: "oui-text-base-contrast",
|
|
435
435
|
dp: symbolInfo.quote_dp,
|
|
436
436
|
children: formattedOrder.sl_order_price ?? ""
|
|
@@ -443,7 +443,7 @@ function AdvancedTPSLResult(props) {
|
|
|
443
443
|
ui.Text.numeral,
|
|
444
444
|
{
|
|
445
445
|
coloring: true,
|
|
446
|
-
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-
|
|
446
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
447
447
|
dp: 2,
|
|
448
448
|
children: Number(formattedOrder.sl_pnl)
|
|
449
449
|
}
|
|
@@ -645,7 +645,7 @@ var OrderConfirmDialog = (props) => {
|
|
|
645
645
|
unit: quote,
|
|
646
646
|
rule: "price",
|
|
647
647
|
className: "oui-text-base-contrast",
|
|
648
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
648
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
649
649
|
dp: quote_dp,
|
|
650
650
|
padding: false,
|
|
651
651
|
children: order.order_price
|
|
@@ -675,7 +675,7 @@ var OrderConfirmDialog = (props) => {
|
|
|
675
675
|
"oui-text-base-contrast",
|
|
676
676
|
colorType === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
677
677
|
),
|
|
678
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
678
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
679
679
|
dp: quote_dp,
|
|
680
680
|
padding: false,
|
|
681
681
|
children: price
|
|
@@ -981,7 +981,7 @@ var OrderItem = (props) => {
|
|
|
981
981
|
dp,
|
|
982
982
|
padding: false,
|
|
983
983
|
className: "oui-text-base-contrast",
|
|
984
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
984
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
985
985
|
children: value
|
|
986
986
|
}
|
|
987
987
|
)
|
|
@@ -1005,7 +1005,7 @@ var OrderTypeTag = (props) => {
|
|
|
1005
1005
|
default:
|
|
1006
1006
|
return "";
|
|
1007
1007
|
}
|
|
1008
|
-
}, [props.type]);
|
|
1008
|
+
}, [props.type, t]);
|
|
1009
1009
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { color: "neutral", size: "sm", children: typeStr });
|
|
1010
1010
|
};
|
|
1011
1011
|
var Dialog = (props) => {
|
|
@@ -1323,7 +1323,7 @@ var ScaledOrderConfirm = (props) => {
|
|
|
1323
1323
|
dp: base_dp,
|
|
1324
1324
|
padding: false,
|
|
1325
1325
|
intensity: 80,
|
|
1326
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
1326
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
1327
1327
|
children: totalQuantity
|
|
1328
1328
|
}
|
|
1329
1329
|
)
|
|
@@ -1338,7 +1338,7 @@ var ScaledOrderConfirm = (props) => {
|
|
|
1338
1338
|
dp: quote_dp,
|
|
1339
1339
|
padding: false,
|
|
1340
1340
|
intensity: 80,
|
|
1341
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
1341
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
1342
1342
|
children: national
|
|
1343
1343
|
}
|
|
1344
1344
|
)
|
|
@@ -1566,7 +1566,7 @@ var SlippageEditor = React3.forwardRef((props, ref) => {
|
|
|
1566
1566
|
item
|
|
1567
1567
|
);
|
|
1568
1568
|
}),
|
|
1569
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { dir: "ltr", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1570
1570
|
ui.Input,
|
|
1571
1571
|
{
|
|
1572
1572
|
suffix: "%",
|
|
@@ -1583,10 +1583,10 @@ var SlippageEditor = React3.forwardRef((props, ref) => {
|
|
|
1583
1583
|
"oui-h-[40px] oui-w-[74px]"
|
|
1584
1584
|
),
|
|
1585
1585
|
input: "oui-text-base-contrast",
|
|
1586
|
-
additional: "oui-
|
|
1586
|
+
additional: "oui-ps-1"
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
)
|
|
1589
|
+
) })
|
|
1590
1590
|
] }),
|
|
1591
1591
|
!!error && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mt: 5, className: "-oui-mb-5", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "2xs", color: "danger", children: error }) })
|
|
1592
1592
|
] });
|
|
@@ -1660,50 +1660,84 @@ var SlippageCell = (props) => {
|
|
|
1660
1660
|
)
|
|
1661
1661
|
}
|
|
1662
1662
|
),
|
|
1663
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1663
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1664
|
+
ui.Flex,
|
|
1665
|
+
{
|
|
1666
|
+
justify: "between",
|
|
1667
|
+
itemAlign: "center",
|
|
1668
|
+
gap: 1,
|
|
1669
|
+
className: "oui-orderEntry-slippage oui-w-full",
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1672
|
+
ui.Text,
|
|
1673
|
+
{
|
|
1674
|
+
className: "oui-slippage-label oui-shrink-0 oui-whitespace-nowrap",
|
|
1675
|
+
size: "2xs",
|
|
1676
|
+
children: t("orderEntry.slippage")
|
|
1677
|
+
}
|
|
1678
|
+
),
|
|
1679
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1680
|
+
uiConnector.AuthGuard,
|
|
1681
|
+
{
|
|
1682
|
+
fallback: () => /* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { size: "2xs", className: "oui-whitespace-nowrap", children: [
|
|
1683
|
+
t("orderEntry.slippage.est"),
|
|
1684
|
+
": -% / ",
|
|
1685
|
+
t("common.max"),
|
|
1686
|
+
": --%"
|
|
1687
|
+
] }),
|
|
1688
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1689
|
+
ui.Flex,
|
|
1690
|
+
{
|
|
1691
|
+
gap: 1,
|
|
1692
|
+
itemAlign: "center",
|
|
1693
|
+
justify: "end",
|
|
1694
|
+
className: "oui-slippage-value-container oui-min-w-0 oui-flex-1 oui-whitespace-nowrap",
|
|
1695
|
+
children: [
|
|
1696
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1697
|
+
ui.Text.numeral,
|
|
1698
|
+
{
|
|
1699
|
+
size: "2xs",
|
|
1700
|
+
rule: "percentages",
|
|
1701
|
+
prefix: `${t("orderEntry.slippage.est")}: `,
|
|
1702
|
+
suffix: ` / ${t("common.max")}: `,
|
|
1703
|
+
className: "oui-whitespace-nowrap",
|
|
1704
|
+
children: props.estSlippage ?? 0
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1708
|
+
"button",
|
|
1709
|
+
{
|
|
1710
|
+
className: "oui-slippage-edit-btn oui-shrink-0 oui-text-2xs",
|
|
1711
|
+
onClick: () => setOpen(),
|
|
1712
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1713
|
+
ui.Flex,
|
|
1714
|
+
{
|
|
1715
|
+
itemAlign: "center",
|
|
1716
|
+
className: "oui-gap-0.5 oui-whitespace-nowrap",
|
|
1717
|
+
as: "span",
|
|
1718
|
+
children: [
|
|
1719
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "2xs", className: "oui-text-primary", children: `${props.slippage || "-"}%` }),
|
|
1720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1721
|
+
ui.EditIcon,
|
|
1722
|
+
{
|
|
1723
|
+
className: "oui-slippage-edit-icon oui-text-primary oui-hidden md:oui-block",
|
|
1724
|
+
size: 12,
|
|
1725
|
+
opacity: 1
|
|
1726
|
+
}
|
|
1727
|
+
)
|
|
1728
|
+
]
|
|
1729
|
+
}
|
|
1730
|
+
)
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
]
|
|
1734
|
+
}
|
|
1735
|
+
)
|
|
1736
|
+
}
|
|
1737
|
+
)
|
|
1738
|
+
]
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1707
1741
|
] });
|
|
1708
1742
|
};
|
|
1709
1743
|
var SlippageUI = (props) => {
|
|
@@ -1762,7 +1796,7 @@ function AssetInfo(props) {
|
|
|
1762
1796
|
size: "2xs",
|
|
1763
1797
|
dp: props.dp,
|
|
1764
1798
|
className: "oui-estLiqPrice-value oui-text-base-contrast-80",
|
|
1765
|
-
unitClassName: "oui-
|
|
1799
|
+
unitClassName: "oui-ms-1 oui-text-base-contrast-36",
|
|
1766
1800
|
children: canTrade ? displayEstLiqPrice ?? "--" : "--"
|
|
1767
1801
|
}
|
|
1768
1802
|
)
|
|
@@ -1999,7 +2033,7 @@ var Available = (props) => {
|
|
|
1999
2033
|
unit: quote,
|
|
2000
2034
|
size: "2xs",
|
|
2001
2035
|
className: "oui-available-value oui-text-base-contrast-80",
|
|
2002
|
-
unitClassName: "oui-
|
|
2036
|
+
unitClassName: "oui-ms-1 oui-text-base-contrast-54",
|
|
2003
2037
|
dp: 2,
|
|
2004
2038
|
padding: false,
|
|
2005
2039
|
children: canTrade ? freeCollateral : 0
|
|
@@ -2323,7 +2357,7 @@ var QuantitySlider = React3.memo((props) => {
|
|
|
2323
2357
|
{
|
|
2324
2358
|
className: ui.textVariants({
|
|
2325
2359
|
size: "2xs",
|
|
2326
|
-
className: "oui-quantitySlider-maxQty-btn oui-
|
|
2360
|
+
className: "oui-quantitySlider-maxQty-btn oui-me-1"
|
|
2327
2361
|
}),
|
|
2328
2362
|
onClick: onMax,
|
|
2329
2363
|
"data-testid": "oui-testid-orderEntry-maxQty-value-button",
|
|
@@ -2639,7 +2673,7 @@ var OptionCard = (props) => {
|
|
|
2639
2673
|
className: ui.cn(
|
|
2640
2674
|
"oui-relative oui-w-full oui-rounded-md oui-p-2",
|
|
2641
2675
|
"oui-bg-base-6",
|
|
2642
|
-
"oui-text-
|
|
2676
|
+
"oui-text-start",
|
|
2643
2677
|
props.disabled ? "oui-cursor-not-allowed oui-opacity-50 oui-border oui-border-transparent" : props.selected ? "oui-border oui-border-[#38e2fe]" : "oui-border oui-border-transparent hover:oui-border-line-12",
|
|
2644
2678
|
!props.disabled && "oui-cursor-pointer"
|
|
2645
2679
|
),
|
|
@@ -2687,7 +2721,7 @@ var OptionCard = (props) => {
|
|
|
2687
2721
|
"div",
|
|
2688
2722
|
{
|
|
2689
2723
|
className: ui.cn(
|
|
2690
|
-
"oui-absolute -oui-
|
|
2724
|
+
"oui-absolute -oui-end-px -oui-top-px",
|
|
2691
2725
|
"oui-rounded-bl-md oui-rounded-tr-md",
|
|
2692
2726
|
"oui-bg-[#38e2fe] oui-px-1 oui-py-0.5"
|
|
2693
2727
|
),
|
|
@@ -2894,7 +2928,7 @@ var useMarginModeSettingsScript = (options2) => {
|
|
|
2894
2928
|
setIsOperationLoading(false);
|
|
2895
2929
|
}
|
|
2896
2930
|
},
|
|
2897
|
-
[brokerLockedKeys, selectedKeys, updateMarginMode]
|
|
2931
|
+
[brokerLockedKeys, selectedKeys, t, updateMarginMode]
|
|
2898
2932
|
);
|
|
2899
2933
|
const isLoading = isDataLoading || isMarginModesLoading || isOperationLoading || isSettingMarginMode;
|
|
2900
2934
|
return {
|
|
@@ -3000,8 +3034,8 @@ var MarginModeSettings = (props) => {
|
|
|
3000
3034
|
props.searchKeyword.trim() ? "oui-outline-primary-light" : ""
|
|
3001
3035
|
)
|
|
3002
3036
|
},
|
|
3003
|
-
prefix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-
|
|
3004
|
-
suffix: props.searchKeyword ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-
|
|
3037
|
+
prefix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-ps-3 oui-pe-1", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(SearchGlyph, { className: "oui-text-base-contrast-54" }) }),
|
|
3038
|
+
suffix: props.searchKeyword ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-pe-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3005
3039
|
ui.CloseCircleFillIcon,
|
|
3006
3040
|
{
|
|
3007
3041
|
size: 14,
|
|
@@ -3355,7 +3389,7 @@ var LeverageBadge = (props) => {
|
|
|
3355
3389
|
dp: 0,
|
|
3356
3390
|
rm: utils.Decimal.ROUND_DOWN,
|
|
3357
3391
|
unit: "x",
|
|
3358
|
-
unitClassName: "oui-
|
|
3392
|
+
unitClassName: "oui-ms-0",
|
|
3359
3393
|
children: curLeverage
|
|
3360
3394
|
}
|
|
3361
3395
|
)
|
|
@@ -3504,7 +3538,7 @@ var CustomInput = React3.forwardRef(
|
|
|
3504
3538
|
input: ui.cn("oui-mb-1 oui-mt-5 oui-h-5", props?.classNames?.input),
|
|
3505
3539
|
// prefix: cn(props.classNames?.prefix),
|
|
3506
3540
|
suffix: ui.cn(
|
|
3507
|
-
"oui-absolute oui-
|
|
3541
|
+
"oui-absolute oui-end-0 oui-top-0 oui-justify-start oui-py-2 oui-text-2xs oui-text-base-contrast-36",
|
|
3508
3542
|
props.classNames?.suffix
|
|
3509
3543
|
)
|
|
3510
3544
|
},
|
|
@@ -3520,7 +3554,7 @@ var InputLabel = (props) => {
|
|
|
3520
3554
|
{
|
|
3521
3555
|
htmlFor: props.id,
|
|
3522
3556
|
className: ui.cn(
|
|
3523
|
-
"oui-input-label oui-absolute oui-
|
|
3557
|
+
"oui-input-label oui-absolute oui-start-2 oui-top-[7px] oui-text-2xs oui-text-base-contrast-36",
|
|
3524
3558
|
props.className
|
|
3525
3559
|
),
|
|
3526
3560
|
children: props.children
|
|
@@ -3548,7 +3582,7 @@ var BBOOrderTypeSelect = (props) => {
|
|
|
3548
3582
|
value: types.BBOOrderType.QUEUE5
|
|
3549
3583
|
}
|
|
3550
3584
|
],
|
|
3551
|
-
[]
|
|
3585
|
+
[t]
|
|
3552
3586
|
);
|
|
3553
3587
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3554
3588
|
ui.Select.options,
|
|
@@ -3704,7 +3738,7 @@ var PriceInput = (props) => {
|
|
|
3704
3738
|
{
|
|
3705
3739
|
className: ui.cn(
|
|
3706
3740
|
"oui-orderEntry-bboSelect",
|
|
3707
|
-
"oui-absolute oui-bottom-1 oui-
|
|
3741
|
+
"oui-absolute oui-bottom-1 oui-start-0"
|
|
3708
3742
|
),
|
|
3709
3743
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3710
3744
|
BBOOrderTypeSelect,
|
|
@@ -3741,7 +3775,7 @@ var QuantityInput = React3.memo((props) => {
|
|
|
3741
3775
|
formatters: [ui.inputFormatter.dpFormatter(base_dp)],
|
|
3742
3776
|
onFocus: onFocus(3 /* QUANTITY */),
|
|
3743
3777
|
onBlur: onBlur(3 /* QUANTITY */),
|
|
3744
|
-
className: "oui-orderEntry-quantityInput !oui-rounded-
|
|
3778
|
+
className: "oui-orderEntry-quantityInput !oui-rounded-e",
|
|
3745
3779
|
classNames: {
|
|
3746
3780
|
suffix: "oui-justify-end"
|
|
3747
3781
|
}
|
|
@@ -3776,7 +3810,7 @@ var TotalTypeSelect = React3.memo((props) => {
|
|
|
3776
3810
|
trigger: ui.cn(
|
|
3777
3811
|
"oui-orderEntry-totalTypeSelect-btn",
|
|
3778
3812
|
"oui-w-auto oui-border-none oui-bg-transparent oui-shadow-none",
|
|
3779
|
-
"oui-absolute oui-
|
|
3813
|
+
"oui-absolute oui-start-0 oui-top-[5px] oui-text-2xs oui-text-base-contrast-36"
|
|
3780
3814
|
)
|
|
3781
3815
|
},
|
|
3782
3816
|
onValueChange: props.onChange,
|
|
@@ -3834,7 +3868,7 @@ var TotalInput = React3.memo((props) => {
|
|
|
3834
3868
|
formatters: [ui.inputFormatter.dpFormatter(2)],
|
|
3835
3869
|
onFocus: onFocus(6 /* MARGIN */),
|
|
3836
3870
|
onBlur: onBlur(6 /* MARGIN */),
|
|
3837
|
-
className: "oui-orderEntry-marginInput !oui-rounded-
|
|
3871
|
+
className: "oui-orderEntry-marginInput !oui-rounded-s",
|
|
3838
3872
|
classNames: {
|
|
3839
3873
|
suffix: "oui-justify-end"
|
|
3840
3874
|
}
|
|
@@ -3854,7 +3888,7 @@ var TotalInput = React3.memo((props) => {
|
|
|
3854
3888
|
onChange: (val) => {
|
|
3855
3889
|
setOrderValue("total", val);
|
|
3856
3890
|
},
|
|
3857
|
-
className: "oui-orderEntry-totalInput !oui-rounded-
|
|
3891
|
+
className: "oui-orderEntry-totalInput !oui-rounded-s",
|
|
3858
3892
|
classNames: {
|
|
3859
3893
|
suffix: "oui-justify-end"
|
|
3860
3894
|
},
|
|
@@ -3866,17 +3900,10 @@ var TotalInput = React3.memo((props) => {
|
|
|
3866
3900
|
});
|
|
3867
3901
|
TotalInput.displayName = "TotalInput";
|
|
3868
3902
|
var QtyAndTotalInput = React3.memo((props) => {
|
|
3869
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3870
|
-
|
|
3871
|
-
{
|
|
3872
|
-
|
|
3873
|
-
className: "oui-orderEntry-qtyAndTotal oui-group oui-space-x-1",
|
|
3874
|
-
children: [
|
|
3875
|
-
/* @__PURE__ */ jsxRuntime.jsx(QuantityInput, { order_quantity: props.order_quantity }),
|
|
3876
|
-
/* @__PURE__ */ jsxRuntime.jsx(TotalInput, { total: props.total })
|
|
3877
|
-
]
|
|
3878
|
-
}
|
|
3879
|
-
);
|
|
3903
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { cols: 2, className: "oui-orderEntry-qtyAndTotal oui-group oui-gap-1", children: [
|
|
3904
|
+
/* @__PURE__ */ jsxRuntime.jsx(QuantityInput, { order_quantity: props.order_quantity }),
|
|
3905
|
+
/* @__PURE__ */ jsxRuntime.jsx(TotalInput, { total: props.total })
|
|
3906
|
+
] });
|
|
3880
3907
|
});
|
|
3881
3908
|
QtyAndTotalInput.displayName = "QtyAndTotalInput";
|
|
3882
3909
|
var QuantityDistributionInput = React3.memo((props) => {
|
|
@@ -3967,7 +3994,7 @@ var QuantityDistributionHint = (props) => {
|
|
|
3967
3994
|
quantity: /* @__PURE__ */ jsxRuntime.jsx(DescendingQuantity, {})
|
|
3968
3995
|
}
|
|
3969
3996
|
];
|
|
3970
|
-
}, []);
|
|
3997
|
+
}, [t]);
|
|
3971
3998
|
const currentContent = React3.useMemo(() => {
|
|
3972
3999
|
return content.find((item) => item.type === type);
|
|
3973
4000
|
}, [content, type]);
|
|
@@ -3983,7 +4010,7 @@ var QuantityDistributionHint = (props) => {
|
|
|
3983
4010
|
intensity: type === item.type ? 500 : 600,
|
|
3984
4011
|
width: 78,
|
|
3985
4012
|
p: 2,
|
|
3986
|
-
className: "oui-cursor-pointer oui-rounded-
|
|
4013
|
+
className: "oui-cursor-pointer oui-rounded-s",
|
|
3987
4014
|
onClick: () => {
|
|
3988
4015
|
setType(item.type);
|
|
3989
4016
|
},
|
|
@@ -4001,10 +4028,10 @@ var QuantityDistributionHint = (props) => {
|
|
|
4001
4028
|
intensity: 500,
|
|
4002
4029
|
width: "100%",
|
|
4003
4030
|
className: ui.cn(
|
|
4004
|
-
"oui-rounded-
|
|
4005
|
-
type === types.DistributionType.FLAT && "oui-rounded-
|
|
4006
|
-
type === types.DistributionType.ASCENDING && "oui-rounded-
|
|
4007
|
-
type === types.DistributionType.DESCENDING && "oui-rounded-
|
|
4031
|
+
"oui-rounded-e",
|
|
4032
|
+
type === types.DistributionType.FLAT && "oui-rounded-es",
|
|
4033
|
+
type === types.DistributionType.ASCENDING && "oui-rounded-s",
|
|
4034
|
+
type === types.DistributionType.DESCENDING && "oui-rounded-ss"
|
|
4008
4035
|
),
|
|
4009
4036
|
children: [
|
|
4010
4037
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: currentContent?.formula }),
|
|
@@ -4066,7 +4093,7 @@ var QuantityDistribution = (props) => {
|
|
|
4066
4093
|
className: ui.cn(
|
|
4067
4094
|
"oui-quantityDistribution-option-label",
|
|
4068
4095
|
"oui-text-2xs",
|
|
4069
|
-
"oui-
|
|
4096
|
+
"oui-ms-1",
|
|
4070
4097
|
"oui-whitespace-nowrap oui-break-normal"
|
|
4071
4098
|
),
|
|
4072
4099
|
children: distributionTypeMap[type]
|
|
@@ -4400,7 +4427,7 @@ var ScaledQuantityUnit = (props) => {
|
|
|
4400
4427
|
classNames: {
|
|
4401
4428
|
trigger: ui.cn(
|
|
4402
4429
|
"oui-orderEntry-scaledQuantityUnit-btn",
|
|
4403
|
-
"oui-absolute oui-
|
|
4430
|
+
"oui-absolute oui-end-0 oui-top-1",
|
|
4404
4431
|
"oui-w-full oui-justify-end",
|
|
4405
4432
|
"oui-shadow-none"
|
|
4406
4433
|
)
|
|
@@ -4446,7 +4473,7 @@ var ScaledQuantityInput = React3.memo((props) => {
|
|
|
4446
4473
|
suffix,
|
|
4447
4474
|
id: "order_quantity_input",
|
|
4448
4475
|
name: "order_quantity_input",
|
|
4449
|
-
className: "oui-orderEntry-scaledOrder-quantityInput !oui-rounded-
|
|
4476
|
+
className: "oui-orderEntry-scaledOrder-quantityInput !oui-rounded-e",
|
|
4450
4477
|
value: props.order_quantity,
|
|
4451
4478
|
error: getErrorMsg(
|
|
4452
4479
|
"order_quantity",
|
|
@@ -4468,7 +4495,7 @@ var ScaledQuantityInput = React3.memo((props) => {
|
|
|
4468
4495
|
suffix,
|
|
4469
4496
|
id: "order_total_input",
|
|
4470
4497
|
name: "order_total_input",
|
|
4471
|
-
className: "oui-orderEntry-scaledOrder-totalInput !oui-rounded-
|
|
4498
|
+
className: "oui-orderEntry-scaledOrder-totalInput !oui-rounded-e",
|
|
4472
4499
|
value: props.total,
|
|
4473
4500
|
error: getErrorMsg("order_quantity", `${errors?.total?.value} ${quote}`),
|
|
4474
4501
|
onChange: (val) => {
|
|
@@ -4515,7 +4542,7 @@ var TotalOrdersInput = React3.memo((props) => {
|
|
|
4515
4542
|
label: t("orderEntry.totalOrders"),
|
|
4516
4543
|
placeholder: "2-20",
|
|
4517
4544
|
id: "order_total_orders_input",
|
|
4518
|
-
className: "oui-orderEntry-scaledOrder-totalOrdersInput !oui-rounded-
|
|
4545
|
+
className: "oui-orderEntry-scaledOrder-totalOrdersInput !oui-rounded-s",
|
|
4519
4546
|
value: props.total_orders,
|
|
4520
4547
|
error: getErrorMsg("total_orders"),
|
|
4521
4548
|
onChange: (val) => {
|
|
@@ -4546,7 +4573,7 @@ var ScaledOrderInput = (props) => {
|
|
|
4546
4573
|
ui.Grid,
|
|
4547
4574
|
{
|
|
4548
4575
|
cols: 2,
|
|
4549
|
-
className: "oui-scaledOrderInput-qtyAndOrders oui-group oui-
|
|
4576
|
+
className: "oui-scaledOrderInput-qtyAndOrders oui-group oui-gap-1",
|
|
4550
4577
|
children: [
|
|
4551
4578
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4552
4579
|
ScaledQuantityInput,
|
|
@@ -4684,7 +4711,7 @@ var TrailingCallbackSelect = React3.memo(
|
|
|
4684
4711
|
classNames: {
|
|
4685
4712
|
trigger: ui.cn(
|
|
4686
4713
|
"oui-orderEntry-trailingCallbackSelect-btn",
|
|
4687
|
-
"oui-absolute oui-
|
|
4714
|
+
"oui-absolute oui-end-0 oui-top-1",
|
|
4688
4715
|
"oui-w-[124px] oui-justify-end",
|
|
4689
4716
|
"oui-text-base-contrast-36"
|
|
4690
4717
|
)
|
|
@@ -4787,7 +4814,7 @@ var TrailingCallbackInput = React3.memo(
|
|
|
4787
4814
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4788
4815
|
CallbackRatePercentages,
|
|
4789
4816
|
{
|
|
4790
|
-
className: "oui-trailingCallback-percentages oui-absolute oui-bottom-1 oui-
|
|
4817
|
+
className: "oui-trailingCallback-percentages oui-absolute oui-bottom-1 oui-start-2",
|
|
4791
4818
|
callback_rate
|
|
4792
4819
|
}
|
|
4793
4820
|
)
|
|
@@ -5161,7 +5188,7 @@ var PNLInput = (props) => {
|
|
|
5161
5188
|
onBlur();
|
|
5162
5189
|
},
|
|
5163
5190
|
suffix: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5164
|
-
isPercentageMode && !!value && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "2xs", color: "inherit", className: "oui-
|
|
5191
|
+
isPercentageMode && !!value && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "2xs", color: "inherit", className: "oui-ms-[2px]", children: "%" }),
|
|
5165
5192
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5166
5193
|
PNLMenus,
|
|
5167
5194
|
{
|
|
@@ -5220,7 +5247,7 @@ var PnlInputProvider = (props) => {
|
|
|
5220
5247
|
{
|
|
5221
5248
|
rule: "percentages",
|
|
5222
5249
|
className: ui.cn(
|
|
5223
|
-
"oui-
|
|
5250
|
+
"oui-ms-1 oui-text-xs",
|
|
5224
5251
|
type === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
5225
5252
|
),
|
|
5226
5253
|
children: values.ROI
|
|
@@ -5230,14 +5257,14 @@ var PnlInputProvider = (props) => {
|
|
|
5230
5257
|
{
|
|
5231
5258
|
rule: "price",
|
|
5232
5259
|
className: ui.cn(
|
|
5233
|
-
"oui-
|
|
5260
|
+
"oui-ms-1 oui-text-xs",
|
|
5234
5261
|
type === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
5235
5262
|
),
|
|
5236
5263
|
children: values.PnL
|
|
5237
5264
|
}
|
|
5238
5265
|
)
|
|
5239
5266
|
] });
|
|
5240
|
-
}, [mode, values.ROI, values.PnL, values.trigger_price]);
|
|
5267
|
+
}, [mode, t, type, values.ROI, values.PnL, values.trigger_price]);
|
|
5241
5268
|
const memoizedValue = React3.useMemo(() => {
|
|
5242
5269
|
return { mode, setMode, tipsEle };
|
|
5243
5270
|
}, [mode, setMode, tipsEle]);
|
|
@@ -5450,7 +5477,6 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5450
5477
|
const { t } = i18n.useTranslation();
|
|
5451
5478
|
const { errorMsgVisible } = useOrderEntryContext();
|
|
5452
5479
|
const { tipsEle } = usePnlInputContext();
|
|
5453
|
-
const [prefix, setPrefix] = React3.useState(`${props.type} Price`);
|
|
5454
5480
|
const [placeholder, setPlaceholder] = React3.useState("USDC");
|
|
5455
5481
|
const [tipVisible, setTipVisible] = React3.useState(false);
|
|
5456
5482
|
const [isFocused, setIsFocused] = React3.useState(false);
|
|
@@ -5475,31 +5501,17 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5475
5501
|
tipsEle,
|
|
5476
5502
|
props.displayErrorMessage
|
|
5477
5503
|
]);
|
|
5478
|
-
const
|
|
5479
|
-
let _prefix = props.type === "TP" ? t("tpsl.tpPrice") : t("tpsl.slPrice");
|
|
5480
|
-
if (trigger_price) {
|
|
5481
|
-
_prefix = props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl");
|
|
5482
|
-
}
|
|
5483
|
-
return _prefix;
|
|
5484
|
-
};
|
|
5504
|
+
const prefix = isFocused || innerValue ? props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl") : props.type === "TP" ? t("tpsl.tpPrice") : t("tpsl.slPrice");
|
|
5485
5505
|
const onValueChange = (value) => {
|
|
5486
5506
|
setInnerValue(value);
|
|
5487
5507
|
props.onChange(value);
|
|
5488
5508
|
};
|
|
5489
|
-
React3.useEffect(() => {
|
|
5490
|
-
setPrefix(getPrefixLabel(props.values.trigger_price));
|
|
5491
|
-
if (!isFocused) {
|
|
5492
|
-
setInnerValue(props.values.trigger_price ?? "");
|
|
5493
|
-
}
|
|
5494
|
-
}, [props.type, props.values.trigger_price]);
|
|
5495
5509
|
const onFocus = () => {
|
|
5496
|
-
setPrefix(props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl"));
|
|
5497
5510
|
setPlaceholder("");
|
|
5498
5511
|
setTipVisible(true);
|
|
5499
5512
|
setIsFocused(true);
|
|
5500
5513
|
};
|
|
5501
5514
|
const onBlur = () => {
|
|
5502
|
-
setPrefix(getPrefixLabel(props.values.trigger_price));
|
|
5503
5515
|
setPlaceholder("USDC");
|
|
5504
5516
|
setTipVisible(false);
|
|
5505
5517
|
setIsFocused(false);
|
|
@@ -5528,10 +5540,10 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5528
5540
|
additional: "oui-text-base-contrast-54",
|
|
5529
5541
|
root: ui.cn(
|
|
5530
5542
|
"oui-orderEntry-tpsl-triggerPrice",
|
|
5531
|
-
"oui-
|
|
5543
|
+
"oui-pe-2 md:oui-pe-3",
|
|
5532
5544
|
props.classNames?.root
|
|
5533
5545
|
),
|
|
5534
|
-
prefix: ui.cn("oui-
|
|
5546
|
+
prefix: ui.cn("oui-pe-1 md:oui-pe-2", props.classNames?.prefix),
|
|
5535
5547
|
input: ui.cn(
|
|
5536
5548
|
"oui-text-2xs placeholder:oui-text-2xs",
|
|
5537
5549
|
props.classNames?.input
|
|
@@ -6096,7 +6108,7 @@ var OrderEntry = (props) => {
|
|
|
6096
6108
|
},
|
|
6097
6109
|
className: ui.cn(
|
|
6098
6110
|
"oui-additional-pin-btn",
|
|
6099
|
-
"oui-group oui-absolute oui-
|
|
6111
|
+
"oui-group oui-absolute oui-end-2 oui-top-2"
|
|
6100
6112
|
),
|
|
6101
6113
|
"data-testid": "oui-testid-orderEntry-pinned-button"
|
|
6102
6114
|
}
|
|
@@ -6121,7 +6133,7 @@ var OrderEntry = (props) => {
|
|
|
6121
6133
|
content: ui.cn(
|
|
6122
6134
|
"oui-tpslAdvanced-sheet",
|
|
6123
6135
|
"oui-rounded-[16px] oui-border-none !oui-p-0",
|
|
6124
|
-
isMobile ? "oui-inset-y-0 oui-
|
|
6136
|
+
isMobile ? "oui-inset-y-0 oui-end-0 oui-w-[280px]" : "!oui-bottom-[40px] oui-end-3 oui-top-[44px] !oui-h-auto oui-w-[360px]"
|
|
6125
6137
|
)
|
|
6126
6138
|
},
|
|
6127
6139
|
contentProps: { side: "right", closeable: false },
|