@oanda/labs-currency-cross-table 1.0.23 → 1.0.25
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 +204 -0
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +26 -27
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/Main.js +10 -10
- package/dist/main/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/index.js +8 -8
- package/dist/main/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/main/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/main/gql/types/fragment-masking.js.map +1 -1
- package/dist/main/gql/types/gql.js +1 -1
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +73 -73
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/gql/types/index.js.map +1 -1
- package/dist/main/gql/validateInstruments.js +4 -1
- package/dist/main/gql/validateInstruments.js.map +1 -1
- package/dist/main/translations/index.js +1 -1
- package/dist/main/translations/index.js.map +1 -1
- package/dist/main/translations/translations.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +27 -27
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/Main.js +10 -10
- package/dist/module/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/module/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/utils.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +1 -1
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +73 -73
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +2 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/gql/validateInstruments.js +4 -1
- package/dist/module/gql/validateInstruments.js.map +1 -1
- package/dist/module/translations/index.js +1 -1
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/CurrencyCrossTableWidget/CurrencyCrossTableWidget.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/Main.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/ValidationWrapper.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/Cell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/CellWithData.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/TextCell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/constant.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/index.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/utils.d.ts +3 -3
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/index.d.ts +2 -2
- package/dist/types/translations/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx +28 -31
- package/src/CurrencyCrossTableWidget/Main.tsx +21 -28
- package/src/CurrencyCrossTableWidget/ValidationWrapper.tsx +28 -21
- package/src/CurrencyCrossTableWidget/components/Cell.tsx +11 -8
- package/src/CurrencyCrossTableWidget/components/CellWithData.tsx +24 -15
- package/src/CurrencyCrossTableWidget/components/TextCell.tsx +14 -9
- package/src/CurrencyCrossTableWidget/components/types.ts +3 -2
- package/src/CurrencyCrossTableWidget/constant.ts +13 -4
- package/src/CurrencyCrossTableWidget/index.ts +1 -1
- package/src/CurrencyCrossTableWidget/render.tsx +44 -30
- package/src/CurrencyCrossTableWidget/types.tsx +3 -2
- package/src/CurrencyCrossTableWidget/utils.ts +10 -7
- package/src/gql/types/fragment-masking.ts +41 -21
- package/src/gql/types/gql.ts +7 -3
- package/src/gql/types/graphql.ts +129 -47
- package/src/gql/types/index.ts +2 -2
- package/src/gql/validateInstruments.ts +4 -1
- package/src/translations/index.ts +4 -4
- package/src/translations/translations.ts +2 -1
- package/test/Main.test.tsx +25 -11
- package/test/mocks.ts +23 -14
- package/test/utils.test.ts +119 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,210 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.25 (2024-12-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.173 (2024-12-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.172 (2024-11-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.171 (2024-11-28)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.170 (2024-11-28)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.169 (2024-11-20)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.168 (2024-11-19)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.167 (2024-10-14)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.166 (2024-10-07)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.165 (2024-10-03)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.164 (2024-09-26)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.163 (2024-09-18)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.162 (2024-09-12)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.161 (2024-09-11)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.160 (2024-09-10)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.159 (2024-09-09)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.158 (2024-09-04)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.157 (2024-09-04)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.156 (2024-09-02)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.155 (2024-08-29)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.154 (2024-08-29)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.153 (2024-08-23)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.152 (2024-08-23)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.151 (2024-08-20)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.150 (2024-08-19)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @oanda/labs-currency-cross-table
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.24 (2024-12-11)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.172 (2024-11-29)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.171 (2024-11-28)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.170 (2024-11-28)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.169 (2024-11-20)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.168 (2024-11-19)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.167 (2024-10-14)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.166 (2024-10-07)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.165 (2024-10-03)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.164 (2024-09-26)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.163 (2024-09-18)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.162 (2024-09-12)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.161 (2024-09-11)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.160 (2024-09-10)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.159 (2024-09-09)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.158 (2024-09-04)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.157 (2024-09-04)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.156 (2024-09-02)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.155 (2024-08-29)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.154 (2024-08-29)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.153 (2024-08-23)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.152 (2024-08-23)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.151 (2024-08-20)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.150 (2024-08-19)
|
|
203
|
+
|
|
204
|
+
**Note:** Version bump only for package @oanda/labs-currency-cross-table
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
6
210
|
## 1.0.23 (2024-11-29)
|
|
7
211
|
|
|
8
212
|
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CurrencyCrossTableWidget = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
7
|
var _client = require("@apollo/client");
|
|
9
|
-
var _monoI18n = require("@oanda/mono-i18n");
|
|
10
8
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _graphql = require("../gql/types/graphql");
|
|
11
11
|
var _translations = require("../translations");
|
|
12
12
|
var _ValidationWrapper = require("./ValidationWrapper");
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
14
|
const CurrencyCrossTableWidget = _ref => {
|
|
17
15
|
let {
|
|
18
16
|
graphqlUrl,
|
|
@@ -31,29 +29,30 @@ const CurrencyCrossTableWidget = _ref => {
|
|
|
31
29
|
});
|
|
32
30
|
const divisionCode = division === _graphql.Division.Opt ? _graphql.Division.Ogm : division;
|
|
33
31
|
const dataSource = divisionCode === _graphql.Division.Ogm ? 'MT5' : 'V20';
|
|
34
|
-
return _react.default.createElement(
|
|
35
|
-
|
|
32
|
+
return _react.default.createElement(_labsWidgetCommon.WidgetProvider, {
|
|
33
|
+
withSuspense: true,
|
|
34
|
+
client: client,
|
|
35
|
+
liveRates: {
|
|
36
|
+
url: liveRatesUrl,
|
|
37
|
+
options: {
|
|
38
|
+
divisionCode,
|
|
39
|
+
dataSource
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
locale: locale,
|
|
43
|
+
styling: {
|
|
44
|
+
removePadding
|
|
45
|
+
},
|
|
46
|
+
theme: theme,
|
|
36
47
|
translations: _translations.translations
|
|
37
|
-
}, _react.default.createElement(_labsWidgetCommon.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, _react.default.createElement(_react.Suspense, null, _react.default.createElement(_labsWidgetCommon.ThemeProvider, {
|
|
46
|
-
removePadding: removePadding,
|
|
47
|
-
theme: theme
|
|
48
|
-
}, (0, _labsWidgetCommon.renderComponent)({
|
|
49
|
-
Component: _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
|
|
50
|
-
currencies: currencies,
|
|
51
|
-
division: division,
|
|
52
|
-
isParamError: isParamError
|
|
53
|
-
}),
|
|
54
|
-
logoLink,
|
|
55
|
-
linkArea: 'full'
|
|
56
|
-
}))))));
|
|
48
|
+
}, _react.default.createElement(_labsWidgetCommon.WidgetWrapper, {
|
|
49
|
+
linkArea: "full",
|
|
50
|
+
logoLink: logoLink
|
|
51
|
+
}, _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
|
|
52
|
+
currencies: currencies,
|
|
53
|
+
division: division,
|
|
54
|
+
isParamError: isParamError
|
|
55
|
+
})));
|
|
57
56
|
};
|
|
58
57
|
exports.CurrencyCrossTableWidget = CurrencyCrossTableWidget;
|
|
59
58
|
//# sourceMappingURL=CurrencyCrossTableWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyCrossTableWidget.js","names":["
|
|
1
|
+
{"version":3,"file":"CurrencyCrossTableWidget.js","names":["_client","require","_labsWidgetCommon","_react","_interopRequireDefault","_graphql","_translations","_ValidationWrapper","e","__esModule","default","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","WidgetProvider","withSuspense","liveRates","url","options","styling","translations","WidgetWrapper","linkArea","ValidationWrapper","exports"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { Division } from '../gql/types/graphql';\nimport { translations } from '../translations';\nimport type { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper linkArea=\"full\" logoLink={logoLink}>\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExD,MAAMG,wBAAwB,GAAGC,IAAA,IAUD;EAAA,IAVE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC;EACwB,CAAC,GAAAT,IAAA;EACzB,MAAMU,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAEX,UAAU;IACfY,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMC,YAAY,GAAGX,QAAQ,KAAKY,iBAAQ,CAACC,GAAG,GAAGD,iBAAQ,CAACE,GAAG,GAAGd,QAAQ;EACxE,MAAMe,UAAU,GAAGJ,YAAY,KAAKC,iBAAQ,CAACE,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE3B,MAAA,CAAAO,OAAA,CAAAsB,aAAA,CAAC9B,iBAAA,CAAA+B,cAAc;IACbC,YAAY;IACZZ,MAAM,EAAEA,MAAO;IACfa,SAAS,EAAE;MACTC,GAAG,EAAEtB,YAAY;MACjBuB,OAAO,EAAE;QAAEV,YAAY;QAAEI;MAAW;IACtC,CAAE;IACFd,MAAM,EAAEA,MAAO;IACfqB,OAAO,EAAE;MACPlB;IACF,CAAE;IACFF,KAAK,EAAEA,KAAM;IACbqB,YAAY,EAAEA;EAAa,GAE3BpC,MAAA,CAAAO,OAAA,CAAAsB,aAAA,CAAC9B,iBAAA,CAAAsC,aAAa;IAACC,QAAQ,EAAC,MAAM;IAACpB,QAAQ,EAAEA;EAAS,GAChDlB,MAAA,CAAAO,OAAA,CAAAsB,aAAA,CAACzB,kBAAA,CAAAmC,iBAAiB;IAChB3B,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAACwB,OAAA,CAAAhC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Main = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
7
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _components = require("./components");
|
|
10
10
|
var _utils = require("./utils");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -28,33 +28,33 @@ const Main = _ref => {
|
|
|
28
28
|
});
|
|
29
29
|
}, validInstruments);
|
|
30
30
|
return _react.default.createElement("div", {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
className: "lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary",
|
|
32
|
+
"data-testid": "currency-cross-table-wrapper"
|
|
33
33
|
}, _react.default.createElement("div", {
|
|
34
34
|
className: "lw-flex lw-w-max lw-min-w-full"
|
|
35
35
|
}, _react.default.createElement(_components.TextCell, {
|
|
36
36
|
sticky: true
|
|
37
37
|
}), currencies.map(pair => _react.default.createElement(_components.TextCell, {
|
|
38
38
|
key: pair,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
hovered: pair === selectedPair,
|
|
40
|
+
label: pair
|
|
41
41
|
}))), currencies.map((currency, index, arr) => _react.default.createElement("div", {
|
|
42
42
|
key: currency,
|
|
43
43
|
className: "lw-flex lw-w-max lw-min-w-full"
|
|
44
44
|
}, _react.default.createElement(_components.TextCell, {
|
|
45
|
-
|
|
45
|
+
sticky: true,
|
|
46
46
|
hovered: currency === selectedCurrency,
|
|
47
|
-
|
|
47
|
+
label: currency
|
|
48
48
|
}), arr.map(pair => _react.default.createElement(_react.Fragment, {
|
|
49
49
|
key: `${currency}_${pair}`
|
|
50
50
|
}, currency !== pair ? _react.default.createElement(_components.CellWithData, {
|
|
51
51
|
currency: currency,
|
|
52
|
-
|
|
52
|
+
division: division,
|
|
53
53
|
isValid: validInstruments.includes(`${currency}${(0, _utils.divisionMapper)(division)}${pair}`),
|
|
54
|
-
|
|
54
|
+
pair: pair,
|
|
55
55
|
setSelectedCurrency: setSelectedCurrency,
|
|
56
56
|
setSelectedPair: setSelectedPair,
|
|
57
|
-
|
|
57
|
+
target: target
|
|
58
58
|
}) : _react.default.createElement(_components.TextCell, {
|
|
59
59
|
emptyIndicator: true
|
|
60
60
|
}))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["
|
|
1
|
+
{"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_components","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","currencies","validInstruments","division","selectedCurrency","setSelectedCurrency","useState","selectedPair","setSelectedPair","target","setQuery","useLiveRatesQuery","useEffect","instruments","createElement","className","TextCell","sticky","map","pair","key","hovered","label","currency","index","arr","Fragment","CellWithData","isValid","includes","divisionMapper","emptyIndicator","exports"],"sources":["../../../src/CurrencyCrossTableWidget/Main.tsx"],"sourcesContent":["import { useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport React, { Fragment, useEffect, useState } from 'react';\n\nimport { CellWithData, TextCell } from './components';\nimport type { MainProps } from './types';\nimport { divisionMapper } from './utils';\n\nconst Main = ({ currencies, validInstruments, division }: MainProps) => {\n const [selectedCurrency, setSelectedCurrency] = useState('');\n const [selectedPair, setSelectedPair] = useState('');\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n setQuery({ instruments: validInstruments });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, validInstruments);\n\n return (\n <div\n className=\"lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary\"\n data-testid=\"currency-cross-table-wrapper\"\n >\n <div className=\"lw-flex lw-w-max lw-min-w-full\">\n <TextCell sticky />\n {currencies.map((pair) => (\n <TextCell key={pair} hovered={pair === selectedPair} label={pair} />\n ))}\n </div>\n {currencies.map((currency, index, arr) => (\n <div key={currency} className=\"lw-flex lw-w-max lw-min-w-full\">\n <TextCell\n sticky\n hovered={currency === selectedCurrency}\n label={currency}\n />\n {arr.map((pair) => (\n <Fragment key={`${currency}_${pair}`}>\n {currency !== pair ? (\n <CellWithData\n currency={currency}\n division={division}\n isValid={validInstruments.includes(\n `${currency}${divisionMapper(division)}${pair}`\n )}\n pair={pair}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n target={target}\n />\n ) : (\n <TextCell emptyIndicator />\n )}\n </Fragment>\n ))}\n </div>\n ))}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAAyC,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBA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,EAAE,GAAGG,QAAQ,IAAIJ,IAAI;EAAG,GAClCI,QAAQ,KAAKJ,IAAI,GAChB5C,MAAA,CAAAU,OAAA,CAAA6B,aAAA,CAACrC,WAAA,CAAAkD,YAAY;IACXJ,QAAQ,EAAEA,QAAS;IACnBpB,QAAQ,EAAEA,QAAS;IACnByB,OAAO,EAAE1B,gBAAgB,CAAC2B,QAAQ,CAChC,GAAGN,QAAQ,GAAG,IAAAO,qBAAc,EAAC3B,QAAQ,CAAC,GAAGgB,IAAI,EAC/C,CAAE;IACFA,IAAI,EAAEA,IAAK;IACXd,mBAAmB,EAAEA,mBAAoB;IACzCG,eAAe,EAAEA,eAAgB;IACjCC,MAAM,EAAEA;EAAO,CAChB,CAAC,GAEFlC,MAAA,CAAAU,OAAA,CAAA6B,aAAA,CAACrC,WAAA,CAAAuC,QAAQ;IAACe,cAAc;EAAA,CAAE,CAEpB,CACX,CACE,CACN,CACE,CAAC;AAEV,CAAC;AAACC,OAAA,CAAAjC,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ValidationWrapper = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
10
7
|
var _client = require("@apollo/client");
|
|
8
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _validateInstruments = require("../gql/validateInstruments");
|
|
12
|
-
var _utils = require("./utils");
|
|
13
12
|
var _Main = require("./Main");
|
|
13
|
+
var _utils = require("./utils");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const ValidationWrapper = _ref => {
|
|
16
16
|
let {
|
|
@@ -35,9 +35,9 @@ const ValidationWrapper = _ref => {
|
|
|
35
35
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
36
36
|
className: "lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary"
|
|
37
37
|
}, !showError && _react.default.createElement(_Main.Main, {
|
|
38
|
-
validInstruments: validInstruments,
|
|
39
38
|
currencies: currencies,
|
|
40
|
-
division: division
|
|
39
|
+
division: division,
|
|
40
|
+
validInstruments: validInstruments
|
|
41
41
|
}), showError && _react.default.createElement("div", {
|
|
42
42
|
className: (0, _classnames.default)('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')
|
|
43
43
|
}, _react.default.createElement(_labsWidgetCommon.ChartError, null))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationWrapper.js","names":["
|
|
1
|
+
{"version":3,"file":"ValidationWrapper.js","names":["_client","require","_labsWidgetCommon","_classnames","_interopRequireDefault","_react","_validateInstruments","_Main","_utils","e","__esModule","default","ValidationWrapper","_ref","currencies","division","isParamError","instruments","currenciesToInstruments","data","error","useSuspenseQuery","validateInstruments","variables","fetchPolicy","errorPolicy","validInstruments","resolveInstrumentsByDivision","map","instrument","name","showError","validCurrencies","length","createElement","Fragment","className","Main","classnames","ChartError","exports"],"sources":["../../../src/CurrencyCrossTableWidget/ValidationWrapper.tsx"],"sourcesContent":["import { useSuspenseQuery } from '@apollo/client';\nimport { ChartError } from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport type {\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { Main } from './Main';\nimport type { ValidationWrapperProps } from './types';\nimport { currenciesToInstruments, validCurrencies } from './utils';\n\nconst ValidationWrapper = ({\n currencies,\n division,\n isParamError,\n}: ValidationWrapperProps) => {\n const instruments = currenciesToInstruments(currencies, division);\n\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const validInstruments = data?.resolveInstrumentsByDivision?.map(\n (instrument) => instrument.name\n );\n const showError =\n !validCurrencies(currencies) ||\n isParamError ||\n error ||\n !validInstruments ||\n validInstruments.length === 0;\n\n return (\n <>\n <div className=\"lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary\">\n {!showError && (\n <Main\n currencies={currencies}\n division={division}\n validInstruments={validInstruments}\n />\n )}\n {showError && (\n <div\n className={classnames(\n 'lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary'\n )}\n >\n <ChartError />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAMA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAAmE,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE,MAAMG,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,UAAU;IACVC,QAAQ;IACRC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAMI,WAAW,GAAG,IAAAC,8BAAuB,EAACJ,UAAU,EAAEC,QAAQ,CAAC;EAEjE,MAAM;IAAEI,IAAI;IAAEC;EAAM,CAAC,GAAG,IAAAC,wBAAgB,EAGtCC,wCAAmB,EAAE;IACrBC,SAAS,EAAE;MACTN,WAAW;MACXF;IACF,CAAC;IACDS,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,gBAAgB,GAAGP,IAAI,EAAEQ,4BAA4B,EAAEC,GAAG,CAC7DC,UAAU,IAAKA,UAAU,CAACC,IAC7B,CAAC;EACD,MAAMC,SAAS,GACb,CAAC,IAAAC,sBAAe,EAAClB,UAAU,CAAC,IAC5BE,YAAY,IACZI,KAAK,IACL,CAACM,gBAAgB,IACjBA,gBAAgB,CAACO,MAAM,KAAK,CAAC;EAE/B,OACE5B,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAA7B,MAAA,CAAAM,OAAA,CAAAwB,QAAA,QACE9B,MAAA,CAAAM,OAAA,CAAAuB,aAAA;IAAKE,SAAS,EAAC;EAAsE,GAClF,CAACL,SAAS,IACT1B,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAC3B,KAAA,CAAA8B,IAAI;IACHvB,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBW,gBAAgB,EAAEA;EAAiB,CACpC,CACF,EACAK,SAAS,IACR1B,MAAA,CAAAM,OAAA,CAAAuB,aAAA;IACEE,SAAS,EAAE,IAAAE,mBAAU,EACnB,mGACF;EAAE,GAEFjC,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAChC,iBAAA,CAAAqC,UAAU,MAAE,CACV,CAEJ,CACL,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA5B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Cell = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _constant = require("../constant");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const Cell = _ref => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cell.js","names":["
|
|
1
|
+
{"version":3,"file":"Cell.js","names":["_classnames","_interopRequireDefault","require","_react","_constant","e","__esModule","default","Cell","_ref","children","isError","isLoading","hovered","mouseEnterHandler","mouseLeaveHandler","createElement","className","classnames","onMouseEnter","onMouseLeave","CELL_LOADING_VALUE","CELL_EMPTY_VALUE","exports"],"sources":["../../../../src/CurrencyCrossTableWidget/components/Cell.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { CELL_EMPTY_VALUE, CELL_LOADING_VALUE } from '../constant';\nimport type { CellProps } from './types';\n\nconst Cell = ({\n children,\n isError,\n isLoading,\n hovered,\n mouseEnterHandler,\n mouseLeaveHandler,\n}: CellProps) => (\n <div\n className={classnames(\n 'lw-flex lw-h-11 lw-min-w-[70px] lw-flex-1 lw-items-center lw-justify-center lw-border-b lw-border-r lw-border-solid lw-border-border-primary last:lw-border-r-[0px]',\n {\n 'lw-bg-border-primary lw-font-semibold lw-shadow-innerBorderBgColor':\n hovered,\n }\n )}\n onMouseEnter={mouseEnterHandler}\n onMouseLeave={mouseLeaveHandler}\n >\n {isLoading && <div className=\"lw-px-3 lw-py-3.5\">{CELL_LOADING_VALUE}</div>}\n {!isLoading && !isError && children}\n {!isLoading && isError && <span>{CELL_EMPTY_VALUE}</span>}\n </div>\n);\n\nexport { Cell };\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAAmE,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGnE,MAAMG,IAAI,GAAGC,IAAA;EAAA,IAAC;IACZC,QAAQ;IACRC,OAAO;IACPC,SAAS;IACTC,OAAO;IACPC,iBAAiB;IACjBC;EACS,CAAC,GAAAN,IAAA;EAAA,OACVN,MAAA,CAAAI,OAAA,CAAAS,aAAA;IACEC,SAAS,EAAE,IAAAC,mBAAU,EACnB,qKAAqK,EACrK;MACE,oEAAoE,EAClEL;IACJ,CACF,CAAE;IACFM,YAAY,EAAEL,iBAAkB;IAChCM,YAAY,EAAEL;EAAkB,GAE/BH,SAAS,IAAIT,MAAA,CAAAI,OAAA,CAAAS,aAAA;IAAKC,SAAS,EAAC;EAAmB,GAAEI,4BAAwB,CAAC,EAC1E,CAACT,SAAS,IAAI,CAACD,OAAO,IAAID,QAAQ,EAClC,CAACE,SAAS,IAAID,OAAO,IAAIR,MAAA,CAAAI,OAAA,CAAAS,aAAA,eAAOM,0BAAuB,CACrD,CAAC;AAAA,CACP;AAACC,OAAA,CAAAf,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CellWithData = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
7
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
9
|
-
var
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _utils = require("../utils");
|
|
10
|
+
var _Cell = require("./Cell");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
const CellWithData = _ref => {
|
|
@@ -34,7 +34,7 @@ const CellWithData = _ref => {
|
|
|
34
34
|
buyPriceMovement: update?.askPriceMovement,
|
|
35
35
|
displayPrecision: currency === 'JPY' && !isValid ? 6 : update?.displayPrecision
|
|
36
36
|
};
|
|
37
|
-
const checkLoading =
|
|
37
|
+
const checkLoading = () => !liveRatesError && updatedRecord.buy === undefined;
|
|
38
38
|
const handleMouseEnter = () => {
|
|
39
39
|
setHovered(true);
|
|
40
40
|
setSelectedCurrency(currency);
|
|
@@ -46,14 +46,14 @@ const CellWithData = _ref => {
|
|
|
46
46
|
setSelectedPair('');
|
|
47
47
|
};
|
|
48
48
|
return _react.default.createElement(_Cell.Cell, {
|
|
49
|
-
isLoading: checkLoading('buy'),
|
|
50
|
-
isError: !!liveRatesError,
|
|
51
49
|
hovered: hovered,
|
|
50
|
+
isError: !!liveRatesError,
|
|
51
|
+
isLoading: checkLoading(),
|
|
52
52
|
mouseEnterHandler: handleMouseEnter,
|
|
53
53
|
mouseLeaveHandler: handleMouseLeave
|
|
54
54
|
}, _react.default.createElement(_labsWidgetCommon.Price, {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
movementIndicator: "background",
|
|
56
|
+
priceMovement: (0, _utils.getPriceMovement)(updatedRecord.buyPriceMovement, !isValid)
|
|
57
57
|
}, _react.default.createElement("span", null, (0, _utils.getBuyPrice)(updatedRecord.buy, !isValid).toFixed(updatedRecord.displayPrecision))));
|
|
58
58
|
};
|
|
59
59
|
exports.CellWithData = CellWithData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellWithData.js","names":["
|
|
1
|
+
{"version":3,"file":"CellWithData.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_utils","_Cell","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CellWithData","_ref","currency","pair","isValid","target","division","setSelectedCurrency","setSelectedPair","hovered","setHovered","useState","instrument","divisionMapper","instrumentForUpdates","update","error","liveRatesError","useLiveRatesMessage","updatedRecord","displayName","buy","ask","buyPriceMovement","askPriceMovement","displayPrecision","checkLoading","undefined","handleMouseEnter","handleMouseLeave","createElement","Cell","isError","isLoading","mouseEnterHandler","mouseLeaveHandler","Price","movementIndicator","priceMovement","getPriceMovement","getBuyPrice","toFixed","exports"],"sources":["../../../../src/CurrencyCrossTableWidget/components/CellWithData.tsx"],"sourcesContent":["import { Price, useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport React, { useState } from 'react';\n\nimport { divisionMapper, getBuyPrice, getPriceMovement } from '../utils';\nimport { Cell } from './Cell';\nimport type { CellWithDataProps } from './types';\n\nconst CellWithData = ({\n currency,\n pair,\n isValid,\n target,\n division,\n setSelectedCurrency,\n setSelectedPair,\n}: CellWithDataProps) => {\n const [hovered, setHovered] = useState(false);\n\n const instrument = `${currency}${divisionMapper(division)}${pair}`;\n const instrumentForUpdates = isValid\n ? instrument\n : `${pair}${divisionMapper(division)}${currency}`;\n\n const { update, error: liveRatesError } = useLiveRatesMessage(\n instrumentForUpdates,\n target\n );\n\n const updatedRecord = {\n displayName: `${currency}/${pair}`,\n instrument,\n buy: update?.ask,\n buyPriceMovement: update?.askPriceMovement,\n displayPrecision:\n currency === 'JPY' && !isValid ? 6 : update?.displayPrecision,\n };\n\n const checkLoading = () => !liveRatesError && updatedRecord.buy === undefined;\n\n const handleMouseEnter = () => {\n setHovered(true);\n setSelectedCurrency(currency);\n setSelectedPair(pair);\n };\n\n const handleMouseLeave = () => {\n setHovered(false);\n setSelectedCurrency('');\n setSelectedPair('');\n };\n\n return (\n <Cell\n hovered={hovered}\n isError={!!liveRatesError}\n isLoading={checkLoading()}\n mouseEnterHandler={handleMouseEnter}\n mouseLeaveHandler={handleMouseLeave}\n >\n <Price\n movementIndicator=\"background\"\n priceMovement={getPriceMovement(\n updatedRecord.buyPriceMovement,\n !isValid\n )}\n >\n <span>\n {getBuyPrice(updatedRecord.buy, !isValid).toFixed(\n updatedRecord.displayPrecision\n )}\n </span>\n </Price>\n </Cell>\n );\n};\n\nexport { CellWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAA8B,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,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IAC7BlB,UAAU,CAAC,IAAI,CAAC;IAChBH,mBAAmB,CAACL,QAAQ,CAAC;IAC7BM,eAAe,CAACL,IAAI,CAAC;EACvB,CAAC;EAED,MAAM0B,gBAAgB,GAAGA,CAAA,KAAM;IAC7BnB,UAAU,CAAC,KAAK,CAAC;IACjBH,mBAAmB,CAAC,EAAE,CAAC;IACvBC,eAAe,CAAC,EAAE,CAAC;EACrB,CAAC;EAED,OACEhC,MAAA,CAAAU,OAAA,CAAA4C,aAAA,CAACnD,KAAA,CAAAoD,IAAI;IACHtB,OAAO,EAAEA,OAAQ;IACjBuB,OAAO,EAAE,CAAC,CAACf,cAAe;IAC1BgB,SAAS,EAAEP,YAAY,CAAC,CAAE;IAC1BQ,iBAAiB,EAAEN,gBAAiB;IACpCO,iBAAiB,EAAEN;EAAiB,GAEpCrD,MAAA,CAAAU,OAAA,CAAA4C,aAAA,CAACxD,iBAAA,CAAA8D,KAAK;IACJC,iBAAiB,EAAC,YAAY;IAC9BC,aAAa,EAAE,IAAAC,uBAAgB,EAC7BpB,aAAa,CAACI,gBAAgB,EAC9B,CAACnB,OACH;EAAE,GAEF5B,MAAA,CAAAU,OAAA,CAAA4C,aAAA,eACG,IAAAU,kBAAW,EAACrB,aAAa,CAACE,GAAG,EAAE,CAACjB,OAAO,CAAC,CAACqC,OAAO,CAC/CtB,aAAa,CAACM,gBAChB,CACI,CACD,CACH,CAAC;AAEX,CAAC;AAACiB,OAAA,CAAA1C,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TextCell = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const TextCell = _ref => {
|
|
11
11
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextCell.js","names":["
|
|
1
|
+
{"version":3,"file":"TextCell.js","names":["_classnames","_interopRequireDefault","require","_react","e","__esModule","default","TextCell","_ref","label","emptyIndicator","hovered","sticky","createElement","className","classnames","exports"],"sources":["../../../../src/CurrencyCrossTableWidget/components/TextCell.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport type { TextCellProps } from './types';\n\nconst TextCell = ({\n label,\n emptyIndicator,\n hovered,\n sticky,\n}: TextCellProps) => (\n <span\n className={classnames(\n 'lw-h-11 lw-min-w-[70px] lw-flex-1 lw-border-b lw-border-r lw-border-solid lw-border-border-primary lw-py-3.5 lw-text-center last:lw-border-r-[0px]',\n {\n 'lw-bg-border-primary': emptyIndicator,\n 'lw-shadow-innerBorderBgColor': emptyIndicator && hovered,\n 'lw-bg-border-primary lw-font-semibold': hovered,\n 'lw-sticky lw-left-0 lw-z-10': sticky,\n 'lw-bg-bg-primary': sticky && !hovered,\n }\n )}\n >\n {label}\n </span>\n);\n\nexport { TextCell };\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI1B,MAAMG,QAAQ,GAAGC,IAAA;EAAA,IAAC;IAChBC,KAAK;IACLC,cAAc;IACdC,OAAO;IACPC;EACa,CAAC,GAAAJ,IAAA;EAAA,OACdL,MAAA,CAAAG,OAAA,CAAAO,aAAA;IACEC,SAAS,EAAE,IAAAC,mBAAU,EACnB,oJAAoJ,EACpJ;MACE,sBAAsB,EAAEL,cAAc;MACtC,8BAA8B,EAAEA,cAAc,IAAIC,OAAO;MACzD,uCAAuC,EAAEA,OAAO;MAChD,6BAA6B,EAAEC,MAAM;MACrC,kBAAkB,EAAEA,MAAM,IAAI,CAACD;IACjC,CACF;EAAE,GAEDF,KACG,CAAC;AAAA,CACR;AAACO,OAAA,CAAAT,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/CurrencyCrossTableWidget/components/types.ts"],"sourcesContent":["import { LoaderSize } from '@oanda/labs-widget-common';\nimport { Division } from '../../gql/types/graphql';\n\nexport interface CellWithDataProps {\n currency: string;\n pair: string;\n isValid: boolean;\n target: EventTarget | null;\n division: Division;\n setSelectedCurrency: React.Dispatch<React.SetStateAction<string>>;\n setSelectedPair: React.Dispatch<React.SetStateAction<string>>;\n}\n\nexport interface CellProps {\n children: React.ReactNode;\n isLoading?: boolean;\n isError?: boolean;\n loaderSize?: LoaderSize;\n hovered: boolean;\n mouseEnterHandler: () => void;\n mouseLeaveHandler: () => void;\n}\n\nexport interface TextCellProps {\n label?: string;\n emptyIndicator?: boolean;\n hovered?: boolean;\n sticky?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/CurrencyCrossTableWidget/components/types.ts"],"sourcesContent":["import type { LoaderSize } from '@oanda/labs-widget-common';\n\nimport type { Division } from '../../gql/types/graphql';\n\nexport interface CellWithDataProps {\n currency: string;\n pair: string;\n isValid: boolean;\n target: EventTarget | null;\n division: Division;\n setSelectedCurrency: React.Dispatch<React.SetStateAction<string>>;\n setSelectedPair: React.Dispatch<React.SetStateAction<string>>;\n}\n\nexport interface CellProps {\n children: React.ReactNode;\n isLoading?: boolean;\n isError?: boolean;\n loaderSize?: LoaderSize;\n hovered: boolean;\n mouseEnterHandler: () => void;\n mouseLeaveHandler: () => void;\n}\n\nexport interface TextCellProps {\n label?: string;\n emptyIndicator?: boolean;\n hovered?: boolean;\n sticky?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","names":["MAJOR_CURRENCIES","exports","INSTRUMENT_TOOLTIP_ID","CELL_LOADING_VALUE","CELL_EMPTY_VALUE"],"sources":["../../../src/CurrencyCrossTableWidget/constant.ts"],"sourcesContent":["const MAJOR_CURRENCIES = ['EUR'
|
|
1
|
+
{"version":3,"file":"constant.js","names":["MAJOR_CURRENCIES","exports","INSTRUMENT_TOOLTIP_ID","CELL_LOADING_VALUE","CELL_EMPTY_VALUE"],"sources":["../../../src/CurrencyCrossTableWidget/constant.ts"],"sourcesContent":["const MAJOR_CURRENCIES = [\n 'EUR',\n 'USD',\n 'JPY',\n 'GBP',\n 'CHF',\n 'AUD',\n 'CAD',\n 'NZD',\n];\n\nconst INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';\n\nconst CELL_LOADING_VALUE = '...';\n\nconst CELL_EMPTY_VALUE = '\\u2014';\n\nexport {\n CELL_EMPTY_VALUE,\n CELL_LOADING_VALUE,\n INSTRUMENT_TOOLTIP_ID,\n MAJOR_CURRENCIES,\n};\n"],"mappings":";;;;;;AAAA,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CACvB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;AAED,MAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,uBAAuB;AAErD,MAAMC,kBAAkB,GAAAF,OAAA,CAAAE,kBAAA,GAAG,KAAK;AAEhC,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG,QAAQ","ignoreList":[]}
|