@oanda/labs-currency-strength-widget 1.0.52 → 1.0.54

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +436 -0
  2. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +12 -16
  3. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  4. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js +1 -1
  5. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -1
  6. package/dist/main/CurrencyStrengthWidget/Main.js +2 -2
  7. package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -1
  8. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +2 -2
  9. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  10. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js +5 -1
  11. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  12. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  13. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  14. package/dist/main/CurrencyStrengthWidget/render.js +1 -1
  15. package/dist/main/CurrencyStrengthWidget/render.js.map +1 -1
  16. package/dist/main/gql/getCurrencyStrength.js +12 -3
  17. package/dist/main/gql/getCurrencyStrength.js.map +1 -1
  18. package/dist/main/gql/types/fragment-masking.js +2 -3
  19. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  20. package/dist/main/gql/types/gql.js +1 -2
  21. package/dist/main/gql/types/gql.js.map +1 -1
  22. package/dist/main/translations/index.js +1 -1
  23. package/dist/main/translations/index.js.map +1 -1
  24. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +11 -15
  25. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  26. package/dist/module/CurrencyStrengthWidget/Main.js +2 -2
  27. package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -1
  28. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js +1 -1
  29. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  30. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js +5 -1
  31. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  32. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  33. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  34. package/dist/module/gql/getCurrencyStrength.js +12 -3
  35. package/dist/module/gql/getCurrencyStrength.js.map +1 -1
  36. package/dist/module/gql/types/fragment-masking.js +2 -3
  37. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  38. package/dist/module/gql/types/gql.js +1 -2
  39. package/dist/module/gql/types/gql.js.map +1 -1
  40. package/dist/types/gql/types/graphql.d.ts +1 -3
  41. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,442 @@
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.54 (2024-07-03)
7
+
8
+
9
+
10
+ ## 1.0.135 (2024-07-03)
11
+
12
+
13
+
14
+ ## 1.0.134 (2024-07-03)
15
+
16
+
17
+
18
+ ## 1.0.133 (2024-06-28)
19
+
20
+
21
+
22
+ ## 1.0.132 (2024-06-27)
23
+
24
+
25
+
26
+ ## 1.0.131 (2024-06-27)
27
+
28
+
29
+
30
+ ## 1.0.130 (2024-06-26)
31
+
32
+
33
+
34
+ ## 1.0.129 (2024-06-17)
35
+
36
+
37
+
38
+ ## 1.0.128 (2024-06-17)
39
+
40
+
41
+
42
+ ## 1.0.127 (2024-06-10)
43
+
44
+
45
+
46
+ ## 1.0.126 (2024-05-29)
47
+
48
+
49
+
50
+ ## 1.0.125 (2024-05-29)
51
+
52
+
53
+
54
+ ## 1.0.124 (2024-05-29)
55
+
56
+
57
+
58
+ ## 1.0.123 (2024-05-28)
59
+
60
+
61
+
62
+ ## 1.0.122 (2024-05-27)
63
+
64
+
65
+
66
+ ## 1.0.121 (2024-05-27)
67
+
68
+
69
+
70
+ ## 1.0.120 (2024-05-24)
71
+
72
+
73
+
74
+ ## 1.0.119 (2024-05-17)
75
+
76
+
77
+
78
+ ## 1.0.118 (2024-05-09)
79
+
80
+
81
+
82
+ ## 1.0.117 (2024-05-07)
83
+
84
+
85
+
86
+ ## 1.0.116 (2024-04-23)
87
+
88
+
89
+
90
+ ## 1.0.115 (2024-04-22)
91
+
92
+
93
+
94
+ ## 1.0.114 (2024-04-19)
95
+
96
+
97
+
98
+ ## 1.0.113 (2024-04-19)
99
+
100
+
101
+
102
+ ## 1.0.112 (2024-04-15)
103
+
104
+
105
+
106
+ ## 1.0.111 (2024-04-11)
107
+
108
+
109
+
110
+ ## 1.0.110 (2024-04-05)
111
+
112
+
113
+
114
+ ## 1.0.109 (2024-04-05)
115
+
116
+
117
+
118
+ ## 1.0.108 (2024-04-04)
119
+
120
+
121
+
122
+ ## 1.0.107 (2024-04-03)
123
+
124
+
125
+
126
+ ## 1.0.106 (2024-03-29)
127
+
128
+
129
+
130
+ ## 1.0.105 (2024-03-28)
131
+
132
+
133
+
134
+ ## 1.0.104 (2024-03-21)
135
+
136
+
137
+
138
+ ## 1.0.103 (2024-03-20)
139
+
140
+
141
+
142
+ ## 1.0.102 (2024-03-20)
143
+
144
+
145
+
146
+ ## 1.0.101 (2024-03-13)
147
+
148
+
149
+
150
+ ## 1.0.100 (2024-03-12)
151
+
152
+
153
+
154
+ ## 1.0.99 (2024-03-11)
155
+
156
+
157
+
158
+ ## 1.0.98 (2024-03-07)
159
+
160
+
161
+
162
+ ## 1.0.97 (2024-03-06)
163
+
164
+
165
+
166
+ ## 1.0.96 (2024-03-06)
167
+
168
+
169
+
170
+ ## 1.0.95 (2024-03-04)
171
+
172
+
173
+
174
+ ## 1.0.94 (2024-02-29)
175
+
176
+
177
+
178
+ ## 1.0.93 (2024-02-28)
179
+
180
+
181
+
182
+ ## 1.0.92 (2024-02-28)
183
+
184
+
185
+
186
+ ## 1.0.91 (2024-02-23)
187
+
188
+
189
+
190
+ ## 1.0.90 (2024-02-23)
191
+
192
+
193
+
194
+ ## 1.0.89 (2024-02-21)
195
+
196
+
197
+
198
+ ## 1.0.88 (2024-02-21)
199
+
200
+
201
+
202
+ ## 1.0.87 (2024-02-20)
203
+
204
+
205
+
206
+ ## 1.0.86 (2024-02-20)
207
+
208
+
209
+
210
+ ## 1.0.85 (2024-02-13)
211
+
212
+
213
+
214
+ ## 1.0.84 (2024-02-13)
215
+
216
+
217
+
218
+ ## 1.0.83 (2024-02-09)
219
+
220
+ **Note:** Version bump only for package @oanda/labs-currency-strength-widget
221
+
222
+
223
+
224
+
225
+
226
+ ## 1.0.53 (2024-07-03)
227
+
228
+
229
+
230
+ ## 1.0.134 (2024-07-03)
231
+
232
+
233
+
234
+ ## 1.0.133 (2024-06-28)
235
+
236
+
237
+
238
+ ## 1.0.132 (2024-06-27)
239
+
240
+
241
+
242
+ ## 1.0.131 (2024-06-27)
243
+
244
+
245
+
246
+ ## 1.0.130 (2024-06-26)
247
+
248
+
249
+
250
+ ## 1.0.129 (2024-06-17)
251
+
252
+
253
+
254
+ ## 1.0.128 (2024-06-17)
255
+
256
+
257
+
258
+ ## 1.0.127 (2024-06-10)
259
+
260
+
261
+
262
+ ## 1.0.126 (2024-05-29)
263
+
264
+
265
+
266
+ ## 1.0.125 (2024-05-29)
267
+
268
+
269
+
270
+ ## 1.0.124 (2024-05-29)
271
+
272
+
273
+
274
+ ## 1.0.123 (2024-05-28)
275
+
276
+
277
+
278
+ ## 1.0.122 (2024-05-27)
279
+
280
+
281
+
282
+ ## 1.0.121 (2024-05-27)
283
+
284
+
285
+
286
+ ## 1.0.120 (2024-05-24)
287
+
288
+
289
+
290
+ ## 1.0.119 (2024-05-17)
291
+
292
+
293
+
294
+ ## 1.0.118 (2024-05-09)
295
+
296
+
297
+
298
+ ## 1.0.117 (2024-05-07)
299
+
300
+
301
+
302
+ ## 1.0.116 (2024-04-23)
303
+
304
+
305
+
306
+ ## 1.0.115 (2024-04-22)
307
+
308
+
309
+
310
+ ## 1.0.114 (2024-04-19)
311
+
312
+
313
+
314
+ ## 1.0.113 (2024-04-19)
315
+
316
+
317
+
318
+ ## 1.0.112 (2024-04-15)
319
+
320
+
321
+
322
+ ## 1.0.111 (2024-04-11)
323
+
324
+
325
+
326
+ ## 1.0.110 (2024-04-05)
327
+
328
+
329
+
330
+ ## 1.0.109 (2024-04-05)
331
+
332
+
333
+
334
+ ## 1.0.108 (2024-04-04)
335
+
336
+
337
+
338
+ ## 1.0.107 (2024-04-03)
339
+
340
+
341
+
342
+ ## 1.0.106 (2024-03-29)
343
+
344
+
345
+
346
+ ## 1.0.105 (2024-03-28)
347
+
348
+
349
+
350
+ ## 1.0.104 (2024-03-21)
351
+
352
+
353
+
354
+ ## 1.0.103 (2024-03-20)
355
+
356
+
357
+
358
+ ## 1.0.102 (2024-03-20)
359
+
360
+
361
+
362
+ ## 1.0.101 (2024-03-13)
363
+
364
+
365
+
366
+ ## 1.0.100 (2024-03-12)
367
+
368
+
369
+
370
+ ## 1.0.99 (2024-03-11)
371
+
372
+
373
+
374
+ ## 1.0.98 (2024-03-07)
375
+
376
+
377
+
378
+ ## 1.0.97 (2024-03-06)
379
+
380
+
381
+
382
+ ## 1.0.96 (2024-03-06)
383
+
384
+
385
+
386
+ ## 1.0.95 (2024-03-04)
387
+
388
+
389
+
390
+ ## 1.0.94 (2024-02-29)
391
+
392
+
393
+
394
+ ## 1.0.93 (2024-02-28)
395
+
396
+
397
+
398
+ ## 1.0.92 (2024-02-28)
399
+
400
+
401
+
402
+ ## 1.0.91 (2024-02-23)
403
+
404
+
405
+
406
+ ## 1.0.90 (2024-02-23)
407
+
408
+
409
+
410
+ ## 1.0.89 (2024-02-21)
411
+
412
+
413
+
414
+ ## 1.0.88 (2024-02-21)
415
+
416
+
417
+
418
+ ## 1.0.87 (2024-02-20)
419
+
420
+
421
+
422
+ ## 1.0.86 (2024-02-20)
423
+
424
+
425
+
426
+ ## 1.0.85 (2024-02-13)
427
+
428
+
429
+
430
+ ## 1.0.84 (2024-02-13)
431
+
432
+
433
+
434
+ ## 1.0.83 (2024-02-09)
435
+
436
+ **Note:** Version bump only for package @oanda/labs-currency-strength-widget
437
+
438
+
439
+
440
+
441
+
6
442
  ## 1.0.52 (2024-07-03)
7
443
 
8
444
 
@@ -12,11 +12,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
12
12
  var _getCurrencyStrength = require("../gql/getCurrencyStrength");
13
13
  var _Chart = require("./components/Chart");
14
14
  var _formatters = require("./components/Chart/formatters");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  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); }
17
17
  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; }
18
18
  const ChartWithData = _ref => {
19
- var _data$currencyStrengt, _data$currencyStrengt2, _data$currencyStrengt3, _data$currencyStrengt4, _;
20
19
  let {
21
20
  currency
22
21
  } = _ref;
@@ -34,9 +33,9 @@ const ChartWithData = _ref => {
34
33
  } = (0, _client.useQuery)(_getCurrencyStrength.getCurrencyStrength, {
35
34
  fetchPolicy: 'cache-and-network'
36
35
  });
37
- const showChart = (data === null || data === void 0 ? void 0 : data.currencyStrength) && (data === null || data === void 0 || (_data$currencyStrengt = data.currencyStrength) === null || _data$currencyStrengt === void 0 ? void 0 : _data$currencyStrengt.length) > 0;
38
- const showError = (data === null || data === void 0 || (_data$currencyStrengt2 = data.currencyStrength) === null || _data$currencyStrengt2 === void 0 ? void 0 : _data$currencyStrengt2.length) === 0 || error;
39
- const currencyData = currency ? data === null || data === void 0 || (_data$currencyStrengt3 = data.currencyStrength) === null || _data$currencyStrengt3 === void 0 ? void 0 : _data$currencyStrengt3.filter(item => item.currency === currency) : data === null || data === void 0 || (_data$currencyStrengt4 = data.currencyStrength) === null || _data$currencyStrengt4 === void 0 ? void 0 : _data$currencyStrengt4.slice().sort(_formatters.sortCurrencies);
36
+ const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;
37
+ const showError = data?.currencyStrength?.length === 0 || error;
38
+ const currencyData = currency ? data?.currencyStrength?.filter(item => item.currency === currency) : data?.currencyStrength?.slice().sort(_formatters.sortCurrencies);
40
39
  return _react.default.createElement(_react.default.Fragment, null, loading && _react.default.createElement("div", {
41
40
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
42
41
  'lw-h-[461px]': !currency,
@@ -50,16 +49,13 @@ const ChartWithData = _ref => {
50
49
  'lw-grid-cols-3 ': isDesktop && !currency,
51
50
  'lw-grid-cols-1': !isDesktop || currency
52
51
  })
53
- }, currencyData && currencyData.map(item => {
54
- var _item$strengthRelatio;
55
- return _react.default.createElement("div", {
56
- key: item.currency,
57
- className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
58
- }, _react.default.createElement(_Chart.Chart, {
59
- currency: item.currency,
60
- values: (_item$strengthRelatio = item.strengthRelation) === null || _item$strengthRelatio === void 0 ? void 0 : _item$strengthRelatio.slice().sort(_formatters.sortCurrencies)
61
- }));
62
- })), !loading && showError && _react.default.createElement("div", {
52
+ }, currencyData && currencyData.map(item => _react.default.createElement("div", {
53
+ key: item.currency,
54
+ className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
55
+ }, _react.default.createElement(_Chart.Chart, {
56
+ currency: item.currency,
57
+ values: item.strengthRelation?.slice().sort(_formatters.sortCurrencies)
58
+ })))), !loading && showError && _react.default.createElement("div", {
63
59
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
64
60
  'lw-h-[425px]': !currency,
65
61
  'lw-h-[135px]': currency
@@ -67,7 +63,7 @@ const ChartWithData = _ref => {
67
63
  }, _react.default.createElement(_labsWidgetCommon.ChartError, null)), !loading && !showError && _react.default.createElement("div", {
68
64
  className: "lw-mt-2 lw-h-8"
69
65
  }, _react.default.createElement(_labsWidgetCommon.LastUpdated, {
70
- timestamp: data === null || data === void 0 || (_ = data.currencyStrength[0]) === null || _ === void 0 ? void 0 : _.updatedAt,
66
+ timestamp: data?.currencyStrength[0]?.updatedAt,
71
67
  labelCallback: lang
72
68
  })));
73
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["_react","_interopRequireWildcard","require","_client","_monoI18n","_labsWidgetCommon","_classnames","_interopRequireDefault","_getCurrencyStrength","_Chart","_formatters","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChartWithData","_ref","_data$currencyStrengt","_data$currencyStrengt2","_data$currencyStrengt3","_data$currencyStrengt4","_","currency","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","_item$strengthRelatio","key","Chart","values","strengthRelation","ChartError","LastUpdated","timestamp","updatedAt","labelCallback","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport { useLocale } from '@oanda/mono-i18n';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(getCurrencyStrength, {\n fetchPolicy: 'cache-and-network',\n });\n\n const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n data-testid=\"currency-strength-chart-wrapper\"\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n >\n {currencyData && currencyData.map((item) => (\n <div key={item.currency} className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\">\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated timestamp={data?.currencyStrength![0]?.updatedAt} labelCallback={lang} />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA+D,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,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,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,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,CAAAa,OAAA,CAAAmD,aAAA;MAAKS,GAAG,EAAEb,IAAI,CAACrB,QAAS;MAAC2B,SAAS,EAAC;IAAkE,GACnGlE,MAAA,CAAAa,OAAA,CAAAmD,aAAA,CAACvD,MAAA,CAAAiE,KAAK;MACJnC,QAAQ,EAAEqB,IAAI,CAACrB,QAAS;MACxBoC,MAAM,GAAAH,qBAAA,GAAEZ,IAAI,CAACgB,gBAAgB,cAAAJ,qBAAA,uBAArBA,qBAAA,CAAuBX,KAAK,CAAC,CAAC,CAACC,IAAI,CAACC,0BAAc;IAAG,CAC9D,CACE,CAAC;EAAA,CACP,CACE,CACN,EACA,CAACf,OAAO,IAAIS,SAAS,IACpBzD,MAAA,CAAAa,OAAA,CAAAmD,aAAA;IAAKE,SAAS,EAAE,IAAAC,mBAAU,EAAC,sFAAsF,EAAE;MACjH,cAAc,EAAE,CAAC5B,QAAQ;MACzB,cAAc,EAAEA;IAClB,CAAC;EAAE,GAEDvC,MAAA,CAAAa,OAAA,CAAAmD,aAAA,CAAC3D,iBAAA,CAAAwE,UAAU,MAAE,CACV,CACN,EACA,CAAC7B,OAAO,IAAI,CAACS,SAAS,IACrBzD,MAAA,CAAAa,OAAA,CAAAmD,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BlE,MAAA,CAAAa,OAAA,CAAAmD,aAAA,CAAC3D,iBAAA,CAAAyE,WAAW;IAACC,SAAS,EAAE9B,IAAI,aAAJA,IAAI,gBAAAX,CAAA,GAAJW,IAAI,CAAEM,gBAAgB,CAAE,CAAC,CAAC,cAAAjB,CAAA,uBAA1BA,CAAA,CAA4B0C,SAAU;IAACC,aAAa,EAAEnC;EAAK,CAAE,CAClF,CAEP,CAAC;AAEP,CAAC;AAACoC,OAAA,CAAAlD,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"ChartsWithData.js","names":["_react","_interopRequireWildcard","require","_client","_monoI18n","_labsWidgetCommon","_classnames","_interopRequireDefault","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChartWithData","_ref","currency","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","key","Chart","values","strengthRelation","ChartError","LastUpdated","timestamp","updatedAt","labelCallback","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport { useLocale } from '@oanda/mono-i18n';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(getCurrencyStrength, {\n fetchPolicy: 'cache-and-network',\n });\n\n const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n data-testid=\"currency-strength-chart-wrapper\"\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n >\n {currencyData && currencyData.map((item) => (\n <div key={item.currency} className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\">\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated timestamp={data?.currencyStrength![0]?.updatedAt} labelCallback={lang} />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA+D,SAAAK,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAK,CAAA,SA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rB,QAAS;IAAC2B,SAAS,EAAC;EAAkE,GACnG5D,MAAA,CAAAa,OAAA,CAAA6C,aAAA,CAACjD,MAAA,CAAA0D,KAAK;IACJlC,QAAQ,EAAEqB,IAAI,CAACrB,QAAS;IACxBmC,MAAM,EAAEd,IAAI,CAACe,gBAAgB,EAAEd,KAAK,CAAC,CAAC,CAACC,IAAI,CAACC,0BAAc;EAAG,CAC9D,CACE,CACN,CACE,CACN,EACA,CAACf,OAAO,IAAIS,SAAS,IACpBnD,MAAA,CAAAa,OAAA,CAAA6C,aAAA;IAAKE,SAAS,EAAE,IAAAC,mBAAU,EAAC,sFAAsF,EAAE;MACjH,cAAc,EAAE,CAAC5B,QAAQ;MACzB,cAAc,EAAEA;IAClB,CAAC;EAAE,GAEDjC,MAAA,CAAAa,OAAA,CAAA6C,aAAA,CAACrD,iBAAA,CAAAiE,UAAU,MAAE,CACV,CACN,EACA,CAAC5B,OAAO,IAAI,CAACS,SAAS,IACrBnD,MAAA,CAAAa,OAAA,CAAA6C,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7B5D,MAAA,CAAAa,OAAA,CAAA6C,aAAA,CAACrD,iBAAA,CAAAkE,WAAW;IAACC,SAAS,EAAE7B,IAAI,EAAEM,gBAAgB,CAAE,CAAC,CAAC,EAAEwB,SAAU;IAACC,aAAa,EAAElC;EAAK,CAAE,CAClF,CAEP,CAAC;AAEP,CAAC;AAACmC,OAAA,CAAA5C,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -10,7 +10,7 @@ var _client = require("@apollo/client");
10
10
  var _labsWidgetCommon = require("@oanda/labs-widget-common");
11
11
  var _translations = require("../translations");
12
12
  var _Main = require("./Main");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  const CurrencyStrengthWidget = _ref => {
15
15
  let {
16
16
  graphqlUrl,
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyStrengthWidget.js","names":["_react","_interopRequireDefault","require","_monoI18n","_client","_labsWidgetCommon","_translations","_Main","obj","__esModule","default","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","client","ApolloClient","uri","cache","InMemoryCache","createElement","ThemeProvider","LocaleProvider","getLocale","translations","ApolloProvider","className","ChartError","Main","exports"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { ChartError, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { CurrencyStrengthConfig } from './types';\nimport { translations } from '../translations';\nimport { Main } from './Main';\n\nconst CurrencyStrengthWidget = ({\n graphqlUrl, currency, locale, theme, isParamError,\n}: CurrencyStrengthConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n ) : <Main currency={currency} />}\n </ApolloProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAA8B,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE9B,MAAMG,sBAAsB,GAAGC,IAAA,IAED;EAAA,IAFE;IAC9BC,UAAU;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC;EACf,CAAC,GAAAL,IAAA;EACvB,MAAMM,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEtB,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAClB,iBAAA,CAAAmB,aAAa;IAACR,KAAK,EAAEA;EAAM,GAC1BhB,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAACpB,SAAA,CAAAsB,cAAc;IAACV,MAAM,EAAE,IAAAW,2BAAS,EAACX,MAAM,CAAE;IAACY,YAAY,EAAEA;EAAa,GACpE3B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAACnB,OAAA,CAAAwB,cAAc;IAACV,MAAM,EAAEA;EAAO,GAC5BD,YAAY,GACXjB,MAAA,CAAAU,OAAA,CAAAa,aAAA;IAAKM,SAAS,EAAC;EAAmG,GAChH7B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAClB,iBAAA,CAAAyB,UAAU,MAAE,CACV,CAAC,GACJ9B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAChB,KAAA,CAAAwB,IAAI;IAACjB,QAAQ,EAAEA;EAAS,CAAE,CACjB,CACF,CACH,CAAC;AAEpB,CAAC;AAACkB,OAAA,CAAArB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyStrengthWidget.js","names":["_react","_interopRequireDefault","require","_monoI18n","_client","_labsWidgetCommon","_translations","_Main","e","__esModule","default","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","client","ApolloClient","uri","cache","InMemoryCache","createElement","ThemeProvider","LocaleProvider","getLocale","translations","ApolloProvider","className","ChartError","Main","exports"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { ChartError, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { CurrencyStrengthConfig } from './types';\nimport { translations } from '../translations';\nimport { Main } from './Main';\n\nconst CurrencyStrengthWidget = ({\n graphqlUrl, currency, locale, theme, isParamError,\n}: CurrencyStrengthConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n ) : <Main currency={currency} />}\n </ApolloProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAA8B,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B,MAAMG,sBAAsB,GAAGC,IAAA,IAED;EAAA,IAFE;IAC9BC,UAAU;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC;EACf,CAAC,GAAAL,IAAA;EACvB,MAAMM,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEtB,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAClB,iBAAA,CAAAmB,aAAa;IAACR,KAAK,EAAEA;EAAM,GAC1BhB,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAACpB,SAAA,CAAAsB,cAAc;IAACV,MAAM,EAAE,IAAAW,2BAAS,EAACX,MAAM,CAAE;IAACY,YAAY,EAAEA;EAAa,GACpE3B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAACnB,OAAA,CAAAwB,cAAc;IAACV,MAAM,EAAEA;EAAO,GAC5BD,YAAY,GACXjB,MAAA,CAAAU,OAAA,CAAAa,aAAA;IAAKM,SAAS,EAAC;EAAmG,GAChH7B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAClB,iBAAA,CAAAyB,UAAU,MAAE,CACV,CAAC,GACJ9B,MAAA,CAAAU,OAAA,CAAAa,aAAA,CAAChB,KAAA,CAAAwB,IAAI;IAACjB,QAAQ,EAAEA;EAAS,CAAE,CACjB,CACF,CACH,CAAC;AAEpB,CAAC;AAACkB,OAAA,CAAArB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -24,9 +24,9 @@ const Main = _ref => {
24
24
  "data-testid": "currency-strength-wrapper"
25
25
  }, _react.default.createElement("div", {
26
26
  className: "lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold"
27
- }, _react.default.createElement("span", null, "".concat(lang('daily'), " (").concat(lang('minute', {
27
+ }, _react.default.createElement("span", null, `${lang('daily')} (${lang('minute', {
28
28
  count: 5
29
- }), ")"))), _react.default.createElement(_ChartsWithData.ChartWithData, {
29
+ })})`)), _react.default.createElement(_ChartsWithData.ChartWithData, {
30
30
  currency: currency
31
31
  })));
32
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["_react","_interopRequireWildcard","require","_monoI18n","_labsWidgetCommon","_ChartsWithData","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","currency","lang","useLocale","size","useContext","ThemeContext","createElement","Fragment","className","concat","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { ThemeContext } from '@oanda/labs-widget-common';\nimport { ChartWithData } from './ChartsWithData';\nimport { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useContext(ThemeContext);\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAAiD,SAAAI,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,SAAAN,wBAAAM,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,cA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IAACX,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEL,CAAC;AAEP,CAAC;AAACY,OAAA,CAAAd,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["_react","_interopRequireWildcard","require","_monoI18n","_labsWidgetCommon","_ChartsWithData","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","currency","lang","useLocale","size","useContext","ThemeContext","createElement","Fragment","className","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { ThemeContext } from '@oanda/labs-widget-common';\nimport { ChartWithData } from './ChartsWithData';\nimport { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useContext(ThemeContext);\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAAiD,SAAAI,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,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAA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AsB,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFpC,MAAA,CAAAY,OAAA,CAAAsB,aAAA,eAAO,GAAGL,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEQ,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNrC,MAAA,CAAAY,OAAA,CAAAsB,aAAA,CAAC7B,eAAA,CAAAiC,aAAa;IAACV,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEL,CAAC;AAEP,CAAC;AAACW,OAAA,CAAAb,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -14,7 +14,7 @@ var _monoI18n = require("@oanda/mono-i18n");
14
14
  var _labsWidgetCommon = require("@oanda/labs-widget-common");
15
15
  var _constants = require("./constants");
16
16
  var _getOption = require("./getOption");
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  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); }
19
19
  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; }
20
20
  echarts.use([_components.GridSimpleComponent, _components.GraphicComponent, _components.TooltipComponent, _components.TitleComponent, _charts.BarChart, _renderers.CanvasRenderer]);
@@ -35,7 +35,7 @@ const Chart = _ref => {
35
35
  echarts: echarts,
36
36
  theme: isDark ? 'dark_theme' : 'light_theme',
37
37
  style: {
38
- height: "".concat(_constants.CHART_HEIGHT, "px"),
38
+ height: `${_constants.CHART_HEIGHT}px`,
39
39
  width: '100%'
40
40
  },
41
41
  option: (0, _getOption.getOption)({
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["_react","_interopRequireWildcard","require","_core","_interopRequireDefault","echarts","_charts","_renderers","_components","_monoI18n","_labsWidgetCommon","_constants","_getOption","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useContext","ThemeContext","createElement","theme","style","height","concat","CHART_HEIGHT","width","option","getOption","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent,\n} from 'echarts/components';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { Theme, ThemeContext, getChartTheme } from '@oanda/labs-widget-common';\nimport {\n CHART_HEIGHT,\n} from './constants';\nimport { getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useContext(ThemeContext);\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n theme={isDark ? 'dark_theme' : 'light_the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C,KAAK,EAAE;IACT,CAAE;IACFC,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBf,MAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAEE;IAC1B,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC;AAACY,OAAA,CAAAlB,KAAA,GAAAA,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"Chart.js","names":["_react","_interopRequireWildcard","require","_core","_interopRequireDefault","echarts","_charts","_renderers","_components","_monoI18n","_labsWidgetCommon","_constants","_getOption","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useContext","ThemeContext","createElement","theme","style","height","CHART_HEIGHT","width","option","getOption","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent,\n} from 'echarts/components';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { Theme, ThemeContext, getChartTheme } from '@oanda/labs-widget-common';\nimport {\n CHART_HEIGHT,\n} from './constants';\nimport { getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useContext(ThemeContext);\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n option={getOption({\n values, currency, lang, isDark,\n })}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAGA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAGA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,SAAAE,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA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MAAM,EAAE,GAAGC,uBAAY,IAAI;MAC3BC,KAAK,EAAE;IACT,CAAE;IACFC,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBd,MAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAEE;IAC1B,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC;AAACW,OAAA,CAAAjB,KAAA,GAAAA,KAAA","ignoreList":[]}
@@ -13,7 +13,11 @@ const tooltipFormatter = _ref => {
13
13
  currency,
14
14
  lang
15
15
  } = _ref;
16
- return "\n<div>\n <div style=\"margin-bottom:5px;\">".concat(currency, " ").concat(lang('vs'), " ").concat(name, "</div>\n <div style=\"display:flex;align-items:center;\">").concat(marker, " ").concat(value, "%</div>\n</div>");
16
+ return `
17
+ <div>
18
+ <div style="margin-bottom:5px;">${currency} ${lang('vs')} ${name}</div>
19
+ <div style="display:flex;align-items:center;">${marker} ${value}%</div>
20
+ </div>`;
17
21
  };
18
22
  exports.tooltipFormatter = tooltipFormatter;
19
23
  const sortCurrencies = (a, b) => _constants.instrumentsConfig.indexOf(a.currency) - _constants.instrumentsConfig.indexOf(b.currency);