@kodiak-finance/orderly-ui-orders 2.9.1-alpha.0 → 2.9.1-alpha.2
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 +168 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +171 -122
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -9,8 +9,8 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
9
9
|
var orderlyUi = require('@kodiak-finance/orderly-ui');
|
|
10
10
|
var orderlyReactApp = require('@kodiak-finance/orderly-react-app');
|
|
11
11
|
var orderlyUiTpsl = require('@kodiak-finance/orderly-ui-tpsl');
|
|
12
|
-
var dateFns = require('date-fns');
|
|
13
12
|
var orderlyUiShare = require('@kodiak-finance/orderly-ui-share');
|
|
13
|
+
var dateFns = require('date-fns');
|
|
14
14
|
var orderlyUiConnector = require('@kodiak-finance/orderly-ui-connector');
|
|
15
15
|
|
|
16
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -43,67 +43,10 @@ var init_orders_script = __esm({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
function parseBadgesFor(record) {
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!!record.parent_algo_type) {
|
|
51
|
-
if (algoType === orderlyTypes.AlgoOrderType.STOP_LOSS) {
|
|
52
|
-
const types = orderType === orderlyTypes.OrderType.CLOSE_POSITION ? [orderlyI18n.i18n.t("common.position"), orderlyI18n.i18n.t("tpsl.sl")] : [orderlyI18n.i18n.t("tpsl.sl")];
|
|
53
|
-
list.push(...types);
|
|
54
|
-
}
|
|
55
|
-
if (algoType === orderlyTypes.AlgoOrderType.TAKE_PROFIT) {
|
|
56
|
-
const types = orderType === orderlyTypes.OrderType.CLOSE_POSITION ? [orderlyI18n.i18n.t("common.position"), orderlyI18n.i18n.t("tpsl.tp")] : [orderlyI18n.i18n.t("tpsl.tp")];
|
|
57
|
-
list.push(...types);
|
|
58
|
-
}
|
|
59
|
-
return list;
|
|
60
|
-
}
|
|
61
|
-
const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
|
|
62
|
-
if ([orderlyTypes.OrderType.ASK, orderlyTypes.OrderType.BID].includes(orderType)) {
|
|
63
|
-
return [orderlyI18n.i18n.t("orderEntry.orderType.limit")];
|
|
64
|
-
}
|
|
65
|
-
if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
|
|
66
|
-
const typeMap = {
|
|
67
|
-
[orderlyTypes.OrderType.LIMIT]: orderlyI18n.i18n.t("orderEntry.orderType.limit"),
|
|
68
|
-
[orderlyTypes.OrderType.MARKET]: orderlyI18n.i18n.t("orderEntry.orderType.market"),
|
|
69
|
-
[orderlyTypes.OrderType.POST_ONLY]: orderlyI18n.i18n.t("orderEntry.orderType.postOnly"),
|
|
70
|
-
[orderlyTypes.OrderType.IOC]: orderlyI18n.i18n.t("orderEntry.orderType.ioc"),
|
|
71
|
-
[orderlyTypes.OrderType.FOK]: orderlyI18n.i18n.t("orderEntry.orderType.fok")
|
|
72
|
-
};
|
|
73
|
-
return [
|
|
74
|
-
typeMap[type] || upperCaseFirstLetter(type)
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
if (algoType === orderlyTypes.AlgoOrderRootType.TRAILING_STOP) {
|
|
78
|
-
return [orderlyI18n.i18n.t("orderEntry.orderType.trailingStop")];
|
|
79
|
-
}
|
|
80
|
-
if (type) {
|
|
81
|
-
const typeMap = {
|
|
82
|
-
[orderlyTypes.OrderType.LIMIT]: orderlyI18n.i18n.t("orderEntry.orderType.stopLimit"),
|
|
83
|
-
[orderlyTypes.OrderType.MARKET]: orderlyI18n.i18n.t("orderEntry.orderType.stopMarket")
|
|
84
|
-
};
|
|
85
|
-
return [typeMap[type] || type];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (typeof algoType !== "undefined") {
|
|
89
|
-
const list = [];
|
|
90
|
-
if (algoType === orderlyTypes.AlgoOrderRootType.POSITIONAL_TP_SL) {
|
|
91
|
-
list.push(orderlyI18n.i18n.t("common.position"));
|
|
92
|
-
}
|
|
93
|
-
const tpOrder = record?.child_orders?.find(
|
|
94
|
-
(order) => order.algo_type === orderlyTypes.AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
|
|
95
|
-
);
|
|
96
|
-
const slOrder = record?.child_orders?.find(
|
|
97
|
-
(order) => order.algo_type === orderlyTypes.AlgoOrderType.STOP_LOSS && !!order.trigger_price
|
|
98
|
-
);
|
|
99
|
-
if (tpOrder || slOrder) {
|
|
100
|
-
list.push(
|
|
101
|
-
tpOrder && slOrder ? orderlyI18n.i18n.t("common.tpsl") : tpOrder ? orderlyI18n.i18n.t("tpsl.tp") : orderlyI18n.i18n.t("tpsl.sl")
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
return list;
|
|
105
|
-
}
|
|
106
|
-
return void 0;
|
|
46
|
+
const orderTypeBadges = getOrderTypeBadges(record);
|
|
47
|
+
const marginModeBadges = getMarginModeBadges(record);
|
|
48
|
+
const badges = [...orderTypeBadges, ...marginModeBadges];
|
|
49
|
+
return badges.length ? badges : void 0;
|
|
107
50
|
}
|
|
108
51
|
function grayCell(record) {
|
|
109
52
|
return record.status === orderlyTypes.OrderStatus.CANCELLED || record.algo_status === orderlyTypes.OrderStatus.CANCELLED;
|
|
@@ -207,7 +150,7 @@ function convertApiOrderTypeToOrderEntryType(order) {
|
|
|
207
150
|
}
|
|
208
151
|
return order.type;
|
|
209
152
|
}
|
|
210
|
-
var upperCaseFirstLetter;
|
|
153
|
+
var upperCaseFirstLetter, normalizeMarginMode, getMarginModeBadges, getOrderTypeBadges;
|
|
211
154
|
var init_util = __esm({
|
|
212
155
|
"src/utils/util.ts"() {
|
|
213
156
|
upperCaseFirstLetter = (str) => {
|
|
@@ -216,6 +159,88 @@ var init_util = __esm({
|
|
|
216
159
|
if (str.length === 1) return str.charAt(0).toUpperCase();
|
|
217
160
|
return str.charAt(0).toUpperCase() + str.toLowerCase().slice(1);
|
|
218
161
|
};
|
|
162
|
+
normalizeMarginMode = (value) => {
|
|
163
|
+
if (value === 1 || value === orderlyTypes.MarginMode.ISOLATED) {
|
|
164
|
+
return orderlyTypes.MarginMode.ISOLATED;
|
|
165
|
+
}
|
|
166
|
+
if (value === 0 || value === orderlyTypes.MarginMode.CROSS) {
|
|
167
|
+
return orderlyTypes.MarginMode.CROSS;
|
|
168
|
+
}
|
|
169
|
+
return void 0;
|
|
170
|
+
};
|
|
171
|
+
getMarginModeBadges = (record) => {
|
|
172
|
+
const marginMode = normalizeMarginMode(record?.margin_mode);
|
|
173
|
+
if (marginMode === orderlyTypes.MarginMode.ISOLATED) {
|
|
174
|
+
return [orderlyI18n.i18n.t("marginMode.isolated")];
|
|
175
|
+
}
|
|
176
|
+
if (marginMode === orderlyTypes.MarginMode.CROSS) {
|
|
177
|
+
return [orderlyI18n.i18n.t("marginMode.cross")];
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
};
|
|
181
|
+
getOrderTypeBadges = (record) => {
|
|
182
|
+
const orderType = record.type;
|
|
183
|
+
const algoType = record.algo_type;
|
|
184
|
+
if (typeof orderType !== "undefined") {
|
|
185
|
+
const list = [];
|
|
186
|
+
if (!!record.parent_algo_type) {
|
|
187
|
+
if (algoType === orderlyTypes.AlgoOrderType.STOP_LOSS) {
|
|
188
|
+
const types = orderType === orderlyTypes.OrderType.CLOSE_POSITION ? [orderlyI18n.i18n.t("common.position"), orderlyI18n.i18n.t("tpsl.sl")] : [orderlyI18n.i18n.t("tpsl.sl")];
|
|
189
|
+
list.push(...types);
|
|
190
|
+
}
|
|
191
|
+
if (algoType === orderlyTypes.AlgoOrderType.TAKE_PROFIT) {
|
|
192
|
+
const types = orderType === orderlyTypes.OrderType.CLOSE_POSITION ? [orderlyI18n.i18n.t("common.position"), orderlyI18n.i18n.t("tpsl.tp")] : [orderlyI18n.i18n.t("tpsl.tp")];
|
|
193
|
+
list.push(...types);
|
|
194
|
+
}
|
|
195
|
+
return list;
|
|
196
|
+
}
|
|
197
|
+
const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
|
|
198
|
+
if ([orderlyTypes.OrderType.ASK, orderlyTypes.OrderType.BID].includes(orderType)) {
|
|
199
|
+
return [orderlyI18n.i18n.t("orderEntry.orderType.limit")];
|
|
200
|
+
}
|
|
201
|
+
if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
|
|
202
|
+
const typeMap = {
|
|
203
|
+
[orderlyTypes.OrderType.LIMIT]: orderlyI18n.i18n.t("orderEntry.orderType.limit"),
|
|
204
|
+
[orderlyTypes.OrderType.MARKET]: orderlyI18n.i18n.t("orderEntry.orderType.market"),
|
|
205
|
+
[orderlyTypes.OrderType.POST_ONLY]: orderlyI18n.i18n.t("orderEntry.orderType.postOnly"),
|
|
206
|
+
[orderlyTypes.OrderType.IOC]: orderlyI18n.i18n.t("orderEntry.orderType.ioc"),
|
|
207
|
+
[orderlyTypes.OrderType.FOK]: orderlyI18n.i18n.t("orderEntry.orderType.fok")
|
|
208
|
+
};
|
|
209
|
+
return [
|
|
210
|
+
typeMap[type] || upperCaseFirstLetter(type)
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
if (algoType === orderlyTypes.AlgoOrderRootType.TRAILING_STOP) {
|
|
214
|
+
return [orderlyI18n.i18n.t("orderEntry.orderType.trailingStop")];
|
|
215
|
+
}
|
|
216
|
+
if (type) {
|
|
217
|
+
const typeMap = {
|
|
218
|
+
[orderlyTypes.OrderType.LIMIT]: orderlyI18n.i18n.t("orderEntry.orderType.stopLimit"),
|
|
219
|
+
[orderlyTypes.OrderType.MARKET]: orderlyI18n.i18n.t("orderEntry.orderType.stopMarket")
|
|
220
|
+
};
|
|
221
|
+
return [typeMap[type] || type];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (typeof algoType !== "undefined") {
|
|
225
|
+
const list = [];
|
|
226
|
+
if (algoType === orderlyTypes.AlgoOrderRootType.POSITIONAL_TP_SL) {
|
|
227
|
+
list.push(orderlyI18n.i18n.t("common.position"));
|
|
228
|
+
}
|
|
229
|
+
const tpOrder = record?.child_orders?.find(
|
|
230
|
+
(order) => order.algo_type === orderlyTypes.AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
|
|
231
|
+
);
|
|
232
|
+
const slOrder = record?.child_orders?.find(
|
|
233
|
+
(order) => order.algo_type === orderlyTypes.AlgoOrderType.STOP_LOSS && !!order.trigger_price
|
|
234
|
+
);
|
|
235
|
+
if (tpOrder || slOrder) {
|
|
236
|
+
list.push(
|
|
237
|
+
tpOrder && slOrder ? orderlyI18n.i18n.t("common.tpsl") : tpOrder ? orderlyI18n.i18n.t("tpsl.tp") : orderlyI18n.i18n.t("tpsl.sl")
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
return list;
|
|
241
|
+
}
|
|
242
|
+
return [];
|
|
243
|
+
};
|
|
219
244
|
}
|
|
220
245
|
});
|
|
221
246
|
var SymbolContext, useSymbolContext;
|
|
@@ -282,6 +307,7 @@ var init_shareButton_script = __esm({
|
|
|
282
307
|
const { sharePnLConfig, order, iconSize } = props;
|
|
283
308
|
const { t } = orderlyI18n.useTranslation();
|
|
284
309
|
const { getFirstRefCode } = orderlyHooks.useReferralInfo();
|
|
310
|
+
const { brokerNameRaw } = orderlyHooks.useBadgeBySymbol(order.symbol);
|
|
285
311
|
const refCode = React2.useMemo(() => {
|
|
286
312
|
return getFirstRefCode()?.code;
|
|
287
313
|
}, [getFirstRefCode]);
|
|
@@ -299,7 +325,8 @@ var init_shareButton_script = __esm({
|
|
|
299
325
|
},
|
|
300
326
|
refCode,
|
|
301
327
|
leverage,
|
|
302
|
-
...sharePnLConfig
|
|
328
|
+
...sharePnLConfig,
|
|
329
|
+
brokerName: sharePnLConfig?.brokerName ?? brokerNameRaw
|
|
303
330
|
}
|
|
304
331
|
});
|
|
305
332
|
};
|
|
@@ -1146,10 +1173,10 @@ var init_tpslOrderRowContext = __esm({
|
|
|
1146
1173
|
}
|
|
1147
1174
|
);
|
|
1148
1175
|
const getRelatedPosition = orderlyHooks.useMemoizedFn(
|
|
1149
|
-
(symbol) => {
|
|
1176
|
+
(symbol, marginMode) => {
|
|
1150
1177
|
const positions = config.cache.get(positionKey);
|
|
1151
1178
|
return positions?.data?.rows?.find(
|
|
1152
|
-
(p) => p.symbol === symbol
|
|
1179
|
+
(p) => p.symbol === symbol && (p.margin_mode ?? orderlyTypes.MarginMode.CROSS) === (marginMode ?? orderlyTypes.MarginMode.CROSS)
|
|
1153
1180
|
);
|
|
1154
1181
|
}
|
|
1155
1182
|
);
|
|
@@ -1167,12 +1194,12 @@ var init_tpslOrderRowContext = __esm({
|
|
|
1167
1194
|
});
|
|
1168
1195
|
React2.useEffect(() => {
|
|
1169
1196
|
if ("algo_type" in order || (order?.reduce_only ?? false)) {
|
|
1170
|
-
const position2 = getRelatedPosition(order.symbol);
|
|
1197
|
+
const position2 = getRelatedPosition(order.symbol, order.margin_mode);
|
|
1171
1198
|
if (position2) {
|
|
1172
1199
|
setPosition(position2);
|
|
1173
1200
|
}
|
|
1174
1201
|
}
|
|
1175
|
-
}, [order.symbol]);
|
|
1202
|
+
}, [getRelatedPosition, order.margin_mode, order.symbol]);
|
|
1176
1203
|
const memoizedValue = React2.useMemo(() => {
|
|
1177
1204
|
return {
|
|
1178
1205
|
order,
|
|
@@ -2358,7 +2385,7 @@ function instrument(option) {
|
|
|
2358
2385
|
},
|
|
2359
2386
|
render: (value, record) => {
|
|
2360
2387
|
const showGray = grayCell(record);
|
|
2361
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gap: 2, children: [
|
|
2388
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gap: 2, className: "oui-py-1", children: [
|
|
2362
2389
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2363
2390
|
"div",
|
|
2364
2391
|
{
|
|
@@ -2368,7 +2395,7 @@ function instrument(option) {
|
|
|
2368
2395
|
)
|
|
2369
2396
|
}
|
|
2370
2397
|
),
|
|
2371
|
-
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "column", itemAlign: "start", children: [
|
|
2398
|
+
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
|
|
2372
2399
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2373
2400
|
orderlyUi.Text.formatted,
|
|
2374
2401
|
{
|
|
@@ -2382,7 +2409,7 @@ function instrument(option) {
|
|
|
2382
2409
|
children: `${value.split("_")[1]}-PERP`
|
|
2383
2410
|
}
|
|
2384
2411
|
),
|
|
2385
|
-
option?.showType && /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Flex, { direction: "row", gap: 1, children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2412
|
+
option?.showType && /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Flex, { direction: "row", gap: 1, wrap: "wrap", children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2386
2413
|
orderlyUi.Badge,
|
|
2387
2414
|
{
|
|
2388
2415
|
color: e.toLocaleLowerCase() === "position" ? showGray ? "neutral" : "primary" : "neutral",
|
|
@@ -2929,7 +2956,7 @@ var init_useColumn = __esm({
|
|
|
2929
2956
|
case "all" /* all */:
|
|
2930
2957
|
return [
|
|
2931
2958
|
instrument({
|
|
2932
|
-
width:
|
|
2959
|
+
width: 200,
|
|
2933
2960
|
showType: true,
|
|
2934
2961
|
onSymbolChange,
|
|
2935
2962
|
enableSort: false
|
|
@@ -2967,7 +2994,7 @@ var init_useColumn = __esm({
|
|
|
2967
2994
|
case "pending" /* pending */:
|
|
2968
2995
|
return [
|
|
2969
2996
|
instrument({
|
|
2970
|
-
width:
|
|
2997
|
+
width: 200,
|
|
2971
2998
|
showType: true,
|
|
2972
2999
|
onSymbolChange,
|
|
2973
3000
|
enableSort: false
|
|
@@ -2991,7 +3018,7 @@ var init_useColumn = __esm({
|
|
|
2991
3018
|
case "tp_sl" /* tp_sl */:
|
|
2992
3019
|
return [
|
|
2993
3020
|
instrument({
|
|
2994
|
-
width:
|
|
3021
|
+
width: 200,
|
|
2995
3022
|
showType: true,
|
|
2996
3023
|
onSymbolChange,
|
|
2997
3024
|
enableSort: false
|
|
@@ -3009,7 +3036,7 @@ var init_useColumn = __esm({
|
|
|
3009
3036
|
return [
|
|
3010
3037
|
instrument({
|
|
3011
3038
|
showType: true,
|
|
3012
|
-
width:
|
|
3039
|
+
width: 200,
|
|
3013
3040
|
onSymbolChange
|
|
3014
3041
|
}),
|
|
3015
3042
|
// type({ width: 124 }),
|
|
@@ -3044,7 +3071,7 @@ var init_useColumn = __esm({
|
|
|
3044
3071
|
return [
|
|
3045
3072
|
instrument({
|
|
3046
3073
|
showType: true,
|
|
3047
|
-
width:
|
|
3074
|
+
width: 200,
|
|
3048
3075
|
onSymbolChange,
|
|
3049
3076
|
enableSort: false
|
|
3050
3077
|
}),
|
|
@@ -3068,7 +3095,7 @@ var init_useColumn = __esm({
|
|
|
3068
3095
|
return [
|
|
3069
3096
|
instrument({
|
|
3070
3097
|
showType: true,
|
|
3071
|
-
width:
|
|
3098
|
+
width: 200,
|
|
3072
3099
|
onSymbolChange
|
|
3073
3100
|
}),
|
|
3074
3101
|
// side({ width: 124 }),
|
|
@@ -3091,7 +3118,7 @@ var init_useColumn = __esm({
|
|
|
3091
3118
|
return [
|
|
3092
3119
|
instrument({
|
|
3093
3120
|
showType: true,
|
|
3094
|
-
width:
|
|
3121
|
+
width: 200,
|
|
3095
3122
|
onSymbolChange
|
|
3096
3123
|
}),
|
|
3097
3124
|
// side({ width: 124 }),
|
|
@@ -3129,11 +3156,23 @@ var init_useColumn = __esm({
|
|
|
3129
3156
|
};
|
|
3130
3157
|
}
|
|
3131
3158
|
});
|
|
3159
|
+
var SymbolBadge;
|
|
3160
|
+
var init_symbolBadge = __esm({
|
|
3161
|
+
"src/components/symbolBadge.tsx"() {
|
|
3162
|
+
SymbolBadge = (props) => {
|
|
3163
|
+
const { brokerId, brokerName, brokerNameRaw } = orderlyHooks.useBadgeBySymbol(
|
|
3164
|
+
props.symbol
|
|
3165
|
+
);
|
|
3166
|
+
const badge = brokerName ?? brokerId ?? void 0;
|
|
3167
|
+
return /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.SymbolBadge, { badge, fullName: brokerNameRaw });
|
|
3168
|
+
};
|
|
3169
|
+
}
|
|
3170
|
+
});
|
|
3132
3171
|
var SymbolToken, OrderTypeView, OrderTime, OrderState, Qty, Filled, EstTotal, TriggerPrice, MarkPrice, LimitPrice, TPTrigger, SLTrigger, TPPrice, SLPrice, TPSLQuantity, AvgPrice2, OrderPrice, RealizedPnL, MobileTooltip, Fee, TrailingCallback, TrailingPrice;
|
|
3133
3172
|
var init_items = __esm({
|
|
3134
3173
|
"src/components/orderList/mobile/items.tsx"() {
|
|
3135
3174
|
init_util();
|
|
3136
|
-
|
|
3175
|
+
init_symbolBadge();
|
|
3137
3176
|
init_tpslOrderRowContext();
|
|
3138
3177
|
SymbolToken = (props) => {
|
|
3139
3178
|
const { item } = props;
|
|
@@ -3144,9 +3183,10 @@ var init_items = __esm({
|
|
|
3144
3183
|
{
|
|
3145
3184
|
intensity: 80,
|
|
3146
3185
|
rule: "symbol",
|
|
3147
|
-
formatString: "base
|
|
3186
|
+
formatString: "base",
|
|
3148
3187
|
size: "sm",
|
|
3149
3188
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Badge, { color: isBuy ? "success" : "danger", size: "xs", children: isBuy ? t("common.buy") : t("common.sell") }),
|
|
3189
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol }),
|
|
3150
3190
|
onClick: () => {
|
|
3151
3191
|
props.onSymbolChange?.({ symbol: item.symbol });
|
|
3152
3192
|
},
|
|
@@ -3667,29 +3707,17 @@ var init_items = __esm({
|
|
|
3667
3707
|
label: "oui-text-2xs"
|
|
3668
3708
|
},
|
|
3669
3709
|
align: "end",
|
|
3670
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
}
|
|
3682
|
-
),
|
|
3683
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3684
|
-
ShareButtonWidget,
|
|
3685
|
-
{
|
|
3686
|
-
order: props.item,
|
|
3687
|
-
sharePnLConfig: props.sharePnLConfig,
|
|
3688
|
-
modalId: orderlyUiShare.SharePnLBottomSheetId,
|
|
3689
|
-
iconSize: 12
|
|
3690
|
-
}
|
|
3691
|
-
)
|
|
3692
|
-
] })
|
|
3710
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Flex, { gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3711
|
+
orderlyUi.Text.pnl,
|
|
3712
|
+
{
|
|
3713
|
+
dp: props.quote_dp,
|
|
3714
|
+
padding: false,
|
|
3715
|
+
intensity: (value ?? 0) == 0 ? 80 : void 0,
|
|
3716
|
+
showIdentifier: (value ?? 0) > 0,
|
|
3717
|
+
coloring: (value ?? 0) != 0,
|
|
3718
|
+
children: value ?? "--"
|
|
3719
|
+
}
|
|
3720
|
+
) })
|
|
3693
3721
|
}
|
|
3694
3722
|
);
|
|
3695
3723
|
};
|
|
@@ -4094,6 +4122,7 @@ var ConfirmDialogContent;
|
|
|
4094
4122
|
var init_editDialogContent = __esm({
|
|
4095
4123
|
"src/components/orderList/mobile/editSheet/components/editDialogContent.tsx"() {
|
|
4096
4124
|
init_util();
|
|
4125
|
+
init_symbolBadge();
|
|
4097
4126
|
ConfirmDialogContent = (props) => {
|
|
4098
4127
|
const { item } = props;
|
|
4099
4128
|
const {
|
|
@@ -4116,16 +4145,19 @@ var init_editDialogContent = __esm({
|
|
|
4116
4145
|
}
|
|
4117
4146
|
),
|
|
4118
4147
|
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gap: 2, mb: 3, mt: 2, justify: "between", children: [
|
|
4119
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4148
|
+
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "column", itemAlign: "start", gap: 1, grow: true, children: [
|
|
4149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4150
|
+
orderlyUi.Text.formatted,
|
|
4151
|
+
{
|
|
4152
|
+
rule: "symbol",
|
|
4153
|
+
formatString: "base",
|
|
4154
|
+
size: "base",
|
|
4155
|
+
showIcon: true,
|
|
4156
|
+
children: item.symbol
|
|
4157
|
+
}
|
|
4158
|
+
),
|
|
4159
|
+
/* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol })
|
|
4160
|
+
] }),
|
|
4129
4161
|
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "row", gap: 1, children: [
|
|
4130
4162
|
parseBadgesFor(item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4131
4163
|
orderlyUi.Badge,
|
|
@@ -4267,11 +4299,22 @@ var EditSheetHeader;
|
|
|
4267
4299
|
var init_editSheetHeader = __esm({
|
|
4268
4300
|
"src/components/orderList/mobile/editSheet/components/editSheetHeader.tsx"() {
|
|
4269
4301
|
init_util();
|
|
4302
|
+
init_symbolBadge();
|
|
4270
4303
|
EditSheetHeader = (props) => {
|
|
4271
4304
|
const { item } = props;
|
|
4272
4305
|
const { t } = orderlyI18n.useTranslation();
|
|
4273
4306
|
return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { width: "100%", justify: "between", children: [
|
|
4274
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4307
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4308
|
+
orderlyUi.Text.formatted,
|
|
4309
|
+
{
|
|
4310
|
+
rule: "symbol",
|
|
4311
|
+
formatString: "base",
|
|
4312
|
+
showIcon: true,
|
|
4313
|
+
intensity: 80,
|
|
4314
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol: item.symbol }),
|
|
4315
|
+
children: item.symbol
|
|
4316
|
+
}
|
|
4317
|
+
),
|
|
4275
4318
|
/* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "row", gap: 1, children: [
|
|
4276
4319
|
parseBadgesFor(props.item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4277
4320
|
orderlyUi.Badge,
|
|
@@ -5435,15 +5478,21 @@ var init_useFormatOrderHistory = __esm({
|
|
|
5435
5478
|
if (!e.is_activated || !e.trigger_price) {
|
|
5436
5479
|
continue;
|
|
5437
5480
|
}
|
|
5438
|
-
|
|
5439
|
-
|
|
5481
|
+
_data.push({
|
|
5482
|
+
...e,
|
|
5483
|
+
parent_algo_type: element.algo_type,
|
|
5484
|
+
margin_mode: e.margin_mode ?? element.margin_mode
|
|
5485
|
+
});
|
|
5440
5486
|
}
|
|
5441
5487
|
} else {
|
|
5442
5488
|
for (let j = 0; j < element.child_orders.length; j++) {
|
|
5443
5489
|
const e = element.child_orders[j];
|
|
5444
5490
|
if (!!e && (e.algo_status === orderlyTypes.OrderStatus.FILLED || e.algo_status === orderlyTypes.OrderStatus.PARTIAL_FILLED)) {
|
|
5445
|
-
|
|
5446
|
-
|
|
5491
|
+
_data.push({
|
|
5492
|
+
...e,
|
|
5493
|
+
parent_algo_type: element.algo_type,
|
|
5494
|
+
margin_mode: e.margin_mode ?? element.margin_mode
|
|
5495
|
+
});
|
|
5447
5496
|
}
|
|
5448
5497
|
}
|
|
5449
5498
|
}
|
|
@@ -5544,7 +5593,7 @@ var init_orderList_script = __esm({
|
|
|
5544
5593
|
page: enableLoadMore || !manualPagination ? void 0 : page,
|
|
5545
5594
|
// pending and ts_sl list get all data
|
|
5546
5595
|
size: manualPagination ? pageSize : 500,
|
|
5547
|
-
sourceTypeAll: type === "orderHistory" /* orderHistory */,
|
|
5596
|
+
sourceTypeAll: type === "orderHistory" /* orderHistory */ || type === "filled" /* filled */,
|
|
5548
5597
|
dateRange,
|
|
5549
5598
|
includes,
|
|
5550
5599
|
excludes
|