@oanda/labs-currency-power-balance-widget 1.0.143 → 1.0.144
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 +580 -0
- package/dist/main/CurrencyPowerBalanceWidget/Main.js +4 -3
- package/dist/main/CurrencyPowerBalanceWidget/Main.js.map +1 -1
- package/dist/module/CurrencyPowerBalanceWidget/Main.js +4 -3
- package/dist/module/CurrencyPowerBalanceWidget/Main.js.map +1 -1
- package/package.json +3 -3
- package/src/CurrencyPowerBalanceWidget/Main.tsx +4 -3
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js +0 -60
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js.map +0 -1
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js +0 -58
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js.map +0 -1
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.js +0 -17
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.js.map +0 -1
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.js +0 -6
- package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.js.map +0 -1
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js +0 -53
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js.map +0 -1
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js +0 -51
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js.map +0 -1
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.js +0 -2
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.js.map +0 -1
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.js +0 -2
- package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.js.map +0 -1
- package/dist/types/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.d.ts +0 -4
- package/dist/types/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.d.ts +0 -4
- package/dist/types/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.d.ts +0 -1
- package/dist/types/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.d.ts +0 -16
- package/src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.tsx +0 -38
- package/src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.tsx +0 -72
- package/src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.ts +0 -1
- package/src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,586 @@
|
|
|
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.144 (2025-07-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.204 (2025-07-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.203 (2025-06-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.202 (2025-06-04)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.201 (2025-06-02)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.200 (2025-05-30)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.199 (2025-05-29)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.198 (2025-05-26)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.197 (2025-05-23)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.196 (2025-05-22)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.195 (2025-05-21)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.194 (2025-05-21)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.193 (2025-05-15)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.192 (2025-05-14)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.191 (2025-04-30)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.190 (2025-04-28)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.189 (2025-04-23)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.188 (2025-04-22)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.187 (2025-04-18)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.186 (2025-04-10)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.185 (2025-04-09)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.184 (2025-04-08)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.183 (2025-04-04)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.182 (2025-03-21)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.181 (2025-03-13)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.180 (2025-01-30)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.179 (2025-01-29)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.178 (2025-01-12)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.177 (2025-01-10)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.176 (2025-01-10)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.175 (2025-01-08)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.174 (2024-12-16)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.173 (2024-12-11)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.172 (2024-11-29)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.171 (2024-11-28)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.170 (2024-11-28)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.169 (2024-11-20)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.168 (2024-11-19)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.167 (2024-10-14)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.166 (2024-10-07)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.165 (2024-10-03)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.164 (2024-09-26)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.163 (2024-09-18)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.162 (2024-09-12)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.161 (2024-09-11)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.160 (2024-09-10)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.159 (2024-09-09)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.158 (2024-09-04)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.157 (2024-09-04)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.156 (2024-09-02)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## 1.0.155 (2024-08-29)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.154 (2024-08-29)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 1.0.153 (2024-08-23)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## 1.0.152 (2024-08-23)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## 1.0.151 (2024-08-20)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## 1.0.150 (2024-08-19)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## 1.0.149 (2024-08-07)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## 1.0.148 (2024-08-01)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## 1.0.147 (2024-08-01)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 1.0.146 (2024-07-26)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 1.0.145 (2024-07-25)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## 1.0.144 (2024-07-22)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 1.0.143 (2024-07-19)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
## 1.0.142 (2024-07-16)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 1.0.141 (2024-07-16)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## 1.0.140 (2024-07-12)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## 1.0.139 (2024-07-12)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
## 1.0.138 (2024-07-10)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## 1.0.137 (2024-07-05)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## 1.0.136 (2024-07-03)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## 1.0.135 (2024-07-03)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 1.0.134 (2024-07-03)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## 1.0.133 (2024-06-28)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## 1.0.132 (2024-06-27)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
## 1.0.131 (2024-06-27)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
## 1.0.130 (2024-06-26)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## 1.0.129 (2024-06-17)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## 1.0.128 (2024-06-17)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## 1.0.127 (2024-06-10)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## 1.0.126 (2024-05-29)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
## 1.0.125 (2024-05-29)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## 1.0.124 (2024-05-29)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 1.0.123 (2024-05-28)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 1.0.122 (2024-05-27)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## 1.0.121 (2024-05-27)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
## 1.0.120 (2024-05-24)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## 1.0.119 (2024-05-17)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## 1.0.118 (2024-05-09)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## 1.0.117 (2024-05-07)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## 1.0.116 (2024-04-23)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## 1.0.115 (2024-04-22)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
## 1.0.114 (2024-04-19)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
## 1.0.113 (2024-04-19)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
## 1.0.112 (2024-04-15)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
## 1.0.111 (2024-04-11)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## 1.0.110 (2024-04-05)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
## 1.0.109 (2024-04-05)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## 1.0.108 (2024-04-04)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
## 1.0.107 (2024-04-03)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
## 1.0.106 (2024-03-29)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
## 1.0.105 (2024-03-28)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
## 1.0.104 (2024-03-21)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
## 1.0.103 (2024-03-20)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
## 1.0.102 (2024-03-20)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
## 1.0.101 (2024-03-13)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
## 1.0.100 (2024-03-12)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
## 1.0.99 (2024-03-11)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## 1.0.98 (2024-03-07)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
## 1.0.97 (2024-03-06)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
## 1.0.96 (2024-03-06)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
## 1.0.95 (2024-03-04)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
## 1.0.94 (2024-02-29)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
## 1.0.93 (2024-02-28)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
## 1.0.92 (2024-02-28)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
## 1.0.91 (2024-02-23)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
## 1.0.90 (2024-02-23)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
## 1.0.89 (2024-02-21)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
## 1.0.88 (2024-02-21)
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
## 1.0.87 (2024-02-20)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
## 1.0.86 (2024-02-20)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
## 1.0.85 (2024-02-13)
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
## 1.0.84 (2024-02-13)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
## 1.0.83 (2024-02-09)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
## 1.0.82 (2024-02-05)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
## 1.0.81 (2024-02-05)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
## 1.0.80 (2024-02-05)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
## 1.0.79 (2024-02-05)
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
## 1.0.78 (2024-01-30)
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
## 1.0.77 (2024-01-25)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
## 1.0.76 (2024-01-25)
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
## 1.0.75 (2024-01-22)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
## 1.0.74 (2024-01-22)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
## 1.0.73 (2024-01-22)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
## 1.0.72 (2024-01-19)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
## 1.0.71 (2024-01-18)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
## 1.0.70 (2024-01-17)
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
## 1.0.69 (2024-01-17)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
## 1.0.68 (2024-01-15)
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
## 1.0.67 (2024-01-15)
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
## 1.0.66 (2024-01-12)
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
## 1.0.65 (2024-01-11)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
## 1.0.64 (2024-01-11)
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
## 1.0.63 (2024-01-11)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
## 1.0.62 (2024-01-10)
|
|
579
|
+
|
|
580
|
+
**Note:** Version bump only for package @oanda/labs-currency-power-balance-widget
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
6
586
|
## 1.0.143 (2025-07-09)
|
|
7
587
|
|
|
8
588
|
|
|
@@ -9,8 +9,8 @@ var _monoI18n = require("@oanda/mono-i18n");
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _graphql = require("../gql/types/graphql");
|
|
11
11
|
var _ChartWithData = require("./ChartWithData");
|
|
12
|
-
var _TimeUnitSwitch = require("./components/TimeUnitSwitch");
|
|
13
12
|
var _config = require("./config");
|
|
13
|
+
var _constants = require("./constants");
|
|
14
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
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; }
|
|
16
16
|
const Main = _ref => {
|
|
@@ -45,10 +45,11 @@ const Main = _ref => {
|
|
|
45
45
|
}, tooltipLabel ? _react.default.createElement("span", null, `${lang(tooltipLabel.translationKey, {
|
|
46
46
|
count: tooltipLabel.count
|
|
47
47
|
})}`) : _react.default.createElement("span", null, `${lang(label)}`));
|
|
48
|
-
})) : _react.default.createElement(
|
|
48
|
+
})) : _react.default.createElement(_labsWidgetCommon.TimeUnitSwitch, {
|
|
49
49
|
callback: setSelectedTimeUnit,
|
|
50
50
|
options: _config.timeUnitConfig,
|
|
51
|
-
selected: selectedTimeUnit
|
|
51
|
+
selected: selectedTimeUnit,
|
|
52
|
+
tooltipId: _constants.CURRENCY_POWER_BALANCE_TOOLTIP_ID
|
|
52
53
|
}), _react.default.createElement(_ChartWithData.ChartWithData, {
|
|
53
54
|
currencies: timeUnit && currencies,
|
|
54
55
|
timeUnit: selectedTimeUnit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireWildcard","_graphql","_ChartWithData","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireWildcard","_graphql","_ChartWithData","_config","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","timeUnit","currencies","size","useLayoutProvider","lang","useLocale","selectedTimeUnit","setSelectedTimeUnit","useState","CurrencyPowerBalanceTimeUnit","CurrentDay","createElement","Fragment","className","timeUnitConfig","filter","_ref2","value","map","_ref3","tooltipLabel","label","key","translationKey","count","TimeUnitSwitch","callback","options","selected","tooltipId","CURRENCY_POWER_BALANCE_TOOLTIP_ID","ChartWithData","exports"],"sources":["../../../src/CurrencyPowerBalanceWidget/Main.tsx"],"sourcesContent":["import { TimeUnitSwitch, useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React, { useState } from 'react';\n\nimport { CurrencyPowerBalanceTimeUnit } from '../gql/types/graphql';\nimport { ChartWithData } from './ChartWithData';\nimport { timeUnitConfig } from './config';\nimport { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from './constants';\nimport type { MainProps } from './types';\n\nconst Main = ({ timeUnit, currencies }: MainProps) => {\n const { size } = useLayoutProvider();\n const { lang } = useLocale();\n const [selectedTimeUnit, setSelectedTimeUnit] = useState(\n timeUnit || CurrencyPowerBalanceTimeUnit.CurrentDay\n );\n return (\n <>\n {size && (\n <div\n className=\"lw-flex lw-flex-col lw-text-sm lw-tracking-normal\"\n data-testid=\"currency-power-balance-wrapper\"\n >\n {timeUnit && currencies ? (\n <>\n {timeUnitConfig\n .filter(({ value }) => value === selectedTimeUnit)\n .map(({ tooltipLabel, label }) => (\n <div\n key={label}\n className=\"lw-mb-6 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\"\n data-testid=\"time-unit-label\"\n >\n {tooltipLabel ? (\n <span>{`${lang(tooltipLabel!.translationKey, { count: tooltipLabel!.count })}`}</span>\n ) : (\n <span>{`${lang(label)}`}</span>\n )}\n </div>\n ))}\n </>\n ) : (\n <TimeUnitSwitch<CurrencyPowerBalanceTimeUnit>\n callback={setSelectedTimeUnit}\n options={timeUnitConfig}\n selected={sel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AAiB,GAE5BO,YAAY,GACXhD,MAAA,CAAAY,OAAA,CAAA2B,aAAA,eAAO,GAAGP,IAAI,CAACgB,YAAY,CAAEG,cAAc,EAAE;MAAEC,KAAK,EAAEJ,YAAY,CAAEI;IAAM,CAAC,CAAC,EAAS,CAAC,GAEtFpD,MAAA,CAAAY,OAAA,CAAA2B,aAAA,eAAO,GAAGP,IAAI,CAACiB,KAAK,CAAC,EAAS,CAE7B,CAAC;EAAA,CACP,CACH,CAAC,GAEHjD,MAAA,CAAAY,OAAA,CAAA2B,aAAA,CAAC1C,iBAAA,CAAAwD,cAAc;IACbC,QAAQ,EAAEnB,mBAAoB;IAC9BoB,OAAO,EAAEb,sBAAe;IACxBc,QAAQ,EAAEtB,gBAAiB;IAC3BuB,SAAS,EAAEC;EAAkC,CAC9C,CACF,EACD1D,MAAA,CAAAY,OAAA,CAAA2B,aAAA,CAACpC,cAAA,CAAAwD,aAAa;IACZ9B,UAAU,EAAED,QAAQ,IAAIC,UAAW;IACnCD,QAAQ,EAAEM;EAAiB,CAC5B,CACE,CAEP,CAAC;AAEP,CAAC;AAAC0B,OAAA,CAAAlC,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
1
|
+
import { TimeUnitSwitch, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
2
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { CurrencyPowerBalanceTimeUnit } from '../gql/types/graphql';
|
|
5
5
|
import { ChartWithData } from './ChartWithData';
|
|
6
|
-
import { TimeUnitSwitch } from './components/TimeUnitSwitch';
|
|
7
6
|
import { timeUnitConfig } from './config';
|
|
7
|
+
import { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from './constants';
|
|
8
8
|
const Main = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
timeUnit,
|
|
@@ -40,7 +40,8 @@ const Main = _ref => {
|
|
|
40
40
|
})) : React.createElement(TimeUnitSwitch, {
|
|
41
41
|
callback: setSelectedTimeUnit,
|
|
42
42
|
options: timeUnitConfig,
|
|
43
|
-
selected: selectedTimeUnit
|
|
43
|
+
selected: selectedTimeUnit,
|
|
44
|
+
tooltipId: CURRENCY_POWER_BALANCE_TOOLTIP_ID
|
|
44
45
|
}), React.createElement(ChartWithData, {
|
|
45
46
|
currencies: timeUnit && currencies,
|
|
46
47
|
timeUnit: selectedTimeUnit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","useState","CurrencyPowerBalanceTimeUnit","ChartWithData","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["TimeUnitSwitch","useLayoutProvider","useLocale","React","useState","CurrencyPowerBalanceTimeUnit","ChartWithData","timeUnitConfig","CURRENCY_POWER_BALANCE_TOOLTIP_ID","Main","_ref","timeUnit","currencies","size","lang","selectedTimeUnit","setSelectedTimeUnit","CurrentDay","createElement","Fragment","className","filter","_ref2","value","map","_ref3","tooltipLabel","label","key","translationKey","count","callback","options","selected","tooltipId"],"sources":["../../../src/CurrencyPowerBalanceWidget/Main.tsx"],"sourcesContent":["import { TimeUnitSwitch, useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React, { useState } from 'react';\n\nimport { CurrencyPowerBalanceTimeUnit } from '../gql/types/graphql';\nimport { ChartWithData } from './ChartWithData';\nimport { timeUnitConfig } from './config';\nimport { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from './constants';\nimport type { MainProps } from './types';\n\nconst Main = ({ timeUnit, currencies }: MainProps) => {\n const { size } = useLayoutProvider();\n const { lang } = useLocale();\n const [selectedTimeUnit, setSelectedTimeUnit] = useState(\n timeUnit || CurrencyPowerBalanceTimeUnit.CurrentDay\n );\n return (\n <>\n {size && (\n <div\n className=\"lw-flex lw-flex-col lw-text-sm lw-tracking-normal\"\n data-testid=\"currency-power-balance-wrapper\"\n >\n {timeUnit && currencies ? (\n <>\n {timeUnitConfig\n .filter(({ value }) => value === selectedTimeUnit)\n .map(({ tooltipLabel, label }) => (\n <div\n key={label}\n className=\"lw-mb-6 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\"\n data-testid=\"time-unit-label\"\n >\n {tooltipLabel ? (\n <span>{`${lang(tooltipLabel!.translationKey, { count: tooltipLabel!.count })}`}</span>\n ) : (\n <span>{`${lang(label)}`}</span>\n )}\n </div>\n ))}\n </>\n ) : (\n <TimeUnitSwitch<CurrencyPowerBalanceTimeUnit>\n callback={setSelectedTimeUnit}\n options={timeUnitConfig}\n selected={selectedTimeUnit}\n tooltipId={CURRENCY_POWER_BALANCE_TOOLTIP_ID}\n />\n )}\n <ChartWithData\n currencies={timeUnit && currencies}\n timeUnit={selectedTimeUnit}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,iBAAiB,QAAQ,2BAA2B;AAC7E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AAEvC,SAASC,4BAA4B,QAAQ,sBAAsB;AACnE,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,iCAAiC,QAAQ,aAAa;AAG/D,MAAMC,IAAI,GAAGC,IAAA,IAAyC;EAAA,IAAxC;IAAEC,QAAQ;IAAEC;EAAsB,CAAC,GAAAF,IAAA;EAC/C,MAAM;IAAEG;EAAK,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EACpC,MAAM;IAAEa;EAAK,CAAC,GAAGZ,SAAS,CAAC,CAAC;EAC5B,MAAM,CAACa,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGZ,QAAQ,CACtDO,QAAQ,IAAIN,4BAA4B,CAACY,UAC3C,CAAC;EACD,OACEd,KAAA,CAAAe,aAAA,CAAAf,KAAA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
|
3
|
+
"version": "1.0.144",
|
|
4
4
|
"description": "Labs Currency Power Balance 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.205",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"echarts": "5.5.0",
|
|
18
18
|
"echarts-for-react": "3.0.2",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"@graphql-codegen/cli": "5.0.0",
|
|
23
23
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "c3d9e64eb9cf5a50d714b8147501b7dfe7aa4aed"
|
|
26
26
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
1
|
+
import { TimeUnitSwitch, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
2
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { CurrencyPowerBalanceTimeUnit } from '../gql/types/graphql';
|
|
6
6
|
import { ChartWithData } from './ChartWithData';
|
|
7
|
-
import { TimeUnitSwitch } from './components/TimeUnitSwitch';
|
|
8
7
|
import { timeUnitConfig } from './config';
|
|
8
|
+
import { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from './constants';
|
|
9
9
|
import type { MainProps } from './types';
|
|
10
10
|
|
|
11
11
|
const Main = ({ timeUnit, currencies }: MainProps) => {
|
|
@@ -40,10 +40,11 @@ const Main = ({ timeUnit, currencies }: MainProps) => {
|
|
|
40
40
|
))}
|
|
41
41
|
</>
|
|
42
42
|
) : (
|
|
43
|
-
<TimeUnitSwitch
|
|
43
|
+
<TimeUnitSwitch<CurrencyPowerBalanceTimeUnit>
|
|
44
44
|
callback={setSelectedTimeUnit}
|
|
45
45
|
options={timeUnitConfig}
|
|
46
46
|
selected={selectedTimeUnit}
|
|
47
|
+
tooltipId={CURRENCY_POWER_BALANCE_TOOLTIP_ID}
|
|
47
48
|
/>
|
|
48
49
|
)}
|
|
49
50
|
<ChartWithData
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TimeUnitSelect = void 0;
|
|
7
|
-
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
-
var _monoI18n = require("@oanda/mono-i18n");
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const TimeUnitSelect = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
selected,
|
|
14
|
-
options,
|
|
15
|
-
callback
|
|
16
|
-
} = _ref;
|
|
17
|
-
const {
|
|
18
|
-
lang
|
|
19
|
-
} = (0, _monoI18n.useLocale)();
|
|
20
|
-
const selectOptions = options.map(_ref2 => {
|
|
21
|
-
let {
|
|
22
|
-
value: id,
|
|
23
|
-
label,
|
|
24
|
-
tooltipLabel
|
|
25
|
-
} = _ref2;
|
|
26
|
-
return {
|
|
27
|
-
id,
|
|
28
|
-
label: tooltipLabel ? lang(tooltipLabel.translationKey, {
|
|
29
|
-
count: tooltipLabel.count
|
|
30
|
-
}) : lang(label)
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const [{
|
|
34
|
-
label: selectedLabel
|
|
35
|
-
}] = selectOptions.filter(_ref3 => {
|
|
36
|
-
let {
|
|
37
|
-
id
|
|
38
|
-
} = _ref3;
|
|
39
|
-
return id === selected;
|
|
40
|
-
});
|
|
41
|
-
return _react.default.createElement("div", {
|
|
42
|
-
className: "lw-mb-6 lw-w-full",
|
|
43
|
-
"data-testid": "time-unit-select"
|
|
44
|
-
}, _react.default.createElement(_labsWidgetCommon.Select, {
|
|
45
|
-
options: selectOptions,
|
|
46
|
-
searchPlaceholder: lang('search'),
|
|
47
|
-
selectedOption: {
|
|
48
|
-
id: selected,
|
|
49
|
-
label: selectedLabel
|
|
50
|
-
},
|
|
51
|
-
setSelectedOption: _ref4 => {
|
|
52
|
-
let {
|
|
53
|
-
id
|
|
54
|
-
} = _ref4;
|
|
55
|
-
return callback(id);
|
|
56
|
-
}
|
|
57
|
-
}));
|
|
58
|
-
};
|
|
59
|
-
exports.TimeUnitSelect = TimeUnitSelect;
|
|
60
|
-
//# sourceMappingURL=TimeUnitSelect.js.map
|
package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeUnitSelect.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","e","__esModule","default","TimeUnitSelect","_ref","selected","options","callback","lang","useLocale","selectOptions","map","_ref2","value","id","label","tooltipLabel","translationKey","count","selectedLabel","filter","_ref3","createElement","className","Select","searchPlaceholder","selectedOption","setSelectedOption","_ref4","exports"],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.tsx"],"sourcesContent":["import { Select } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSelect = ({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps) => {\n const { lang } = useLocale();\n const selectOptions = options.map(({ value: id, label, tooltipLabel }) => ({\n id,\n label: tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : lang(label),\n }));\n const [{ label: selectedLabel }] = selectOptions.filter(\n ({ id }) => id === selected\n );\n\n return (\n <div className=\"lw-mb-6 lw-w-full\" data-testid=\"time-unit-select\">\n <Select\n options={selectOptions}\n searchPlaceholder={lang('search')}\n selectedOption={{ id: selected, label: selectedLabel }}\n setSelectedOption={({ id }) =>\n callback(id as CurrencyPowerBalanceTimeUnit)\n }\n />\n </div>\n );\n};\n\nexport { TimeUnitSelect };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK1B,MAAMG,cAAc,GAAGC,IAAA,IAII;EAAA,IAJH;IACtBC,QAAQ;IACRC,OAAO;IACPC;EACmB,CAAC,GAAAH,IAAA;EACpB,MAAM;IAAEI;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAMC,aAAa,GAAGJ,OAAO,CAACK,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,KAAK,EAAEC,EAAE;MAAEC,KAAK;MAAEC;IAAa,CAAC,GAAAJ,KAAA;IAAA,OAAM;MACzEE,EAAE;MACFC,KAAK,EAAEC,YAAY,GACfR,IAAI,CAACQ,YAAY,CAACC,cAAc,EAAE;QAAEC,KAAK,EAAEF,YAAY,CAACE;MAAM,CAAC,CAAC,GAChEV,IAAI,CAACO,KAAK;IAChB,CAAC;EAAA,CAAC,CAAC;EACH,MAAM,CAAC;IAAEA,KAAK,EAAEI;EAAc,CAAC,CAAC,GAAGT,aAAa,CAACU,MAAM,CACrDC,KAAA;IAAA,IAAC;MAAEP;IAAG,CAAC,GAAAO,KAAA;IAAA,OAAKP,EAAE,KAAKT,QAAQ;EAAA,CAC7B,CAAC;EAED,OACEP,MAAA,CAAAI,OAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAkB,GAC/DzB,MAAA,CAAAI,OAAA,CAAAoB,aAAA,CAAC3B,iBAAA,CAAA6B,MAAM;IACLlB,OAAO,EAAEI,aAAc;IACvBe,iBAAiB,EAAEjB,IAAI,CAAC,QAAQ,CAAE;IAClCkB,cAAc,EAAE;MAAEZ,EAAE,EAAET,QAAQ;MAAEU,KAAK,EAAEI;IAAc,CAAE;IACvDQ,iBAAiB,EAAEC,KAAA;MAAA,IAAC;QAAEd;MAAG,CAAC,GAAAc,KAAA;MAAA,OACxBrB,QAAQ,CAACO,EAAkC,CAAC;IAAA;EAC7C,CACF,CACE,CAAC;AAEV,CAAC;AAACe,OAAA,CAAA1B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TimeUnitSwitch = void 0;
|
|
7
|
-
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
-
var _monoI18n = require("@oanda/mono-i18n");
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _constants = require("../../constants");
|
|
11
|
-
var _TimeUnitSelect = require("./TimeUnitSelect");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const TimeUnitSwitch = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
selected,
|
|
16
|
-
options,
|
|
17
|
-
callback
|
|
18
|
-
} = _ref;
|
|
19
|
-
const {
|
|
20
|
-
lang
|
|
21
|
-
} = (0, _monoI18n.useLocale)();
|
|
22
|
-
const {
|
|
23
|
-
size
|
|
24
|
-
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
25
|
-
const isDesktop = size === _labsWidgetCommon.Size.DESKTOP;
|
|
26
|
-
const handleButtonClick = e => {
|
|
27
|
-
callback(e.currentTarget.value);
|
|
28
|
-
};
|
|
29
|
-
return _react.default.createElement(_react.default.Fragment, null, isDesktop ? _react.default.createElement("div", {
|
|
30
|
-
className: "lw-mb-6 lw-flex lw-gap-1 lw-self-end",
|
|
31
|
-
"data-testid": "time-unit-switch"
|
|
32
|
-
}, options.map(_ref2 => {
|
|
33
|
-
let {
|
|
34
|
-
value,
|
|
35
|
-
label,
|
|
36
|
-
tooltipLabel
|
|
37
|
-
} = _ref2;
|
|
38
|
-
const tooltip = tooltipLabel ? lang(tooltipLabel.translationKey, {
|
|
39
|
-
count: tooltipLabel.count
|
|
40
|
-
}) : tooltipLabel;
|
|
41
|
-
const buttonLabel = lang(label);
|
|
42
|
-
return _react.default.createElement(_labsWidgetCommon.Button, {
|
|
43
|
-
key: value,
|
|
44
|
-
"data-tooltip-content": tooltip,
|
|
45
|
-
"data-tooltip-id": _constants.CURRENCY_POWER_BALANCE_TOOLTIP_ID,
|
|
46
|
-
size: _labsWidgetCommon.ButtonSize.full,
|
|
47
|
-
value: value,
|
|
48
|
-
variant: selected === value ? _labsWidgetCommon.ButtonVariant.primary : _labsWidgetCommon.ButtonVariant.secondary,
|
|
49
|
-
onClick: handleButtonClick
|
|
50
|
-
}, buttonLabel);
|
|
51
|
-
})) : _react.default.createElement(_TimeUnitSelect.TimeUnitSelect, {
|
|
52
|
-
callback: callback,
|
|
53
|
-
options: options,
|
|
54
|
-
selected: selected
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
exports.TimeUnitSwitch = TimeUnitSwitch;
|
|
58
|
-
//# sourceMappingURL=TimeUnitSwitch.js.map
|
package/dist/main/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeUnitSwitch.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_constants","_TimeUnitSelect","e","__esModule","default","TimeUnitSwitch","_ref","selected","options","callback","lang","useLocale","size","useLayoutProvider","isDesktop","Size","DESKTOP","handleButtonClick","currentTarget","value","createElement","Fragment","className","map","_ref2","label","tooltipLabel","tooltip","translationKey","count","buttonLabel","Button","key","CURRENCY_POWER_BALANCE_TOOLTIP_ID","ButtonSize","full","variant","ButtonVariant","primary","secondary","onClick","TimeUnitSelect","exports"],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.tsx"],"sourcesContent":["import {\n Button,\n ButtonSize,\n ButtonVariant,\n Size,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\nimport { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from '../../constants';\nimport { TimeUnitSelect } from './TimeUnitSelect';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSwitch = ({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n const handleButtonClick = (e: React.SyntheticEvent<HTMLButtonElement>) => {\n callback(e.currentTarget.value as CurrencyPowerBalanceTimeUnit);\n };\n\n return (\n <>\n {isDesktop ? (\n <div\n className=\"lw-mb-6 lw-flex lw-gap-1 lw-self-end\"\n data-testid=\"time-unit-switch\"\n >\n {options.map(({ value, label, tooltipLabel }) => {\n const tooltip = tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : tooltipLabel;\n const buttonLabel = lang(label);\n\n return (\n <Button\n key={value}\n data-tooltip-content={tooltip}\n data-tooltip-id={CURRENCY_POWER_BALANCE_TOOLTIP_ID}\n size={ButtonSize.full}\n value={value}\n variant={\n selected === value\n ? ButtonVariant.primary\n : ButtonVariant.secondary\n }\n onClick={handleButtonClick}\n >\n {buttonLabel}\n </Button>\n );\n })}\n </div>\n ) : (\n <TimeUnitSelect\n callback={callback}\n options={options}\n selected={selected}\n />\n )}\n </>\n );\n};\n\nexport { TimeUnitSwitch };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAkD,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGlD,MAAMG,cAAc,GAAGC,IAAA,IAII;EAAA,IAJH;IACtBC,QAAQ;IACRC,OAAO;IACPC;EACmB,CAAC,GAAAH,IAAA;EACpB,MAAM;IAAEI;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EACpC,MAAMC,SAAS,GAAGF,IAAI,KAAKG,sBAAI,CAACC,OAAO;EAEvC,MAAMC,iBAAiB,GAAIf,CAA0C,IAAK;IACxEO,QAAQ,CAACP,CAAC,CAACgB,aAAa,CAACC,KAAqC,CAAC;EACjE,CAAC;EAED,OACErB,MAAA,CAAAM,OAAA,CAAAgB,aAAA,CAAAtB,MAAA,CAAAM,OAAA,CAAAiB,QAAA,QACGP,SAAS,GACRhB,MAAA,CAAAM,OAAA,CAAAgB,aAAA;IACEE,SAAS,EAAC,sCAAsC;IAChD,eAAY;EAAkB,GAE7Bd,OAAO,CAACe,GAAG,CAACC,KAAA,IAAoC;IAAA,IAAnC;MAAEL,KAAK;MAAEM,KAAK;MAAEC;IAAa,CAAC,GAAAF,KAAA;IAC1C,MAAMG,OAAO,GAAGD,YAAY,GACxBhB,IAAI,CAACgB,YAAY,CAACE,cAAc,EAAE;MAAEC,KAAK,EAAEH,YAAY,CAACG;IAAM,CAAC,CAAC,GAChEH,YAAY;IAChB,MAAMI,WAAW,GAAGpB,IAAI,CAACe,KAAK,CAAC;IAE/B,OACE3B,MAAA,CAAAM,OAAA,CAAAgB,aAAA,CAACzB,iBAAA,CAAAoC,MAAM;MACLC,GAAG,EAAEb,KAAM;MACX,wBAAsBQ,OAAQ;MAC9B,mBAAiBM,4CAAkC;MACnDrB,IAAI,EAAEsB,4BAAU,CAACC,IAAK;MACtBhB,KAAK,EAAEA,KAAM;MACbiB,OAAO,EACL7B,QAAQ,KAAKY,KAAK,GACdkB,+BAAa,CAACC,OAAO,GACrBD,+BAAa,CAACE,SACnB;MACDC,OAAO,EAAEvB;IAAkB,GAE1Ba,WACK,CAAC;EAEb,CAAC,CACE,CAAC,GAENhC,MAAA,CAAAM,OAAA,CAAAgB,aAAA,CAACnB,eAAA,CAAAwC,cAAc;IACbhC,QAAQ,EAAEA,QAAS;IACnBD,OAAO,EAAEA,OAAQ;IACjBD,QAAQ,EAAEA;EAAS,CACpB,CAEH,CAAC;AAEP,CAAC;AAACmC,OAAA,CAAArC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _TimeUnitSwitch = require("./TimeUnitSwitch");
|
|
7
|
-
Object.keys(_TimeUnitSwitch).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _TimeUnitSwitch[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _TimeUnitSwitch[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_TimeUnitSwitch","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.ts"],"sourcesContent":["export * from './TimeUnitSwitch';\n"],"mappings":";;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,eAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,eAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,eAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.ts"],"sourcesContent":["import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\n\nexport interface TimeUnitOption {\n value: CurrencyPowerBalanceTimeUnit;\n label: string;\n tooltipLabel?: TooltipLabel;\n}\n\nexport interface TimeUnitSwitchProps {\n selected: CurrencyPowerBalanceTimeUnit;\n options: TimeUnitOption[];\n callback: (value: CurrencyPowerBalanceTimeUnit) => void;\n}\n\ninterface TooltipLabel {\n translationKey: string;\n count: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Select } from '@oanda/labs-widget-common';
|
|
2
|
-
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
const TimeUnitSelect = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
selected,
|
|
7
|
-
options,
|
|
8
|
-
callback
|
|
9
|
-
} = _ref;
|
|
10
|
-
const {
|
|
11
|
-
lang
|
|
12
|
-
} = useLocale();
|
|
13
|
-
const selectOptions = options.map(_ref2 => {
|
|
14
|
-
let {
|
|
15
|
-
value: id,
|
|
16
|
-
label,
|
|
17
|
-
tooltipLabel
|
|
18
|
-
} = _ref2;
|
|
19
|
-
return {
|
|
20
|
-
id,
|
|
21
|
-
label: tooltipLabel ? lang(tooltipLabel.translationKey, {
|
|
22
|
-
count: tooltipLabel.count
|
|
23
|
-
}) : lang(label)
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
const [{
|
|
27
|
-
label: selectedLabel
|
|
28
|
-
}] = selectOptions.filter(_ref3 => {
|
|
29
|
-
let {
|
|
30
|
-
id
|
|
31
|
-
} = _ref3;
|
|
32
|
-
return id === selected;
|
|
33
|
-
});
|
|
34
|
-
return React.createElement("div", {
|
|
35
|
-
className: "lw-mb-6 lw-w-full",
|
|
36
|
-
"data-testid": "time-unit-select"
|
|
37
|
-
}, React.createElement(Select, {
|
|
38
|
-
options: selectOptions,
|
|
39
|
-
searchPlaceholder: lang('search'),
|
|
40
|
-
selectedOption: {
|
|
41
|
-
id: selected,
|
|
42
|
-
label: selectedLabel
|
|
43
|
-
},
|
|
44
|
-
setSelectedOption: _ref4 => {
|
|
45
|
-
let {
|
|
46
|
-
id
|
|
47
|
-
} = _ref4;
|
|
48
|
-
return callback(id);
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
};
|
|
52
|
-
export { TimeUnitSelect };
|
|
53
|
-
//# sourceMappingURL=TimeUnitSelect.js.map
|
package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeUnitSelect.js","names":["Select","useLocale","React","TimeUnitSelect","_ref","selected","options","callback","lang","selectOptions","map","_ref2","value","id","label","tooltipLabel","translationKey","count","selectedLabel","filter","_ref3","createElement","className","searchPlaceholder","selectedOption","setSelectedOption","_ref4"],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSelect.tsx"],"sourcesContent":["import { Select } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSelect = ({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps) => {\n const { lang } = useLocale();\n const selectOptions = options.map(({ value: id, label, tooltipLabel }) => ({\n id,\n label: tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : lang(label),\n }));\n const [{ label: selectedLabel }] = selectOptions.filter(\n ({ id }) => id === selected\n );\n\n return (\n <div className=\"lw-mb-6 lw-w-full\" data-testid=\"time-unit-select\">\n <Select\n options={selectOptions}\n searchPlaceholder={lang('search')}\n selectedOption={{ id: selected, label: selectedLabel }}\n setSelectedOption={({ id }) =>\n callback(id as CurrencyPowerBalanceTimeUnit)\n }\n />\n </div>\n );\n};\n\nexport { TimeUnitSelect };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,2BAA2B;AAClD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAKzB,MAAMC,cAAc,GAAGC,IAAA,IAII;EAAA,IAJH;IACtBC,QAAQ;IACRC,OAAO;IACPC;EACmB,CAAC,GAAAH,IAAA;EACpB,MAAM;IAAEI;EAAK,CAAC,GAAGP,SAAS,CAAC,CAAC;EAC5B,MAAMQ,aAAa,GAAGH,OAAO,CAACI,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,KAAK,EAAEC,EAAE;MAAEC,KAAK;MAAEC;IAAa,CAAC,GAAAJ,KAAA;IAAA,OAAM;MACzEE,EAAE;MACFC,KAAK,EAAEC,YAAY,GACfP,IAAI,CAACO,YAAY,CAACC,cAAc,EAAE;QAAEC,KAAK,EAAEF,YAAY,CAACE;MAAM,CAAC,CAAC,GAChET,IAAI,CAACM,KAAK;IAChB,CAAC;EAAA,CAAC,CAAC;EACH,MAAM,CAAC;IAAEA,KAAK,EAAEI;EAAc,CAAC,CAAC,GAAGT,aAAa,CAACU,MAAM,CACrDC,KAAA;IAAA,IAAC;MAAEP;IAAG,CAAC,GAAAO,KAAA;IAAA,OAAKP,EAAE,KAAKR,QAAQ;EAAA,CAC7B,CAAC;EAED,OACEH,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAkB,GAC/DpB,KAAA,CAAAmB,aAAA,CAACrB,MAAM;IACLM,OAAO,EAAEG,aAAc;IACvBc,iBAAiB,EAAEf,IAAI,CAAC,QAAQ,CAAE;IAClCgB,cAAc,EAAE;MAAEX,EAAE,EAAER,QAAQ;MAAES,KAAK,EAAEI;IAAc,CAAE;IACvDO,iBAAiB,EAAEC,KAAA;MAAA,IAAC;QAAEb;MAAG,CAAC,GAAAa,KAAA;MAAA,OACxBnB,QAAQ,CAACM,EAAkC,CAAC;IAAA;EAC7C,CACF,CACE,CAAC;AAEV,CAAC;AAED,SAASV,cAAc","ignoreList":[]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Button, ButtonSize, ButtonVariant, Size, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
2
|
-
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from '../../constants';
|
|
5
|
-
import { TimeUnitSelect } from './TimeUnitSelect';
|
|
6
|
-
const TimeUnitSwitch = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
selected,
|
|
9
|
-
options,
|
|
10
|
-
callback
|
|
11
|
-
} = _ref;
|
|
12
|
-
const {
|
|
13
|
-
lang
|
|
14
|
-
} = useLocale();
|
|
15
|
-
const {
|
|
16
|
-
size
|
|
17
|
-
} = useLayoutProvider();
|
|
18
|
-
const isDesktop = size === Size.DESKTOP;
|
|
19
|
-
const handleButtonClick = e => {
|
|
20
|
-
callback(e.currentTarget.value);
|
|
21
|
-
};
|
|
22
|
-
return React.createElement(React.Fragment, null, isDesktop ? React.createElement("div", {
|
|
23
|
-
className: "lw-mb-6 lw-flex lw-gap-1 lw-self-end",
|
|
24
|
-
"data-testid": "time-unit-switch"
|
|
25
|
-
}, options.map(_ref2 => {
|
|
26
|
-
let {
|
|
27
|
-
value,
|
|
28
|
-
label,
|
|
29
|
-
tooltipLabel
|
|
30
|
-
} = _ref2;
|
|
31
|
-
const tooltip = tooltipLabel ? lang(tooltipLabel.translationKey, {
|
|
32
|
-
count: tooltipLabel.count
|
|
33
|
-
}) : tooltipLabel;
|
|
34
|
-
const buttonLabel = lang(label);
|
|
35
|
-
return React.createElement(Button, {
|
|
36
|
-
key: value,
|
|
37
|
-
"data-tooltip-content": tooltip,
|
|
38
|
-
"data-tooltip-id": CURRENCY_POWER_BALANCE_TOOLTIP_ID,
|
|
39
|
-
size: ButtonSize.full,
|
|
40
|
-
value: value,
|
|
41
|
-
variant: selected === value ? ButtonVariant.primary : ButtonVariant.secondary,
|
|
42
|
-
onClick: handleButtonClick
|
|
43
|
-
}, buttonLabel);
|
|
44
|
-
})) : React.createElement(TimeUnitSelect, {
|
|
45
|
-
callback: callback,
|
|
46
|
-
options: options,
|
|
47
|
-
selected: selected
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
export { TimeUnitSwitch };
|
|
51
|
-
//# sourceMappingURL=TimeUnitSwitch.js.map
|
package/dist/module/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeUnitSwitch.js","names":["Button","ButtonSize","ButtonVariant","Size","useLayoutProvider","useLocale","React","CURRENCY_POWER_BALANCE_TOOLTIP_ID","TimeUnitSelect","TimeUnitSwitch","_ref","selected","options","callback","lang","size","isDesktop","DESKTOP","handleButtonClick","e","currentTarget","value","createElement","Fragment","className","map","_ref2","label","tooltipLabel","tooltip","translationKey","count","buttonLabel","key","full","variant","primary","secondary","onClick"],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/TimeUnitSwitch.tsx"],"sourcesContent":["import {\n Button,\n ButtonSize,\n ButtonVariant,\n Size,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\nimport { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from '../../constants';\nimport { TimeUnitSelect } from './TimeUnitSelect';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSwitch = ({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n const handleButtonClick = (e: React.SyntheticEvent<HTMLButtonElement>) => {\n callback(e.currentTarget.value as CurrencyPowerBalanceTimeUnit);\n };\n\n return (\n <>\n {isDesktop ? (\n <div\n className=\"lw-mb-6 lw-flex lw-gap-1 lw-self-end\"\n data-testid=\"time-unit-switch\"\n >\n {options.map(({ value, label, tooltipLabel }) => {\n const tooltip = tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : tooltipLabel;\n const buttonLabel = lang(label);\n\n return (\n <Button\n key={value}\n data-tooltip-content={tooltip}\n data-tooltip-id={CURRENCY_POWER_BALANCE_TOOLTIP_ID}\n size={ButtonSize.full}\n value={value}\n variant={\n selected === value\n ? ButtonVariant.primary\n : ButtonVariant.secondary\n }\n onClick={handleButtonClick}\n >\n {buttonLabel}\n </Button>\n );\n })}\n </div>\n ) : (\n <TimeUnitSelect\n callback={callback}\n options={options}\n selected={selected}\n />\n )}\n </>\n );\n};\n\nexport { TimeUnitSwitch };\n"],"mappings":"AAAA,SACEA,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,IAAI,EACJC,iBAAiB,QACZ,2BAA2B;AACl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AACkC,OAAO,GACrBlC,aAAa,CAACmC,SACnB;MACDC,OAAO,EAAEpB;IAAkB,GAE1Bc,WACK,CAAC;EAEb,CAAC,CACE,CAAC,GAEN1B,KAAA,CAAAgB,aAAA,CAACd,cAAc;IACbK,QAAQ,EAAEA,QAAS;IACnBD,OAAO,EAAEA,OAAQ;IACjBD,QAAQ,EAAEA;EAAS,CACpB,CAEH,CAAC;AAEP,CAAC;AAED,SAASF,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/index.ts"],"sourcesContent":["export * from './TimeUnitSwitch';\n"],"mappings":"AAAA,cAAc,kBAAkB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CurrencyPowerBalanceWidget/components/TimeUnitSwitch/types.ts"],"sourcesContent":["import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';\n\nexport interface TimeUnitOption {\n value: CurrencyPowerBalanceTimeUnit;\n label: string;\n tooltipLabel?: TooltipLabel;\n}\n\nexport interface TimeUnitSwitchProps {\n selected: CurrencyPowerBalanceTimeUnit;\n options: TimeUnitOption[];\n callback: (value: CurrencyPowerBalanceTimeUnit) => void;\n}\n\ninterface TooltipLabel {\n translationKey: string;\n count: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TimeUnitSwitch';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';
|
|
2
|
-
export interface TimeUnitOption {
|
|
3
|
-
value: CurrencyPowerBalanceTimeUnit;
|
|
4
|
-
label: string;
|
|
5
|
-
tooltipLabel?: TooltipLabel;
|
|
6
|
-
}
|
|
7
|
-
export interface TimeUnitSwitchProps {
|
|
8
|
-
selected: CurrencyPowerBalanceTimeUnit;
|
|
9
|
-
options: TimeUnitOption[];
|
|
10
|
-
callback: (value: CurrencyPowerBalanceTimeUnit) => void;
|
|
11
|
-
}
|
|
12
|
-
interface TooltipLabel {
|
|
13
|
-
translationKey: string;
|
|
14
|
-
count: number;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Select } from '@oanda/labs-widget-common';
|
|
2
|
-
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';
|
|
6
|
-
import type { TimeUnitSwitchProps } from './types';
|
|
7
|
-
|
|
8
|
-
const TimeUnitSelect = ({
|
|
9
|
-
selected,
|
|
10
|
-
options,
|
|
11
|
-
callback,
|
|
12
|
-
}: TimeUnitSwitchProps) => {
|
|
13
|
-
const { lang } = useLocale();
|
|
14
|
-
const selectOptions = options.map(({ value: id, label, tooltipLabel }) => ({
|
|
15
|
-
id,
|
|
16
|
-
label: tooltipLabel
|
|
17
|
-
? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })
|
|
18
|
-
: lang(label),
|
|
19
|
-
}));
|
|
20
|
-
const [{ label: selectedLabel }] = selectOptions.filter(
|
|
21
|
-
({ id }) => id === selected
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div className="lw-mb-6 lw-w-full" data-testid="time-unit-select">
|
|
26
|
-
<Select
|
|
27
|
-
options={selectOptions}
|
|
28
|
-
searchPlaceholder={lang('search')}
|
|
29
|
-
selectedOption={{ id: selected, label: selectedLabel }}
|
|
30
|
-
setSelectedOption={({ id }) =>
|
|
31
|
-
callback(id as CurrencyPowerBalanceTimeUnit)
|
|
32
|
-
}
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { TimeUnitSelect };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button,
|
|
3
|
-
ButtonSize,
|
|
4
|
-
ButtonVariant,
|
|
5
|
-
Size,
|
|
6
|
-
useLayoutProvider,
|
|
7
|
-
} from '@oanda/labs-widget-common';
|
|
8
|
-
import { useLocale } from '@oanda/mono-i18n';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
|
|
11
|
-
import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';
|
|
12
|
-
import { CURRENCY_POWER_BALANCE_TOOLTIP_ID } from '../../constants';
|
|
13
|
-
import { TimeUnitSelect } from './TimeUnitSelect';
|
|
14
|
-
import type { TimeUnitSwitchProps } from './types';
|
|
15
|
-
|
|
16
|
-
const TimeUnitSwitch = ({
|
|
17
|
-
selected,
|
|
18
|
-
options,
|
|
19
|
-
callback,
|
|
20
|
-
}: TimeUnitSwitchProps) => {
|
|
21
|
-
const { lang } = useLocale();
|
|
22
|
-
const { size } = useLayoutProvider();
|
|
23
|
-
const isDesktop = size === Size.DESKTOP;
|
|
24
|
-
|
|
25
|
-
const handleButtonClick = (e: React.SyntheticEvent<HTMLButtonElement>) => {
|
|
26
|
-
callback(e.currentTarget.value as CurrencyPowerBalanceTimeUnit);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
{isDesktop ? (
|
|
32
|
-
<div
|
|
33
|
-
className="lw-mb-6 lw-flex lw-gap-1 lw-self-end"
|
|
34
|
-
data-testid="time-unit-switch"
|
|
35
|
-
>
|
|
36
|
-
{options.map(({ value, label, tooltipLabel }) => {
|
|
37
|
-
const tooltip = tooltipLabel
|
|
38
|
-
? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })
|
|
39
|
-
: tooltipLabel;
|
|
40
|
-
const buttonLabel = lang(label);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Button
|
|
44
|
-
key={value}
|
|
45
|
-
data-tooltip-content={tooltip}
|
|
46
|
-
data-tooltip-id={CURRENCY_POWER_BALANCE_TOOLTIP_ID}
|
|
47
|
-
size={ButtonSize.full}
|
|
48
|
-
value={value}
|
|
49
|
-
variant={
|
|
50
|
-
selected === value
|
|
51
|
-
? ButtonVariant.primary
|
|
52
|
-
: ButtonVariant.secondary
|
|
53
|
-
}
|
|
54
|
-
onClick={handleButtonClick}
|
|
55
|
-
>
|
|
56
|
-
{buttonLabel}
|
|
57
|
-
</Button>
|
|
58
|
-
);
|
|
59
|
-
})}
|
|
60
|
-
</div>
|
|
61
|
-
) : (
|
|
62
|
-
<TimeUnitSelect
|
|
63
|
-
callback={callback}
|
|
64
|
-
options={options}
|
|
65
|
-
selected={selected}
|
|
66
|
-
/>
|
|
67
|
-
)}
|
|
68
|
-
</>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export { TimeUnitSwitch };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TimeUnitSwitch';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CurrencyPowerBalanceTimeUnit } from '../../../gql/types/graphql';
|
|
2
|
-
|
|
3
|
-
export interface TimeUnitOption {
|
|
4
|
-
value: CurrencyPowerBalanceTimeUnit;
|
|
5
|
-
label: string;
|
|
6
|
-
tooltipLabel?: TooltipLabel;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface TimeUnitSwitchProps {
|
|
10
|
-
selected: CurrencyPowerBalanceTimeUnit;
|
|
11
|
-
options: TimeUnitOption[];
|
|
12
|
-
callback: (value: CurrencyPowerBalanceTimeUnit) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface TooltipLabel {
|
|
16
|
-
translationKey: string;
|
|
17
|
-
count: number;
|
|
18
|
-
}
|