@kodiak-finance/orderly-ui-orders 2.9.2 → 2.9.4

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
@@ -592,7 +592,7 @@ var init_confirmContent = __esm({
592
592
  /* @__PURE__ */ jsxRuntime.jsx(
593
593
  "button",
594
594
  {
595
- className: "oui-absolute oui-right-0 oui-top-0 oui-text-base-contrast-54",
595
+ className: "oui-absolute oui-end-0 oui-top-0 oui-text-base-contrast-54",
596
596
  onClick: cancelPopover,
597
597
  children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.CloseIcon, { size: 16, color: "white", opacity: 1 })
598
598
  }
@@ -740,7 +740,7 @@ var init_editableCellInput = __esm({
740
740
  ],
741
741
  classNames: {
742
742
  root: "oui-bg-base-700 oui-px-2 oui-py-1 oui-rounded",
743
- input: "oui-pr-2"
743
+ input: "oui-pe-2"
744
744
  },
745
745
  readOnly: props.readonly,
746
746
  suffix: /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gapX: 1, children: [
@@ -1284,7 +1284,7 @@ var init_innerInput = __esm({
1284
1284
  color: open ? "danger" : void 0,
1285
1285
  classNames: {
1286
1286
  root: "oui-bg-base-700 oui-px-2 oui-py-1 oui-rounded",
1287
- input: "oui-pr-2"
1287
+ input: "oui-pe-2"
1288
1288
  },
1289
1289
  suffix: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick, children: /* @__PURE__ */ jsxRuntime.jsx(
1290
1290
  orderlyUi.CheckIcon,
@@ -2014,6 +2014,29 @@ var init_triggerPriceCell = __esm({
2014
2014
  };
2015
2015
  }
2016
2016
  });
2017
+ var OrderSymbolCell;
2018
+ var init_orderSymbolCell = __esm({
2019
+ "src/components/orderList/desktop/orderSymbolCell.tsx"() {
2020
+ OrderSymbolCell = (props) => {
2021
+ const { symbol, onSymbolChange } = props;
2022
+ const { brokerId, brokerName, brokerNameRaw } = orderlyHooks.useBadgeBySymbol(symbol);
2023
+ return /* @__PURE__ */ jsxRuntime.jsx(
2024
+ orderlyUi.Text.symbolBadge,
2025
+ {
2026
+ className: "oui-cursor-pointer",
2027
+ badge: brokerName ?? brokerId ?? void 0,
2028
+ fullName: brokerNameRaw,
2029
+ onClick: (e) => {
2030
+ onSymbolChange?.({ symbol });
2031
+ e.stopPropagation();
2032
+ e.preventDefault();
2033
+ },
2034
+ children: symbol
2035
+ }
2036
+ );
2037
+ };
2038
+ }
2039
+ });
2017
2040
  var Renew;
2018
2041
  var init_renew = __esm({
2019
2042
  "src/components/orderList/desktop/renew.tsx"() {
@@ -2286,7 +2309,7 @@ var init_tpslTriggerPrice = __esm({
2286
2309
  orderlyUiTpsl.CloseToLiqPriceIcon,
2287
2310
  {
2288
2311
  slPriceError: props.slPriceError,
2289
- className: "oui-ml-1"
2312
+ className: "oui-ms-1"
2290
2313
  }
2291
2314
  )
2292
2315
  },
@@ -2348,7 +2371,7 @@ var init_tpslTriggerPrice = __esm({
2348
2371
  const type = orderType === orderlyTypes.AlgoOrderType.TAKE_PROFIT ? "TP" : "SL";
2349
2372
  const label = type === "TP" ? `${t("tpsl.tpPnl")}:` : `${t("tpsl.slPnl")}:`;
2350
2373
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-flex oui-items-center", children: [
2351
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-text-base-contrast-54 oui-mr-1", children: label }),
2374
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-text-base-contrast-54 oui-me-1", children: label }),
2352
2375
  /* @__PURE__ */ jsxRuntime.jsx(
2353
2376
  orderlyUi.Text.numeral,
2354
2377
  {
@@ -2360,7 +2383,7 @@ var init_tpslTriggerPrice = __esm({
2360
2383
  // @ts-ignore
2361
2384
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: pnl === 0 ? "" : pnl > 0 ? "+" : "-" })
2362
2385
  ),
2363
- suffix: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-text-base-contrast-36 oui-ml-1", children: "USDC" }),
2386
+ suffix: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-text-base-contrast-36 oui-ms-1", children: "USDC" }),
2364
2387
  children: `${Math.abs(pnl)}`
2365
2388
  }
2366
2389
  )
@@ -2372,7 +2395,7 @@ function instrument(option) {
2372
2395
  return {
2373
2396
  title: orderlyI18n.i18n.t("common.symbol"),
2374
2397
  dataIndex: "symbol",
2375
- fixed: "left",
2398
+ fixed: "start",
2376
2399
  // className: "oui-h-[48px]",
2377
2400
  width: option?.width,
2378
2401
  onSort: option?.enableSort ? (r1, r2) => {
@@ -2390,23 +2413,17 @@ function instrument(option) {
2390
2413
  "div",
2391
2414
  {
2392
2415
  className: orderlyUi.cn(
2393
- "oui-h-7 oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2416
+ "oui-h-[34px] oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2394
2417
  record.side === orderlyTypes.OrderSide.BUY ? "oui-bg-trade-profit" : "oui-bg-trade-loss"
2395
2418
  )
2396
2419
  }
2397
2420
  ),
2398
2421
  /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
2399
2422
  /* @__PURE__ */ jsxRuntime.jsx(
2400
- orderlyUi.Text.formatted,
2423
+ OrderSymbolCell,
2401
2424
  {
2402
- size: "xs",
2403
- className: "oui-cursor-pointer oui-text-xs",
2404
- onClick: (e) => {
2405
- option?.onSymbolChange?.({ symbol: value });
2406
- e.stopPropagation();
2407
- e.preventDefault();
2408
- },
2409
- children: `${value.split("_")[1]}-PERP`
2425
+ symbol: value,
2426
+ onSymbolChange: option?.onSymbolChange
2410
2427
  }
2411
2428
  ),
2412
2429
  option?.showType && /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Flex, { direction: "row", gap: 1, wrap: "wrap", children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -2684,10 +2701,9 @@ function realizedPnL(option) {
2684
2701
  const value = new orderlyUtils.Decimal(_value ?? 0).toNumber();
2685
2702
  return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gap: 1, children: [
2686
2703
  /* @__PURE__ */ jsxRuntime.jsx(
2687
- orderlyUi.Text.numeral,
2704
+ orderlyUi.Text.pnl,
2688
2705
  {
2689
2706
  dp,
2690
- rm: orderlyUtils.Decimal.ROUND_DOWN,
2691
2707
  padding: false,
2692
2708
  intensity: (value ?? 0) == 0 ? 80 : void 0,
2693
2709
  showIdentifier: (value ?? 0) > 0,
@@ -2847,7 +2863,7 @@ function cancelBtn(option) {
2847
2863
  width: option?.width,
2848
2864
  className: option?.className,
2849
2865
  align: "right",
2850
- fixed: "right",
2866
+ fixed: "end",
2851
2867
  render: (_, record) => {
2852
2868
  if (record.status === orderlyTypes.OrderStatus.CANCELLED) {
2853
2869
  return /* @__PURE__ */ jsxRuntime.jsx(Renew, { record });
@@ -2867,7 +2883,7 @@ function pendingTabCancelBtn(option) {
2867
2883
  width: option?.width,
2868
2884
  className: option?.className,
2869
2885
  align: "right",
2870
- fixed: "right",
2886
+ fixed: "end",
2871
2887
  render: (_, record) => {
2872
2888
  return /* @__PURE__ */ jsxRuntime.jsx(CancelButton, { order: record });
2873
2889
  }
@@ -2881,7 +2897,7 @@ function tpslAction(option) {
2881
2897
  width: option?.width,
2882
2898
  className: option?.className,
2883
2899
  align: "right",
2884
- fixed: "right",
2900
+ fixed: "end",
2885
2901
  render: (_, record) => {
2886
2902
  return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { gap: 3, children: [
2887
2903
  /* @__PURE__ */ jsxRuntime.jsx(TP_SLEditButton, { order: record }),
@@ -2938,6 +2954,7 @@ var init_useColumn = __esm({
2938
2954
  init_quantityCell();
2939
2955
  init_trailingCallbackCell();
2940
2956
  init_triggerPriceCell();
2957
+ init_orderSymbolCell();
2941
2958
  init_renew();
2942
2959
  init_tpslEdit();
2943
2960
  init_tpslPrice();
@@ -2965,7 +2982,7 @@ var init_useColumn = __esm({
2965
2982
  fillAndQuantity({
2966
2983
  width: 130,
2967
2984
  disableEdit: true,
2968
- className: "oui-pl-0 oui-pr-0",
2985
+ className: "oui-ps-0 oui-pe-0",
2969
2986
  enableSort: false
2970
2987
  }),
2971
2988
  price({
@@ -3002,12 +3019,12 @@ var init_useColumn = __esm({
3002
3019
  // side({ width: 162 }),
3003
3020
  fillAndQuantity({
3004
3021
  width: 162,
3005
- className: "oui-pr-0",
3022
+ className: "oui-pe-0",
3006
3023
  enableSort: false
3007
3024
  }),
3008
- price({ width: 162, className: "oui-pr-0", enableSort: false }),
3025
+ price({ width: 162, className: "oui-pe-0", enableSort: false }),
3009
3026
  trailingCallback({ width: 162 }),
3010
- triggerPrice({ width: 162, className: "oui-pr-0", isPending: true }),
3027
+ triggerPrice({ width: 162, className: "oui-pe-0", isPending: true }),
3011
3028
  bracketOrderPrice({ width: 130 }),
3012
3029
  estTotal({ width: 162, isPending: true }),
3013
3030
  reduceOnly({ width: 162 }),
@@ -3044,7 +3061,7 @@ var init_useColumn = __esm({
3044
3061
  fillAndQuantity({
3045
3062
  width: 124,
3046
3063
  disableEdit: true,
3047
- className: "oui-pl-0 oui-pr-0"
3064
+ className: "oui-ps-0 oui-pe-0"
3048
3065
  }),
3049
3066
  price({
3050
3067
  width: 124,
@@ -3079,7 +3096,7 @@ var init_useColumn = __esm({
3079
3096
  fillAndQuantity({
3080
3097
  width: 124,
3081
3098
  disableEdit: true,
3082
- className: "oui-pl-0 oui-pr-0",
3099
+ className: "oui-ps-0 oui-pe-0",
3083
3100
  enableSort: false
3084
3101
  }),
3085
3102
  price({ width: 124, disableEdit: true, enableSort: false }),
@@ -3102,7 +3119,7 @@ var init_useColumn = __esm({
3102
3119
  fillAndQuantity({
3103
3120
  width: 124,
3104
3121
  disableEdit: true,
3105
- className: "oui-pl-0 oui-pr-0"
3122
+ className: "oui-ps-0 oui-pe-0"
3106
3123
  }),
3107
3124
  price({ width: 124, disableEdit: true }),
3108
3125
  avgOpen({ width: 124 }),
@@ -3125,7 +3142,7 @@ var init_useColumn = __esm({
3125
3142
  fillAndQuantity({
3126
3143
  width: 150,
3127
3144
  disableEdit: true,
3128
- className: "oui-pl-6 oui-pr-0"
3145
+ className: "oui-ps-6 oui-pe-0"
3129
3146
  }),
3130
3147
  price({
3131
3148
  width: 124,
@@ -3465,7 +3482,7 @@ var init_items = __esm({
3465
3482
  }
3466
3483
  ),
3467
3484
  classNames: {
3468
- content: "oui-bg-base-6 oui-ml-2",
3485
+ content: "oui-bg-base-6 oui-ms-2",
3469
3486
  arrow: "oui-fill-base-6"
3470
3487
  },
3471
3488
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3518,7 +3535,7 @@ var init_items = __esm({
3518
3535
  }
3519
3536
  ),
3520
3537
  classNames: {
3521
- content: "oui-bg-base-6 oui-ml-2",
3538
+ content: "oui-bg-base-6 oui-ms-2",
3522
3539
  arrow: "oui-fill-base-6"
3523
3540
  },
3524
3541
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3562,7 +3579,7 @@ var init_items = __esm({
3562
3579
  children: tp_order_price
3563
3580
  }
3564
3581
  );
3565
- }, [tp_order_price]);
3582
+ }, [props.quote_dp, t, tp_order_price]);
3566
3583
  return /* @__PURE__ */ jsxRuntime.jsx(
3567
3584
  orderlyUi.Statistic,
3568
3585
  {
@@ -3595,7 +3612,7 @@ var init_items = __esm({
3595
3612
  children: sl_order_price
3596
3613
  }
3597
3614
  );
3598
- }, [sl_order_price]);
3615
+ }, [props.quote_dp, sl_order_price, t]);
3599
3616
  return /* @__PURE__ */ jsxRuntime.jsx(
3600
3617
  orderlyUi.Statistic,
3601
3618
  {
@@ -3820,7 +3837,7 @@ var init_bracketOrderPrice_ui = __esm({
3820
3837
  MobileTooltip,
3821
3838
  {
3822
3839
  classNames: {
3823
- content: "oui-bg-base-6 oui-ml-2",
3840
+ content: "oui-bg-base-6 oui-ms-2",
3824
3841
  arrow: "oui-fill-base-6"
3825
3842
  },
3826
3843
  content: /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
@@ -5060,7 +5077,7 @@ var init_editBtn_script = __esm({
5060
5077
  }).catch((error) => {
5061
5078
  });
5062
5079
  }
5063
- }, [state]);
5080
+ }, [editAlgoOrder, editOrder, position, state, symbolInfo, t]);
5064
5081
  return {
5065
5082
  ...state,
5066
5083
  onShowEditSheet