@orderly.network/ui-orders 3.0.0-beta.1 → 3.0.0-beta.10
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 +184 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +187 -107
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -47,67 +47,10 @@ var init_orders_script = __esm({
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
function parseBadgesFor(record) {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!!record.parent_algo_type) {
|
|
55
|
-
if (algoType === types.AlgoOrderType.STOP_LOSS) {
|
|
56
|
-
const types$1 = orderType === types.OrderType.CLOSE_POSITION ? [i18n.i18n.t("common.position"), i18n.i18n.t("tpsl.sl")] : [i18n.i18n.t("tpsl.sl")];
|
|
57
|
-
list.push(...types$1);
|
|
58
|
-
}
|
|
59
|
-
if (algoType === types.AlgoOrderType.TAKE_PROFIT) {
|
|
60
|
-
const types$1 = orderType === types.OrderType.CLOSE_POSITION ? [i18n.i18n.t("common.position"), i18n.i18n.t("tpsl.tp")] : [i18n.i18n.t("tpsl.tp")];
|
|
61
|
-
list.push(...types$1);
|
|
62
|
-
}
|
|
63
|
-
return list;
|
|
64
|
-
}
|
|
65
|
-
const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
|
|
66
|
-
if ([types.OrderType.ASK, types.OrderType.BID].includes(orderType)) {
|
|
67
|
-
return [i18n.i18n.t("orderEntry.orderType.limit")];
|
|
68
|
-
}
|
|
69
|
-
if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
|
|
70
|
-
const typeMap = {
|
|
71
|
-
[types.OrderType.LIMIT]: i18n.i18n.t("orderEntry.orderType.limit"),
|
|
72
|
-
[types.OrderType.MARKET]: i18n.i18n.t("orderEntry.orderType.market"),
|
|
73
|
-
[types.OrderType.POST_ONLY]: i18n.i18n.t("orderEntry.orderType.postOnly"),
|
|
74
|
-
[types.OrderType.IOC]: i18n.i18n.t("orderEntry.orderType.ioc"),
|
|
75
|
-
[types.OrderType.FOK]: i18n.i18n.t("orderEntry.orderType.fok")
|
|
76
|
-
};
|
|
77
|
-
return [
|
|
78
|
-
typeMap[type] || upperCaseFirstLetter(type)
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
if (algoType === types.AlgoOrderRootType.TRAILING_STOP) {
|
|
82
|
-
return [i18n.i18n.t("orderEntry.orderType.trailingStop")];
|
|
83
|
-
}
|
|
84
|
-
if (type) {
|
|
85
|
-
const typeMap = {
|
|
86
|
-
[types.OrderType.LIMIT]: i18n.i18n.t("orderEntry.orderType.stopLimit"),
|
|
87
|
-
[types.OrderType.MARKET]: i18n.i18n.t("orderEntry.orderType.stopMarket")
|
|
88
|
-
};
|
|
89
|
-
return [typeMap[type] || type];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (typeof algoType !== "undefined") {
|
|
93
|
-
const list = [];
|
|
94
|
-
if (algoType === types.AlgoOrderRootType.POSITIONAL_TP_SL) {
|
|
95
|
-
list.push(i18n.i18n.t("common.position"));
|
|
96
|
-
}
|
|
97
|
-
const tpOrder = record?.child_orders?.find(
|
|
98
|
-
(order) => order.algo_type === types.AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
|
|
99
|
-
);
|
|
100
|
-
const slOrder = record?.child_orders?.find(
|
|
101
|
-
(order) => order.algo_type === types.AlgoOrderType.STOP_LOSS && !!order.trigger_price
|
|
102
|
-
);
|
|
103
|
-
if (tpOrder || slOrder) {
|
|
104
|
-
list.push(
|
|
105
|
-
tpOrder && slOrder ? i18n.i18n.t("common.tpsl") : tpOrder ? i18n.i18n.t("tpsl.tp") : i18n.i18n.t("tpsl.sl")
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
return list;
|
|
109
|
-
}
|
|
110
|
-
return void 0;
|
|
50
|
+
const orderTypeBadges = getOrderTypeBadges(record);
|
|
51
|
+
const marginModeBadges = getMarginModeBadges(record);
|
|
52
|
+
const badges = [...orderTypeBadges, ...marginModeBadges];
|
|
53
|
+
return badges.length ? badges : void 0;
|
|
111
54
|
}
|
|
112
55
|
function grayCell(record) {
|
|
113
56
|
return record.status === types.OrderStatus.CANCELLED || record.algo_status === types.OrderStatus.CANCELLED;
|
|
@@ -211,7 +154,7 @@ function convertApiOrderTypeToOrderEntryType(order) {
|
|
|
211
154
|
}
|
|
212
155
|
return order.type;
|
|
213
156
|
}
|
|
214
|
-
var upperCaseFirstLetter;
|
|
157
|
+
var upperCaseFirstLetter, normalizeMarginMode, getMarginModeBadges, getOrderTypeBadges;
|
|
215
158
|
var init_util = __esm({
|
|
216
159
|
"src/utils/util.ts"() {
|
|
217
160
|
upperCaseFirstLetter = (str) => {
|
|
@@ -220,6 +163,88 @@ var init_util = __esm({
|
|
|
220
163
|
if (str.length === 1) return str.charAt(0).toUpperCase();
|
|
221
164
|
return str.charAt(0).toUpperCase() + str.toLowerCase().slice(1);
|
|
222
165
|
};
|
|
166
|
+
normalizeMarginMode = (value) => {
|
|
167
|
+
if (value === 1 || value === types.MarginMode.ISOLATED) {
|
|
168
|
+
return types.MarginMode.ISOLATED;
|
|
169
|
+
}
|
|
170
|
+
if (value === 0 || value === types.MarginMode.CROSS) {
|
|
171
|
+
return types.MarginMode.CROSS;
|
|
172
|
+
}
|
|
173
|
+
return void 0;
|
|
174
|
+
};
|
|
175
|
+
getMarginModeBadges = (record) => {
|
|
176
|
+
const marginMode = normalizeMarginMode(record?.margin_mode);
|
|
177
|
+
if (marginMode === types.MarginMode.ISOLATED) {
|
|
178
|
+
return [i18n.i18n.t("marginMode.isolated")];
|
|
179
|
+
}
|
|
180
|
+
if (marginMode === types.MarginMode.CROSS) {
|
|
181
|
+
return [i18n.i18n.t("marginMode.cross")];
|
|
182
|
+
}
|
|
183
|
+
return [];
|
|
184
|
+
};
|
|
185
|
+
getOrderTypeBadges = (record) => {
|
|
186
|
+
const orderType = record.type;
|
|
187
|
+
const algoType = record.algo_type;
|
|
188
|
+
if (typeof orderType !== "undefined") {
|
|
189
|
+
const list = [];
|
|
190
|
+
if (!!record.parent_algo_type) {
|
|
191
|
+
if (algoType === types.AlgoOrderType.STOP_LOSS) {
|
|
192
|
+
const types$1 = orderType === types.OrderType.CLOSE_POSITION ? [i18n.i18n.t("common.position"), i18n.i18n.t("tpsl.sl")] : [i18n.i18n.t("tpsl.sl")];
|
|
193
|
+
list.push(...types$1);
|
|
194
|
+
}
|
|
195
|
+
if (algoType === types.AlgoOrderType.TAKE_PROFIT) {
|
|
196
|
+
const types$1 = orderType === types.OrderType.CLOSE_POSITION ? [i18n.i18n.t("common.position"), i18n.i18n.t("tpsl.tp")] : [i18n.i18n.t("tpsl.tp")];
|
|
197
|
+
list.push(...types$1);
|
|
198
|
+
}
|
|
199
|
+
return list;
|
|
200
|
+
}
|
|
201
|
+
const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
|
|
202
|
+
if ([types.OrderType.ASK, types.OrderType.BID].includes(orderType)) {
|
|
203
|
+
return [i18n.i18n.t("orderEntry.orderType.limit")];
|
|
204
|
+
}
|
|
205
|
+
if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
|
|
206
|
+
const typeMap = {
|
|
207
|
+
[types.OrderType.LIMIT]: i18n.i18n.t("orderEntry.orderType.limit"),
|
|
208
|
+
[types.OrderType.MARKET]: i18n.i18n.t("orderEntry.orderType.market"),
|
|
209
|
+
[types.OrderType.POST_ONLY]: i18n.i18n.t("orderEntry.orderType.postOnly"),
|
|
210
|
+
[types.OrderType.IOC]: i18n.i18n.t("orderEntry.orderType.ioc"),
|
|
211
|
+
[types.OrderType.FOK]: i18n.i18n.t("orderEntry.orderType.fok")
|
|
212
|
+
};
|
|
213
|
+
return [
|
|
214
|
+
typeMap[type] || upperCaseFirstLetter(type)
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
if (algoType === types.AlgoOrderRootType.TRAILING_STOP) {
|
|
218
|
+
return [i18n.i18n.t("orderEntry.orderType.trailingStop")];
|
|
219
|
+
}
|
|
220
|
+
if (type) {
|
|
221
|
+
const typeMap = {
|
|
222
|
+
[types.OrderType.LIMIT]: i18n.i18n.t("orderEntry.orderType.stopLimit"),
|
|
223
|
+
[types.OrderType.MARKET]: i18n.i18n.t("orderEntry.orderType.stopMarket")
|
|
224
|
+
};
|
|
225
|
+
return [typeMap[type] || type];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (typeof algoType !== "undefined") {
|
|
229
|
+
const list = [];
|
|
230
|
+
if (algoType === types.AlgoOrderRootType.POSITIONAL_TP_SL) {
|
|
231
|
+
list.push(i18n.i18n.t("common.position"));
|
|
232
|
+
}
|
|
233
|
+
const tpOrder = record?.child_orders?.find(
|
|
234
|
+
(order) => order.algo_type === types.AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
|
|
235
|
+
);
|
|
236
|
+
const slOrder = record?.child_orders?.find(
|
|
237
|
+
(order) => order.algo_type === types.AlgoOrderType.STOP_LOSS && !!order.trigger_price
|
|
238
|
+
);
|
|
239
|
+
if (tpOrder || slOrder) {
|
|
240
|
+
list.push(
|
|
241
|
+
tpOrder && slOrder ? i18n.i18n.t("common.tpsl") : tpOrder ? i18n.i18n.t("tpsl.tp") : i18n.i18n.t("tpsl.sl")
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
return list;
|
|
245
|
+
}
|
|
246
|
+
return [];
|
|
247
|
+
};
|
|
223
248
|
}
|
|
224
249
|
});
|
|
225
250
|
var SymbolContext, useSymbolContext;
|
|
@@ -286,6 +311,7 @@ var init_shareButton_script = __esm({
|
|
|
286
311
|
const { sharePnLConfig, order, iconSize } = props;
|
|
287
312
|
const { t } = i18n.useTranslation();
|
|
288
313
|
const { getFirstRefCode } = hooks.useReferralInfo();
|
|
314
|
+
const { brokerNameRaw } = hooks.useBadgeBySymbol(order.symbol);
|
|
289
315
|
const refCode = React2.useMemo(() => {
|
|
290
316
|
return getFirstRefCode()?.code;
|
|
291
317
|
}, [getFirstRefCode]);
|
|
@@ -303,7 +329,8 @@ var init_shareButton_script = __esm({
|
|
|
303
329
|
},
|
|
304
330
|
refCode,
|
|
305
331
|
leverage,
|
|
306
|
-
...sharePnLConfig
|
|
332
|
+
...sharePnLConfig,
|
|
333
|
+
brokerName: sharePnLConfig?.brokerName ?? brokerNameRaw
|
|
307
334
|
}
|
|
308
335
|
});
|
|
309
336
|
};
|
|
@@ -1149,10 +1176,10 @@ var init_tpslOrderRowContext = __esm({
|
|
|
1149
1176
|
}
|
|
1150
1177
|
);
|
|
1151
1178
|
const getRelatedPosition = hooks.useMemoizedFn(
|
|
1152
|
-
(symbol) => {
|
|
1179
|
+
(symbol, marginMode) => {
|
|
1153
1180
|
const positions = config.cache.get(positionKey);
|
|
1154
1181
|
return positions?.data?.rows?.find(
|
|
1155
|
-
(p) => p.symbol === symbol
|
|
1182
|
+
(p) => p.symbol === symbol && (p.margin_mode ?? types.MarginMode.CROSS) === (marginMode ?? types.MarginMode.CROSS)
|
|
1156
1183
|
);
|
|
1157
1184
|
}
|
|
1158
1185
|
);
|
|
@@ -1170,12 +1197,12 @@ var init_tpslOrderRowContext = __esm({
|
|
|
1170
1197
|
});
|
|
1171
1198
|
React2.useEffect(() => {
|
|
1172
1199
|
if ("algo_type" in order || (order?.reduce_only ?? false)) {
|
|
1173
|
-
const position2 = getRelatedPosition(order.symbol);
|
|
1200
|
+
const position2 = getRelatedPosition(order.symbol, order.margin_mode);
|
|
1174
1201
|
if (position2) {
|
|
1175
1202
|
setPosition(position2);
|
|
1176
1203
|
}
|
|
1177
1204
|
}
|
|
1178
|
-
}, [order.symbol]);
|
|
1205
|
+
}, [getRelatedPosition, order.margin_mode, order.symbol]);
|
|
1179
1206
|
const memoizedValue = React2.useMemo(() => {
|
|
1180
1207
|
return {
|
|
1181
1208
|
order,
|
|
@@ -1990,6 +2017,29 @@ var init_triggerPriceCell = __esm({
|
|
|
1990
2017
|
};
|
|
1991
2018
|
}
|
|
1992
2019
|
});
|
|
2020
|
+
var OrderSymbolCell;
|
|
2021
|
+
var init_orderSymbolCell = __esm({
|
|
2022
|
+
"src/components/orderList/desktop/orderSymbolCell.tsx"() {
|
|
2023
|
+
OrderSymbolCell = (props) => {
|
|
2024
|
+
const { symbol, onSymbolChange } = props;
|
|
2025
|
+
const { brokerId, brokerName, brokerNameRaw } = hooks.useBadgeBySymbol(symbol);
|
|
2026
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2027
|
+
ui.Text.symbolBadge,
|
|
2028
|
+
{
|
|
2029
|
+
className: "oui-cursor-pointer",
|
|
2030
|
+
badge: brokerName ?? brokerId ?? void 0,
|
|
2031
|
+
fullName: brokerNameRaw,
|
|
2032
|
+
onClick: (e) => {
|
|
2033
|
+
onSymbolChange?.({ symbol });
|
|
2034
|
+
e.stopPropagation();
|
|
2035
|
+
e.preventDefault();
|
|
2036
|
+
},
|
|
2037
|
+
children: symbol
|
|
2038
|
+
}
|
|
2039
|
+
);
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
1993
2043
|
var Renew;
|
|
1994
2044
|
var init_renew = __esm({
|
|
1995
2045
|
"src/components/orderList/desktop/renew.tsx"() {
|
|
@@ -2361,31 +2411,25 @@ function instrument(option) {
|
|
|
2361
2411
|
},
|
|
2362
2412
|
render: (value, record) => {
|
|
2363
2413
|
const showGray = grayCell(record);
|
|
2364
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 2, children: [
|
|
2414
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 2, className: "oui-py-1", children: [
|
|
2365
2415
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2366
2416
|
"div",
|
|
2367
2417
|
{
|
|
2368
2418
|
className: ui.cn(
|
|
2369
|
-
"oui-h-
|
|
2419
|
+
"oui-h-[34px] oui-w-1 oui-shrink-0 oui-rounded-[1px]",
|
|
2370
2420
|
record.side === types.OrderSide.BUY ? "oui-bg-trade-profit" : "oui-bg-trade-loss"
|
|
2371
2421
|
)
|
|
2372
2422
|
}
|
|
2373
2423
|
),
|
|
2374
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", children: [
|
|
2424
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
|
|
2375
2425
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2376
|
-
|
|
2426
|
+
OrderSymbolCell,
|
|
2377
2427
|
{
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
onClick: (e) => {
|
|
2381
|
-
option?.onSymbolChange?.({ symbol: value });
|
|
2382
|
-
e.stopPropagation();
|
|
2383
|
-
e.preventDefault();
|
|
2384
|
-
},
|
|
2385
|
-
children: `${value.split("_")[1]}-PERP`
|
|
2428
|
+
symbol: value,
|
|
2429
|
+
onSymbolChange: option?.onSymbolChange
|
|
2386
2430
|
}
|
|
2387
2431
|
),
|
|
2388
|
-
option?.showType && /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { direction: "row", gap: 1, children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2432
|
+
option?.showType && /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { direction: "row", gap: 1, wrap: "wrap", children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2389
2433
|
ui.Badge,
|
|
2390
2434
|
{
|
|
2391
2435
|
color: e.toLocaleLowerCase() === "position" ? showGray ? "neutral" : "primary" : "neutral",
|
|
@@ -2913,6 +2957,7 @@ var init_useColumn = __esm({
|
|
|
2913
2957
|
init_quantityCell();
|
|
2914
2958
|
init_trailingCallbackCell();
|
|
2915
2959
|
init_triggerPriceCell();
|
|
2960
|
+
init_orderSymbolCell();
|
|
2916
2961
|
init_renew();
|
|
2917
2962
|
init_tpslEdit();
|
|
2918
2963
|
init_tpslPrice();
|
|
@@ -2931,7 +2976,7 @@ var init_useColumn = __esm({
|
|
|
2931
2976
|
case "all" /* all */:
|
|
2932
2977
|
return [
|
|
2933
2978
|
instrument({
|
|
2934
|
-
width:
|
|
2979
|
+
width: 200,
|
|
2935
2980
|
showType: true,
|
|
2936
2981
|
onSymbolChange,
|
|
2937
2982
|
enableSort: false
|
|
@@ -2969,7 +3014,7 @@ var init_useColumn = __esm({
|
|
|
2969
3014
|
case "pending" /* pending */:
|
|
2970
3015
|
return [
|
|
2971
3016
|
instrument({
|
|
2972
|
-
width:
|
|
3017
|
+
width: 200,
|
|
2973
3018
|
showType: true,
|
|
2974
3019
|
onSymbolChange,
|
|
2975
3020
|
enableSort: false
|
|
@@ -2993,7 +3038,7 @@ var init_useColumn = __esm({
|
|
|
2993
3038
|
case "tp_sl" /* tp_sl */:
|
|
2994
3039
|
return [
|
|
2995
3040
|
instrument({
|
|
2996
|
-
width:
|
|
3041
|
+
width: 200,
|
|
2997
3042
|
showType: true,
|
|
2998
3043
|
onSymbolChange,
|
|
2999
3044
|
enableSort: false
|
|
@@ -3011,7 +3056,7 @@ var init_useColumn = __esm({
|
|
|
3011
3056
|
return [
|
|
3012
3057
|
instrument({
|
|
3013
3058
|
showType: true,
|
|
3014
|
-
width:
|
|
3059
|
+
width: 200,
|
|
3015
3060
|
onSymbolChange
|
|
3016
3061
|
}),
|
|
3017
3062
|
// type({ width: 124 }),
|
|
@@ -3046,7 +3091,7 @@ var init_useColumn = __esm({
|
|
|
3046
3091
|
return [
|
|
3047
3092
|
instrument({
|
|
3048
3093
|
showType: true,
|
|
3049
|
-
width:
|
|
3094
|
+
width: 200,
|
|
3050
3095
|
onSymbolChange,
|
|
3051
3096
|
enableSort: false
|
|
3052
3097
|
}),
|
|
@@ -3070,7 +3115,7 @@ var init_useColumn = __esm({
|
|
|
3070
3115
|
return [
|
|
3071
3116
|
instrument({
|
|
3072
3117
|
showType: true,
|
|
3073
|
-
width:
|
|
3118
|
+
width: 200,
|
|
3074
3119
|
onSymbolChange
|
|
3075
3120
|
}),
|
|
3076
3121
|
// side({ width: 124 }),
|
|
@@ -3093,7 +3138,7 @@ var init_useColumn = __esm({
|
|
|
3093
3138
|
return [
|
|
3094
3139
|
instrument({
|
|
3095
3140
|
showType: true,
|
|
3096
|
-
width:
|
|
3141
|
+
width: 200,
|
|
3097
3142
|
onSymbolChange
|
|
3098
3143
|
}),
|
|
3099
3144
|
// side({ width: 124 }),
|
|
@@ -3131,10 +3176,23 @@ var init_useColumn = __esm({
|
|
|
3131
3176
|
};
|
|
3132
3177
|
}
|
|
3133
3178
|
});
|
|
3179
|
+
var SymbolBadge;
|
|
3180
|
+
var init_symbolBadge = __esm({
|
|
3181
|
+
"src/components/symbolBadge.tsx"() {
|
|
3182
|
+
SymbolBadge = (props) => {
|
|
3183
|
+
const { brokerId, brokerName, brokerNameRaw } = hooks.useBadgeBySymbol(
|
|
3184
|
+
props.symbol
|
|
3185
|
+
);
|
|
3186
|
+
const badge = brokerName ?? brokerId ?? void 0;
|
|
3187
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.SymbolBadge, { badge, fullName: brokerNameRaw });
|
|
3188
|
+
};
|
|
3189
|
+
}
|
|
3190
|
+
});
|
|
3134
3191
|
var SymbolToken, OrderTypeView, OrderTime, OrderState, Qty, Filled, EstTotal, TriggerPrice, MarkPrice, LimitPrice, TPTrigger, SLTrigger, TPPrice, SLPrice, TPSLQuantity, AvgPrice2, OrderPrice, RealizedPnL, MobileTooltip, Fee, TrailingCallback, TrailingPrice;
|
|
3135
3192
|
var init_items = __esm({
|
|
3136
3193
|
"src/components/orderList/mobile/items.tsx"() {
|
|
3137
3194
|
init_util();
|
|
3195
|
+
init_symbolBadge();
|
|
3138
3196
|
init_tpslOrderRowContext();
|
|
3139
3197
|
SymbolToken = (props) => {
|
|
3140
3198
|
const { item } = props;
|
|
@@ -3145,9 +3203,10 @@ var init_items = __esm({
|
|
|
3145
3203
|
{
|
|
3146
3204
|
intensity: 80,
|
|
3147
3205
|
rule: "symbol",
|
|
3148
|
-
formatString: "base
|
|
3206
|
+
formatString: "base",
|
|
3149
3207
|
size: "sm",
|
|
3150
3208
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { color: isBuy ? "success" : "danger", size: "xs", children: isBuy ? t("common.buy") : t("common.sell") }),
|
|
3209
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol }),
|
|
3151
3210
|
onClick: () => {
|
|
3152
3211
|
props.onSymbolChange?.({ symbol: item.symbol });
|
|
3153
3212
|
},
|
|
@@ -4082,6 +4141,7 @@ var ConfirmDialogContent;
|
|
|
4082
4141
|
var init_editDialogContent = __esm({
|
|
4083
4142
|
"src/components/orderList/mobile/editSheet/components/editDialogContent.tsx"() {
|
|
4084
4143
|
init_util();
|
|
4144
|
+
init_symbolBadge();
|
|
4085
4145
|
ConfirmDialogContent = (props) => {
|
|
4086
4146
|
const { item } = props;
|
|
4087
4147
|
const {
|
|
@@ -4104,16 +4164,19 @@ var init_editDialogContent = __esm({
|
|
|
4104
4164
|
}
|
|
4105
4165
|
),
|
|
4106
4166
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 2, mb: 3, mt: 2, justify: "between", children: [
|
|
4107
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4167
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", gap: 1, grow: true, children: [
|
|
4168
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4169
|
+
ui.Text.formatted,
|
|
4170
|
+
{
|
|
4171
|
+
rule: "symbol",
|
|
4172
|
+
formatString: "base",
|
|
4173
|
+
size: "base",
|
|
4174
|
+
showIcon: true,
|
|
4175
|
+
children: item.symbol
|
|
4176
|
+
}
|
|
4177
|
+
),
|
|
4178
|
+
/* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol })
|
|
4179
|
+
] }),
|
|
4117
4180
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "row", gap: 1, children: [
|
|
4118
4181
|
parseBadgesFor(item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4119
4182
|
ui.Badge,
|
|
@@ -4255,11 +4318,22 @@ var EditSheetHeader;
|
|
|
4255
4318
|
var init_editSheetHeader = __esm({
|
|
4256
4319
|
"src/components/orderList/mobile/editSheet/components/editSheetHeader.tsx"() {
|
|
4257
4320
|
init_util();
|
|
4321
|
+
init_symbolBadge();
|
|
4258
4322
|
EditSheetHeader = (props) => {
|
|
4259
4323
|
const { item } = props;
|
|
4260
4324
|
const { t } = i18n.useTranslation();
|
|
4261
4325
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { width: "100%", justify: "between", children: [
|
|
4262
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4326
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4327
|
+
ui.Text.formatted,
|
|
4328
|
+
{
|
|
4329
|
+
rule: "symbol",
|
|
4330
|
+
formatString: "base",
|
|
4331
|
+
showIcon: true,
|
|
4332
|
+
intensity: 80,
|
|
4333
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol }),
|
|
4334
|
+
children: item.symbol
|
|
4335
|
+
}
|
|
4336
|
+
),
|
|
4263
4337
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "row", gap: 1, children: [
|
|
4264
4338
|
parseBadgesFor(props.item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4265
4339
|
ui.Badge,
|
|
@@ -5397,15 +5471,21 @@ var init_useFormatOrderHistory = __esm({
|
|
|
5397
5471
|
if (!e.is_activated || !e.trigger_price) {
|
|
5398
5472
|
continue;
|
|
5399
5473
|
}
|
|
5400
|
-
|
|
5401
|
-
|
|
5474
|
+
_data.push({
|
|
5475
|
+
...e,
|
|
5476
|
+
parent_algo_type: element.algo_type,
|
|
5477
|
+
margin_mode: e.margin_mode ?? element.margin_mode
|
|
5478
|
+
});
|
|
5402
5479
|
}
|
|
5403
5480
|
} else {
|
|
5404
5481
|
for (let j = 0; j < element.child_orders.length; j++) {
|
|
5405
5482
|
const e = element.child_orders[j];
|
|
5406
5483
|
if (!!e && (e.algo_status === types.OrderStatus.FILLED || e.algo_status === types.OrderStatus.PARTIAL_FILLED)) {
|
|
5407
|
-
|
|
5408
|
-
|
|
5484
|
+
_data.push({
|
|
5485
|
+
...e,
|
|
5486
|
+
parent_algo_type: element.algo_type,
|
|
5487
|
+
margin_mode: e.margin_mode ?? element.margin_mode
|
|
5488
|
+
});
|
|
5409
5489
|
}
|
|
5410
5490
|
}
|
|
5411
5491
|
}
|
|
@@ -5512,7 +5592,7 @@ var init_orderList_script = __esm({
|
|
|
5512
5592
|
page: enableLoadMore || !manualPagination ? void 0 : page,
|
|
5513
5593
|
// pending and ts_sl list get all data
|
|
5514
5594
|
size: manualPagination ? pageSize : 500,
|
|
5515
|
-
sourceTypeAll: type === "orderHistory" /* orderHistory */,
|
|
5595
|
+
sourceTypeAll: type === "orderHistory" /* orderHistory */ || type === "filled" /* filled */,
|
|
5516
5596
|
dateRange,
|
|
5517
5597
|
includes,
|
|
5518
5598
|
excludes
|