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

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 (122) hide show
  1. package/CHANGELOG.md +164 -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 +17 -17
  7. package/dist/main/LiveRatesTableWidget/components/CardWithData/CardWithData.js.map +1 -1
  8. package/dist/main/LiveRatesTableWidget/components/Cards/Cards.js +6 -6
  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 +4 -4
  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.map +1 -1
  15. package/dist/main/LiveRatesTableWidget/components/RowWithData/RowWithData.js +24 -24
  16. package/dist/main/LiveRatesTableWidget/components/RowWithData/RowWithData.js.map +1 -1
  17. package/dist/main/LiveRatesTableWidget/components/index.js +12 -12
  18. package/dist/main/LiveRatesTableWidget/components/index.js.map +1 -1
  19. package/dist/main/LiveRatesTableWidget/config.js.map +1 -1
  20. package/dist/main/LiveRatesTableWidget/constant.js.map +1 -1
  21. package/dist/main/LiveRatesTableWidget/render.js +6 -6
  22. package/dist/main/LiveRatesTableWidget/render.js.map +1 -1
  23. package/dist/main/LiveRatesTableWidget/types.js +1 -1
  24. package/dist/main/LiveRatesTableWidget/types.js.map +1 -1
  25. package/dist/main/LiveRatesTableWidget/utils.js +2 -2
  26. package/dist/main/LiveRatesTableWidget/utils.js.map +1 -1
  27. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  28. package/dist/main/gql/types/gql.js +2 -2
  29. package/dist/main/gql/types/gql.js.map +1 -1
  30. package/dist/main/gql/types/graphql.js +142 -142
  31. package/dist/main/gql/types/graphql.js.map +1 -1
  32. package/dist/main/gql/types/index.js.map +1 -1
  33. package/dist/main/index.js +8 -8
  34. package/dist/main/index.js.map +1 -1
  35. package/dist/main/translations/index.js +1 -1
  36. package/dist/main/translations/index.js.map +1 -1
  37. package/dist/main/translations/translations.js.map +1 -1
  38. package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js +14 -14
  39. package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js.map +1 -1
  40. package/dist/module/LiveRatesTableWidget/Main.js +17 -17
  41. package/dist/module/LiveRatesTableWidget/Main.js.map +1 -1
  42. package/dist/module/LiveRatesTableWidget/components/CardWithData/CardWithData.js +18 -18
  43. package/dist/module/LiveRatesTableWidget/components/CardWithData/CardWithData.js.map +1 -1
  44. package/dist/module/LiveRatesTableWidget/components/Cards/Cards.js +6 -6
  45. package/dist/module/LiveRatesTableWidget/components/Cards/Cards.js.map +1 -1
  46. package/dist/module/LiveRatesTableWidget/components/Cards/types.js.map +1 -1
  47. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js +4 -4
  48. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.js.map +1 -1
  49. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/types.js.map +1 -1
  50. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/utils.js +1 -1
  51. package/dist/module/LiveRatesTableWidget/components/LineChartWithData/utils.js.map +1 -1
  52. package/dist/module/LiveRatesTableWidget/components/RowWithData/RowWithData.js +24 -24
  53. package/dist/module/LiveRatesTableWidget/components/RowWithData/RowWithData.js.map +1 -1
  54. package/dist/module/LiveRatesTableWidget/components/index.js +2 -2
  55. package/dist/module/LiveRatesTableWidget/components/index.js.map +1 -1
  56. package/dist/module/LiveRatesTableWidget/config.js.map +1 -1
  57. package/dist/module/LiveRatesTableWidget/constant.js +1 -1
  58. package/dist/module/LiveRatesTableWidget/constant.js.map +1 -1
  59. package/dist/module/LiveRatesTableWidget/render.js +6 -6
  60. package/dist/module/LiveRatesTableWidget/render.js.map +1 -1
  61. package/dist/module/LiveRatesTableWidget/types.js +1 -1
  62. package/dist/module/LiveRatesTableWidget/types.js.map +1 -1
  63. package/dist/module/LiveRatesTableWidget/utils.js +3 -3
  64. package/dist/module/LiveRatesTableWidget/utils.js.map +1 -1
  65. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  66. package/dist/module/gql/types/gql.js +2 -2
  67. package/dist/module/gql/types/gql.js.map +1 -1
  68. package/dist/module/gql/types/graphql.js +142 -142
  69. package/dist/module/gql/types/graphql.js.map +1 -1
  70. package/dist/module/gql/types/index.js +2 -2
  71. package/dist/module/gql/types/index.js.map +1 -1
  72. package/dist/module/index.js +1 -1
  73. package/dist/module/index.js.map +1 -1
  74. package/dist/module/translations/index.js +1 -1
  75. package/dist/module/translations/index.js.map +1 -1
  76. package/dist/module/translations/translations.js.map +1 -1
  77. package/dist/types/LiveRatesTableWidget/LiveRatesTableWidget.d.ts +1 -1
  78. package/dist/types/LiveRatesTableWidget/Main.d.ts +1 -1
  79. package/dist/types/LiveRatesTableWidget/components/CardWithData/CardWithData.d.ts +1 -1
  80. package/dist/types/LiveRatesTableWidget/components/Cards/Cards.d.ts +1 -1
  81. package/dist/types/LiveRatesTableWidget/components/Cards/types.d.ts +2 -2
  82. package/dist/types/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.d.ts +1 -1
  83. package/dist/types/LiveRatesTableWidget/components/LineChartWithData/types.d.ts +3 -3
  84. package/dist/types/LiveRatesTableWidget/components/RowWithData/RowWithData.d.ts +1 -1
  85. package/dist/types/LiveRatesTableWidget/components/index.d.ts +2 -2
  86. package/dist/types/LiveRatesTableWidget/config.d.ts +1 -1
  87. package/dist/types/LiveRatesTableWidget/constant.d.ts +1 -1
  88. package/dist/types/LiveRatesTableWidget/types.d.ts +4 -4
  89. package/dist/types/LiveRatesTableWidget/utils.d.ts +5 -4
  90. package/dist/types/gql/types/gql.d.ts +4 -4
  91. package/dist/types/gql/types/index.d.ts +2 -2
  92. package/dist/types/index.d.ts +1 -1
  93. package/dist/types/translations/index.d.ts +2 -2
  94. package/package.json +3 -3
  95. package/src/LiveRatesTableWidget/LiveRatesTableWidget.tsx +14 -17
  96. package/src/LiveRatesTableWidget/Main.tsx +49 -43
  97. package/src/LiveRatesTableWidget/components/CardWithData/CardWithData.tsx +43 -28
  98. package/src/LiveRatesTableWidget/components/Cards/Cards.tsx +15 -8
  99. package/src/LiveRatesTableWidget/components/Cards/types.tsx +2 -2
  100. package/src/LiveRatesTableWidget/components/LineChartWithData/LineChartWithData.tsx +12 -10
  101. package/src/LiveRatesTableWidget/components/LineChartWithData/types.tsx +4 -3
  102. package/src/LiveRatesTableWidget/components/LineChartWithData/utils.ts +1 -1
  103. package/src/LiveRatesTableWidget/components/RowWithData/RowWithData.tsx +63 -30
  104. package/src/LiveRatesTableWidget/components/index.ts +2 -2
  105. package/src/LiveRatesTableWidget/config.ts +2 -4
  106. package/src/LiveRatesTableWidget/constant.ts +4 -1
  107. package/src/LiveRatesTableWidget/render.tsx +52 -34
  108. package/src/LiveRatesTableWidget/types.tsx +5 -4
  109. package/src/LiveRatesTableWidget/utils.ts +20 -17
  110. package/src/gql/types/fragment-masking.ts +41 -21
  111. package/src/gql/types/gql.ts +12 -5
  112. package/src/gql/types/graphql.ts +214 -49
  113. package/src/gql/types/index.ts +2 -2
  114. package/src/index.ts +1 -1
  115. package/src/translations/index.ts +4 -4
  116. package/src/translations/translations.ts +2 -1
  117. package/test/CardWithData.test.tsx +8 -7
  118. package/test/Cards.test.tsx +32 -29
  119. package/test/LineChartWithData.test.tsx +77 -32
  120. package/test/Main.test.tsx +10 -9
  121. package/test/RowWithData.test.tsx +9 -8
  122. package/test/mocks.ts +1 -3
@@ -1,18 +1,21 @@
1
- import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
1
+ import {
2
+ ResultOf,
3
+ DocumentTypeDecoration,
4
+ TypedDocumentNode,
5
+ } from '@graphql-typed-document-node/core';
2
6
  import { FragmentDefinitionNode } from 'graphql';
3
7
  import { Incremental } from './graphql';
4
8
 
5
-
6
- export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
7
- infer TType,
8
- any
9
- >
10
- ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
11
- ? TKey extends string
12
- ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
9
+ export type FragmentType<
10
+ TDocumentType extends DocumentTypeDecoration<any, any>,
11
+ > =
12
+ TDocumentType extends DocumentTypeDecoration<infer TType, any>
13
+ ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
14
+ ? TKey extends string
15
+ ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
16
+ : never
13
17
  : never
14
- : never
15
- : never;
18
+ : never;
16
19
 
17
20
  // return non-nullable if `fragmentType` is non-nullable
18
21
  export function useFragment<TType>(
@@ -22,7 +25,10 @@ export function useFragment<TType>(
22
25
  // return nullable if `fragmentType` is nullable
23
26
  export function useFragment<TType>(
24
27
  _documentNode: DocumentTypeDecoration<TType, any>,
25
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
28
+ fragmentType:
29
+ | FragmentType<DocumentTypeDecoration<TType, any>>
30
+ | null
31
+ | undefined
26
32
  ): TType | null | undefined;
27
33
  // return array of non-nullable if `fragmentType` is array of non-nullable
28
34
  export function useFragment<TType>(
@@ -32,35 +38,49 @@ export function useFragment<TType>(
32
38
  // return array of nullable if `fragmentType` is array of nullable
33
39
  export function useFragment<TType>(
34
40
  _documentNode: DocumentTypeDecoration<TType, any>,
35
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
41
+ fragmentType:
42
+ | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
43
+ | null
44
+ | undefined
36
45
  ): ReadonlyArray<TType> | null | undefined;
37
46
  export function useFragment<TType>(
38
47
  _documentNode: DocumentTypeDecoration<TType, any>,
39
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
48
+ fragmentType:
49
+ | FragmentType<DocumentTypeDecoration<TType, any>>
50
+ | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
51
+ | null
52
+ | undefined
40
53
  ): TType | ReadonlyArray<TType> | null | undefined {
41
54
  return fragmentType as any;
42
55
  }
43
56
 
44
-
45
57
  export function makeFragmentData<
46
58
  F extends DocumentTypeDecoration<any, any>,
47
- FT extends ResultOf<F>
59
+ FT extends ResultOf<F>,
48
60
  >(data: FT, _fragment: F): FragmentType<F> {
49
61
  return data as FragmentType<F>;
50
62
  }
51
63
  export function isFragmentReady<TQuery, TFrag>(
52
64
  queryNode: DocumentTypeDecoration<TQuery, any>,
53
65
  fragmentNode: TypedDocumentNode<TFrag>,
54
- data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
66
+ data:
67
+ | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>
68
+ | null
69
+ | undefined
55
70
  ): data is FragmentType<typeof fragmentNode> {
56
- const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57
- ?.deferredFields;
71
+ const deferredFields = (
72
+ queryNode as {
73
+ __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };
74
+ }
75
+ ).__meta__?.deferredFields;
58
76
 
59
77
  if (!deferredFields) return true;
60
78
 
61
- const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
79
+ const fragDef = fragmentNode.definitions[0] as
80
+ | FragmentDefinitionNode
81
+ | undefined;
62
82
  const fragName = fragDef?.name?.value;
63
83
 
64
84
  const fields = (fragName && deferredFields[fragName]) || [];
65
- return fields.length > 0 && fields.every(field => data && field in data);
85
+ return fields.length > 0 && fields.every((field) => data && field in data);
66
86
  }
@@ -13,8 +13,10 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
13
13
  * Therefore it is highly recommended to use the babel or swc plugin for production.
14
14
  */
15
15
  const documents = {
16
- "\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n": types.GetInstrumentsChartDocument,
17
- "\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n": types.ValidateInstrumentsDocument,
16
+ '\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n':
17
+ types.GetInstrumentsChartDocument,
18
+ '\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n':
19
+ types.ValidateInstrumentsDocument,
18
20
  };
19
21
 
20
22
  /**
@@ -34,14 +36,19 @@ export function graphql(source: string): unknown;
34
36
  /**
35
37
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
36
38
  */
37
- export function graphql(source: "\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n"): (typeof documents)["\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n"];
39
+ export function graphql(
40
+ source: '\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n'
41
+ ): (typeof documents)['\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n'];
38
42
  /**
39
43
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
40
44
  */
41
- export function graphql(source: "\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n"): (typeof documents)["\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n"];
45
+ export function graphql(
46
+ source: '\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n'
47
+ ): (typeof documents)['\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n'];
42
48
 
43
49
  export function graphql(source: string) {
44
50
  return (documents as any)[source] ?? {};
45
51
  }
46
52
 
47
- export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;
53
+ export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
54
+ TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
@@ -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();