@oanda/labs-live-rates-table-widget 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/CHANGELOG.md +332 -0
  2. package/dist/main/LiveRatesTableWidget/LiveRatesTableWidget.js +14 -14
  3. package/dist/main/LiveRatesTableWidget/LiveRatesTableWidget.js.map +1 -1
  4. package/dist/main/LiveRatesTableWidget/Main.js +15 -15
  5. package/dist/main/LiveRatesTableWidget/Main.js.map +1 -1
  6. package/dist/main/LiveRatesTableWidget/components/CardWithData/CardWithData.js +22 -20
  7. package/dist/main/LiveRatesTableWidget/components/CardWithData/CardWithData.js.map +1 -1
  8. package/dist/main/LiveRatesTableWidget/components/Cards/Cards.js +7 -7
  9. package/dist/main/LiveRatesTableWidget/components/Cards/Cards.js.map +1 -1
  10. package/dist/main/LiveRatesTableWidget/components/Cards/types.js.map +1 -1
  11. package/dist/main/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js +6 -5
  12. package/dist/main/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js.map +1 -1
  13. package/dist/main/LiveRatesTableWidget/components/LineChartWithData/types.js.map +1 -1
  14. package/dist/main/LiveRatesTableWidget/components/LineChartWithData/utils.js +1 -1
  15. package/dist/main/LiveRatesTableWidget/components/LineChartWithData/utils.js.map +1 -1
  16. package/dist/main/LiveRatesTableWidget/components/RowWithData/RowWithData.js +29 -27
  17. package/dist/main/LiveRatesTableWidget/components/RowWithData/RowWithData.js.map +1 -1
  18. package/dist/main/LiveRatesTableWidget/components/index.js +12 -12
  19. package/dist/main/LiveRatesTableWidget/components/index.js.map +1 -1
  20. package/dist/main/LiveRatesTableWidget/config.js.map +1 -1
  21. package/dist/main/LiveRatesTableWidget/constant.js.map +1 -1
  22. package/dist/main/LiveRatesTableWidget/render.js +6 -6
  23. package/dist/main/LiveRatesTableWidget/render.js.map +1 -1
  24. package/dist/main/LiveRatesTableWidget/types.js +1 -1
  25. package/dist/main/LiveRatesTableWidget/types.js.map +1 -1
  26. package/dist/main/LiveRatesTableWidget/utils.js +17 -14
  27. package/dist/main/LiveRatesTableWidget/utils.js.map +1 -1
  28. package/dist/main/gql/getInstrumentsChart.js +3 -8
  29. package/dist/main/gql/getInstrumentsChart.js.map +1 -1
  30. package/dist/main/gql/types/fragment-masking.js +3 -2
  31. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  32. package/dist/main/gql/types/gql.js +4 -3
  33. package/dist/main/gql/types/gql.js.map +1 -1
  34. package/dist/main/gql/types/graphql.js +142 -142
  35. package/dist/main/gql/types/graphql.js.map +1 -1
  36. package/dist/main/gql/types/index.js.map +1 -1
  37. package/dist/main/gql/validateInstruments.js +3 -8
  38. package/dist/main/gql/validateInstruments.js.map +1 -1
  39. package/dist/main/index.js +8 -8
  40. package/dist/main/index.js.map +1 -1
  41. package/dist/main/translations/index.js +1 -1
  42. package/dist/main/translations/index.js.map +1 -1
  43. package/dist/main/translations/translations.js.map +1 -1
  44. package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js +14 -14
  45. package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js.map +1 -1
  46. package/dist/module/LiveRatesTableWidget/Main.js +17 -17
  47. package/dist/module/LiveRatesTableWidget/Main.js.map +1 -1
  48. package/dist/module/LiveRatesTableWidget/components/CardWithData/CardWithData.js +23 -21
  49. package/dist/module/LiveRatesTableWidget/components/CardWithData/CardWithData.js.map +1 -1
  50. package/dist/module/LiveRatesTableWidget/components/Cards/Cards.js +7 -7
  51. package/dist/module/LiveRatesTableWidget/components/Cards/Cards.js.map +1 -1
  52. package/dist/module/LiveRatesTableWidget/components/Cards/types.js.map +1 -1
  53. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js +6 -5
  54. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js.map +1 -1
  55. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/types.js.map +1 -1
  56. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/utils.js +2 -2
  57. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/utils.js.map +1 -1
  58. package/dist/module/LiveRatesTableWidget/components/RowWithData/RowWithData.js +29 -27
  59. package/dist/module/LiveRatesTableWidget/components/RowWithData/RowWithData.js.map +1 -1
  60. package/dist/module/LiveRatesTableWidget/components/index.js +2 -2
  61. package/dist/module/LiveRatesTableWidget/components/index.js.map +1 -1
  62. package/dist/module/LiveRatesTableWidget/config.js.map +1 -1
  63. package/dist/module/LiveRatesTableWidget/constant.js +1 -1
  64. package/dist/module/LiveRatesTableWidget/constant.js.map +1 -1
  65. package/dist/module/LiveRatesTableWidget/render.js +6 -6
  66. package/dist/module/LiveRatesTableWidget/render.js.map +1 -1
  67. package/dist/module/LiveRatesTableWidget/types.js +1 -1
  68. package/dist/module/LiveRatesTableWidget/types.js.map +1 -1
  69. package/dist/module/LiveRatesTableWidget/utils.js +18 -15
  70. package/dist/module/LiveRatesTableWidget/utils.js.map +1 -1
  71. package/dist/module/gql/getInstrumentsChart.js +3 -8
  72. package/dist/module/gql/getInstrumentsChart.js.map +1 -1
  73. package/dist/module/gql/types/fragment-masking.js +3 -2
  74. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  75. package/dist/module/gql/types/gql.js +4 -3
  76. package/dist/module/gql/types/gql.js.map +1 -1
  77. package/dist/module/gql/types/graphql.js +142 -142
  78. package/dist/module/gql/types/graphql.js.map +1 -1
  79. package/dist/module/gql/types/index.js +2 -2
  80. package/dist/module/gql/types/index.js.map +1 -1
  81. package/dist/module/gql/validateInstruments.js +3 -8
  82. package/dist/module/gql/validateInstruments.js.map +1 -1
  83. package/dist/module/index.js +1 -1
  84. package/dist/module/index.js.map +1 -1
  85. package/dist/module/translations/index.js +1 -1
  86. package/dist/module/translations/index.js.map +1 -1
  87. package/dist/module/translations/translations.js.map +1 -1
  88. package/dist/types/LiveRatesTableWidget/LiveRatesTableWidget.d.ts +1 -1
  89. package/dist/types/LiveRatesTableWidget/Main.d.ts +1 -1
  90. package/dist/types/LiveRatesTableWidget/components/CardWithData/CardWithData.d.ts +1 -1
  91. package/dist/types/LiveRatesTableWidget/components/Cards/Cards.d.ts +1 -1
  92. package/dist/types/LiveRatesTableWidget/components/Cards/types.d.ts +2 -2
  93. package/dist/types/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.d.ts +1 -1
  94. package/dist/types/LiveRatesTableWidget/components/LineChartWithData/types.d.ts +3 -3
  95. package/dist/types/LiveRatesTableWidget/components/RowWithData/RowWithData.d.ts +1 -1
  96. package/dist/types/LiveRatesTableWidget/components/index.d.ts +2 -2
  97. package/dist/types/LiveRatesTableWidget/config.d.ts +1 -1
  98. package/dist/types/LiveRatesTableWidget/constant.d.ts +1 -1
  99. package/dist/types/LiveRatesTableWidget/types.d.ts +4 -4
  100. package/dist/types/LiveRatesTableWidget/utils.d.ts +5 -4
  101. package/dist/types/gql/types/gql.d.ts +4 -4
  102. package/dist/types/gql/types/index.d.ts +2 -2
  103. package/dist/types/index.d.ts +1 -1
  104. package/dist/types/translations/index.d.ts +2 -2
  105. package/package.json +3 -3
  106. package/src/LiveRatesTableWidget/LiveRatesTableWidget.tsx +14 -17
  107. package/src/LiveRatesTableWidget/Main.tsx +49 -43
  108. package/src/LiveRatesTableWidget/components/CardWithData/CardWithData.tsx +43 -28
  109. package/src/LiveRatesTableWidget/components/Cards/Cards.tsx +15 -8
  110. package/src/LiveRatesTableWidget/components/Cards/types.tsx +2 -2
  111. package/src/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.tsx +12 -10
  112. package/src/LiveRatesTableWidget/components/LineChartWithData/types.tsx +4 -3
  113. package/src/LiveRatesTableWidget/components/LineChartWithData/utils.ts +1 -1
  114. package/src/LiveRatesTableWidget/components/RowWithData/RowWithData.tsx +63 -30
  115. package/src/LiveRatesTableWidget/components/index.ts +2 -2
  116. package/src/LiveRatesTableWidget/config.ts +2 -4
  117. package/src/LiveRatesTableWidget/constant.ts +4 -1
  118. package/src/LiveRatesTableWidget/render.tsx +52 -34
  119. package/src/LiveRatesTableWidget/types.tsx +5 -4
  120. package/src/LiveRatesTableWidget/utils.ts +20 -17
  121. package/src/gql/types/fragment-masking.ts +41 -21
  122. package/src/gql/types/gql.ts +12 -5
  123. package/src/gql/types/graphql.ts +214 -49
  124. package/src/gql/types/index.ts +2 -2
  125. package/src/index.ts +1 -1
  126. package/src/translations/index.ts +4 -4
  127. package/src/translations/translations.ts +2 -1
  128. package/test/CardWithData.test.tsx +8 -7
  129. package/test/Cards.test.tsx +32 -29
  130. package/test/LineChartWithData.test.tsx +77 -32
  131. package/test/Main.test.tsx +10 -9
  132. package/test/RowWithData.test.tsx +9 -8
  133. package/test/mocks.ts +1 -3
@@ -2,18 +2,31 @@
2
2
  import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
3
3
  export type Maybe<T> = T | null;
4
4
  export type InputMaybe<T> = Maybe<T>;
5
- export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6
- export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
7
- export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8
- export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9
- export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
5
+ export type Exact<T extends { [key: string]: unknown }> = {
6
+ [K in keyof T]: T[K];
7
+ };
8
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
9
+ [SubKey in K]?: Maybe<T[SubKey]>;
10
+ };
11
+ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
12
+ [SubKey in K]: Maybe<T[SubKey]>;
13
+ };
14
+ export type MakeEmpty<
15
+ T extends { [key: string]: unknown },
16
+ K extends keyof T,
17
+ > = { [_ in K]?: never };
18
+ export type Incremental<T> =
19
+ | T
20
+ | {
21
+ [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
22
+ };
10
23
  /** All built-in and custom scalars, mapped to their actual values */
11
24
  export type Scalars = {
12
- ID: { input: string; output: string; }
13
- String: { input: string; output: string; }
14
- Boolean: { input: boolean; output: boolean; }
15
- Int: { input: number; output: number; }
16
- Float: { input: number; output: number; }
25
+ ID: { input: string; output: string };
26
+ String: { input: string; output: string };
27
+ Boolean: { input: boolean; output: boolean };
28
+ Int: { input: number; output: number };
29
+ Float: { input: number; output: number };
17
30
  };
18
31
 
19
32
  export type AssetClass = {
@@ -28,12 +41,12 @@ export enum AssetClassName {
28
41
  Currency = 'CURRENCY',
29
42
  EquityShares = 'EQUITY_SHARES',
30
43
  Indices = 'INDICES',
31
- Rates = 'RATES'
44
+ Rates = 'RATES',
32
45
  }
33
46
 
34
47
  export enum BookType {
35
48
  Order = 'ORDER',
36
- Position = 'POSITION'
49
+ Position = 'POSITION',
37
50
  }
38
51
 
39
52
  export type CorrelationHeatmap = {
@@ -56,7 +69,7 @@ export enum CorrelationTimeUnit {
56
69
  M3 = 'M3',
57
70
  M6 = 'M6',
58
71
  W1 = 'W1',
59
- Y1 = 'Y1'
72
+ Y1 = 'Y1',
60
73
  }
61
74
 
62
75
  export enum CurrencyName {
@@ -67,7 +80,7 @@ export enum CurrencyName {
67
80
  Gbp = 'GBP',
68
81
  Jpy = 'JPY',
69
82
  Nzd = 'NZD',
70
- Usd = 'USD'
83
+ Usd = 'USD',
71
84
  }
72
85
 
73
86
  export type CurrencyPower = {
@@ -92,7 +105,7 @@ export enum CurrencyPowerBalanceTimeUnit {
92
105
  M1 = 'M1',
93
106
  M3 = 'M3',
94
107
  PreviousDay = 'PREVIOUS_DAY',
95
- W1 = 'W1'
108
+ W1 = 'W1',
96
109
  }
97
110
 
98
111
  export type CurrencyStrength = {
@@ -104,7 +117,7 @@ export type CurrencyStrength = {
104
117
 
105
118
  export enum DataSource {
106
119
  Ny4 = 'NY4',
107
- Ty3 = 'TY3'
120
+ Ty3 = 'TY3',
108
121
  }
109
122
 
110
123
  export enum Division {
@@ -116,7 +129,7 @@ export enum Division {
116
129
  Ogm = 'OGM',
117
130
  Oj = 'OJ',
118
131
  Opt = 'OPT',
119
- Otms = 'OTMS'
132
+ Otms = 'OTMS',
120
133
  }
121
134
 
122
135
  export type Heatmap = {
@@ -182,36 +195,30 @@ export type Query = {
182
195
  volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;
183
196
  };
184
197
 
185
-
186
198
  export type QueryAssetClassesArgs = {
187
199
  division: Division;
188
200
  };
189
201
 
190
-
191
202
  export type QueryCorrelationHeatmapArgs = {
192
203
  division: Division;
193
204
  instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
194
205
  timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;
195
206
  };
196
207
 
197
-
198
208
  export type QueryCorrelationMatrixArgs = {
199
209
  division: Division;
200
210
  instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
201
211
  };
202
212
 
203
-
204
213
  export type QueryCurrencyPowerBalanceArgs = {
205
214
  timeUnit: CurrencyPowerBalanceTimeUnit;
206
215
  };
207
216
 
208
-
209
217
  export type QueryMapInstrumentNamesArgs = {
210
218
  division?: InputMaybe<Division>;
211
219
  instruments: Array<InputMaybe<Scalars['String']['input']>>;
212
220
  };
213
221
 
214
-
215
222
  export type QueryOrderPositionBooksArgs = {
216
223
  bookType: BookType;
217
224
  dataSource?: InputMaybe<DataSource>;
@@ -220,19 +227,16 @@ export type QueryOrderPositionBooksArgs = {
220
227
  region?: InputMaybe<Region>;
221
228
  };
222
229
 
223
-
224
230
  export type QuerySentimentArgs = {
225
231
  division?: InputMaybe<Division>;
226
232
  name: Scalars['String']['input'];
227
233
  };
228
234
 
229
-
230
235
  export type QuerySentimentListArgs = {
231
236
  division?: InputMaybe<Division>;
232
237
  sort?: InputMaybe<Sort>;
233
238
  };
234
239
 
235
-
236
240
  export type QueryTopicalInstrumentsArgs = {
237
241
  assetClass?: InputMaybe<AssetClassName>;
238
242
  count?: InputMaybe<Scalars['Int']['input']>;
@@ -241,25 +245,21 @@ export type QueryTopicalInstrumentsArgs = {
241
245
  sort: TopicalSort;
242
246
  };
243
247
 
244
-
245
248
  export type QueryTopicalInstrumentsChartsArgs = {
246
249
  division?: InputMaybe<Division>;
247
250
  instruments?: InputMaybe<Array<Scalars['String']['input']>>;
248
251
  };
249
252
 
250
-
251
253
  export type QueryTopicalInstrumentsTotalCountArgs = {
252
254
  assetClass?: InputMaybe<AssetClassName>;
253
255
  division?: InputMaybe<Division>;
254
256
  sort: TopicalSort;
255
257
  };
256
258
 
257
-
258
259
  export type QueryValueAtRiskAssetClassesArgs = {
259
260
  division?: InputMaybe<Division>;
260
261
  };
261
262
 
262
-
263
263
  export type QueryValueAtRiskChartArgs = {
264
264
  bars: ValueAtRiskBars;
265
265
  division?: InputMaybe<Division>;
@@ -267,7 +267,6 @@ export type QueryValueAtRiskChartArgs = {
267
267
  instrument: Scalars['String']['input'];
268
268
  };
269
269
 
270
-
271
270
  export type QueryVolatilityChartArgs = {
272
271
  division?: InputMaybe<Division>;
273
272
  instrument: Scalars['String']['input'];
@@ -275,7 +274,6 @@ export type QueryVolatilityChartArgs = {
275
274
  timeUnit: VolatilityChartTimeUnit;
276
275
  };
277
276
 
278
-
279
277
  export type QueryVolatilityChartAssetClassesArgs = {
280
278
  division?: InputMaybe<Division>;
281
279
  };
@@ -283,7 +281,7 @@ export type QueryVolatilityChartAssetClassesArgs = {
283
281
  export enum Region {
284
282
  Amer = 'AMER',
285
283
  Apac = 'APAC',
286
- Emea = 'EMEA'
284
+ Emea = 'EMEA',
287
285
  }
288
286
 
289
287
  export type Sentiment = {
@@ -302,7 +300,7 @@ export type SentimentInstrument = {
302
300
 
303
301
  export enum Sort {
304
302
  Bearish = 'BEARISH',
305
- Bullish = 'BULLISH'
303
+ Bullish = 'BULLISH',
306
304
  }
307
305
 
308
306
  export type StrengthRelation = {
@@ -337,13 +335,13 @@ export enum TopicalSort {
337
335
  Bullish = 'BULLISH',
338
336
  Hot = 'HOT',
339
337
  Popular = 'POPULAR',
340
- Volatile = 'VOLATILE'
338
+ Volatile = 'VOLATILE',
341
339
  }
342
340
 
343
341
  export enum ValueAtRiskBars {
344
342
  C100 = 'C100',
345
343
  C200 = 'C200',
346
- C300 = 'C300'
344
+ C300 = 'C300',
347
345
  }
348
346
 
349
347
  export type ValueAtRiskChart = {
@@ -373,7 +371,7 @@ export enum ValueAtRiskDuration {
373
371
  C3 = 'C3',
374
372
  C4 = 'C4',
375
373
  C5 = 'C5',
376
- C10 = 'C10'
374
+ C10 = 'C10',
377
375
  }
378
376
 
379
377
  export type VolatilityChart = {
@@ -396,31 +394,198 @@ export enum VolatilityChartTimeSpan {
396
394
  /** Valid for: W */
397
395
  W5 = 'W5',
398
396
  /** Valid for: W */
399
- W10 = 'W10'
397
+ W10 = 'W10',
400
398
  }
401
399
 
402
400
  export enum VolatilityChartTimeUnit {
403
401
  D = 'D',
404
402
  H = 'H',
405
- W = 'W'
403
+ W = 'W',
406
404
  }
407
405
 
408
406
  export type GetInstrumentsChartQueryVariables = Exact<{
409
- instruments?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
407
+ instruments?: InputMaybe<
408
+ Array<Scalars['String']['input']> | Scalars['String']['input']
409
+ >;
410
410
  division?: InputMaybe<Division>;
411
411
  }>;
412
412
 
413
-
414
- export type GetInstrumentsChartQuery = { __typename?: 'Query', topicalInstrumentsCharts?: Array<{ __typename?: 'TopicalInstrumentChart', name: string, chart?: Array<number> | null }> | null };
413
+ export type GetInstrumentsChartQuery = {
414
+ __typename?: 'Query';
415
+ topicalInstrumentsCharts?: Array<{
416
+ __typename?: 'TopicalInstrumentChart';
417
+ name: string;
418
+ chart?: Array<number> | null;
419
+ }> | null;
420
+ };
415
421
 
416
422
  export type ValidateInstrumentsQueryVariables = Exact<{
417
- instruments: Array<InputMaybe<Scalars['String']['input']>> | InputMaybe<Scalars['String']['input']>;
423
+ instruments:
424
+ | Array<InputMaybe<Scalars['String']['input']>>
425
+ | InputMaybe<Scalars['String']['input']>;
418
426
  division?: InputMaybe<Division>;
419
427
  }>;
420
428
 
421
-
422
- export type ValidateInstrumentsQuery = { __typename?: 'Query', mapInstrumentNames?: Array<{ __typename?: 'Instrument', name: string, displayName: string } | null> | null };
423
-
424
-
425
- export const GetInstrumentsChartDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInstrumentsChart"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"instruments"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"topicalInstrumentsCharts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"instruments"},"value":{"kind":"Variable","name":{"kind":"Name","value":"instruments"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"chart"}}]}}]}}]} as unknown as DocumentNode<GetInstrumentsChartQuery, GetInstrumentsChartQueryVariables>;
426
- export const ValidateInstrumentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"validateInstruments"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"instruments"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapInstrumentNames"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"instruments"},"value":{"kind":"Variable","name":{"kind":"Name","value":"instruments"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]} as unknown as DocumentNode<ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables>;
429
+ export type ValidateInstrumentsQuery = {
430
+ __typename?: 'Query';
431
+ mapInstrumentNames?: Array<{
432
+ __typename?: 'Instrument';
433
+ name: string;
434
+ displayName: string;
435
+ } | null> | null;
436
+ };
437
+
438
+ export const GetInstrumentsChartDocument = {
439
+ kind: 'Document',
440
+ definitions: [
441
+ {
442
+ kind: 'OperationDefinition',
443
+ operation: 'query',
444
+ name: { kind: 'Name', value: 'GetInstrumentsChart' },
445
+ variableDefinitions: [
446
+ {
447
+ kind: 'VariableDefinition',
448
+ variable: {
449
+ kind: 'Variable',
450
+ name: { kind: 'Name', value: 'instruments' },
451
+ },
452
+ type: {
453
+ kind: 'ListType',
454
+ type: {
455
+ kind: 'NonNullType',
456
+ type: {
457
+ kind: 'NamedType',
458
+ name: { kind: 'Name', value: 'String' },
459
+ },
460
+ },
461
+ },
462
+ },
463
+ {
464
+ kind: 'VariableDefinition',
465
+ variable: {
466
+ kind: 'Variable',
467
+ name: { kind: 'Name', value: 'division' },
468
+ },
469
+ type: {
470
+ kind: 'NamedType',
471
+ name: { kind: 'Name', value: 'Division' },
472
+ },
473
+ },
474
+ ],
475
+ selectionSet: {
476
+ kind: 'SelectionSet',
477
+ selections: [
478
+ {
479
+ kind: 'Field',
480
+ name: { kind: 'Name', value: 'topicalInstrumentsCharts' },
481
+ arguments: [
482
+ {
483
+ kind: 'Argument',
484
+ name: { kind: 'Name', value: 'instruments' },
485
+ value: {
486
+ kind: 'Variable',
487
+ name: { kind: 'Name', value: 'instruments' },
488
+ },
489
+ },
490
+ {
491
+ kind: 'Argument',
492
+ name: { kind: 'Name', value: 'division' },
493
+ value: {
494
+ kind: 'Variable',
495
+ name: { kind: 'Name', value: 'division' },
496
+ },
497
+ },
498
+ ],
499
+ selectionSet: {
500
+ kind: 'SelectionSet',
501
+ selections: [
502
+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
503
+ { kind: 'Field', name: { kind: 'Name', value: 'chart' } },
504
+ ],
505
+ },
506
+ },
507
+ ],
508
+ },
509
+ },
510
+ ],
511
+ } as unknown as DocumentNode<
512
+ GetInstrumentsChartQuery,
513
+ GetInstrumentsChartQueryVariables
514
+ >;
515
+ export const ValidateInstrumentsDocument = {
516
+ kind: 'Document',
517
+ definitions: [
518
+ {
519
+ kind: 'OperationDefinition',
520
+ operation: 'query',
521
+ name: { kind: 'Name', value: 'validateInstruments' },
522
+ variableDefinitions: [
523
+ {
524
+ kind: 'VariableDefinition',
525
+ variable: {
526
+ kind: 'Variable',
527
+ name: { kind: 'Name', value: 'instruments' },
528
+ },
529
+ type: {
530
+ kind: 'NonNullType',
531
+ type: {
532
+ kind: 'ListType',
533
+ type: {
534
+ kind: 'NamedType',
535
+ name: { kind: 'Name', value: 'String' },
536
+ },
537
+ },
538
+ },
539
+ },
540
+ {
541
+ kind: 'VariableDefinition',
542
+ variable: {
543
+ kind: 'Variable',
544
+ name: { kind: 'Name', value: 'division' },
545
+ },
546
+ type: {
547
+ kind: 'NamedType',
548
+ name: { kind: 'Name', value: 'Division' },
549
+ },
550
+ },
551
+ ],
552
+ selectionSet: {
553
+ kind: 'SelectionSet',
554
+ selections: [
555
+ {
556
+ kind: 'Field',
557
+ name: { kind: 'Name', value: 'mapInstrumentNames' },
558
+ arguments: [
559
+ {
560
+ kind: 'Argument',
561
+ name: { kind: 'Name', value: 'instruments' },
562
+ value: {
563
+ kind: 'Variable',
564
+ name: { kind: 'Name', value: 'instruments' },
565
+ },
566
+ },
567
+ {
568
+ kind: 'Argument',
569
+ name: { kind: 'Name', value: 'division' },
570
+ value: {
571
+ kind: 'Variable',
572
+ name: { kind: 'Name', value: 'division' },
573
+ },
574
+ },
575
+ ],
576
+ selectionSet: {
577
+ kind: 'SelectionSet',
578
+ selections: [
579
+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
580
+ { kind: 'Field', name: { kind: 'Name', value: 'displayName' } },
581
+ ],
582
+ },
583
+ },
584
+ ],
585
+ },
586
+ },
587
+ ],
588
+ } as unknown as DocumentNode<
589
+ ValidateInstrumentsQuery,
590
+ ValidateInstrumentsQueryVariables
591
+ >;
@@ -1,2 +1,2 @@
1
- export * from "./fragment-masking";
2
- export * from "./gql";
1
+ export * from './fragment-masking';
2
+ export * from './gql';
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './LiveRatesTableWidget/types';
2
1
  export * from './LiveRatesTableWidget/LiveRatesTableWidget';
2
+ export * from './LiveRatesTableWidget/types';
@@ -1,11 +1,11 @@
1
- import { Locale, Translations } from '@oanda/mono-i18n';
1
+ import type { Translations } from '@oanda/mono-i18n';
2
+ import { Locale } from '@oanda/mono-i18n';
2
3
 
3
4
  import en from './sources/en.json';
4
- import zhTW from './sources/zh_TW.json';
5
5
  import es from './sources/es.json';
6
6
  import th from './sources/th.json';
7
-
8
- import { defaultTranslations } from './translations';
7
+ import zhTW from './sources/zh_TW.json';
8
+ import type { defaultTranslations } from './translations';
9
9
 
10
10
  export type TranslationKey = keyof typeof defaultTranslations;
11
11
 
@@ -9,7 +9,8 @@ export const defaultTranslations = {
9
9
  data_unavailable: 'Data unavailable',
10
10
  hot: 'Hot',
11
11
  instrument: 'Instrument',
12
- pagination_entries_range: '{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries',
12
+ pagination_entries_range:
13
+ '{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries',
13
14
  popular: 'Popular',
14
15
  sell: 'Sell',
15
16
  sell_price: 'Sell Price',
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render } from '@testing-library/react';
6
4
  import { MockedProvider } from '@apollo/client/testing';
7
5
  import { MockLayoutProvider } from '@oanda/labs-widget-common';
8
- import { CardWithData } from '../src/LiveRatesTableWidget/components/CardWithData';
9
- import { ColumnsNames } from '../src/LiveRatesTableWidget/types';
6
+ import { render } from '@testing-library/react';
7
+ import React from 'react';
8
+
10
9
  import { getInstrumentsChart } from '../src/gql/getInstrumentsChart';
11
10
  import { Division } from '../src/gql/types/graphql';
11
+ import { CardWithData } from '../src/LiveRatesTableWidget/components/CardWithData';
12
+ import { ColumnsNames } from '../src/LiveRatesTableWidget/types';
12
13
 
13
14
  const chartPointsMocks = [
14
15
  {
@@ -57,14 +58,14 @@ describe('CardWithData component', () => {
57
58
  <MockedProvider mocks={chartPointsMocks}>
58
59
  <MockLayoutProvider>
59
60
  <CardWithData
60
- record={record}
61
- index={0}
62
61
  activeColumns={columns}
63
62
  division={Division.Oc}
63
+ index={0}
64
+ record={record}
64
65
  target={null}
65
66
  />
66
67
  </MockLayoutProvider>
67
- </MockedProvider>,
68
+ </MockedProvider>
68
69
  );
69
70
  expect(getByTestId('card')).toBeInTheDocument();
70
71
  expect(getByTestId('card-header')).toBeInTheDocument();
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render } from '@testing-library/react';
6
4
  import { MockedProvider } from '@apollo/client/testing';
7
5
  import { MockLayoutProvider } from '@oanda/labs-widget-common';
8
- import { Cards } from '../src/LiveRatesTableWidget/components';
9
- import { ColumnsNames } from '../src/LiveRatesTableWidget/types';
6
+ import { render } from '@testing-library/react';
7
+ import React from 'react';
8
+
10
9
  import { getInstrumentsChart } from '../src/gql/getInstrumentsChart';
11
10
  import { Division } from '../src/gql/types/graphql';
11
+ import { Cards } from '../src/LiveRatesTableWidget/components';
12
+ import { ColumnsNames } from '../src/LiveRatesTableWidget/types';
12
13
 
13
14
  const chartPointsMocks = [
14
15
  {
@@ -62,22 +63,24 @@ const chartPointsMocks = [
62
63
  ];
63
64
 
64
65
  describe('Cards component', () => {
65
- const records = [{
66
- instrument: 'EUR_USD',
67
- displayName: 'EUR_USD',
68
- buy: 1.04508,
69
- sell: 1.04523,
70
- spread: 1.2,
71
- dailyPercentChange: '+3,23%',
72
- },
73
- {
74
- instrument: 'EUR_JPY',
75
- displayName: 'EUR_JPY',
76
- buy: 1.04553,
77
- sell: 1.045353,
78
- spread: 1.3,
79
- dailyPercentChange: '+4,23%',
80
- }];
66
+ const records = [
67
+ {
68
+ instrument: 'EUR_USD',
69
+ displayName: 'EUR_USD',
70
+ buy: 1.04508,
71
+ sell: 1.04523,
72
+ spread: 1.2,
73
+ dailyPercentChange: '+3,23%',
74
+ },
75
+ {
76
+ instrument: 'EUR_JPY',
77
+ displayName: 'EUR_JPY',
78
+ buy: 1.04553,
79
+ sell: 1.045353,
80
+ spread: 1.3,
81
+ dailyPercentChange: '+4,23%',
82
+ },
83
+ ];
81
84
  const columns = [
82
85
  ColumnsNames.SELL,
83
86
  ColumnsNames.BUY,
@@ -90,16 +93,16 @@ describe('Cards component', () => {
90
93
  <MockedProvider mocks={chartPointsMocks}>
91
94
  <MockLayoutProvider>
92
95
  <Cards
93
- target={null}
94
- records={records}
95
96
  columns={columns}
97
+ division={Division.Oc}
96
98
  emptyCardsCount={2}
97
99
  isError={false}
98
100
  isLoading={false}
99
- division={Division.Oc}
101
+ records={records}
102
+ target={null}
100
103
  />
101
104
  </MockLayoutProvider>
102
- </MockedProvider>,
105
+ </MockedProvider>
103
106
  );
104
107
  expect(getAllByTestId('card').length).toEqual(2);
105
108
  expect(getAllByTestId('card-header').length).toEqual(2);
@@ -110,16 +113,16 @@ describe('Cards component', () => {
110
113
  <MockedProvider mocks={chartPointsMocks}>
111
114
  <MockLayoutProvider>
112
115
  <Cards
113
- target={null}
114
- records={records}
116
+ isError
115
117
  columns={columns}
118
+ division={Division.Oc}
116
119
  emptyCardsCount={2}
117
- isError
118
120
  isLoading={false}
119
- division={Division.Oc}
121
+ records={records}
122
+ target={null}
120
123
  />
121
124
  </MockLayoutProvider>
122
- </MockedProvider>,
125
+ </MockedProvider>
123
126
  );
124
127
  expect(getAllByTestId('card').length).toEqual(1);
125
128
  expect(getAllByTestId('chart-error').length).toEqual(1);