@oanda/labs-currency-cross-table 1.0.6 → 1.0.7

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 (85) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/codegen.ts +15 -0
  3. package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +12 -4
  4. package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
  5. package/dist/main/CurrencyCrossTableWidget/Main.js +11 -9
  6. package/dist/main/CurrencyCrossTableWidget/Main.js.map +1 -1
  7. package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js +2 -1
  8. package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
  9. package/dist/main/CurrencyCrossTableWidget/components/CellValidationWrapper.js +51 -0
  10. package/dist/main/CurrencyCrossTableWidget/components/CellValidationWrapper.js.map +1 -0
  11. package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js +19 -11
  12. package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
  13. package/dist/main/CurrencyCrossTableWidget/components/types.js.map +1 -1
  14. package/dist/main/CurrencyCrossTableWidget/render.js +7 -2
  15. package/dist/main/CurrencyCrossTableWidget/render.js.map +1 -1
  16. package/dist/main/CurrencyCrossTableWidget/types.js +0 -13
  17. package/dist/main/CurrencyCrossTableWidget/types.js.map +1 -1
  18. package/dist/main/CurrencyCrossTableWidget/utils.js +13 -30
  19. package/dist/main/CurrencyCrossTableWidget/utils.js.map +1 -1
  20. package/dist/main/gql/types/fragment-masking.js +23 -0
  21. package/dist/main/gql/types/fragment-masking.js.map +1 -0
  22. package/dist/main/gql/types/gql.js +16 -0
  23. package/dist/main/gql/types/gql.js.map +1 -0
  24. package/dist/main/gql/types/graphql.js +223 -0
  25. package/dist/main/gql/types/graphql.js.map +1 -0
  26. package/dist/main/gql/types/index.js +28 -0
  27. package/dist/main/gql/types/index.js.map +1 -0
  28. package/dist/main/gql/validateInstruments.js +16 -0
  29. package/dist/main/gql/validateInstruments.js.map +1 -0
  30. package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +10 -2
  31. package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
  32. package/dist/module/CurrencyCrossTableWidget/Main.js +13 -11
  33. package/dist/module/CurrencyCrossTableWidget/Main.js.map +1 -1
  34. package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js +2 -1
  35. package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
  36. package/dist/module/CurrencyCrossTableWidget/components/CellValidationWrapper.js +44 -0
  37. package/dist/module/CurrencyCrossTableWidget/components/CellValidationWrapper.js.map +1 -0
  38. package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js +20 -12
  39. package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
  40. package/dist/module/CurrencyCrossTableWidget/components/types.js.map +1 -1
  41. package/dist/module/CurrencyCrossTableWidget/render.js +6 -1
  42. package/dist/module/CurrencyCrossTableWidget/render.js.map +1 -1
  43. package/dist/module/CurrencyCrossTableWidget/types.js +0 -12
  44. package/dist/module/CurrencyCrossTableWidget/types.js.map +1 -1
  45. package/dist/module/CurrencyCrossTableWidget/utils.js +10 -29
  46. package/dist/module/CurrencyCrossTableWidget/utils.js.map +1 -1
  47. package/dist/module/gql/types/fragment-masking.js +15 -0
  48. package/dist/module/gql/types/fragment-masking.js.map +1 -0
  49. package/dist/module/gql/types/gql.js +8 -0
  50. package/dist/module/gql/types/gql.js.map +1 -0
  51. package/dist/module/gql/types/graphql.js +217 -0
  52. package/dist/module/gql/types/graphql.js.map +1 -0
  53. package/dist/module/gql/types/index.js +3 -0
  54. package/dist/module/gql/types/index.js.map +1 -0
  55. package/dist/module/gql/validateInstruments.js +10 -0
  56. package/dist/module/gql/validateInstruments.js.map +1 -0
  57. package/dist/types/CurrencyCrossTableWidget/CurrencyCrossTableWidget.d.ts +1 -1
  58. package/dist/types/CurrencyCrossTableWidget/Main.d.ts +1 -1
  59. package/dist/types/CurrencyCrossTableWidget/components/CellValidationWrapper.d.ts +4 -0
  60. package/dist/types/CurrencyCrossTableWidget/components/CellWithData.d.ts +1 -1
  61. package/dist/types/CurrencyCrossTableWidget/components/types.d.ts +15 -1
  62. package/dist/types/CurrencyCrossTableWidget/types.d.ts +3 -11
  63. package/dist/types/CurrencyCrossTableWidget/utils.d.ts +5 -6
  64. package/dist/types/gql/types/fragment-masking.d.ts +15 -0
  65. package/dist/types/gql/types/gql.d.ts +37 -0
  66. package/dist/types/gql/types/graphql.d.ts +384 -0
  67. package/dist/types/gql/types/index.d.ts +2 -0
  68. package/dist/types/gql/validateInstruments.d.ts +1 -0
  69. package/package.json +12 -4
  70. package/src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx +16 -6
  71. package/src/CurrencyCrossTableWidget/Main.tsx +19 -13
  72. package/src/CurrencyCrossTableWidget/ValidationWrapper.tsx +1 -0
  73. package/src/CurrencyCrossTableWidget/components/CellValidationWrapper.tsx +51 -0
  74. package/src/CurrencyCrossTableWidget/components/CellWithData.tsx +30 -14
  75. package/src/CurrencyCrossTableWidget/components/types.ts +15 -1
  76. package/src/CurrencyCrossTableWidget/render.tsx +6 -2
  77. package/src/CurrencyCrossTableWidget/types.tsx +3 -12
  78. package/src/CurrencyCrossTableWidget/utils.ts +17 -37
  79. package/src/gql/types/fragment-masking.ts +66 -0
  80. package/src/gql/types/gql.ts +42 -0
  81. package/src/gql/types/graphql.ts +423 -0
  82. package/src/gql/types/index.ts +2 -0
  83. package/src/gql/validateInstruments.ts +10 -0
  84. package/test/Main.test.tsx +12 -6
  85. package/test/mocks.ts +225 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\n\nexport type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<\n infer TType,\n any\n>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__\n ?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every(field => data && field in data);\n}\n"],"mappings":";;;;;;;;AAoCO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAAmJ,EAClG;EACjD,OAAOA,YAAY;AACrB;AAGO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAAiF,EACtC;EAC3C,MAAMK,cAAc,GAAIF,SAAS,CAAwEG,QAAQ,EAC7GD,cAAc;EAElB,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAAuC;EACjF,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAACC,KAAK,IAAIf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC1E","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.graphql = graphql;
7
+ var types = _interopRequireWildcard(require("./graphql"));
8
+ 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); }
9
+ 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; }
10
+ const documents = {
11
+ "\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n": types.ValidateInstrumentsDocument
12
+ };
13
+ function graphql(source) {
14
+ return documents[source] ?? {};
15
+ }
16
+ //# sourceMappingURL=gql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","documents","ValidateInstrumentsDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n \"\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\": types.ValidateInstrumentsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport 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\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAanC,MAAMW,SAAS,GAAG;EACd,sMAAsM,EAAEvB,KAAK,CAACwB;AAClN,CAAC;AAqBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VolatilityChartTimeUnit = exports.VolatilityChartTimeSpan = exports.ValueAtRiskDuration = exports.ValueAtRiskBars = exports.ValidateInstrumentsDocument = exports.TopicalSort = exports.Sort = exports.Region = exports.Division = exports.DataSource = exports.CurrencyPowerBalanceTimeUnit = exports.CurrencyName = exports.CorrelationTimeUnit = exports.BookType = exports.AssetClassName = void 0;
7
+ let AssetClassName = exports.AssetClassName = function (AssetClassName) {
8
+ AssetClassName["Commodities"] = "COMMODITIES";
9
+ AssetClassName["Cryptocurrency"] = "CRYPTOCURRENCY";
10
+ AssetClassName["Currency"] = "CURRENCY";
11
+ AssetClassName["EquityShares"] = "EQUITY_SHARES";
12
+ AssetClassName["Indices"] = "INDICES";
13
+ AssetClassName["Rates"] = "RATES";
14
+ return AssetClassName;
15
+ }({});
16
+ let BookType = exports.BookType = function (BookType) {
17
+ BookType["Order"] = "ORDER";
18
+ BookType["Position"] = "POSITION";
19
+ return BookType;
20
+ }({});
21
+ let CorrelationTimeUnit = exports.CorrelationTimeUnit = function (CorrelationTimeUnit) {
22
+ CorrelationTimeUnit["H1"] = "H1";
23
+ CorrelationTimeUnit["H4"] = "H4";
24
+ CorrelationTimeUnit["H24"] = "H24";
25
+ CorrelationTimeUnit["M1"] = "M1";
26
+ CorrelationTimeUnit["M3"] = "M3";
27
+ CorrelationTimeUnit["M6"] = "M6";
28
+ CorrelationTimeUnit["W1"] = "W1";
29
+ CorrelationTimeUnit["Y1"] = "Y1";
30
+ return CorrelationTimeUnit;
31
+ }({});
32
+ let CurrencyName = exports.CurrencyName = function (CurrencyName) {
33
+ CurrencyName["Aud"] = "AUD";
34
+ CurrencyName["Cad"] = "CAD";
35
+ CurrencyName["Chf"] = "CHF";
36
+ CurrencyName["Eur"] = "EUR";
37
+ CurrencyName["Gbp"] = "GBP";
38
+ CurrencyName["Jpy"] = "JPY";
39
+ CurrencyName["Nzd"] = "NZD";
40
+ CurrencyName["Usd"] = "USD";
41
+ return CurrencyName;
42
+ }({});
43
+ let CurrencyPowerBalanceTimeUnit = exports.CurrencyPowerBalanceTimeUnit = function (CurrencyPowerBalanceTimeUnit) {
44
+ CurrencyPowerBalanceTimeUnit["CurrentDay"] = "CURRENT_DAY";
45
+ CurrencyPowerBalanceTimeUnit["H4"] = "H4";
46
+ CurrencyPowerBalanceTimeUnit["H8"] = "H8";
47
+ CurrencyPowerBalanceTimeUnit["H24"] = "H24";
48
+ CurrencyPowerBalanceTimeUnit["M1"] = "M1";
49
+ CurrencyPowerBalanceTimeUnit["M3"] = "M3";
50
+ CurrencyPowerBalanceTimeUnit["PreviousDay"] = "PREVIOUS_DAY";
51
+ CurrencyPowerBalanceTimeUnit["W1"] = "W1";
52
+ return CurrencyPowerBalanceTimeUnit;
53
+ }({});
54
+ let DataSource = exports.DataSource = function (DataSource) {
55
+ DataSource["Ny4"] = "NY4";
56
+ DataSource["Ty3"] = "TY3";
57
+ return DataSource;
58
+ }({});
59
+ let Division = exports.Division = function (Division) {
60
+ Division["Oap"] = "OAP";
61
+ Division["Oau"] = "OAU";
62
+ Division["Oc"] = "OC";
63
+ Division["Ocan"] = "OCAN";
64
+ Division["Oel"] = "OEL";
65
+ Division["Ogm"] = "OGM";
66
+ Division["Oj"] = "OJ";
67
+ Division["Opt"] = "OPT";
68
+ Division["Otms"] = "OTMS";
69
+ return Division;
70
+ }({});
71
+ let Region = exports.Region = function (Region) {
72
+ Region["Amer"] = "AMER";
73
+ Region["Apac"] = "APAC";
74
+ Region["Emea"] = "EMEA";
75
+ return Region;
76
+ }({});
77
+ let Sort = exports.Sort = function (Sort) {
78
+ Sort["Bearish"] = "BEARISH";
79
+ Sort["Bullish"] = "BULLISH";
80
+ return Sort;
81
+ }({});
82
+ let TopicalSort = exports.TopicalSort = function (TopicalSort) {
83
+ TopicalSort["Bearish"] = "BEARISH";
84
+ TopicalSort["Bullish"] = "BULLISH";
85
+ TopicalSort["Hot"] = "HOT";
86
+ TopicalSort["Popular"] = "POPULAR";
87
+ TopicalSort["Volatile"] = "VOLATILE";
88
+ return TopicalSort;
89
+ }({});
90
+ let ValueAtRiskBars = exports.ValueAtRiskBars = function (ValueAtRiskBars) {
91
+ ValueAtRiskBars["C100"] = "C100";
92
+ ValueAtRiskBars["C200"] = "C200";
93
+ ValueAtRiskBars["C300"] = "C300";
94
+ return ValueAtRiskBars;
95
+ }({});
96
+ let ValueAtRiskDuration = exports.ValueAtRiskDuration = function (ValueAtRiskDuration) {
97
+ ValueAtRiskDuration["C1"] = "C1";
98
+ ValueAtRiskDuration["C2"] = "C2";
99
+ ValueAtRiskDuration["C3"] = "C3";
100
+ ValueAtRiskDuration["C4"] = "C4";
101
+ ValueAtRiskDuration["C5"] = "C5";
102
+ ValueAtRiskDuration["C10"] = "C10";
103
+ return ValueAtRiskDuration;
104
+ }({});
105
+ let VolatilityChartTimeSpan = exports.VolatilityChartTimeSpan = function (VolatilityChartTimeSpan) {
106
+ VolatilityChartTimeSpan["D5"] = "D5";
107
+ VolatilityChartTimeSpan["D10"] = "D10";
108
+ VolatilityChartTimeSpan["M1"] = "M1";
109
+ VolatilityChartTimeSpan["M3"] = "M3";
110
+ VolatilityChartTimeSpan["W5"] = "W5";
111
+ VolatilityChartTimeSpan["W10"] = "W10";
112
+ return VolatilityChartTimeSpan;
113
+ }({});
114
+ let VolatilityChartTimeUnit = exports.VolatilityChartTimeUnit = function (VolatilityChartTimeUnit) {
115
+ VolatilityChartTimeUnit["D"] = "D";
116
+ VolatilityChartTimeUnit["H"] = "H";
117
+ VolatilityChartTimeUnit["W"] = "W";
118
+ return VolatilityChartTimeUnit;
119
+ }({});
120
+ const ValidateInstrumentsDocument = exports.ValidateInstrumentsDocument = {
121
+ "kind": "Document",
122
+ "definitions": [{
123
+ "kind": "OperationDefinition",
124
+ "operation": "query",
125
+ "name": {
126
+ "kind": "Name",
127
+ "value": "validateInstruments"
128
+ },
129
+ "variableDefinitions": [{
130
+ "kind": "VariableDefinition",
131
+ "variable": {
132
+ "kind": "Variable",
133
+ "name": {
134
+ "kind": "Name",
135
+ "value": "instruments"
136
+ }
137
+ },
138
+ "type": {
139
+ "kind": "NonNullType",
140
+ "type": {
141
+ "kind": "ListType",
142
+ "type": {
143
+ "kind": "NamedType",
144
+ "name": {
145
+ "kind": "Name",
146
+ "value": "String"
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }, {
152
+ "kind": "VariableDefinition",
153
+ "variable": {
154
+ "kind": "Variable",
155
+ "name": {
156
+ "kind": "Name",
157
+ "value": "division"
158
+ }
159
+ },
160
+ "type": {
161
+ "kind": "NamedType",
162
+ "name": {
163
+ "kind": "Name",
164
+ "value": "Division"
165
+ }
166
+ }
167
+ }],
168
+ "selectionSet": {
169
+ "kind": "SelectionSet",
170
+ "selections": [{
171
+ "kind": "Field",
172
+ "name": {
173
+ "kind": "Name",
174
+ "value": "mapInstrumentNames"
175
+ },
176
+ "arguments": [{
177
+ "kind": "Argument",
178
+ "name": {
179
+ "kind": "Name",
180
+ "value": "instruments"
181
+ },
182
+ "value": {
183
+ "kind": "Variable",
184
+ "name": {
185
+ "kind": "Name",
186
+ "value": "instruments"
187
+ }
188
+ }
189
+ }, {
190
+ "kind": "Argument",
191
+ "name": {
192
+ "kind": "Name",
193
+ "value": "division"
194
+ },
195
+ "value": {
196
+ "kind": "Variable",
197
+ "name": {
198
+ "kind": "Name",
199
+ "value": "division"
200
+ }
201
+ }
202
+ }],
203
+ "selectionSet": {
204
+ "kind": "SelectionSet",
205
+ "selections": [{
206
+ "kind": "Field",
207
+ "name": {
208
+ "kind": "Name",
209
+ "value": "name"
210
+ }
211
+ }, {
212
+ "kind": "Field",
213
+ "name": {
214
+ "kind": "Name",
215
+ "value": "displayName"
216
+ }
217
+ }]
218
+ }
219
+ }]
220
+ }
221
+ }]
222
+ };
223
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.js","names":["AssetClassName","exports","BookType","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Region","Sort","TopicalSort","ValueAtRiskBars","ValueAtRiskDuration","VolatilityChartTimeSpan","VolatilityChartTimeUnit","ValidateInstrumentsDocument"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments: Array<Instrument>;\n name: Scalars['String']['output'];\n};\n\nexport enum AssetClassName {\n Commodities = 'COMMODITIES',\n Cryptocurrency = 'CRYPTOCURRENCY',\n Currency = 'CURRENCY',\n EquityShares = 'EQUITY_SHARES',\n Indices = 'INDICES',\n Rates = 'RATES'\n}\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION'\n}\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Instrument;\n heatmap: Array<Heatmap>;\n};\n\nexport type CorrelationMatrix = {\n __typename?: 'CorrelationMatrix';\n baseTimeUnit: CorrelationTimeUnit;\n matrix: Array<Matrix>;\n};\n\nexport enum CorrelationTimeUnit {\n H1 = 'H1',\n H4 = 'H4',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n M6 = 'M6',\n W1 = 'W1',\n Y1 = 'Y1'\n}\n\nexport enum CurrencyName {\n Aud = 'AUD',\n Cad = 'CAD',\n Chf = 'CHF',\n Eur = 'EUR',\n Gbp = 'GBP',\n Jpy = 'JPY',\n Nzd = 'NZD',\n Usd = 'USD'\n}\n\nexport type CurrencyPower = {\n __typename?: 'CurrencyPower';\n /** UTC Timestamp */\n point: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n};\n\nexport type CurrencyPowerBalance = {\n __typename?: 'CurrencyPowerBalance';\n currency: CurrencyName;\n power: Array<CurrencyPower>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum CurrencyPowerBalanceTimeUnit {\n CurrentDay = 'CURRENT_DAY',\n H4 = 'H4',\n H8 = 'H8',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n PreviousDay = 'PREVIOUS_DAY',\n W1 = 'W1'\n}\n\nexport type CurrencyStrength = {\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n strengthRelation?: Maybe<Array<StrengthRelation>>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3'\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Opt = 'OPT',\n Otms = 'OTMS'\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n instrument: Instrument;\n timeCorrelation: Array<TimeCorrelation>;\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport type InstrumentCorrelation = {\n __typename?: 'InstrumentCorrelation';\n instrument: Instrument;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type Matrix = {\n __typename?: 'Matrix';\n instrument: Instrument;\n instrumentCorrelation: Array<InstrumentCorrelation>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price?: Maybe<Scalars['Float']['output']>;\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n correlationHeatmap: CorrelationHeatmap;\n correlationMatrix: CorrelationMatrix;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;\n mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n valueAtRiskAssetClasses?: Maybe<Array<AssetClass>>;\n valueAtRiskChart?: Maybe<ValueAtRiskChart>;\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;\n};\n\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;\n};\n\n\nexport type QueryCorrelationMatrixArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n};\n\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\n\nexport type QueryIsAllowedPartnerArgs = {\n url: Scalars['String']['input'];\n};\n\n\nexport type QueryMapInstrumentNamesArgs = {\n division?: InputMaybe<Division>;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\n\nexport type QueryTopicalInstrumentsArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\n\nexport type QueryValueAtRiskAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\n\nexport type QueryValueAtRiskChartArgs = {\n bars: ValueAtRiskBars;\n division?: InputMaybe<Division>;\n duration: ValueAtRiskDuration;\n instrument: Scalars['String']['input'];\n};\n\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA'\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH'\n}\n\nexport type StrengthRelation = {\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: Scalars['Float']['output'];\n};\n\nexport type TimeCorrelation = {\n __typename?: 'TimeCorrelation';\n timeUnit: CorrelationTimeUnit;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n assetClass?: Maybe<AssetClassName>;\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE'\n}\n\nexport enum ValueAtRiskBars {\n C100 = 'C100',\n C200 = 'C200',\n C300 = 'C300'\n}\n\nexport type ValueAtRiskChart = {\n __typename?: 'ValueAtRiskChart';\n down: ValueAtRiskChartData;\n up: ValueAtRiskChartData;\n};\n\nexport type ValueAtRiskChartData = {\n __typename?: 'ValueAtRiskChartData';\n average: Scalars['Float']['output'];\n max: Scalars['Float']['output'];\n median: Scalars['Float']['output'];\n points?: Maybe<Array<ValueAtRiskChartPoint>>;\n threshold: Scalars['Float']['output'];\n};\n\nexport type ValueAtRiskChartPoint = {\n __typename?: 'ValueAtRiskChartPoint';\n percent: Scalars['Float']['output'];\n pips: Scalars['Float']['output'];\n};\n\nexport enum ValueAtRiskDuration {\n C1 = 'C1',\n C2 = 'C2',\n C3 = 'C3',\n C4 = 'C4',\n C5 = 'C5',\n C10 = 'C10'\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n /** Valid for: H */\n D5 = 'D5',\n /** Valid for: H */\n D10 = 'D10',\n /** Valid for: D */\n M1 = 'M1',\n /** Valid for: D */\n M3 = 'M3',\n /** Valid for: W */\n W5 = 'W5',\n /** Valid for: W */\n W10 = 'W10'\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W'\n}\n\nexport type ValidateInstrumentsQueryVariables = Exact<{\n instruments: Array<InputMaybe<Scalars['String']['input']>> | InputMaybe<Scalars['String']['input']>;\n division?: InputMaybe<Division>;\n}>;\n\n\nexport type ValidateInstrumentsQuery = { __typename?: 'Query', mapInstrumentNames?: Array<{ __typename?: 'Instrument', name: string, displayName: string } | null> | null };\n\n\nexport 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\",\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AAC,CAAC,EAAC;UAAC,MAAM,EAAC,UAAU;UAAC,MAAM,EAAC;YAAC,MAAM,EAAC,MAAM;YAAC,OAAO,EAAC;UAAU,CAAC;UAAC,OAAO,EAAC;YAAC,MAAM,EAAC,UAAU;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAU;UAAC;QAAC,CAAC,CAAC;QAAC,cAAc,EAAC;UAAC,MAAM,EAAC,cAAc;UAAC,YAAY,EAAC,CAAC;YAAC,MAAM,EAAC,OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAM;UAAC,CAAC,EAAC;YAAC,MAAM,EAAC,OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAa;UAAC,CAAC;QAAC;MAAC,CAAC;IAAC;EAAC,CAAC;AAAC,CAAyF","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _fragmentMasking = require("./fragment-masking");
7
+ Object.keys(_fragmentMasking).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _fragmentMasking[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _fragmentMasking[key];
14
+ }
15
+ });
16
+ });
17
+ var _gql = require("./gql");
18
+ Object.keys(_gql).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _gql[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _gql[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_fragmentMasking","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_gql"],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from \"./fragment-masking\";\nexport * from \"./gql\";"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateInstruments = void 0;
7
+ var _client = require("@apollo/client");
8
+ const validateInstruments = exports.validateInstruments = (0, _client.gql)`
9
+ query validateInstruments($instruments: [String]!, $division: Division) {
10
+ mapInstrumentNames(instruments: $instruments, division: $division) {
11
+ name
12
+ displayName
13
+ }
14
+ }
15
+ `;
16
+ //# sourceMappingURL=validateInstruments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateInstruments.js","names":["_client","require","validateInstruments","exports","gql"],"sources":["../../../src/gql/validateInstruments.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const validateInstruments = gql`\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,WAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
+ import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
2
3
  import { LocaleProvider } from '@oanda/mono-i18n';
3
4
  import { LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';
4
5
  import { translations } from '../translations';
5
- import { Division } from './types';
6
6
  import { ValidationWrapper } from './ValidationWrapper';
7
+ import { Division } from '../gql/types/graphql';
7
8
  const CurrencyCrossTableWidget = _ref => {
8
9
  let {
10
+ graphqlUrl,
9
11
  liveRatesUrl,
10
12
  currencies,
11
13
  division,
@@ -14,6 +16,10 @@ const CurrencyCrossTableWidget = _ref => {
14
16
  isParamError,
15
17
  removePadding
16
18
  } = _ref;
19
+ const client = new ApolloClient({
20
+ uri: graphqlUrl,
21
+ cache: new InMemoryCache()
22
+ });
17
23
  const divisionCode = division === Division.Opt ? Division.Ogm : division;
18
24
  const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';
19
25
  return React.createElement(ThemeProvider, {
@@ -28,11 +34,13 @@ const CurrencyCrossTableWidget = _ref => {
28
34
  divisionCode,
29
35
  dataSource
30
36
  }
37
+ }, React.createElement(ApolloProvider, {
38
+ client: client
31
39
  }, React.createElement(ValidationWrapper, {
32
40
  currencies: currencies,
33
41
  division: division,
34
42
  isParamError: isParamError
35
- }))));
43
+ })))));
36
44
  };
37
45
  export { CurrencyCrossTableWidget };
38
46
  //# sourceMappingURL=CurrencyCrossTableWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyCrossTableWidget.js","names":["React","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","translations","Division","ValidationWrapper","CurrencyCrossTableWidget","_ref","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","divisionCode","Opt","Ogm","dataSource","createElement","url","options"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n LiveRatesProvider, ThemeProvider, getLocale,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Division, CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst CurrencyCrossTableWidget = ({\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n}: CurrencyCrossTableConfig) => {\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </LiveRatesProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,QACtC,2BAA2B;AAClC,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,QAAQ,QAAkC,SAAS;AAC5D,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,wBAAwB,GAAGC,IAAA,IAQD;EAAA,IARE;IAChCC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC;EACwB,CAAC,GAAAP,IAAA;EACzB,MAAMQ,YAAY,GAAGL,QAAQ,KAAKN,QAAQ,CAACY,GAAG,GAAGZ,QAAQ,CAACa,GAAG,GAAGP,QAAQ;EACxE,MAAMQ,UAAU,GAAGH,YAAY,KAAKX,QAAQ,CAACa,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACEnB,KAAA,CAAAqB,aAAA,CAAClB,aAAa;IAACa,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA;EAAM,GACxDd,KAAA,CAAAqB,aAAA,CAACpB,cAAc;IAACY,MAAM,EAAET,SAAS,CAACS,MAAM,CAAE;IAACR,YAAY,EAAEA;EAAa,GACpEL,KAAA,CAAAqB,aAAA,CAACnB,iBAAiB;IAChBoB,GAAG,EAAEZ,YAAa;IAClBa,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtCpB,KAAA,CAAAqB,aAAA,CAACd,iBAAiB;IAChBI,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACgB,CACL,CACH,CAAC;AAEpB,CAAC;AAED,SAASP,wBAAwB","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyCrossTableWidget.js","names":["React","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","translations","ValidationWrapper","Division","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n LiveRatesProvider, ThemeProvider, getLocale,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,QACtC,2BAA2B;AAClC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAMC,wBAAwB,GAAGC,IAAA,IASD;EAAA,IATE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC;EACwB,CAAC,GAAAR,IAAA;EACzB,MAAMS,MAAM,GAAG,IAAIpB,YAAY,CAAC;IAC9BqB,GAAG,EAAET,UAAU;IACfU,KAAK,EAAE,IAAIrB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMsB,YAAY,GAAGR,QAAQ,KAAKN,QAAQ,CAACe,GAAG,GAAGf,QAAQ,CAACgB,GAAG,GAAGV,QAAQ;EACxE,MAAMW,UAAU,GAAGH,YAAY,KAAKd,QAAQ,CAACgB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE1B,KAAA,CAAA4B,aAAA,CAACtB,aAAa;IAACc,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA;EAAM,GACxDlB,KAAA,CAAA4B,aAAA,CAACxB,cAAc;IAACa,MAAM,EAAEV,SAAS,CAACU,MAAM,CAAE;IAACT,YAAY,EAAEA;EAAa,GACpER,KAAA,CAAA4B,aAAA,CAACvB,iBAAiB;IAChBwB,GAAG,EAAEf,YAAa;IAClBgB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC3B,KAAA,CAAA4B,aAAA,CAACzB,cAAc;IAACkB,MAAM,EAAEA;EAAO,GAC7BrB,KAAA,CAAA4B,aAAA,CAACnB,iBAAiB;IAChBM,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACa,CACC,CACL,CACH,CAAC;AAEpB,CAAC;AAED,SAASR,wBAAwB","ignoreList":[]}
@@ -1,10 +1,13 @@
1
- import React, { Fragment, useEffect, useState } from 'react';
1
+ import React, { Fragment, Suspense, useEffect, useState } from 'react';
2
2
  import { useLiveRatesQuery } from '@oanda/labs-widget-common';
3
- import { CellWithData, TextCell } from './components';
3
+ import { TextCell } from './components';
4
+ import { CellValidationWrapper } from './components/CellValidationWrapper';
5
+ import { divisionMapper } from './utils';
4
6
  const Main = _ref => {
5
7
  let {
6
8
  instruments,
7
- currencies
9
+ currencies,
10
+ division
8
11
  } = _ref;
9
12
  const [selectedCurrency, setSelectedCurrency] = useState('');
10
13
  const [selectedPair, setSelectedPair] = useState('');
@@ -38,17 +41,16 @@ const Main = _ref => {
38
41
  hovered: currency === selectedCurrency
39
42
  }), arr.map(pair => React.createElement(Fragment, {
40
43
  key: `${currency}_${pair}`
41
- }, currency !== pair ? React.createElement(CellWithData, {
42
- loading: false,
43
- record: {
44
- instrument: `${currency}_${pair}`,
45
- displayName: `${currency}/${pair}`
46
- },
44
+ }, currency !== pair ? React.createElement(Suspense, null, React.createElement(CellValidationWrapper, {
45
+ currency: currency,
46
+ pair: pair,
47
+ instrument: `${currency}${divisionMapper(division)}${pair}`,
47
48
  target: target,
48
49
  additionalBorderBottom: index === arr.length - 1,
49
50
  setSelectedCurrency: setSelectedCurrency,
50
- setSelectedPair: setSelectedPair
51
- }) : React.createElement(TextCell, {
51
+ setSelectedPair: setSelectedPair,
52
+ division: division
53
+ })) : React.createElement(TextCell, {
52
54
  additionalBorderBottom: index === arr.length - 1,
53
55
  emptyIndicator: true
54
56
  }))))));
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["React","Fragment","useEffect","useState","useLiveRatesQuery","CellWithData","TextCell","Main","_ref","instruments","currencies","selectedCurrency","setSelectedCurrency","selectedPair","setSelectedPair","hasInstruments","length","target","setQuery","createElement","className","map","pair","key","label","hovered","currency","index","arr","additionalBorderBottom","loading","record","instrument","displayName","emptyIndicator"],"sources":["../../../src/CurrencyCrossTableWidget/Main.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useState } from 'react';\nimport { useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { MainProps } from './types';\nimport { CellWithData, TextCell } from './components';\n\nconst Main = ({\n instruments,\n currencies,\n}: MainProps) => {\n const [selectedCurrency, setSelectedCurrency] = useState('');\n const [selectedPair, setSelectedPair] = useState('');\n\n const hasInstruments = instruments.length > 0;\n\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n if (hasInstruments) {\n setQuery({ instruments });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, instruments);\n\n return (\n <div data-testid=\"currency-cross-table-wrapper\" className=\"lw-w-full\">\n <div className=\"lw-flex lw-border-l lw-border-t lw-border-solid lw-border-border-primary\">\n <TextCell />\n {currencies.map(((pair) => (\n <TextCell\n key={pair}\n label={pair}\n hovered={pair === selectedPair}\n />\n )))}\n </div>\n {currencies.map(((currency, index, arr) => (\n <div\n key={currency}\n className=\"lw-flex lw-border-l lw-border-t lw-border-solid lw-border-border-primary\"\n >\n <TextCell\n label={currency}\n additionalBorderBottom={index === arr.length - 1}\n hovered={currency === selectedCurrency}\n />\n {arr.map((pair) => (\n <Fragment key={`${currency}_${pair}`}>\n {currency !== pair ? (\n <CellWithData\n loading={false}\n record={{\n instrument: `${currency}_${pair}`,\n displayName: `${currency}/${pair}`,\n }}\n target={target}\n additionalBorderBottom={index === arr.length - 1}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n />\n ) : (\n <TextCell\n additionalBorderBottom={index === arr.length - 1}\n emptyIndicator\n />\n )}\n </Fragment>\n ))}\n </div>\n )))}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,YAAY,EAAEC,QAAQ,QAAQ,cAAc;AAErD,MAAMC,IAAI,GAAGC,IAAA,IAGI;EAAA,IAHH;IACZC,WAAW;IACXC;EACS,CAAC,GAAAF,IAAA;EACV,MAAM,CAACG,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGT,QAAQ,CAAC,EAAE,CAAC;EAC5D,MAAM,CAACU,YAAY,EAAEC,eAAe,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EAEpD,MAAMY,cAAc,GAAGN,WAAW,CAACO,MAAM,GAAG,CAAC;EAE7C,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGd,iBAAiB,CAAC,CAAC;EAEhDF,SAAS,CAAC,MAAM;IACd,IAAIa,cAAc,EAAE;MAClBG,QAAQ,CAAC;QAAET;MAAY,CAAC,CAAC;IAC3B;EAEF,CAAC,EAAEA,WAAW,CAAC;EAEf,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C,GAEFd,KAAA,CAAAmB,aAAA,CAACb,QAAQ;IACPuB,sBAAsB,EAAEF,KAAK,KAAKC,GAAG,CAACZ,MAAM,GAAG,CAAE;IACjDkB,cAAc;EAAA,CACf,CAEK,CACX,CACE,CACL,CACC,CAAC;AAEV,CAAC;AAED,SAAS3B,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["React","Fragment","Suspense","useEffect","useState","useLiveRatesQuery","TextCell","CellValidationWrapper","divisionMapper","Main","_ref","instruments","currencies","division","selectedCurrency","setSelectedCurrency","selectedPair","setSelectedPair","hasInstruments","length","target","setQuery","createElement","className","map","pair","key","label","hovered","currency","index","arr","additionalBorderBottom","instrument","emptyIndicator"],"sources":["../../../src/CurrencyCrossTableWidget/Main.tsx"],"sourcesContent":["import React, {\n Fragment, Suspense, useEffect, useState,\n} from 'react';\nimport { useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { MainProps } from './types';\nimport { TextCell } from './components';\nimport { CellValidationWrapper } from './components/CellValidationWrapper';\nimport { divisionMapper } from './utils';\n\nconst Main = ({\n instruments,\n currencies,\n division,\n}: MainProps) => {\n const [selectedCurrency, setSelectedCurrency] = useState('');\n const [selectedPair, setSelectedPair] = useState('');\n\n const hasInstruments = instruments.length > 0;\n\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n if (hasInstruments) {\n setQuery({ instruments });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, instruments);\n\n return (\n <div data-testid=\"currency-cross-table-wrapper\" className=\"lw-w-full\">\n <div className=\"lw-flex lw-border-l lw-border-t lw-border-solid lw-border-border-primary\">\n <TextCell />\n {currencies.map(((pair) => (\n <TextCell\n key={pair}\n label={pair}\n hovered={pair === selectedPair}\n />\n )))}\n </div>\n {currencies.map(((currency, index, arr) => (\n <div\n key={currency}\n className=\"lw-flex lw-border-l lw-border-t lw-border-solid lw-border-border-primary\"\n >\n <TextCell\n label={currency}\n additionalBorderBottom={index === arr.length - 1}\n hovered={currency === selectedCurrency}\n />\n {arr.map((pair) => (\n <Fragment key={`${currency}_${pair}`}>\n {currency !== pair ? (\n <Suspense>\n <CellValidationWrapper\n currency={currency}\n pair={pair}\n instrument={`${currency}${divisionMapper(division)}${pair}`}\n target={target}\n additionalBorderBottom={index === arr.length - 1}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n division={division}\n />\n </Suspense>\n ) : (\n <TextCell\n additionalBorderBottom={index === arr.length - 1}\n emptyIndicator\n />\n )}\n </Fragment>\n ))}\n </div>\n )))}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAClC,OAAO;AACd,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,cAAc,QAAQ,SAAS;AAExC,MAAMC,IAAI,GAAGC,IAAA,IAII;EAAA,IAJH;IACZC,WAAW;IACXC,UAAU;IACVC;EACS,CAAC,GAAAH,IAAA;EACV,MAAM,CAACI,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EAC5D,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,GAAGb,QAAQ,CAAC,EAAE,CAAC;EAEpD,MAAMc,cAAc,GAAGP,WAAW,CAACQ,MAAM,GAAG,CAAC;EAE7C,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGhB,iBAAiB,CAAC,CAAC;EAEhDF,SAAS,CAAC,MAAM;IACd,IAAIe,cAAc,EAAE;MAClBG,QAAQ,CAAC;QAAEV;MAAY,CAAC,CAAC;IAC3B;EAEF,CAAC,EAAEA,WAAW,CAAC;EAEf,OACEX,KAAA,CAAAsB,aAAA;IAAK,eAAY,8BAA8B;IAACC,SAAS,EAAC;EAAW,GACnEvB,KAAA,CAAAsB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AsB,aAAA,CAAChB,QAAQ;IACP0B,sBAAsB,EAAEF,KAAK,KAAKC,GAAG,CAACZ,MAAM,GAAG,CAAE;IACjDe,cAAc;EAAA,CACf,CAEK,CACX,CACE,CACL,CACC,CAAC;AAEV,CAAC;AAED,SAASzB,IAAI","ignoreList":[]}
@@ -14,7 +14,8 @@ const ValidationWrapper = _ref => {
14
14
  className: "lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary"
15
15
  }, !showError && React.createElement(Main, {
16
16
  instruments: currenciesToInstruments(currencies, division),
17
- currencies: currencies
17
+ currencies: currencies,
18
+ division: division
18
19
  }), showError && React.createElement("div", {
19
20
  className: classnames('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')
20
21
  }, React.createElement(ChartError, null))));
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationWrapper.js","names":["React","classnames","ChartError","currenciesToInstruments","validCurrencies","Main","ValidationWrapper","_ref","currencies","division","isParamError","showError","createElement","Fragment","className","instruments"],"sources":["../../../src/CurrencyCrossTableWidget/ValidationWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { ChartError } from '@oanda/labs-widget-common';\nimport { currenciesToInstruments, validCurrencies } from './utils';\nimport { ValidationWrapperProps } from './types';\nimport { Main } from './Main';\n\nconst ValidationWrapper = ({\n currencies,\n division,\n isParamError,\n}: ValidationWrapperProps) => {\n const showError = !validCurrencies(currencies) || isParamError;\n\n return (\n <>\n <div\n className=\"lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary\"\n >\n {!showError && (\n <Main\n instruments={currenciesToInstruments(currencies, division)}\n currencies={currencies}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')}>\n <ChartError />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,SAAS;AAElE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,MAAMC,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,UAAU;IACVC,QAAQ;IACRC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAMI,SAAS,GAAG,CAACP,eAAe,CAACI,UAAU,CAAC,IAAIE,YAAY;EAE9D,OACEV,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QACEb,KAAA,CAAAY,aAAA;IACEE,SAAS,EAAC;EAAsE,GAE/E,CAACH,SAAS,IACTX,KAAA,CAAAY,aAAA,CAACP,IAAI;IACHU,WAAW,EAAEZ,uBAAuB,CAACK,UAAU,EAAEC,QAAQ,CAAE;IAC3DD,UAAU,EAAEA;EAAW,CACxB,CACF,EACAG,SAAS,IACRX,KAAA,CAAAY,aAAA;IAAKE,SAAS,EAAEb,UAAU,CAAC,mGAAmG;EAAE,GAC9HD,KAAA,CAAAY,aAAA,CAACV,UAAU,MAAE,CACV,CAEJ,CACL,CAAC;AAEP,CAAC;AAED,SAASI,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"ValidationWrapper.js","names":["React","classnames","ChartError","currenciesToInstruments","validCurrencies","Main","ValidationWrapper","_ref","currencies","division","isParamError","showError","createElement","Fragment","className","instruments"],"sources":["../../../src/CurrencyCrossTableWidget/ValidationWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { ChartError } from '@oanda/labs-widget-common';\nimport { currenciesToInstruments, validCurrencies } from './utils';\nimport { ValidationWrapperProps } from './types';\nimport { Main } from './Main';\n\nconst ValidationWrapper = ({\n currencies,\n division,\n isParamError,\n}: ValidationWrapperProps) => {\n const showError = !validCurrencies(currencies) || isParamError;\n\n return (\n <>\n <div\n className=\"lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary\"\n >\n {!showError && (\n <Main\n instruments={currenciesToInstruments(currencies, division)}\n currencies={currencies}\n division={division}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')}>\n <ChartError />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,SAAS;AAElE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,MAAMC,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,UAAU;IACVC,QAAQ;IACRC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAMI,SAAS,GAAG,CAACP,eAAe,CAACI,UAAU,CAAC,IAAIE,YAAY;EAE9D,OACEV,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QACEb,KAAA,CAAAY,aAAA;IACEE,SAAS,EAAC;EAAsE,GAE/E,CAACH,SAAS,IACTX,KAAA,CAAAY,aAAA,CAACP,IAAI;IACHU,WAAW,EAAEZ,uBAAuB,CAACK,UAAU,EAAEC,QAAQ,CAAE;IAC3DD,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA;EAAS,CACpB,CACF,EACAE,SAAS,IACRX,KAAA,CAAAY,aAAA;IAAKE,SAAS,EAAEb,UAAU,CAAC,mGAAmG;EAAE,GAC9HD,KAAA,CAAAY,aAAA,CAACV,UAAU,MAAE,CACV,CAEJ,CACL,CAAC;AAEP,CAAC;AAED,SAASI,iBAAiB","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { useSuspenseQuery } from '@apollo/client';
3
+ import { validateInstruments } from '../../gql/validateInstruments';
4
+ import { CellWithData } from './CellWithData';
5
+ import { divisionMapper } from '../utils';
6
+ const CellValidationWrapper = _ref => {
7
+ let {
8
+ currency,
9
+ pair,
10
+ instrument,
11
+ target,
12
+ additionalBorderBottom,
13
+ setSelectedCurrency,
14
+ setSelectedPair,
15
+ division
16
+ } = _ref;
17
+ const {
18
+ error
19
+ } = useSuspenseQuery(validateInstruments, {
20
+ variables: {
21
+ instruments: [instrument],
22
+ division
23
+ },
24
+ fetchPolicy: 'network-only',
25
+ errorPolicy: 'all'
26
+ });
27
+ const instrumentForCalculations = error ? `${pair}${divisionMapper(division)}${currency}` : '';
28
+ return React.createElement(CellWithData, {
29
+ currency: currency,
30
+ pair: pair,
31
+ record: {
32
+ instrument,
33
+ displayName: `${currency}${divisionMapper(division)}${pair}`
34
+ },
35
+ instrumentForCalculations: instrumentForCalculations,
36
+ target: target,
37
+ additionalBorderBottom: additionalBorderBottom,
38
+ setSelectedCurrency: setSelectedCurrency,
39
+ setSelectedPair: setSelectedPair,
40
+ division: division
41
+ });
42
+ };
43
+ export { CellValidationWrapper };
44
+ //# sourceMappingURL=CellValidationWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CellValidationWrapper.js","names":["React","useSuspenseQuery","validateInstruments","CellWithData","divisionMapper","CellValidationWrapper","_ref","currency","pair","instrument","target","additionalBorderBottom","setSelectedCurrency","setSelectedPair","division","error","variables","instruments","fetchPolicy","errorPolicy","instrumentForCalculations","createElement","record","displayName"],"sources":["../../../../src/CurrencyCrossTableWidget/components/CellValidationWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport { CellValidationWrapperProps } from './types';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../../gql/types/graphql';\nimport { validateInstruments } from '../../gql/validateInstruments';\nimport { CellWithData } from './CellWithData';\nimport { divisionMapper } from '../utils';\n\nconst CellValidationWrapper = ({\n currency,\n pair,\n instrument,\n target,\n additionalBorderBottom,\n setSelectedCurrency,\n setSelectedPair,\n division,\n}: CellValidationWrapperProps) => {\n const { error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments: [instrument],\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const instrumentForCalculations = error ? `${pair}${divisionMapper(division)}${currency}` : '';\n\n return (\n <CellWithData\n currency={currency}\n pair={pair}\n record={{\n instrument,\n displayName: `${currency}${divisionMapper(division)}${pair}`,\n }}\n instrumentForCalculations={instrumentForCalculations}\n target={target}\n additionalBorderBottom={additionalBorderBottom}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n division={division}\n />\n );\n};\n\nexport { CellValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,gBAAgB;AAGjD,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,cAAc,QAAQ,UAAU;AAEzC,MAAMC,qBAAqB,GAAGC,IAAA,IASI;EAAA,IATH;IAC7BC,QAAQ;IACRC,IAAI;IACJC,UAAU;IACVC,MAAM;IACNC,sBAAsB;IACtBC,mBAAmB;IACnBC,eAAe;IACfC;EAC0B,CAAC,GAAAR,IAAA;EAC3B,MAAM;IAAES;EAAM,CAAC,GAAGd,gBAAgB,CAGhCC,mBAAmB,EAAE;IACrBc,SAAS,EAAE;MACTC,WAAW,EAAE,CAACR,UAAU,CAAC;MACzBK;IACF,CAAC;IACDI,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,yBAAyB,GAAGL,KAAK,GAAG,GAAGP,IAAI,GAAGJ,cAAc,CAACU,QAAQ,CAAC,GAAGP,QAAQ,EAAE,GAAG,EAAE;EAE9F,OACEP,KAAA,CAAAqB,aAAA,CAAClB,YAAY;IACXI,QAAQ,EAAEA,QAAS;IACnBC,IAAI,EAAEA,IAAK;IACXc,MAAM,EAAE;MACNb,UAAU;MACVc,WAAW,EAAE,GAAGhB,QAAQ,GAAGH,cAAc,CAACU,QAAQ,CAAC,GAAGN,IAAI;IAC5D,CAAE;IACFY,yBAAyB,EAAEA,yBAA0B;IACrDV,MAAM,EAAEA,MAAO;IACfC,sBAAsB,EAAEA,sBAAuB;IAC/CC,mBAAmB,EAAEA,mBAAoB;IACzCC,eAAe,EAAEA,eAAgB;IACjCC,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CAAC;AAED,SAAST,qBAAqB","ignoreList":[]}