@oanda/labs-spread-cost-calculator-widget 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -0
- package/dist/main/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js +3 -1
- package/dist/main/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js.map +1 -1
- package/dist/main/SpreadCostCalculatorWidget/render.js +3 -1
- package/dist/main/SpreadCostCalculatorWidget/render.js.map +1 -1
- package/dist/module/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js +3 -1
- package/dist/module/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js.map +1 -1
- package/dist/module/SpreadCostCalculatorWidget/render.js +3 -1
- package/dist/module/SpreadCostCalculatorWidget/render.js.map +1 -1
- package/package.json +3 -3
- package/src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx +6 -1
- package/src/SpreadCostCalculatorWidget/render.tsx +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,106 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.12 (2025-01-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.178 (2025-01-12)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.177 (2025-01-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.176 (2025-01-10)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.175 (2025-01-08)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.174 (2024-12-16)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.173 (2024-12-11)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.172 (2024-11-29)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.171 (2024-11-28)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.170 (2024-11-28)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.169 (2024-11-20)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.168 (2024-11-19)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @oanda/labs-spread-cost-calculator-widget
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.11 (2025-01-12)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.177 (2025-01-10)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.176 (2025-01-10)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.175 (2025-01-08)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.174 (2024-12-16)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.173 (2024-12-11)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.172 (2024-11-29)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.171 (2024-11-28)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.170 (2024-11-28)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.169 (2024-11-20)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.168 (2024-11-19)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @oanda/labs-spread-cost-calculator-widget
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
6
106
|
## 1.0.10 (2025-01-10)
|
|
7
107
|
|
|
8
108
|
|
|
@@ -21,7 +21,8 @@ const SpreadCostCalculatorWidget = _ref => {
|
|
|
21
21
|
removePadding,
|
|
22
22
|
division,
|
|
23
23
|
instruments,
|
|
24
|
-
logoLink
|
|
24
|
+
logoLink,
|
|
25
|
+
brandingSpace
|
|
25
26
|
} = _ref;
|
|
26
27
|
const client = new _client.ApolloClient({
|
|
27
28
|
uri: graphqlUrl,
|
|
@@ -46,6 +47,7 @@ const SpreadCostCalculatorWidget = _ref => {
|
|
|
46
47
|
theme: theme,
|
|
47
48
|
translations: _translations.translations
|
|
48
49
|
}, _react.default.createElement(_labsWidgetCommon.WidgetWrapper, {
|
|
50
|
+
brandingSpace: brandingSpace,
|
|
49
51
|
linkArea: "logo",
|
|
50
52
|
logoLink: logoLink
|
|
51
53
|
}, _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpreadCostCalculatorWidget.js","names":["_client","require","_labsLiveRatesTableWidget","_labsWidgetCommon","_react","_interopRequireDefault","_translations","_ValidationWrapper","e","__esModule","default","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","WidgetProvider","withSuspense","liveRates","url","options","styling","translations","WidgetWrapper","linkArea","ValidationWrapper","exports"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport type { FC } from 'react';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport type { SpreadCostCalculatorWidgetConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({\n graphqlUrl,\n liveRatesUrl,\n theme,\n locale,\n isParamError,\n removePadding,\n division,\n instruments,\n logoLink,\n}) => {\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 <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper
|
|
1
|
+
{"version":3,"file":"SpreadCostCalculatorWidget.js","names":["_client","require","_labsLiveRatesTableWidget","_labsWidgetCommon","_react","_interopRequireDefault","_translations","_ValidationWrapper","e","__esModule","default","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","brandingSpace","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","WidgetProvider","withSuspense","liveRates","url","options","styling","translations","WidgetWrapper","linkArea","ValidationWrapper","exports"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport type { FC } from 'react';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport type { SpreadCostCalculatorWidgetConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({\n graphqlUrl,\n liveRatesUrl,\n theme,\n locale,\n isParamError,\n removePadding,\n division,\n instruments,\n logoLink,\n brandingSpace,\n}) => {\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 <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper\n brandingSpace={brandingSpace}\n linkArea=\"logo\"\n logoLink={logoLink}\n >\n <ValidationWrapper\n division={division}\n instruments={instruments}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExD,MAAMG,0BAAgE,GAAGC,IAAA,IAWnE;EAAA,IAXoE;IACxEC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,YAAY;IACZC,aAAa;IACbC,QAAQ;IACRC,WAAW;IACXC,QAAQ;IACRC;EACF,CAAC,GAAAV,IAAA;EACC,MAAMW,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAEZ,UAAU;IACfa,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMC,YAAY,GAAGT,QAAQ,KAAKU,kCAAQ,CAACC,GAAG,GAAGD,kCAAQ,CAACE,GAAG,GAAGZ,QAAQ;EACxE,MAAMa,UAAU,GAAGJ,YAAY,KAAKC,kCAAQ,CAACE,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE3B,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAC9B,iBAAA,CAAA+B,cAAc;IACbC,YAAY;IACZZ,MAAM,EAAEA,MAAO;IACfa,SAAS,EAAE;MACTC,GAAG,EAAEvB,YAAY;MACjBwB,OAAO,EAAE;QAAEV,YAAY;QAAEI;MAAW;IACtC,CAAE;IACFhB,MAAM,EAAEA,MAAO;IACfuB,OAAO,EAAE;MACPrB;IACF,CAAE;IACFH,KAAK,EAAEA,KAAM;IACbyB,YAAY,EAAEA;EAAa,GAE3BpC,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAC9B,iBAAA,CAAAsC,aAAa;IACZnB,aAAa,EAAEA,aAAc;IAC7BoB,QAAQ,EAAC,MAAM;IACfrB,QAAQ,EAAEA;EAAS,GAEnBjB,MAAA,CAAAM,OAAA,CAAAuB,aAAA,CAAC1B,kBAAA,CAAAoC,iBAAiB;IAChBxB,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBH,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAAC2B,OAAA,CAAAjC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -17,7 +17,8 @@ spreadCostCalculatorParamsElements.forEach(element => {
|
|
|
17
17
|
const {
|
|
18
18
|
locale,
|
|
19
19
|
instruments,
|
|
20
|
-
division
|
|
20
|
+
division,
|
|
21
|
+
logoLink
|
|
21
22
|
} = JSON.parse(params);
|
|
22
23
|
const isParamError = (0, _labsWidgetCommon.validateToolParams)({
|
|
23
24
|
locale,
|
|
@@ -45,6 +46,7 @@ spreadCostCalculatorParamsElements.forEach(element => {
|
|
|
45
46
|
isParamError: isParamError,
|
|
46
47
|
liveRatesUrl: liveRatesUrl,
|
|
47
48
|
locale: locale,
|
|
49
|
+
logoLink: logoLink,
|
|
48
50
|
theme: mode
|
|
49
51
|
}));
|
|
50
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["_labsWidgetCommon","require","_react","_interopRequireDefault","_client","_SpreadCostCalculatorWidget","e","__esModule","default","graphqlUrl","liveRatesUrl","window","widgetsConfig","spreadCostCalculatorParamsElements","document","querySelectorAll","forEach","element","root","createRoot","params","getAttribute","mode","locale","instruments","division","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","length","render","createElement","SpreadCostCalculatorWidget","theme"],"sources":["../../../src/SpreadCostCalculatorWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\nconst spreadCostCalculatorParamsElements = document.querySelectorAll(\n 'div[data-spread-cost-calculator-params]'\n);\n\nspreadCostCalculatorParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-spread-cost-calculator-params');\n const mode = element.getAttribute('data-mode');\n const { locale, instruments, division } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n locale,\n graphqlUrl,\n instruments,\n division,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n {\n name: 'division',\n },\n {\n name: 'instruments',\n valueCheck: (value) =>\n (value as string[]).length > 0 && (value as string[]).length <= 10,\n },\n ]\n );\n\n root.render(\n <SpreadCostCalculatorWidget\n division={division}\n graphqlUrl={graphqlUrl}\n instruments={instruments}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":";;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,2BAAA,GAAAJ,OAAA;AAA0E,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1E,MAAM;EAAEG,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAC/D,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAClE,yCACF,CAAC;AAEDF,kCAAkC,CAACG,OAAO,CAAEC,OAAO,IAAK;EACtD,MAAMC,IAAI,GAAG,IAAAC,kBAAU,EAACF,OAAO,CAAC;EAChC,MAAMG,MAAM,GAAGH,OAAO,CAACI,YAAY,CAAC,oCAAoC,CAAC;EACzE,MAAMC,IAAI,GAAGL,OAAO,CAACI,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,MAAM;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,
|
|
1
|
+
{"version":3,"file":"render.js","names":["_labsWidgetCommon","require","_react","_interopRequireDefault","_client","_SpreadCostCalculatorWidget","e","__esModule","default","graphqlUrl","liveRatesUrl","window","widgetsConfig","spreadCostCalculatorParamsElements","document","querySelectorAll","forEach","element","root","createRoot","params","getAttribute","mode","locale","instruments","division","logoLink","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","length","render","createElement","SpreadCostCalculatorWidget","theme"],"sources":["../../../src/SpreadCostCalculatorWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\nconst spreadCostCalculatorParamsElements = document.querySelectorAll(\n 'div[data-spread-cost-calculator-params]'\n);\n\nspreadCostCalculatorParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-spread-cost-calculator-params');\n const mode = element.getAttribute('data-mode');\n const { locale, instruments, division, logoLink } = JSON.parse(\n params as string\n );\n\n const isParamError = validateToolParams(\n {\n locale,\n graphqlUrl,\n instruments,\n division,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n {\n name: 'division',\n },\n {\n name: 'instruments',\n valueCheck: (value) =>\n (value as string[]).length > 0 && (value as string[]).length <= 10,\n },\n ]\n );\n\n root.render(\n <SpreadCostCalculatorWidget\n division={division}\n graphqlUrl={graphqlUrl}\n instruments={instruments}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n logoLink={logoLink}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":";;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,2BAAA,GAAAJ,OAAA;AAA0E,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1E,MAAM;EAAEG,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAC/D,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAClE,yCACF,CAAC;AAEDF,kCAAkC,CAACG,OAAO,CAAEC,OAAO,IAAK;EACtD,MAAMC,IAAI,GAAG,IAAAC,kBAAU,EAACF,OAAO,CAAC;EAChC,MAAMG,MAAM,GAAGH,OAAO,CAACI,YAAY,CAAC,oCAAoC,CAAC;EACzE,MAAMC,IAAI,GAAGL,OAAO,CAACI,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,MAAM;IAAEC,WAAW;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,CAC5DR,MACF,CAAC;EAED,MAAMS,YAAY,GAAG,IAAAC,oCAAkB,EACrC;IACEP,MAAM;IACNd,UAAU;IACVe,WAAW;IACXC,QAAQ;IACRf;EACF,CAAC,EACD,CACE;IACEqB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAyB,IAAK,IAAAC,gCAAc,EAACD,KAAK;EACjE,CAAC,EACD;IACEF,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE,aAAa;IACnBC,UAAU,EAAGC,KAAK,IACfA,KAAK,CAAcE,MAAM,GAAG,CAAC,IAAKF,KAAK,CAAcE,MAAM,IAAI;EACpE,CAAC,CAEL,CAAC;EAEDjB,IAAI,CAACkB,MAAM,CACTlC,MAAA,CAAAM,OAAA,CAAA6B,aAAA,CAAChC,2BAAA,CAAAiC,0BAA0B;IACzBb,QAAQ,EAAEA,QAAS;IACnBhB,UAAU,EAAEA,UAAW;IACvBe,WAAW,EAAEA,WAAY;IACzBK,YAAY,EAAEA,YAAa;IAC3BnB,YAAY,EAAEA,YAAa;IAC3Ba,MAAM,EAAEA,MAAO;IACfG,QAAQ,EAAEA,QAAS;IACnBa,KAAK,EAAEjB;EAAc,CACtB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -14,7 +14,8 @@ const SpreadCostCalculatorWidget = _ref => {
|
|
|
14
14
|
removePadding,
|
|
15
15
|
division,
|
|
16
16
|
instruments,
|
|
17
|
-
logoLink
|
|
17
|
+
logoLink,
|
|
18
|
+
brandingSpace
|
|
18
19
|
} = _ref;
|
|
19
20
|
const client = new ApolloClient({
|
|
20
21
|
uri: graphqlUrl,
|
|
@@ -39,6 +40,7 @@ const SpreadCostCalculatorWidget = _ref => {
|
|
|
39
40
|
theme: theme,
|
|
40
41
|
translations: translations
|
|
41
42
|
}, React.createElement(WidgetWrapper, {
|
|
43
|
+
brandingSpace: brandingSpace,
|
|
42
44
|
linkArea: "logo",
|
|
43
45
|
logoLink: logoLink
|
|
44
46
|
}, React.createElement(ValidationWrapper, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpreadCostCalculatorWidget.js","names":["ApolloClient","InMemoryCache","Division","WidgetProvider","WidgetWrapper","React","translations","ValidationWrapper","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","withSuspense","liveRates","url","options","styling","linkArea"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport type { FC } from 'react';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport type { SpreadCostCalculatorWidgetConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({\n graphqlUrl,\n liveRatesUrl,\n theme,\n locale,\n isParamError,\n removePadding,\n division,\n instruments,\n logoLink,\n}) => {\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 <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper
|
|
1
|
+
{"version":3,"file":"SpreadCostCalculatorWidget.js","names":["ApolloClient","InMemoryCache","Division","WidgetProvider","WidgetWrapper","React","translations","ValidationWrapper","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","brandingSpace","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","withSuspense","liveRates","url","options","styling","linkArea"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport type { FC } from 'react';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport type { SpreadCostCalculatorWidgetConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({\n graphqlUrl,\n liveRatesUrl,\n theme,\n locale,\n isParamError,\n removePadding,\n division,\n instruments,\n logoLink,\n brandingSpace,\n}) => {\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 <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper\n brandingSpace={brandingSpace}\n linkArea=\"logo\"\n logoLink={logoLink}\n >\n <ValidationWrapper\n division={division}\n instruments={instruments}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,QAAQ,QAAQ,qCAAqC;AAC9D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AAEzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,0BAAgE,GAAGC,IAAA,IAWnE;EAAA,IAXoE;IACxEC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,YAAY;IACZC,aAAa;IACbC,QAAQ;IACRC,WAAW;IACXC,QAAQ;IACRC;EACF,CAAC,GAAAV,IAAA;EACC,MAAMW,MAAM,GAAG,IAAIpB,YAAY,CAAC;IAC9BqB,GAAG,EAAEX,UAAU;IACfY,KAAK,EAAE,IAAIrB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMsB,YAAY,GAAGP,QAAQ,KAAKd,QAAQ,CAACsB,GAAG,GAAGtB,QAAQ,CAACuB,GAAG,GAAGT,QAAQ;EACxE,MAAMU,UAAU,GAAGH,YAAY,KAAKrB,QAAQ,CAACuB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACEpB,KAAA,CAAAsB,aAAA,CAACxB,cAAc;IACbyB,YAAY;IACZR,MAAM,EAAEA,MAAO;IACfS,SAAS,EAAE;MACTC,GAAG,EAAEnB,YAAY;MACjBoB,OAAO,EAAE;QAAER,YAAY;QAAEG;MAAW;IACtC,CAAE;IACFb,MAAM,EAAEA,MAAO;IACfmB,OAAO,EAAE;MACPjB;IACF,CAAE;IACFH,KAAK,EAAEA,KAAM;IACbN,YAAY,EAAEA;EAAa,GAE3BD,KAAA,CAAAsB,aAAA,CAACvB,aAAa;IACZe,aAAa,EAAEA,aAAc;IAC7Bc,QAAQ,EAAC,MAAM;IACff,QAAQ,EAAEA;EAAS,GAEnBb,KAAA,CAAAsB,aAAA,CAACpB,iBAAiB;IAChBS,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBH,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAED,SAASN,0BAA0B","ignoreList":[]}
|
|
@@ -14,7 +14,8 @@ spreadCostCalculatorParamsElements.forEach(element => {
|
|
|
14
14
|
const {
|
|
15
15
|
locale,
|
|
16
16
|
instruments,
|
|
17
|
-
division
|
|
17
|
+
division,
|
|
18
|
+
logoLink
|
|
18
19
|
} = JSON.parse(params);
|
|
19
20
|
const isParamError = validateToolParams({
|
|
20
21
|
locale,
|
|
@@ -42,6 +43,7 @@ spreadCostCalculatorParamsElements.forEach(element => {
|
|
|
42
43
|
isParamError: isParamError,
|
|
43
44
|
liveRatesUrl: liveRatesUrl,
|
|
44
45
|
locale: locale,
|
|
46
|
+
logoLink: logoLink,
|
|
45
47
|
theme: mode
|
|
46
48
|
}));
|
|
47
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","SpreadCostCalculatorWidget","graphqlUrl","liveRatesUrl","window","widgetsConfig","spreadCostCalculatorParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","locale","instruments","division","JSON","parse","isParamError","name","valueCheck","value","length","render","createElement","theme"],"sources":["../../../src/SpreadCostCalculatorWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\nconst spreadCostCalculatorParamsElements = document.querySelectorAll(\n 'div[data-spread-cost-calculator-params]'\n);\n\nspreadCostCalculatorParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-spread-cost-calculator-params');\n const mode = element.getAttribute('data-mode');\n const { locale, instruments, division } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n locale,\n graphqlUrl,\n instruments,\n division,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n {\n name: 'division',\n },\n {\n name: 'instruments',\n valueCheck: (value) =>\n (value as string[]).length > 0 && (value as string[]).length <= 10,\n },\n ]\n );\n\n root.render(\n <SpreadCostCalculatorWidget\n division={division}\n graphqlUrl={graphqlUrl}\n instruments={instruments}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,0BAA0B,QAAQ,8BAA8B;AAEzE,MAAM;EAAEC,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAC/D,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAClE,yCACF,CAAC;AAEDF,kCAAkC,CAACG,OAAO,CAAEC,OAAO,IAAK;EACtD,MAAMC,IAAI,GAAGX,UAAU,CAACU,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,oCAAoC,CAAC;EACzE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,MAAM;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,
|
|
1
|
+
{"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","SpreadCostCalculatorWidget","graphqlUrl","liveRatesUrl","window","widgetsConfig","spreadCostCalculatorParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","locale","instruments","division","logoLink","JSON","parse","isParamError","name","valueCheck","value","length","render","createElement","theme"],"sources":["../../../src/SpreadCostCalculatorWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\nconst spreadCostCalculatorParamsElements = document.querySelectorAll(\n 'div[data-spread-cost-calculator-params]'\n);\n\nspreadCostCalculatorParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-spread-cost-calculator-params');\n const mode = element.getAttribute('data-mode');\n const { locale, instruments, division, logoLink } = JSON.parse(\n params as string\n );\n\n const isParamError = validateToolParams(\n {\n locale,\n graphqlUrl,\n instruments,\n division,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n {\n name: 'division',\n },\n {\n name: 'instruments',\n valueCheck: (value) =>\n (value as string[]).length > 0 && (value as string[]).length <= 10,\n },\n ]\n );\n\n root.render(\n <SpreadCostCalculatorWidget\n division={division}\n graphqlUrl={graphqlUrl}\n instruments={instruments}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n logoLink={logoLink}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,0BAA0B,QAAQ,8BAA8B;AAEzE,MAAM;EAAEC,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAC/D,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAClE,yCACF,CAAC;AAEDF,kCAAkC,CAACG,OAAO,CAAEC,OAAO,IAAK;EACtD,MAAMC,IAAI,GAAGX,UAAU,CAACU,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,oCAAoC,CAAC;EACzE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,MAAM;IAAEC,WAAW;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,CAC5DR,MACF,CAAC;EAED,MAAMS,YAAY,GAAGvB,kBAAkB,CACrC;IACEiB,MAAM;IACNb,UAAU;IACVc,WAAW;IACXC,QAAQ;IACRd;EACF,CAAC,EACD,CACE;IACEmB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAyB,IAAK3B,cAAc,CAAC2B,KAAK;EACjE,CAAC,EACD;IACEF,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE,aAAa;IACnBC,UAAU,EAAGC,KAAK,IACfA,KAAK,CAAcC,MAAM,GAAG,CAAC,IAAKD,KAAK,CAAcC,MAAM,IAAI;EACpE,CAAC,CAEL,CAAC;EAEDd,IAAI,CAACe,MAAM,CACT3B,KAAA,CAAA4B,aAAA,CAAC1B,0BAA0B;IACzBgB,QAAQ,EAAEA,QAAS;IACnBf,UAAU,EAAEA,UAAW;IACvBc,WAAW,EAAEA,WAAY;IACzBK,YAAY,EAAEA,YAAa;IAC3BlB,YAAY,EAAEA,YAAa;IAC3BY,MAAM,EAAEA,MAAO;IACfG,QAAQ,EAAEA,QAAS;IACnBU,KAAK,EAAEd;EAAc,CACtB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-spread-cost-calculator-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Labs Spread Cost Calculator Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "OANDA",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
15
|
+
"@oanda/labs-widget-common": "^1.0.179",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"echarts": "5.5.0",
|
|
18
18
|
"echarts-for-react": "3.0.2",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"@graphql-codegen/cli": "5.0.0",
|
|
23
23
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "3a1843166935a46ac099a9807d381f0db743b4b3"
|
|
26
26
|
}
|
|
@@ -18,6 +18,7 @@ const SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({
|
|
|
18
18
|
division,
|
|
19
19
|
instruments,
|
|
20
20
|
logoLink,
|
|
21
|
+
brandingSpace,
|
|
21
22
|
}) => {
|
|
22
23
|
const client = new ApolloClient({
|
|
23
24
|
uri: graphqlUrl,
|
|
@@ -42,7 +43,11 @@ const SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({
|
|
|
42
43
|
theme={theme}
|
|
43
44
|
translations={translations}
|
|
44
45
|
>
|
|
45
|
-
<WidgetWrapper
|
|
46
|
+
<WidgetWrapper
|
|
47
|
+
brandingSpace={brandingSpace}
|
|
48
|
+
linkArea="logo"
|
|
49
|
+
logoLink={logoLink}
|
|
50
|
+
>
|
|
46
51
|
<ValidationWrapper
|
|
47
52
|
division={division}
|
|
48
53
|
instruments={instruments}
|
|
@@ -14,7 +14,9 @@ spreadCostCalculatorParamsElements.forEach((element) => {
|
|
|
14
14
|
const root = createRoot(element);
|
|
15
15
|
const params = element.getAttribute('data-spread-cost-calculator-params');
|
|
16
16
|
const mode = element.getAttribute('data-mode');
|
|
17
|
-
const { locale, instruments, division } = JSON.parse(
|
|
17
|
+
const { locale, instruments, division, logoLink } = JSON.parse(
|
|
18
|
+
params as string
|
|
19
|
+
);
|
|
18
20
|
|
|
19
21
|
const isParamError = validateToolParams(
|
|
20
22
|
{
|
|
@@ -54,6 +56,7 @@ spreadCostCalculatorParamsElements.forEach((element) => {
|
|
|
54
56
|
isParamError={isParamError}
|
|
55
57
|
liveRatesUrl={liveRatesUrl}
|
|
56
58
|
locale={locale}
|
|
59
|
+
logoLink={logoLink}
|
|
57
60
|
theme={mode as Theme}
|
|
58
61
|
/>
|
|
59
62
|
);
|