@orderly.network/ui-orders 2.11.2 → 2.12.0-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 CHANGED
@@ -311,6 +311,7 @@ var init_shareButton_script = __esm({
311
311
  const { sharePnLConfig, order, iconSize } = props;
312
312
  const { t } = i18n.useTranslation();
313
313
  const { getFirstRefCode } = hooks.useReferralInfo();
314
+ const { brokerNameRaw } = hooks.useBadgeBySymbol(order.symbol);
314
315
  const refCode = React2.useMemo(() => {
315
316
  return getFirstRefCode()?.code;
316
317
  }, [getFirstRefCode]);
@@ -328,7 +329,8 @@ var init_shareButton_script = __esm({
328
329
  },
329
330
  refCode,
330
331
  leverage,
331
- ...sharePnLConfig
332
+ ...sharePnLConfig,
333
+ brokerName: sharePnLConfig?.brokerName ?? brokerNameRaw
332
334
  }
333
335
  });
334
336
  };
@@ -2015,6 +2017,29 @@ var init_triggerPriceCell = __esm({
2015
2017
  };
2016
2018
  }
2017
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
+ });
2018
2043
  var Renew;
2019
2044
  var init_renew = __esm({
2020
2045
  "src/components/orderList/desktop/renew.tsx"() {
@@ -2391,23 +2416,17 @@ function instrument(option) {
2391
2416
  "div",
2392
2417
  {
2393
2418
  className: ui.cn(
2394
- "oui-h-7 oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2419
+ "oui-h-[34px] oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2395
2420
  record.side === types.OrderSide.BUY ? "oui-bg-trade-profit" : "oui-bg-trade-loss"
2396
2421
  )
2397
2422
  }
2398
2423
  ),
2399
2424
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
2400
2425
  /* @__PURE__ */ jsxRuntime.jsx(
2401
- ui.Text.formatted,
2426
+ OrderSymbolCell,
2402
2427
  {
2403
- size: "xs",
2404
- className: "oui-cursor-pointer oui-text-xs",
2405
- onClick: (e) => {
2406
- option?.onSymbolChange?.({ symbol: value });
2407
- e.stopPropagation();
2408
- e.preventDefault();
2409
- },
2410
- children: `${value.split("_")[1]}-PERP`
2428
+ symbol: value,
2429
+ onSymbolChange: option?.onSymbolChange
2411
2430
  }
2412
2431
  ),
2413
2432
  option?.showType && /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { direction: "row", gap: 1, wrap: "wrap", children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -2938,6 +2957,7 @@ var init_useColumn = __esm({
2938
2957
  init_quantityCell();
2939
2958
  init_trailingCallbackCell();
2940
2959
  init_triggerPriceCell();
2960
+ init_orderSymbolCell();
2941
2961
  init_renew();
2942
2962
  init_tpslEdit();
2943
2963
  init_tpslPrice();
@@ -2956,7 +2976,7 @@ var init_useColumn = __esm({
2956
2976
  case "all" /* all */:
2957
2977
  return [
2958
2978
  instrument({
2959
- width: 174,
2979
+ width: 200,
2960
2980
  showType: true,
2961
2981
  onSymbolChange,
2962
2982
  enableSort: false
@@ -2994,7 +3014,7 @@ var init_useColumn = __esm({
2994
3014
  case "pending" /* pending */:
2995
3015
  return [
2996
3016
  instrument({
2997
- width: 172,
3017
+ width: 200,
2998
3018
  showType: true,
2999
3019
  onSymbolChange,
3000
3020
  enableSort: false
@@ -3018,7 +3038,7 @@ var init_useColumn = __esm({
3018
3038
  case "tp_sl" /* tp_sl */:
3019
3039
  return [
3020
3040
  instrument({
3021
- width: 176,
3041
+ width: 200,
3022
3042
  showType: true,
3023
3043
  onSymbolChange,
3024
3044
  enableSort: false
@@ -3036,7 +3056,7 @@ var init_useColumn = __esm({
3036
3056
  return [
3037
3057
  instrument({
3038
3058
  showType: true,
3039
- width: 166,
3059
+ width: 200,
3040
3060
  onSymbolChange
3041
3061
  }),
3042
3062
  // type({ width: 124 }),
@@ -3071,7 +3091,7 @@ var init_useColumn = __esm({
3071
3091
  return [
3072
3092
  instrument({
3073
3093
  showType: true,
3074
- width: 154,
3094
+ width: 200,
3075
3095
  onSymbolChange,
3076
3096
  enableSort: false
3077
3097
  }),
@@ -3095,7 +3115,7 @@ var init_useColumn = __esm({
3095
3115
  return [
3096
3116
  instrument({
3097
3117
  showType: true,
3098
- width: 154,
3118
+ width: 200,
3099
3119
  onSymbolChange
3100
3120
  }),
3101
3121
  // side({ width: 124 }),
@@ -3118,7 +3138,7 @@ var init_useColumn = __esm({
3118
3138
  return [
3119
3139
  instrument({
3120
3140
  showType: true,
3121
- width: 160,
3141
+ width: 200,
3122
3142
  onSymbolChange
3123
3143
  }),
3124
3144
  // side({ width: 124 }),
@@ -3156,10 +3176,23 @@ var init_useColumn = __esm({
3156
3176
  };
3157
3177
  }
3158
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
+ });
3159
3191
  var SymbolToken, OrderTypeView, OrderTime, OrderState, Qty, Filled, EstTotal, TriggerPrice, MarkPrice, LimitPrice, TPTrigger, SLTrigger, TPPrice, SLPrice, TPSLQuantity, AvgPrice2, OrderPrice, RealizedPnL, MobileTooltip, Fee, TrailingCallback, TrailingPrice;
3160
3192
  var init_items = __esm({
3161
3193
  "src/components/orderList/mobile/items.tsx"() {
3162
3194
  init_util();
3195
+ init_symbolBadge();
3163
3196
  init_tpslOrderRowContext();
3164
3197
  SymbolToken = (props) => {
3165
3198
  const { item } = props;
@@ -3170,9 +3203,10 @@ var init_items = __esm({
3170
3203
  {
3171
3204
  intensity: 80,
3172
3205
  rule: "symbol",
3173
- formatString: "base-type",
3206
+ formatString: "base",
3174
3207
  size: "sm",
3175
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 }),
3176
3210
  onClick: () => {
3177
3211
  props.onSymbolChange?.({ symbol: item.symbol });
3178
3212
  },
@@ -4107,6 +4141,7 @@ var ConfirmDialogContent;
4107
4141
  var init_editDialogContent = __esm({
4108
4142
  "src/components/orderList/mobile/editSheet/components/editDialogContent.tsx"() {
4109
4143
  init_util();
4144
+ init_symbolBadge();
4110
4145
  ConfirmDialogContent = (props) => {
4111
4146
  const { item } = props;
4112
4147
  const {
@@ -4129,16 +4164,19 @@ var init_editDialogContent = __esm({
4129
4164
  }
4130
4165
  ),
4131
4166
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 2, mb: 3, mt: 2, justify: "between", children: [
4132
- /* @__PURE__ */ jsxRuntime.jsx(
4133
- ui.Text.formatted,
4134
- {
4135
- rule: "symbol",
4136
- formatString: "base-type",
4137
- size: "base",
4138
- showIcon: true,
4139
- children: item.symbol
4140
- }
4141
- ),
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
+ ] }),
4142
4180
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "row", gap: 1, children: [
4143
4181
  parseBadgesFor(item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
4144
4182
  ui.Badge,
@@ -4280,11 +4318,22 @@ var EditSheetHeader;
4280
4318
  var init_editSheetHeader = __esm({
4281
4319
  "src/components/orderList/mobile/editSheet/components/editSheetHeader.tsx"() {
4282
4320
  init_util();
4321
+ init_symbolBadge();
4283
4322
  EditSheetHeader = (props) => {
4284
4323
  const { item } = props;
4285
4324
  const { t } = i18n.useTranslation();
4286
4325
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { width: "100%", justify: "between", children: [
4287
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text.formatted, { rule: "symbol", showIcon: true, intensity: 80, children: item.symbol }),
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
+ ),
4288
4337
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "row", gap: 1, children: [
4289
4338
  parseBadgesFor(props.item)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
4290
4339
  ui.Badge,
@@ -5543,7 +5592,7 @@ var init_orderList_script = __esm({
5543
5592
  page: enableLoadMore || !manualPagination ? void 0 : page,
5544
5593
  // pending and ts_sl list get all data
5545
5594
  size: manualPagination ? pageSize : 500,
5546
- sourceTypeAll: type === "orderHistory" /* orderHistory */,
5595
+ sourceTypeAll: type === "orderHistory" /* orderHistory */ || type === "filled" /* filled */,
5547
5596
  dateRange,
5548
5597
  includes,
5549
5598
  excludes