@orderly.network/ui-positions 2.7.1 → 2.7.2-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.d.mts +36 -13
- package/dist/index.d.ts +36 -13
- package/dist/index.js +23 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OrderType, OrderSide, API } from '@orderly.network/types';
|
|
2
2
|
import React, { FC } from 'react';
|
|
3
3
|
import { PriceMode } from '@orderly.network/hooks';
|
|
4
|
-
import { SharePnLConfig } from '@orderly.network/ui-share';
|
|
5
4
|
import * as _orderly_network_ui from '@orderly.network/ui';
|
|
6
|
-
import
|
|
5
|
+
import { SortOrder, TableSort } from '@orderly.network/ui';
|
|
6
|
+
import { SharePnLConfig } from '@orderly.network/ui-share';
|
|
7
7
|
|
|
8
8
|
interface PositionsRowContextState {
|
|
9
9
|
quantity: string;
|
|
@@ -40,6 +40,10 @@ declare const FundingFeeButton: FC<{
|
|
|
40
40
|
end_t: string;
|
|
41
41
|
}>;
|
|
42
42
|
|
|
43
|
+
type SortType = {
|
|
44
|
+
sortKey: string;
|
|
45
|
+
sortOrder: SortOrder;
|
|
46
|
+
};
|
|
43
47
|
type PositionsProps = {
|
|
44
48
|
pnlNotionalDecimalPrecision?: number;
|
|
45
49
|
sharePnLConfig?: SharePnLConfig;
|
|
@@ -48,32 +52,49 @@ type PositionsProps = {
|
|
|
48
52
|
includedPendingOrder?: boolean;
|
|
49
53
|
selectedAccount?: string;
|
|
50
54
|
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
55
|
+
enableSortingStorage?: boolean;
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
declare const PositionsWidget: React.FC<PositionsProps>;
|
|
54
59
|
declare const MobilePositionsWidget: React.FC<PositionsProps>;
|
|
55
60
|
declare const CombinePositionsWidget: React.FC<PositionsProps>;
|
|
56
61
|
|
|
62
|
+
declare enum PositionsTabName {
|
|
63
|
+
Positions = "positions",
|
|
64
|
+
PositionHistory = "positionHistory"
|
|
65
|
+
}
|
|
66
|
+
declare function useTabSort(options: {
|
|
67
|
+
storageKey: string;
|
|
68
|
+
}): {
|
|
69
|
+
tabSort: Record<PositionsTabName, SortType>;
|
|
70
|
+
onTabSort: (type: PositionsTabName) => (sort?: SortType) => void;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
declare function sortList(list: any[], sort?: SortType): any[];
|
|
74
|
+
declare function useSort(initialSort?: SortType, onSortChange?: (sort?: SortType) => void): {
|
|
75
|
+
sort: SortType | undefined;
|
|
76
|
+
onSort: (options?: TableSort) => void;
|
|
77
|
+
getSortedList: (list: any[]) => any[];
|
|
78
|
+
};
|
|
79
|
+
|
|
57
80
|
type PositionHistoryProps$1 = {
|
|
58
81
|
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
59
82
|
symbol?: string;
|
|
60
83
|
pnlNotionalDecimalPrecision?: number;
|
|
61
84
|
sharePnLConfig?: SharePnLConfig;
|
|
85
|
+
enableSortingStorage?: boolean;
|
|
62
86
|
};
|
|
63
|
-
declare const PositionHistoryWidget:
|
|
64
|
-
declare const MobilePositionHistoryWidget:
|
|
87
|
+
declare const PositionHistoryWidget: React.FC<PositionHistoryProps$1>;
|
|
88
|
+
declare const MobilePositionHistoryWidget: React.FC<PositionHistoryProps$1 & {
|
|
65
89
|
classNames?: {
|
|
66
90
|
root?: string;
|
|
67
91
|
content?: string;
|
|
68
92
|
cell?: string;
|
|
69
93
|
};
|
|
70
|
-
}
|
|
94
|
+
}>;
|
|
71
95
|
|
|
72
|
-
type PositionHistoryExt = API.PositionHistory & {
|
|
73
|
-
netPnL?: number;
|
|
74
|
-
};
|
|
75
96
|
declare const usePositionHistoryScript: (props: PositionHistoryProps$1) => {
|
|
76
|
-
dataSource:
|
|
97
|
+
dataSource: any[];
|
|
77
98
|
isLoading: boolean;
|
|
78
99
|
onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
|
|
79
100
|
pagination: _orderly_network_ui.PaginationMeta;
|
|
@@ -86,6 +107,8 @@ declare const usePositionHistoryScript: (props: PositionHistoryProps$1) => {
|
|
|
86
107
|
filterDays: 1 | 7 | 30 | 90 | null;
|
|
87
108
|
updateFilterDays: (days: 1 | 7 | 30 | 90) => void;
|
|
88
109
|
pnlNotionalDecimalPrecision: number | undefined;
|
|
110
|
+
onSort: (options?: _orderly_network_ui.TableSort) => void;
|
|
111
|
+
initialSort: SortType | undefined;
|
|
89
112
|
};
|
|
90
113
|
type PositionHistoryState = ReturnType<typeof usePositionHistoryScript>;
|
|
91
114
|
|
|
@@ -106,14 +129,14 @@ type LiquidationProps = {
|
|
|
106
129
|
symbol?: string;
|
|
107
130
|
enableLoadMore?: boolean;
|
|
108
131
|
};
|
|
109
|
-
declare const LiquidationWidget:
|
|
110
|
-
declare const MobileLiquidationWidget:
|
|
132
|
+
declare const LiquidationWidget: React.FC<LiquidationProps>;
|
|
133
|
+
declare const MobileLiquidationWidget: React.FC<LiquidationProps & {
|
|
111
134
|
classNames?: {
|
|
112
135
|
root?: string;
|
|
113
136
|
content?: string;
|
|
114
137
|
cell?: string;
|
|
115
138
|
};
|
|
116
|
-
}
|
|
139
|
+
}>;
|
|
117
140
|
|
|
118
141
|
declare const useLiquidationScript: (props: LiquidationProps) => {
|
|
119
142
|
dataSource: any[] | null | undefined;
|
|
@@ -145,4 +168,4 @@ declare const MobileLiquidation: FC<LiquidationState & {
|
|
|
145
168
|
|
|
146
169
|
declare const MarketCloseConfirmID = "MarketCloseConfirmID";
|
|
147
170
|
|
|
148
|
-
export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, PositionHistoryWidget, type PositionsProps, PositionsWidget, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext };
|
|
171
|
+
export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, PositionHistoryWidget, type PositionsProps, PositionsTabName, PositionsWidget, type SortType, sortList, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useSort, useTabSort };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OrderType, OrderSide, API } from '@orderly.network/types';
|
|
2
2
|
import React, { FC } from 'react';
|
|
3
3
|
import { PriceMode } from '@orderly.network/hooks';
|
|
4
|
-
import { SharePnLConfig } from '@orderly.network/ui-share';
|
|
5
4
|
import * as _orderly_network_ui from '@orderly.network/ui';
|
|
6
|
-
import
|
|
5
|
+
import { SortOrder, TableSort } from '@orderly.network/ui';
|
|
6
|
+
import { SharePnLConfig } from '@orderly.network/ui-share';
|
|
7
7
|
|
|
8
8
|
interface PositionsRowContextState {
|
|
9
9
|
quantity: string;
|
|
@@ -40,6 +40,10 @@ declare const FundingFeeButton: FC<{
|
|
|
40
40
|
end_t: string;
|
|
41
41
|
}>;
|
|
42
42
|
|
|
43
|
+
type SortType = {
|
|
44
|
+
sortKey: string;
|
|
45
|
+
sortOrder: SortOrder;
|
|
46
|
+
};
|
|
43
47
|
type PositionsProps = {
|
|
44
48
|
pnlNotionalDecimalPrecision?: number;
|
|
45
49
|
sharePnLConfig?: SharePnLConfig;
|
|
@@ -48,32 +52,49 @@ type PositionsProps = {
|
|
|
48
52
|
includedPendingOrder?: boolean;
|
|
49
53
|
selectedAccount?: string;
|
|
50
54
|
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
55
|
+
enableSortingStorage?: boolean;
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
declare const PositionsWidget: React.FC<PositionsProps>;
|
|
54
59
|
declare const MobilePositionsWidget: React.FC<PositionsProps>;
|
|
55
60
|
declare const CombinePositionsWidget: React.FC<PositionsProps>;
|
|
56
61
|
|
|
62
|
+
declare enum PositionsTabName {
|
|
63
|
+
Positions = "positions",
|
|
64
|
+
PositionHistory = "positionHistory"
|
|
65
|
+
}
|
|
66
|
+
declare function useTabSort(options: {
|
|
67
|
+
storageKey: string;
|
|
68
|
+
}): {
|
|
69
|
+
tabSort: Record<PositionsTabName, SortType>;
|
|
70
|
+
onTabSort: (type: PositionsTabName) => (sort?: SortType) => void;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
declare function sortList(list: any[], sort?: SortType): any[];
|
|
74
|
+
declare function useSort(initialSort?: SortType, onSortChange?: (sort?: SortType) => void): {
|
|
75
|
+
sort: SortType | undefined;
|
|
76
|
+
onSort: (options?: TableSort) => void;
|
|
77
|
+
getSortedList: (list: any[]) => any[];
|
|
78
|
+
};
|
|
79
|
+
|
|
57
80
|
type PositionHistoryProps$1 = {
|
|
58
81
|
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
59
82
|
symbol?: string;
|
|
60
83
|
pnlNotionalDecimalPrecision?: number;
|
|
61
84
|
sharePnLConfig?: SharePnLConfig;
|
|
85
|
+
enableSortingStorage?: boolean;
|
|
62
86
|
};
|
|
63
|
-
declare const PositionHistoryWidget:
|
|
64
|
-
declare const MobilePositionHistoryWidget:
|
|
87
|
+
declare const PositionHistoryWidget: React.FC<PositionHistoryProps$1>;
|
|
88
|
+
declare const MobilePositionHistoryWidget: React.FC<PositionHistoryProps$1 & {
|
|
65
89
|
classNames?: {
|
|
66
90
|
root?: string;
|
|
67
91
|
content?: string;
|
|
68
92
|
cell?: string;
|
|
69
93
|
};
|
|
70
|
-
}
|
|
94
|
+
}>;
|
|
71
95
|
|
|
72
|
-
type PositionHistoryExt = API.PositionHistory & {
|
|
73
|
-
netPnL?: number;
|
|
74
|
-
};
|
|
75
96
|
declare const usePositionHistoryScript: (props: PositionHistoryProps$1) => {
|
|
76
|
-
dataSource:
|
|
97
|
+
dataSource: any[];
|
|
77
98
|
isLoading: boolean;
|
|
78
99
|
onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
|
|
79
100
|
pagination: _orderly_network_ui.PaginationMeta;
|
|
@@ -86,6 +107,8 @@ declare const usePositionHistoryScript: (props: PositionHistoryProps$1) => {
|
|
|
86
107
|
filterDays: 1 | 7 | 30 | 90 | null;
|
|
87
108
|
updateFilterDays: (days: 1 | 7 | 30 | 90) => void;
|
|
88
109
|
pnlNotionalDecimalPrecision: number | undefined;
|
|
110
|
+
onSort: (options?: _orderly_network_ui.TableSort) => void;
|
|
111
|
+
initialSort: SortType | undefined;
|
|
89
112
|
};
|
|
90
113
|
type PositionHistoryState = ReturnType<typeof usePositionHistoryScript>;
|
|
91
114
|
|
|
@@ -106,14 +129,14 @@ type LiquidationProps = {
|
|
|
106
129
|
symbol?: string;
|
|
107
130
|
enableLoadMore?: boolean;
|
|
108
131
|
};
|
|
109
|
-
declare const LiquidationWidget:
|
|
110
|
-
declare const MobileLiquidationWidget:
|
|
132
|
+
declare const LiquidationWidget: React.FC<LiquidationProps>;
|
|
133
|
+
declare const MobileLiquidationWidget: React.FC<LiquidationProps & {
|
|
111
134
|
classNames?: {
|
|
112
135
|
root?: string;
|
|
113
136
|
content?: string;
|
|
114
137
|
cell?: string;
|
|
115
138
|
};
|
|
116
|
-
}
|
|
139
|
+
}>;
|
|
117
140
|
|
|
118
141
|
declare const useLiquidationScript: (props: LiquidationProps) => {
|
|
119
142
|
dataSource: any[] | null | undefined;
|
|
@@ -145,4 +168,4 @@ declare const MobileLiquidation: FC<LiquidationState & {
|
|
|
145
168
|
|
|
146
169
|
declare const MarketCloseConfirmID = "MarketCloseConfirmID";
|
|
147
170
|
|
|
148
|
-
export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, PositionHistoryWidget, type PositionsProps, PositionsWidget, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext };
|
|
171
|
+
export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, PositionHistoryWidget, type PositionsProps, PositionsTabName, PositionsWidget, type SortType, sortList, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useSort, useTabSort };
|