@oanda/labs-live-rates-table-widget 1.0.72 → 1.0.74
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 +596 -0
- package/dist/main/LiveRatesTableWidget/Main.js +1 -1
- package/dist/main/LiveRatesTableWidget/Main.js.map +1 -1
- package/dist/main/LiveRatesTableWidget/config.js +34 -12
- package/dist/main/LiveRatesTableWidget/config.js.map +1 -1
- package/dist/module/LiveRatesTableWidget/Main.js +3 -3
- package/dist/module/LiveRatesTableWidget/Main.js.map +1 -1
- package/dist/module/LiveRatesTableWidget/config.js +34 -11
- package/dist/module/LiveRatesTableWidget/config.js.map +1 -1
- package/dist/types/LiveRatesTableWidget/config.d.ts +4 -9
- package/package.json +3 -3
- package/src/LiveRatesTableWidget/Main.tsx +3 -2
- package/src/LiveRatesTableWidget/config.ts +36 -31
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,602 @@
|
|
|
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.74 (2025-07-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.207 (2025-07-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.206 (2025-07-18)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.205 (2025-07-17)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.204 (2025-07-09)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.203 (2025-06-16)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.202 (2025-06-04)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.201 (2025-06-02)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.200 (2025-05-30)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.199 (2025-05-29)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.198 (2025-05-26)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.197 (2025-05-23)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.196 (2025-05-22)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.195 (2025-05-21)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.194 (2025-05-21)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.193 (2025-05-15)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.192 (2025-05-14)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.191 (2025-04-30)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.190 (2025-04-28)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.189 (2025-04-23)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.188 (2025-04-22)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.187 (2025-04-18)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.186 (2025-04-10)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.185 (2025-04-09)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.184 (2025-04-08)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.183 (2025-04-04)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.182 (2025-03-21)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.181 (2025-03-13)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.180 (2025-01-30)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.179 (2025-01-29)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.178 (2025-01-12)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.177 (2025-01-10)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.176 (2025-01-10)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.175 (2025-01-08)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.174 (2024-12-16)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.173 (2024-12-11)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.172 (2024-11-29)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.171 (2024-11-28)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.170 (2024-11-28)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.169 (2024-11-20)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.168 (2024-11-19)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.167 (2024-10-14)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.166 (2024-10-07)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.165 (2024-10-03)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.164 (2024-09-26)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.163 (2024-09-18)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.162 (2024-09-12)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.161 (2024-09-11)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.160 (2024-09-10)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.159 (2024-09-09)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## 1.0.158 (2024-09-04)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.157 (2024-09-04)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 1.0.156 (2024-09-02)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## 1.0.155 (2024-08-29)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## 1.0.154 (2024-08-29)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## 1.0.153 (2024-08-23)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## 1.0.152 (2024-08-23)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## 1.0.151 (2024-08-20)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## 1.0.150 (2024-08-19)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 1.0.149 (2024-08-07)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 1.0.148 (2024-08-01)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## 1.0.147 (2024-08-01)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 1.0.146 (2024-07-26)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
## 1.0.145 (2024-07-25)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 1.0.144 (2024-07-22)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## 1.0.143 (2024-07-19)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## 1.0.142 (2024-07-16)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
## 1.0.141 (2024-07-16)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## 1.0.140 (2024-07-12)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## 1.0.139 (2024-07-12)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## 1.0.138 (2024-07-10)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 1.0.137 (2024-07-05)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## 1.0.136 (2024-07-03)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## 1.0.135 (2024-07-03)
|
|
299
|
+
|
|
300
|
+
**Note:** Version bump only for package @oanda/labs-live-rates-table-widget
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
## 1.0.73 (2025-07-18)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## 1.0.206 (2025-07-18)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## 1.0.205 (2025-07-17)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## 1.0.204 (2025-07-09)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## 1.0.203 (2025-06-16)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
## 1.0.202 (2025-06-04)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## 1.0.201 (2025-06-02)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 1.0.200 (2025-05-30)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 1.0.199 (2025-05-29)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## 1.0.198 (2025-05-26)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
## 1.0.197 (2025-05-23)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## 1.0.196 (2025-05-22)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## 1.0.195 (2025-05-21)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## 1.0.194 (2025-05-21)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## 1.0.193 (2025-05-15)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## 1.0.192 (2025-05-14)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
## 1.0.191 (2025-04-30)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
## 1.0.190 (2025-04-28)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
## 1.0.189 (2025-04-23)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
## 1.0.188 (2025-04-22)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## 1.0.187 (2025-04-18)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
## 1.0.186 (2025-04-10)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## 1.0.185 (2025-04-09)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
## 1.0.184 (2025-04-08)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
## 1.0.183 (2025-04-04)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
## 1.0.182 (2025-03-21)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
## 1.0.181 (2025-03-13)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
## 1.0.180 (2025-01-30)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
## 1.0.179 (2025-01-29)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
## 1.0.178 (2025-01-12)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
## 1.0.177 (2025-01-10)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
## 1.0.176 (2025-01-10)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## 1.0.175 (2025-01-08)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
## 1.0.174 (2024-12-16)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
## 1.0.173 (2024-12-11)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
## 1.0.172 (2024-11-29)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
## 1.0.171 (2024-11-28)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
## 1.0.170 (2024-11-28)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
## 1.0.169 (2024-11-20)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
## 1.0.168 (2024-11-19)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
## 1.0.167 (2024-10-14)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
## 1.0.166 (2024-10-07)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
## 1.0.165 (2024-10-03)
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
## 1.0.164 (2024-09-26)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
## 1.0.163 (2024-09-18)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
## 1.0.162 (2024-09-12)
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
## 1.0.161 (2024-09-11)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
## 1.0.160 (2024-09-10)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
## 1.0.159 (2024-09-09)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
## 1.0.158 (2024-09-04)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
## 1.0.157 (2024-09-04)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
## 1.0.156 (2024-09-02)
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
## 1.0.155 (2024-08-29)
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
## 1.0.154 (2024-08-29)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
## 1.0.153 (2024-08-23)
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
## 1.0.152 (2024-08-23)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
## 1.0.151 (2024-08-20)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
## 1.0.150 (2024-08-19)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
## 1.0.149 (2024-08-07)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
## 1.0.148 (2024-08-01)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
## 1.0.147 (2024-08-01)
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
## 1.0.146 (2024-07-26)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
## 1.0.145 (2024-07-25)
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
## 1.0.144 (2024-07-22)
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
## 1.0.143 (2024-07-19)
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
## 1.0.142 (2024-07-16)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
## 1.0.141 (2024-07-16)
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
## 1.0.140 (2024-07-12)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
## 1.0.139 (2024-07-12)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
## 1.0.138 (2024-07-10)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
## 1.0.137 (2024-07-05)
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
## 1.0.136 (2024-07-03)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
## 1.0.135 (2024-07-03)
|
|
595
|
+
|
|
596
|
+
**Note:** Version bump only for package @oanda/labs-live-rates-table-widget
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
|
|
6
602
|
## 1.0.72 (2025-07-18)
|
|
7
603
|
|
|
8
604
|
|
|
@@ -86,7 +86,7 @@ const Main = _ref => {
|
|
|
86
86
|
activeColumns: columns,
|
|
87
87
|
count: 0,
|
|
88
88
|
hasError: showError,
|
|
89
|
-
headerColumns: (0,
|
|
89
|
+
headerColumns: (0, _labsWidgetCommon.getHeaderConfig)(columns, _config.headerConfig),
|
|
90
90
|
isChartLoading: loading,
|
|
91
91
|
isLoading: mainLoading,
|
|
92
92
|
pageNumber: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_getInstrumentsChart","_validateInstruments","_config","_constant","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","instruments","division","columns","DEFAULT_COLUMNS","size","useLayoutProvider","isDesktop","Size","DESKTOP","target","setQuery","useLiveRatesQuery","records","setRecords","useState","Array","length","fill","data","loading","mainLoading","error","useFetchCombinedDataRecords","mainQuery","validateInstruments","mainVariables","batchQuery","getInstrumentsChart","getBatchVariables","mainData","instrumentsByDivision","mapInstrumentNames","filter","displayName","map","undefined","merge","chartData","getRecords","fetchPolicy","useEffect","instrument","instrumentsNames","_ref2","chart","_ref3","showError","createElement","TableWidget","activeColumns","count","hasError","headerColumns","getHeaderConfig","isChartLoading","isLoading","pageNumber","testId","toolTipId","INSTRUMENT_TOOLTIP_ID","exports"],"sources":["../../../src/LiveRatesTableWidget/Main.tsx"],"sourcesContent":["import type { DataRecord } from '@oanda/labs-widget-common';\nimport {\n Size,\n TableWidget,\n useFetchCombinedDataRecords,\n useLayoutProvider,\n useLiveRatesQuery,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect, useState } from 'react';\n\nimport { getInstrumentsChart } from '../gql/getInstrumentsChart';\nimport type {\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport {
|
|
1
|
+
{"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_getInstrumentsChart","_validateInstruments","_config","_constant","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","instruments","division","columns","DEFAULT_COLUMNS","size","useLayoutProvider","isDesktop","Size","DESKTOP","target","setQuery","useLiveRatesQuery","records","setRecords","useState","Array","length","fill","data","loading","mainLoading","error","useFetchCombinedDataRecords","mainQuery","validateInstruments","mainVariables","batchQuery","getInstrumentsChart","getBatchVariables","mainData","instrumentsByDivision","mapInstrumentNames","filter","displayName","map","undefined","merge","chartData","getRecords","fetchPolicy","useEffect","instrument","instrumentsNames","_ref2","chart","_ref3","showError","createElement","TableWidget","activeColumns","count","hasError","headerColumns","getHeaderConfig","headerConfig","isChartLoading","isLoading","pageNumber","testId","toolTipId","INSTRUMENT_TOOLTIP_ID","exports"],"sources":["../../../src/LiveRatesTableWidget/Main.tsx"],"sourcesContent":["import type { DataRecord } from '@oanda/labs-widget-common';\nimport {\n getHeaderConfig,\n Size,\n TableWidget,\n useFetchCombinedDataRecords,\n useLayoutProvider,\n useLiveRatesQuery,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect, useState } from 'react';\n\nimport { getInstrumentsChart } from '../gql/getInstrumentsChart';\nimport type {\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { headerConfig } from './config';\nimport { DEFAULT_COLUMNS, INSTRUMENT_TOOLTIP_ID } from './constant';\nimport type { MainProps, ValidateInstrumentsData } from './types';\nimport { getRecords } from './utils';\n\nconst Main = ({\n instruments,\n division,\n columns = DEFAULT_COLUMNS,\n}: MainProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { target, setQuery } = useLiveRatesQuery();\n\n const [records, setRecords] = useState<DataRecord[]>(\n new Array(instruments.length).fill({})\n );\n\n const { data, loading, mainLoading, error } = useFetchCombinedDataRecords<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n ValidateInstrumentsData\n >({\n mainQuery: validateInstruments,\n mainVariables: {\n instruments,\n division,\n },\n batchQuery: getInstrumentsChart,\n getBatchVariables: (mainData) => {\n const instrumentsByDivision = mainData?.mapInstrumentNames\n ?.filter(\n (i): i is { displayName: string; name: string } => !!i?.displayName\n )\n ?.map((i) => i.displayName);\n\n return instrumentsByDivision?.length\n ? { instruments: instrumentsByDivision, division }\n : undefined;\n },\n merge: (mainData, chartData) => getRecords(mainData, chartData),\n fetchPolicy: 'network-only',\n });\n\n useEffect(() => {\n if (!mainLoading && data) {\n setRecords(data.records ?? []);\n }\n }, [mainLoading, data]);\n\n useEffect(() => {\n if (records[0].instrument) {\n const instrumentsNames = records.map(({ instrument }) => instrument);\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDesktop]);\n\n useEffect(() => {\n if (records[0].instrument && records[0].chart?.length === 0) {\n const instrumentsNames = records.map(({ instrument }) => instrument);\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [records]);\n\n const showError = (!loading && !!error) || (!loading && !data);\n\n return (\n <TableWidget\n activeColumns={columns}\n count={0}\n hasError={showError}\n headerColumns={getHeaderConfig(columns, headerConfig)}\n isChartLoading={loading}\n isLoading={mainLoading}\n pageNumber={0}\n records={records}\n target={target}\n testId=\"live-rates-table-wrapper\"\n toolTipId={INSTRUMENT_TOOLTIP_ID}\n />\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,oBAAA,GAAAH,OAAA;AAOA,IA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,WAAY;IACvBqC,UAAU,EAAE,CAAE;IACd7C,OAAO,EAAEA,OAAQ;IACjBH,MAAM,EAAEA,MAAO;IACfiD,MAAM,EAAC,0BAA0B;IACjCC,SAAS,EAAEC;EAAsB,CAClC,CAAC;AAEN,CAAC;AAACC,OAAA,CAAA/D,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -3,40 +3,62 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sizeConfig = exports.headerConfig =
|
|
6
|
+
exports.sizeConfig = exports.headerConfig = void 0;
|
|
7
7
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
8
|
var _types = require("./types");
|
|
9
9
|
const headerConfig = exports.headerConfig = {
|
|
10
10
|
[_labsWidgetCommon.DataRecordType.INSTRUMENT]: {
|
|
11
11
|
displayName: 'instrument',
|
|
12
|
-
additionalStyles:
|
|
12
|
+
additionalStyles: {
|
|
13
|
+
align: 'left',
|
|
14
|
+
minWidth: '130px'
|
|
15
|
+
}
|
|
13
16
|
},
|
|
14
17
|
[_labsWidgetCommon.DataRecordType.SELL]: {
|
|
15
18
|
displayName: 'sell',
|
|
16
|
-
additionalStyles:
|
|
19
|
+
additionalStyles: {
|
|
20
|
+
align: 'right',
|
|
21
|
+
minWidth: '75px',
|
|
22
|
+
paddingRight: true
|
|
23
|
+
}
|
|
17
24
|
},
|
|
18
25
|
[_labsWidgetCommon.DataRecordType.BUY]: {
|
|
19
26
|
displayName: 'buy',
|
|
20
|
-
additionalStyles:
|
|
27
|
+
additionalStyles: {
|
|
28
|
+
align: 'right',
|
|
29
|
+
minWidth: '75px',
|
|
30
|
+
paddingRight: true
|
|
31
|
+
}
|
|
21
32
|
},
|
|
22
33
|
[_labsWidgetCommon.DataRecordType.DAILY_CHANGE]: {
|
|
23
34
|
displayName: 'daily_percent_change',
|
|
24
|
-
additionalStyles:
|
|
35
|
+
additionalStyles: {
|
|
36
|
+
align: 'right',
|
|
37
|
+
minWidth: '80px'
|
|
38
|
+
}
|
|
25
39
|
},
|
|
26
40
|
[_labsWidgetCommon.DataRecordType.CHART]: {
|
|
27
41
|
displayName: '24h_chart',
|
|
28
|
-
additionalStyles:
|
|
42
|
+
additionalStyles: {
|
|
43
|
+
align: 'center',
|
|
44
|
+
minWidth: '100px'
|
|
45
|
+
}
|
|
29
46
|
},
|
|
30
47
|
[_labsWidgetCommon.DataRecordType.SPREAD]: {
|
|
31
48
|
displayName: 'spread',
|
|
32
|
-
additionalStyles:
|
|
49
|
+
additionalStyles: {
|
|
50
|
+
align: 'right',
|
|
51
|
+
minWidth: '50px'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[_labsWidgetCommon.DataRecordType.SENTIMENT]: {
|
|
55
|
+
displayName: 'sentiment',
|
|
56
|
+
additionalStyles: {
|
|
57
|
+
align: 'center',
|
|
58
|
+
minWidth: '190px'
|
|
59
|
+
}
|
|
33
60
|
}
|
|
34
61
|
};
|
|
35
|
-
const getHeaderConfig = activeColumns => {
|
|
36
|
-
const columns = [_labsWidgetCommon.DataRecordType.INSTRUMENT, ...activeColumns].filter(item => item !== _labsWidgetCommon.DataRecordType.SENTIMENT);
|
|
37
|
-
return columns.map(item => headerConfig[item]);
|
|
38
|
-
};
|
|
39
|
-
exports.getHeaderConfig = getHeaderConfig;
|
|
40
62
|
const sizeConfig = exports.sizeConfig = {
|
|
41
63
|
[_types.View.CARDS]: _labsWidgetCommon.Size.MOBILE,
|
|
42
64
|
[_types.View.TABLE]: _labsWidgetCommon.Size.DESKTOP
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["_labsWidgetCommon","require","_types","headerConfig","exports","DataRecordType","INSTRUMENT","displayName","additionalStyles","
|
|
1
|
+
{"version":3,"file":"config.js","names":["_labsWidgetCommon","require","_types","headerConfig","exports","DataRecordType","INSTRUMENT","displayName","additionalStyles","align","minWidth","SELL","paddingRight","BUY","DAILY_CHANGE","CHART","SPREAD","SENTIMENT","sizeConfig","View","CARDS","Size","MOBILE","TABLE","DESKTOP"],"sources":["../../../src/LiveRatesTableWidget/config.ts"],"sourcesContent":["import type { HeaderConfigType } from '@oanda/labs-widget-common';\nimport { DataRecordType, Size } from '@oanda/labs-widget-common';\n\nimport { View } from './types';\n\nconst headerConfig: HeaderConfigType = {\n [DataRecordType.INSTRUMENT]: {\n displayName: 'instrument',\n additionalStyles: {\n align: 'left',\n minWidth: '130px',\n },\n },\n [DataRecordType.SELL]: {\n displayName: 'sell',\n additionalStyles: {\n align: 'right',\n minWidth: '75px',\n paddingRight: true,\n },\n },\n [DataRecordType.BUY]: {\n displayName: 'buy',\n additionalStyles: {\n align: 'right',\n minWidth: '75px',\n paddingRight: true,\n },\n },\n [DataRecordType.DAILY_CHANGE]: {\n displayName: 'daily_percent_change',\n additionalStyles: {\n align: 'right',\n minWidth: '80px',\n },\n },\n [DataRecordType.CHART]: {\n displayName: '24h_chart',\n additionalStyles: {\n align: 'center',\n minWidth: '100px',\n },\n },\n [DataRecordType.SPREAD]: {\n displayName: 'spread',\n additionalStyles: {\n align: 'right',\n minWidth: '50px',\n },\n },\n [DataRecordType.SENTIMENT]: {\n displayName: 'sentiment',\n additionalStyles: {\n align: 'center',\n minWidth: '190px',\n },\n },\n};\n\nconst sizeConfig = {\n [View.CARDS]: Size.MOBILE,\n [View.TABLE]: Size.DESKTOP,\n};\n\nexport { headerConfig, sizeConfig };\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,YAA8B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACrC,CAACE,gCAAc,CAACC,UAAU,GAAG;IAC3BC,WAAW,EAAE,YAAY;IACzBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,MAAM;MACbC,QAAQ,EAAE;IACZ;EACF,CAAC;EACD,CAACL,gCAAc,CAACM,IAAI,GAAG;IACrBJ,WAAW,EAAE,MAAM;IACnBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,OAAO;MACdC,QAAQ,EAAE,MAAM;MAChBE,YAAY,EAAE;IAChB;EACF,CAAC;EACD,CAACP,gCAAc,CAACQ,GAAG,GAAG;IACpBN,WAAW,EAAE,KAAK;IAClBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,OAAO;MACdC,QAAQ,EAAE,MAAM;MAChBE,YAAY,EAAE;IAChB;EACF,CAAC;EACD,CAACP,gCAAc,CAACS,YAAY,GAAG;IAC7BP,WAAW,EAAE,sBAAsB;IACnCC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,OAAO;MACdC,QAAQ,EAAE;IACZ;EACF,CAAC;EACD,CAACL,gCAAc,CAACU,KAAK,GAAG;IACtBR,WAAW,EAAE,WAAW;IACxBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,QAAQ;MACfC,QAAQ,EAAE;IACZ;EACF,CAAC;EACD,CAACL,gCAAc,CAACW,MAAM,GAAG;IACvBT,WAAW,EAAE,QAAQ;IACrBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,OAAO;MACdC,QAAQ,EAAE;IACZ;EACF,CAAC;EACD,CAACL,gCAAc,CAACY,SAAS,GAAG;IAC1BV,WAAW,EAAE,WAAW;IACxBC,gBAAgB,EAAE;MAChBC,KAAK,EAAE,QAAQ;MACfC,QAAQ,EAAE;IACZ;EACF;AACF,CAAC;AAED,MAAMQ,UAAU,GAAAd,OAAA,CAAAc,UAAA,GAAG;EACjB,CAACC,WAAI,CAACC,KAAK,GAAGC,sBAAI,CAACC,MAAM;EACzB,CAACH,WAAI,CAACI,KAAK,GAAGF,sBAAI,CAACG;AACrB,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Size, TableWidget, useFetchCombinedDataRecords, useLayoutProvider, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
1
|
+
import { getHeaderConfig, Size, TableWidget, useFetchCombinedDataRecords, useLayoutProvider, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { getInstrumentsChart } from '../gql/getInstrumentsChart';
|
|
4
4
|
import { validateInstruments } from '../gql/validateInstruments';
|
|
5
|
-
import {
|
|
5
|
+
import { headerConfig } from './config';
|
|
6
6
|
import { DEFAULT_COLUMNS, INSTRUMENT_TOOLTIP_ID } from './constant';
|
|
7
7
|
import { getRecords } from './utils';
|
|
8
8
|
const Main = _ref => {
|
|
@@ -78,7 +78,7 @@ const Main = _ref => {
|
|
|
78
78
|
activeColumns: columns,
|
|
79
79
|
count: 0,
|
|
80
80
|
hasError: showError,
|
|
81
|
-
headerColumns: getHeaderConfig(columns),
|
|
81
|
+
headerColumns: getHeaderConfig(columns, headerConfig),
|
|
82
82
|
isChartLoading: loading,
|
|
83
83
|
isLoading: mainLoading,
|
|
84
84
|
pageNumber: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["Size","TableWidget","useFetchCombinedDataRecords","useLayoutProvider","useLiveRatesQuery","React","useEffect","useState","getInstrumentsChart","validateInstruments","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["getHeaderConfig","Size","TableWidget","useFetchCombinedDataRecords","useLayoutProvider","useLiveRatesQuery","React","useEffect","useState","getInstrumentsChart","validateInstruments","headerConfig","DEFAULT_COLUMNS","INSTRUMENT_TOOLTIP_ID","getRecords","Main","_ref","instruments","division","columns","size","isDesktop","DESKTOP","target","setQuery","records","setRecords","Array","length","fill","data","loading","mainLoading","error","mainQuery","mainVariables","batchQuery","getBatchVariables","mainData","instrumentsByDivision","mapInstrumentNames","filter","i","displayName","map","undefined","merge","chartData","fetchPolicy","instrument","instrumentsNames","_ref2","chart","_ref3","showError","createElement","activeColumns","count","hasError","headerColumns","isChartLoading","isLoading","pageNumber","testId","toolTipId"],"sources":["../../../src/LiveRatesTableWidget/Main.tsx"],"sourcesContent":["import type { DataRecord } from '@oanda/labs-widget-common';\nimport {\n getHeaderConfig,\n Size,\n TableWidget,\n useFetchCombinedDataRecords,\n useLayoutProvider,\n useLiveRatesQuery,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect, useState } from 'react';\n\nimport { getInstrumentsChart } from '../gql/getInstrumentsChart';\nimport type {\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { headerConfig } from './config';\nimport { DEFAULT_COLUMNS, INSTRUMENT_TOOLTIP_ID } from './constant';\nimport type { MainProps, ValidateInstrumentsData } from './types';\nimport { getRecords } from './utils';\n\nconst Main = ({\n instruments,\n division,\n columns = DEFAULT_COLUMNS,\n}: MainProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { target, setQuery } = useLiveRatesQuery();\n\n const [records, setRecords] = useState<DataRecord[]>(\n new Array(instruments.length).fill({})\n );\n\n const { data, loading, mainLoading, error } = useFetchCombinedDataRecords<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n ValidateInstrumentsData\n >({\n mainQuery: validateInstruments,\n mainVariables: {\n instruments,\n division,\n },\n batchQuery: getInstrumentsChart,\n getBatchVariables: (mainData) => {\n const instrumentsByDivision = mainData?.mapInstrumentNames\n ?.filter(\n (i): i is { displayName: string; name: string } => !!i?.displayName\n )\n ?.map((i) => i.displayName);\n\n return instrumentsByDivision?.length\n ? { instruments: instrumentsByDivision, division }\n : undefined;\n },\n merge: (mainData, chartData) => getRecords(mainData, chartData),\n fetchPolicy: 'network-only',\n });\n\n useEffect(() => {\n if (!mainLoading && data) {\n setRecords(data.records ?? []);\n }\n }, [mainLoading, data]);\n\n useEffect(() => {\n if (records[0].instrument) {\n const instrumentsNames = records.map(({ instrument }) => instrument);\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDesktop]);\n\n useEffect(() => {\n if (records[0].instrument && records[0].chart?.length === 0) {\n const instrumentsNames = records.map(({ instrument }) => instrument);\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [records]);\n\n const showError = (!loading && !!error) || (!loading && !data);\n\n return (\n <TableWidget\n activeColumns={columns}\n count={0}\n hasError={showError}\n headerColumns={getHeaderConfig(columns, headerConfig)}\n isChartLoading={loading}\n isLoading={mainLoading}\n pageNumber={0}\n records={records}\n target={target}\n testId=\"live-rates-table-wrapper\"\n toolTipId={INSTRUMENT_TOOLTIP_ID}\n />\n );\n};\n\nexport { Main };\n"],"mappings":"AACA,SACEA,eAAe,EACfC,IAAI,EACJC,WAAW,EACXC,2BAA2B,EAC3BC,iBAAiB,EACjBC,iBAAiB,QACZ,2BAA2B;AAClC,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElD,SAASC,mBAAmB,QAAQ,4BAA4B;AAOhE,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,YAAY;AAEnE,SAASC,UAAU,QAAQ,SAAS;AAEpC,MAAMC,IAAI,GAAGC,IAAA,IAII;EAAA,IAJH;IACZC,WAAW;IACXC,QAAQ;IACRC,OAAO,GAAGP;EACD,CAAC,GAAAI,IAAA;EACV,MAAM;IAAEI;EAAK,CAAC,GAAGhB,iBAAiB,CAAC,CAAC;EACpC,MAAMiB,SAAS,GAAGD,IAAI,KAAKnB,IAAI,CAACqB,OAAO;EACvC,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGnB,iBAAiB,CAAC,CAAC;EAEhD,MAAM,CAACoB,OAAO,EAAEC,UAAU,CAAC,GAAGlB,QAAQ,CACpC,IAAImB,KAAK,CAACV,WAAW,CAACW,MAAM,CAA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AC;EAEfd,SAAS,CAAC,MAAM;IACd,IAAIkB,OAAO,CAAC,CAAC,CAAC,CAACwB,UAAU,IAAIxB,OAAO,CAAC,CAAC,CAAC,CAAC2B,KAAK,EAAExB,MAAM,KAAK,CAAC,EAAE;MAC3D,MAAMsB,gBAAgB,GAAGzB,OAAO,CAACmB,GAAG,CAACS,KAAA;QAAA,IAAC;UAAEJ;QAAW,CAAC,GAAAI,KAAA;QAAA,OAAKJ,UAAU;MAAA,EAAC;MACpEzB,QAAQ,CAAC;QAAEP,WAAW,EAAEiC;MAAiB,CAAC,CAAC;IAC7C;EAEF,CAAC,EAAE,CAACzB,OAAO,CAAC,CAAC;EAEb,MAAM6B,SAAS,GAAI,CAACvB,OAAO,IAAI,CAAC,CAACE,KAAK,IAAM,CAACF,OAAO,IAAI,CAACD,IAAK;EAE9D,OACExB,KAAA,CAAAiD,aAAA,CAACrD,WAAW;IACVsD,aAAa,EAAErC,OAAQ;IACvBsC,KAAK,EAAE,CAAE;IACTC,QAAQ,EAAEJ,SAAU;IACpBK,aAAa,EAAE3D,eAAe,CAACmB,OAAO,EAAER,YAAY,CAAE;IACtDiD,cAAc,EAAE7B,OAAQ;IACxB8B,SAAS,EAAE7B,WAAY;IACvB8B,UAAU,EAAE,CAAE;IACdrC,OAAO,EAAEA,OAAQ;IACjBF,MAAM,EAAEA,MAAO;IACfwC,MAAM,EAAC,0BAA0B;IACjCC,SAAS,EAAEnD;EAAsB,CAClC,CAAC;AAEN,CAAC;AAED,SAASE,IAAI","ignoreList":[]}
|
|
@@ -3,36 +3,59 @@ import { View } from './types';
|
|
|
3
3
|
const headerConfig = {
|
|
4
4
|
[DataRecordType.INSTRUMENT]: {
|
|
5
5
|
displayName: 'instrument',
|
|
6
|
-
additionalStyles:
|
|
6
|
+
additionalStyles: {
|
|
7
|
+
align: 'left',
|
|
8
|
+
minWidth: '130px'
|
|
9
|
+
}
|
|
7
10
|
},
|
|
8
11
|
[DataRecordType.SELL]: {
|
|
9
12
|
displayName: 'sell',
|
|
10
|
-
additionalStyles:
|
|
13
|
+
additionalStyles: {
|
|
14
|
+
align: 'right',
|
|
15
|
+
minWidth: '75px',
|
|
16
|
+
paddingRight: true
|
|
17
|
+
}
|
|
11
18
|
},
|
|
12
19
|
[DataRecordType.BUY]: {
|
|
13
20
|
displayName: 'buy',
|
|
14
|
-
additionalStyles:
|
|
21
|
+
additionalStyles: {
|
|
22
|
+
align: 'right',
|
|
23
|
+
minWidth: '75px',
|
|
24
|
+
paddingRight: true
|
|
25
|
+
}
|
|
15
26
|
},
|
|
16
27
|
[DataRecordType.DAILY_CHANGE]: {
|
|
17
28
|
displayName: 'daily_percent_change',
|
|
18
|
-
additionalStyles:
|
|
29
|
+
additionalStyles: {
|
|
30
|
+
align: 'right',
|
|
31
|
+
minWidth: '80px'
|
|
32
|
+
}
|
|
19
33
|
},
|
|
20
34
|
[DataRecordType.CHART]: {
|
|
21
35
|
displayName: '24h_chart',
|
|
22
|
-
additionalStyles:
|
|
36
|
+
additionalStyles: {
|
|
37
|
+
align: 'center',
|
|
38
|
+
minWidth: '100px'
|
|
39
|
+
}
|
|
23
40
|
},
|
|
24
41
|
[DataRecordType.SPREAD]: {
|
|
25
42
|
displayName: 'spread',
|
|
26
|
-
additionalStyles:
|
|
43
|
+
additionalStyles: {
|
|
44
|
+
align: 'right',
|
|
45
|
+
minWidth: '50px'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[DataRecordType.SENTIMENT]: {
|
|
49
|
+
displayName: 'sentiment',
|
|
50
|
+
additionalStyles: {
|
|
51
|
+
align: 'center',
|
|
52
|
+
minWidth: '190px'
|
|
53
|
+
}
|
|
27
54
|
}
|
|
28
55
|
};
|
|
29
|
-
const getHeaderConfig = activeColumns => {
|
|
30
|
-
const columns = [DataRecordType.INSTRUMENT, ...activeColumns].filter(item => item !== DataRecordType.SENTIMENT);
|
|
31
|
-
return columns.map(item => headerConfig[item]);
|
|
32
|
-
};
|
|
33
56
|
const sizeConfig = {
|
|
34
57
|
[View.CARDS]: Size.MOBILE,
|
|
35
58
|
[View.TABLE]: Size.DESKTOP
|
|
36
59
|
};
|
|
37
|
-
export {
|
|
60
|
+
export { headerConfig, sizeConfig };
|
|
38
61
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["DataRecordType","Size","View","headerConfig","INSTRUMENT","displayName","additionalStyles","
|
|
1
|
+
{"version":3,"file":"config.js","names":["DataRecordType","Size","View","headerConfig","INSTRUMENT","displayName","additionalStyles","align","minWidth","SELL","paddingRight","BUY","DAILY_CHANGE","CHART","SPREAD","SENTIMENT","sizeConfig","CARDS","MOBILE","TABLE","DESKTOP"],"sources":["../../../src/LiveRatesTableWidget/config.ts"],"sourcesContent":["import type { HeaderConfigType } from '@oanda/labs-widget-common';\nimport { DataRecordType, Size } from '@oanda/labs-widget-common';\n\nimport { View } from './types';\n\nconst headerConfig: HeaderConfigType = {\n [DataRecordType.INSTRUMENT]: {\n displayName: 'instrument',\n additionalStyles: {\n align: 'left',\n minWidth: '130px',\n },\n },\n [DataRecordType.SELL]: {\n displayName: 'sell',\n additionalStyles: {\n align: 'right',\n minWidth: '75px',\n paddingRight: true,\n },\n },\n [DataRecordType.BUY]: {\n displayName: 'buy',\n additionalStyles: {\n align: 'right',\n minWidth: '75px',\n paddingRight: true,\n },\n },\n [DataRecordType.DAILY_CHANGE]: {\n displayName: 'daily_percent_change',\n additionalStyles: {\n align: 'right',\n minWidth: '80px',\n },\n },\n [DataRecordType.CHART]: {\n displayName: '24h_chart',\n additionalStyles: {\n align: 'center',\n minWidth: '100px',\n },\n },\n [DataRecordType.SPREAD]: {\n displayName: 'spread',\n additionalStyles: {\n align: 'right',\n minWidth: '50px',\n },\n },\n [DataRecordType.SENTIMENT]: {\n displayName: 'sentiment',\n additionalStyles: {\n align: 'center',\n minWidth: '190px',\n },\n },\n};\n\nconst sizeConfig = {\n [View.CARDS]: Size.MOBILE,\n [View.TABLE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ED,MAAMQ,UAAU,GAAG;EACjB,CAACd,IAAI,CAACe,KAAK,GAAGhB,IAAI,CAACiB,MAAM;EACzB,CAAChB,IAAI,CAACiB,KAAK,GAAGlB,IAAI,CAACmB;AACrB,CAAC;AAED,SAASjB,YAAY,EAAEa,UAAU","ignoreList":[]}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare const headerConfig: Record<HeaderRecordType, {
|
|
5
|
-
displayName: string;
|
|
6
|
-
additionalStyles: string;
|
|
7
|
-
}>;
|
|
8
|
-
declare const getHeaderConfig: (activeColumns: DataRecordType[]) => HeaderColumns[];
|
|
1
|
+
import type { HeaderConfigType } from '@oanda/labs-widget-common';
|
|
2
|
+
import { Size } from '@oanda/labs-widget-common';
|
|
3
|
+
declare const headerConfig: HeaderConfigType;
|
|
9
4
|
declare const sizeConfig: {
|
|
10
5
|
cards: Size;
|
|
11
6
|
table: Size;
|
|
12
7
|
};
|
|
13
|
-
export {
|
|
8
|
+
export { headerConfig, sizeConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-live-rates-table-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"description": "Labs Live Rates Table Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "OANDA",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
15
|
+
"@oanda/labs-widget-common": "^1.0.208",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"graphql": "16.8.1"
|
|
18
18
|
},
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"@graphql-codegen/cli": "5.0.0",
|
|
21
21
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "5ac438aecc3ec1cc9e02e6c68e7cf3bf1e6eadd4"
|
|
24
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DataRecord } from '@oanda/labs-widget-common';
|
|
2
2
|
import {
|
|
3
|
+
getHeaderConfig,
|
|
3
4
|
Size,
|
|
4
5
|
TableWidget,
|
|
5
6
|
useFetchCombinedDataRecords,
|
|
@@ -16,7 +17,7 @@ import type {
|
|
|
16
17
|
ValidateInstrumentsQueryVariables,
|
|
17
18
|
} from '../gql/types/graphql';
|
|
18
19
|
import { validateInstruments } from '../gql/validateInstruments';
|
|
19
|
-
import {
|
|
20
|
+
import { headerConfig } from './config';
|
|
20
21
|
import { DEFAULT_COLUMNS, INSTRUMENT_TOOLTIP_ID } from './constant';
|
|
21
22
|
import type { MainProps, ValidateInstrumentsData } from './types';
|
|
22
23
|
import { getRecords } from './utils';
|
|
@@ -91,7 +92,7 @@ const Main = ({
|
|
|
91
92
|
activeColumns={columns}
|
|
92
93
|
count={0}
|
|
93
94
|
hasError={showError}
|
|
94
|
-
headerColumns={getHeaderConfig(columns)}
|
|
95
|
+
headerColumns={getHeaderConfig(columns, headerConfig)}
|
|
95
96
|
isChartLoading={loading}
|
|
96
97
|
isLoading={mainLoading}
|
|
97
98
|
pageNumber={0}
|
|
@@ -1,55 +1,60 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeaderConfigType } from '@oanda/labs-widget-common';
|
|
2
2
|
import { DataRecordType, Size } from '@oanda/labs-widget-common';
|
|
3
3
|
|
|
4
4
|
import { View } from './types';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
| DataRecordType.INSTRUMENT
|
|
8
|
-
| DataRecordType.SELL
|
|
9
|
-
| DataRecordType.BUY
|
|
10
|
-
| DataRecordType.DAILY_CHANGE
|
|
11
|
-
| DataRecordType.CHART
|
|
12
|
-
| DataRecordType.SPREAD;
|
|
13
|
-
|
|
14
|
-
const headerConfig: Record<
|
|
15
|
-
HeaderRecordType,
|
|
16
|
-
{ displayName: string; additionalStyles: string }
|
|
17
|
-
> = {
|
|
6
|
+
const headerConfig: HeaderConfigType = {
|
|
18
7
|
[DataRecordType.INSTRUMENT]: {
|
|
19
8
|
displayName: 'instrument',
|
|
20
|
-
additionalStyles:
|
|
9
|
+
additionalStyles: {
|
|
10
|
+
align: 'left',
|
|
11
|
+
minWidth: '130px',
|
|
12
|
+
},
|
|
21
13
|
},
|
|
22
14
|
[DataRecordType.SELL]: {
|
|
23
15
|
displayName: 'sell',
|
|
24
|
-
additionalStyles:
|
|
16
|
+
additionalStyles: {
|
|
17
|
+
align: 'right',
|
|
18
|
+
minWidth: '75px',
|
|
19
|
+
paddingRight: true,
|
|
20
|
+
},
|
|
25
21
|
},
|
|
26
22
|
[DataRecordType.BUY]: {
|
|
27
23
|
displayName: 'buy',
|
|
28
|
-
additionalStyles:
|
|
24
|
+
additionalStyles: {
|
|
25
|
+
align: 'right',
|
|
26
|
+
minWidth: '75px',
|
|
27
|
+
paddingRight: true,
|
|
28
|
+
},
|
|
29
29
|
},
|
|
30
30
|
[DataRecordType.DAILY_CHANGE]: {
|
|
31
31
|
displayName: 'daily_percent_change',
|
|
32
|
-
additionalStyles:
|
|
32
|
+
additionalStyles: {
|
|
33
|
+
align: 'right',
|
|
34
|
+
minWidth: '80px',
|
|
35
|
+
},
|
|
33
36
|
},
|
|
34
37
|
[DataRecordType.CHART]: {
|
|
35
38
|
displayName: '24h_chart',
|
|
36
|
-
additionalStyles:
|
|
39
|
+
additionalStyles: {
|
|
40
|
+
align: 'center',
|
|
41
|
+
minWidth: '100px',
|
|
42
|
+
},
|
|
37
43
|
},
|
|
38
44
|
[DataRecordType.SPREAD]: {
|
|
39
45
|
displayName: 'spread',
|
|
40
|
-
additionalStyles:
|
|
46
|
+
additionalStyles: {
|
|
47
|
+
align: 'right',
|
|
48
|
+
minWidth: '50px',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
[DataRecordType.SENTIMENT]: {
|
|
52
|
+
displayName: 'sentiment',
|
|
53
|
+
additionalStyles: {
|
|
54
|
+
align: 'center',
|
|
55
|
+
minWidth: '190px',
|
|
56
|
+
},
|
|
41
57
|
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const getHeaderConfig = (activeColumns: DataRecordType[]): HeaderColumns[] => {
|
|
45
|
-
const columns: HeaderRecordType[] = [
|
|
46
|
-
DataRecordType.INSTRUMENT,
|
|
47
|
-
...activeColumns,
|
|
48
|
-
].filter(
|
|
49
|
-
(item): item is HeaderRecordType => item !== DataRecordType.SENTIMENT
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return columns.map((item) => headerConfig[item]);
|
|
53
58
|
};
|
|
54
59
|
|
|
55
60
|
const sizeConfig = {
|
|
@@ -57,4 +62,4 @@ const sizeConfig = {
|
|
|
57
62
|
[View.TABLE]: Size.DESKTOP,
|
|
58
63
|
};
|
|
59
64
|
|
|
60
|
-
export {
|
|
65
|
+
export { headerConfig, sizeConfig };
|