@orderly.network/ui-order-entry 3.1.2 → 3.1.3-alpha.1

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.d.mts CHANGED
@@ -1,10 +1,33 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode, FC } from 'react';
1
3
  import * as _orderly_network_types from '@orderly.network/types';
2
4
  import { MarginMode, OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@orderly.network/types';
3
- import * as react from 'react';
4
- import react__default, { FC } from 'react';
5
5
  import * as _orderly_network_hooks from '@orderly.network/hooks';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import { InputProps } from '@orderly.network/ui';
7
8
 
9
+ /** One entry in the order-type dropdown. */
10
+ type OrderTypeOption = {
11
+ value: string;
12
+ label: string;
13
+ };
14
+ /** Props for the Advanced order-type dropdown interceptor target. */
15
+ type OrderTypeAdvancedSelectProps = {
16
+ items: OrderTypeOption[];
17
+ /** Current selection: a real OrderType value, or a custom-type id. */
18
+ value: string;
19
+ placeholder: string;
20
+ disabled?: boolean;
21
+ onValueChange: (value: string) => void;
22
+ };
23
+ /** Props for the mobile order-type dropdown interceptor target. */
24
+ type MobileTypeSelectProps = {
25
+ items: OrderTypeOption[];
26
+ /** Current selection: a real OrderType value, or a custom-type id. */
27
+ value: string;
28
+ disabled?: boolean;
29
+ onValueChange: (value: string) => void;
30
+ };
8
31
  /** Props exposed for plugin interceptors targeting OrderType tabs area. */
9
32
  type OrderEntryTypeTabsProps = {
10
33
  type: OrderType;
@@ -13,12 +36,24 @@ type OrderEntryTypeTabsProps = {
13
36
  onChange: (type: OrderType) => void;
14
37
  marketOrderDisabled?: boolean;
15
38
  marketOrderDisabledTooltip?: string;
39
+ /** Active custom order-type id (null for a real OrderType). */
40
+ selectedExtraId?: string | null;
41
+ onExtraSelect?: (id: string | null) => void;
16
42
  };
17
43
  /** Props exposed for plugin interceptors targeting Buy/Sell switch area. */
18
44
  type OrderEntryBuySellSwitchProps = {
19
45
  side: OrderSide;
20
46
  canTrade: boolean;
21
47
  onSideChange: (side: OrderSide) => void;
48
+ /** Active custom order-type id; a plugin can intercept to hide Buy/Sell for its own type. */
49
+ selectedCustomTypeId?: string | null;
50
+ };
51
+ /** Props for the order-entry form-body interceptor target. */
52
+ type OrderEntryBodyProps = {
53
+ symbol: string;
54
+ side: OrderSide;
55
+ selectedCustomTypeId?: string | null;
56
+ children?: ReactNode;
22
57
  };
23
58
  /** Props exposed for plugin interceptors targeting Available balance row. */
24
59
  type OrderEntryAvailableProps = {
@@ -185,8 +220,11 @@ declare const OrderEntry: react__default.FC<OrderEntryProps>;
185
220
  declare module "@orderly.network/plugin-core" {
186
221
  interface InterceptorTargetPropsMap {
187
222
  OrderEntry: OrderEntryProps;
223
+ "Trading.OrderEntry.AdvancedSelect": OrderTypeAdvancedSelectProps;
188
224
  "Trading.OrderEntry.Available": OrderEntryAvailableProps;
225
+ "Trading.OrderEntry.Body": OrderEntryBodyProps;
189
226
  "Trading.OrderEntry.BuySellSwitch": OrderEntryBuySellSwitchProps;
227
+ "Trading.OrderEntry.MobileTypeSelect": MobileTypeSelectProps;
190
228
  "Trading.OrderEntry.QuantitySlider": OrderEntryQuantitySliderProps;
191
229
  "Trading.OrderEntry.SubmitSection": OrderEntrySubmitSectionProps;
192
230
  "Trading.OrderEntry.TypeTabs": OrderEntryTypeTabsProps;
@@ -222,6 +260,27 @@ type AdditionalInfoProps = {
222
260
  };
223
261
  declare const AdditionalInfo: FC<AdditionalInfoProps>;
224
262
 
263
+ type CustomInputProps = {
264
+ label: string;
265
+ suffix?: ReactNode;
266
+ placeholder?: string;
267
+ id: string;
268
+ className?: string;
269
+ name?: string;
270
+ onChange?: (value: string) => void;
271
+ value?: InputProps["value"];
272
+ autoFocus?: InputProps["autoFocus"];
273
+ error?: string;
274
+ onFocus?: InputProps["onFocus"];
275
+ onBlur?: InputProps["onBlur"];
276
+ formatters?: InputProps["formatters"];
277
+ overrideFormatters?: InputProps["formatters"];
278
+ classNames?: InputProps["classNames"];
279
+ readonly?: boolean;
280
+ prefix?: ReactNode;
281
+ };
282
+ declare const CustomInput: react.ForwardRefExoticComponent<CustomInputProps & react.RefAttributes<HTMLInputElement>>;
283
+
225
284
  declare const LTVRiskTooltipWidget: react__default.FC<{
226
285
  marginMode?: MarginMode;
227
286
  }>;
@@ -237,4 +296,4 @@ type SymbolBadgeProps = {
237
296
  };
238
297
  declare const SymbolBadge: FC<SymbolBadgeProps>;
239
298
 
240
- export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, SymbolBadge, useOrderEntryScript };
299
+ export { AdditionalInfo, CustomInput, type CustomInputProps, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, SymbolBadge, useOrderEntryScript };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,33 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode, FC } from 'react';
1
3
  import * as _orderly_network_types from '@orderly.network/types';
2
4
  import { MarginMode, OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@orderly.network/types';
3
- import * as react from 'react';
4
- import react__default, { FC } from 'react';
5
5
  import * as _orderly_network_hooks from '@orderly.network/hooks';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import { InputProps } from '@orderly.network/ui';
7
8
 
9
+ /** One entry in the order-type dropdown. */
10
+ type OrderTypeOption = {
11
+ value: string;
12
+ label: string;
13
+ };
14
+ /** Props for the Advanced order-type dropdown interceptor target. */
15
+ type OrderTypeAdvancedSelectProps = {
16
+ items: OrderTypeOption[];
17
+ /** Current selection: a real OrderType value, or a custom-type id. */
18
+ value: string;
19
+ placeholder: string;
20
+ disabled?: boolean;
21
+ onValueChange: (value: string) => void;
22
+ };
23
+ /** Props for the mobile order-type dropdown interceptor target. */
24
+ type MobileTypeSelectProps = {
25
+ items: OrderTypeOption[];
26
+ /** Current selection: a real OrderType value, or a custom-type id. */
27
+ value: string;
28
+ disabled?: boolean;
29
+ onValueChange: (value: string) => void;
30
+ };
8
31
  /** Props exposed for plugin interceptors targeting OrderType tabs area. */
9
32
  type OrderEntryTypeTabsProps = {
10
33
  type: OrderType;
@@ -13,12 +36,24 @@ type OrderEntryTypeTabsProps = {
13
36
  onChange: (type: OrderType) => void;
14
37
  marketOrderDisabled?: boolean;
15
38
  marketOrderDisabledTooltip?: string;
39
+ /** Active custom order-type id (null for a real OrderType). */
40
+ selectedExtraId?: string | null;
41
+ onExtraSelect?: (id: string | null) => void;
16
42
  };
17
43
  /** Props exposed for plugin interceptors targeting Buy/Sell switch area. */
18
44
  type OrderEntryBuySellSwitchProps = {
19
45
  side: OrderSide;
20
46
  canTrade: boolean;
21
47
  onSideChange: (side: OrderSide) => void;
48
+ /** Active custom order-type id; a plugin can intercept to hide Buy/Sell for its own type. */
49
+ selectedCustomTypeId?: string | null;
50
+ };
51
+ /** Props for the order-entry form-body interceptor target. */
52
+ type OrderEntryBodyProps = {
53
+ symbol: string;
54
+ side: OrderSide;
55
+ selectedCustomTypeId?: string | null;
56
+ children?: ReactNode;
22
57
  };
23
58
  /** Props exposed for plugin interceptors targeting Available balance row. */
24
59
  type OrderEntryAvailableProps = {
@@ -185,8 +220,11 @@ declare const OrderEntry: react__default.FC<OrderEntryProps>;
185
220
  declare module "@orderly.network/plugin-core" {
186
221
  interface InterceptorTargetPropsMap {
187
222
  OrderEntry: OrderEntryProps;
223
+ "Trading.OrderEntry.AdvancedSelect": OrderTypeAdvancedSelectProps;
188
224
  "Trading.OrderEntry.Available": OrderEntryAvailableProps;
225
+ "Trading.OrderEntry.Body": OrderEntryBodyProps;
189
226
  "Trading.OrderEntry.BuySellSwitch": OrderEntryBuySellSwitchProps;
227
+ "Trading.OrderEntry.MobileTypeSelect": MobileTypeSelectProps;
190
228
  "Trading.OrderEntry.QuantitySlider": OrderEntryQuantitySliderProps;
191
229
  "Trading.OrderEntry.SubmitSection": OrderEntrySubmitSectionProps;
192
230
  "Trading.OrderEntry.TypeTabs": OrderEntryTypeTabsProps;
@@ -222,6 +260,27 @@ type AdditionalInfoProps = {
222
260
  };
223
261
  declare const AdditionalInfo: FC<AdditionalInfoProps>;
224
262
 
263
+ type CustomInputProps = {
264
+ label: string;
265
+ suffix?: ReactNode;
266
+ placeholder?: string;
267
+ id: string;
268
+ className?: string;
269
+ name?: string;
270
+ onChange?: (value: string) => void;
271
+ value?: InputProps["value"];
272
+ autoFocus?: InputProps["autoFocus"];
273
+ error?: string;
274
+ onFocus?: InputProps["onFocus"];
275
+ onBlur?: InputProps["onBlur"];
276
+ formatters?: InputProps["formatters"];
277
+ overrideFormatters?: InputProps["formatters"];
278
+ classNames?: InputProps["classNames"];
279
+ readonly?: boolean;
280
+ prefix?: ReactNode;
281
+ };
282
+ declare const CustomInput: react.ForwardRefExoticComponent<CustomInputProps & react.RefAttributes<HTMLInputElement>>;
283
+
225
284
  declare const LTVRiskTooltipWidget: react__default.FC<{
226
285
  marginMode?: MarginMode;
227
286
  }>;
@@ -237,4 +296,4 @@ type SymbolBadgeProps = {
237
296
  };
238
297
  declare const SymbolBadge: FC<SymbolBadgeProps>;
239
298
 
240
- export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, SymbolBadge, useOrderEntryScript };
299
+ export { AdditionalInfo, CustomInput, type CustomInputProps, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, SymbolBadge, useOrderEntryScript };