@oanda/labs-instruments-table-widget 1.0.25 → 1.0.27
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/CHANGELOG.md +220 -0
- package/dist/main/InstrumentsTableWidget/InstrumentsTableWidget.js +9 -7
- package/dist/main/InstrumentsTableWidget/InstrumentsTableWidget.js.map +1 -1
- package/dist/main/InstrumentsTableWidget/Main.js +14 -7
- package/dist/main/InstrumentsTableWidget/Main.js.map +1 -1
- package/dist/main/InstrumentsTableWidget/config.js +72 -14
- package/dist/main/InstrumentsTableWidget/config.js.map +1 -1
- package/dist/main/InstrumentsTableWidget/types.js.map +1 -1
- package/dist/main/translations/sources/en.json +6 -1
- package/dist/module/InstrumentsTableWidget/InstrumentsTableWidget.js +10 -8
- package/dist/module/InstrumentsTableWidget/InstrumentsTableWidget.js.map +1 -1
- package/dist/module/InstrumentsTableWidget/Main.js +16 -9
- package/dist/module/InstrumentsTableWidget/Main.js.map +1 -1
- package/dist/module/InstrumentsTableWidget/config.js +72 -13
- package/dist/module/InstrumentsTableWidget/config.js.map +1 -1
- package/dist/module/InstrumentsTableWidget/types.js.map +1 -1
- package/dist/module/translations/sources/en.json +6 -1
- package/dist/types/InstrumentsTableWidget/Main.d.ts +1 -1
- package/dist/types/InstrumentsTableWidget/config.d.ts +7 -9
- package/dist/types/InstrumentsTableWidget/types.d.ts +1 -0
- package/package.json +3 -3
- package/src/InstrumentsTableWidget/InstrumentsTableWidget.tsx +24 -5
- package/src/InstrumentsTableWidget/Main.tsx +24 -7
- package/src/InstrumentsTableWidget/config.ts +76 -33
- package/src/InstrumentsTableWidget/types.ts +1 -0
- package/src/translations/sources/en.json +6 -1
- package/test/Main.test.tsx +1 -0
|
@@ -1,52 +1,106 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeaderConfigType } from '@oanda/labs-widget-common';
|
|
2
2
|
import { DataRecordType } from '@oanda/labs-widget-common';
|
|
3
3
|
|
|
4
4
|
import { AssetClassName } from '../gql/types/graphql';
|
|
5
5
|
import type { AssetClassLabels } from './components/Filters/types';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| DataRecordType.INSTRUMENT
|
|
9
|
-
| DataRecordType.SELL
|
|
10
|
-
| DataRecordType.BUY
|
|
11
|
-
| DataRecordType.DAILY_CHANGE
|
|
12
|
-
| DataRecordType.SPREAD
|
|
13
|
-
| DataRecordType.HIGH
|
|
14
|
-
| DataRecordType.LOW;
|
|
15
|
-
|
|
16
|
-
const headerConfig: Record<
|
|
17
|
-
HeaderRecordType,
|
|
18
|
-
{ displayName: string; additionalStyles: string }
|
|
19
|
-
> = {
|
|
7
|
+
const normal: HeaderConfigType = {
|
|
20
8
|
[DataRecordType.INSTRUMENT]: {
|
|
21
9
|
displayName: 'instrument',
|
|
22
|
-
additionalStyles:
|
|
10
|
+
additionalStyles: {
|
|
11
|
+
align: 'left',
|
|
12
|
+
minWidth: '200px',
|
|
13
|
+
},
|
|
23
14
|
},
|
|
24
15
|
[DataRecordType.SELL]: {
|
|
25
16
|
displayName: 'sell',
|
|
26
|
-
additionalStyles:
|
|
17
|
+
additionalStyles: {
|
|
18
|
+
align: 'right',
|
|
19
|
+
minWidth: '75px',
|
|
20
|
+
paddingRight: true,
|
|
21
|
+
},
|
|
27
22
|
},
|
|
28
23
|
[DataRecordType.BUY]: {
|
|
29
24
|
displayName: 'buy',
|
|
30
|
-
additionalStyles:
|
|
25
|
+
additionalStyles: {
|
|
26
|
+
align: 'right',
|
|
27
|
+
minWidth: '75px',
|
|
28
|
+
paddingRight: true,
|
|
29
|
+
},
|
|
31
30
|
},
|
|
32
31
|
[DataRecordType.SPREAD]: {
|
|
33
32
|
displayName: 'spread',
|
|
34
|
-
additionalStyles:
|
|
33
|
+
additionalStyles: {
|
|
34
|
+
align: 'right',
|
|
35
|
+
minWidth: '50px',
|
|
36
|
+
},
|
|
35
37
|
},
|
|
36
38
|
[DataRecordType.DAILY_CHANGE]: {
|
|
37
39
|
displayName: 'daily_percent_change',
|
|
38
|
-
additionalStyles:
|
|
40
|
+
additionalStyles: {
|
|
41
|
+
align: 'right',
|
|
42
|
+
minWidth: '80px',
|
|
43
|
+
},
|
|
39
44
|
},
|
|
40
45
|
[DataRecordType.HIGH]: {
|
|
41
46
|
displayName: 'today_high',
|
|
42
|
-
additionalStyles:
|
|
47
|
+
additionalStyles: {
|
|
48
|
+
align: 'right',
|
|
49
|
+
minWidth: '80px',
|
|
50
|
+
},
|
|
43
51
|
},
|
|
44
52
|
[DataRecordType.LOW]: {
|
|
45
53
|
displayName: 'today_low',
|
|
46
|
-
additionalStyles:
|
|
54
|
+
additionalStyles: {
|
|
55
|
+
align: 'right',
|
|
56
|
+
minWidth: '80px',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
[DataRecordType.TRADE_MODE]: {
|
|
60
|
+
displayName: 'trade_mode',
|
|
61
|
+
additionalStyles: {
|
|
62
|
+
align: 'right',
|
|
63
|
+
minWidth: '80px',
|
|
64
|
+
paddingRight: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
[DataRecordType.SYMBOL]: {
|
|
68
|
+
displayName: 'symbol',
|
|
69
|
+
additionalStyles: {
|
|
70
|
+
align: 'center',
|
|
71
|
+
minWidth: '80px',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const longInstruments: HeaderConfigType = {
|
|
77
|
+
...normal,
|
|
78
|
+
[DataRecordType.INSTRUMENT]: {
|
|
79
|
+
displayName: 'instrument',
|
|
80
|
+
additionalStyles: {
|
|
81
|
+
align: 'left',
|
|
82
|
+
minWidth: '250px',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const mobile: HeaderConfigType = {
|
|
88
|
+
...normal,
|
|
89
|
+
[DataRecordType.INSTRUMENT]: {
|
|
90
|
+
displayName: 'instrument',
|
|
91
|
+
additionalStyles: {
|
|
92
|
+
align: 'left',
|
|
93
|
+
minWidth: '150px',
|
|
94
|
+
},
|
|
47
95
|
},
|
|
48
96
|
};
|
|
49
97
|
|
|
98
|
+
const headerConfigs = {
|
|
99
|
+
normal,
|
|
100
|
+
longInstruments,
|
|
101
|
+
mobile,
|
|
102
|
+
};
|
|
103
|
+
|
|
50
104
|
const assetClassLabels: Record<AssetClassLabels, string> = {
|
|
51
105
|
ALL: 'all',
|
|
52
106
|
[AssetClassName.Currency]: 'currency',
|
|
@@ -58,15 +112,4 @@ const assetClassLabels: Record<AssetClassLabels, string> = {
|
|
|
58
112
|
[AssetClassName.Indices]: 'index',
|
|
59
113
|
};
|
|
60
114
|
|
|
61
|
-
|
|
62
|
-
const columns: HeaderRecordType[] = [
|
|
63
|
-
DataRecordType.INSTRUMENT,
|
|
64
|
-
...activeColumns,
|
|
65
|
-
].filter(
|
|
66
|
-
(item): item is HeaderRecordType => item !== DataRecordType.SENTIMENT
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
return columns.map((item) => headerConfig[item]);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export { assetClassLabels, getHeaderConfig, headerConfig };
|
|
115
|
+
export { assetClassLabels, headerConfigs };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"asset_class": "Asset class",
|
|
4
4
|
"bond": "Bond",
|
|
5
5
|
"buy": "Buy",
|
|
6
|
+
"close_only": "Close Only",
|
|
6
7
|
"commodity": "Commodity",
|
|
7
8
|
"crypto": "Crypto",
|
|
8
9
|
"currency": "Currency",
|
|
@@ -12,12 +13,16 @@
|
|
|
12
13
|
"index": "Index",
|
|
13
14
|
"instrument": "Instrument",
|
|
14
15
|
"instrument_name": "Instrument name",
|
|
16
|
+
"long_only": "Long Only",
|
|
15
17
|
"no_matching_results": "No matching results",
|
|
16
18
|
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries",
|
|
17
19
|
"search": "Search",
|
|
18
20
|
"sell": "Sell",
|
|
19
21
|
"share_cfds": "Share CFDs",
|
|
22
|
+
"short_only": "Short Only",
|
|
20
23
|
"spread": "Spread",
|
|
24
|
+
"symbol": "Symbol",
|
|
21
25
|
"today_high": "Today High",
|
|
22
|
-
"today_low": "Today Low"
|
|
26
|
+
"today_low": "Today Low",
|
|
27
|
+
"trade_mode": "Trade Mode"
|
|
23
28
|
}
|