@oanda/labs-spread-cost-calculator-widget 1.0.2 → 1.0.4

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 CHANGED
@@ -3,6 +3,42 @@
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.4 (2024-11-28)
7
+
8
+
9
+
10
+ ## 1.0.170 (2024-11-28)
11
+
12
+
13
+
14
+ ## 1.0.169 (2024-11-20)
15
+
16
+
17
+
18
+ ## 1.0.168 (2024-11-19)
19
+
20
+ **Note:** Version bump only for package @oanda/labs-spread-cost-calculator-widget
21
+
22
+
23
+
24
+
25
+
26
+ ## 1.0.3 (2024-11-28)
27
+
28
+
29
+
30
+ ## 1.0.169 (2024-11-20)
31
+
32
+
33
+
34
+ ## 1.0.168 (2024-11-19)
35
+
36
+ **Note:** Version bump only for package @oanda/labs-spread-cost-calculator-widget
37
+
38
+
39
+
40
+
41
+
6
42
  ## 1.0.2 (2024-11-20)
7
43
 
8
44
 
@@ -22,7 +22,8 @@ const SpreadCostCalculatorWidget = _ref => {
22
22
  isParamError,
23
23
  removePadding,
24
24
  division,
25
- instruments
25
+ instruments,
26
+ logoLink
26
27
  } = _ref;
27
28
  const client = new _client.ApolloClient({
28
29
  uri: graphqlUrl,
@@ -44,10 +45,14 @@ const SpreadCostCalculatorWidget = _ref => {
44
45
  }, _react.default.createElement(_react.Suspense, null, _react.default.createElement(_labsWidgetCommon.ThemeProvider, {
45
46
  theme: theme,
46
47
  removePadding: removePadding
47
- }, _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
48
- instruments: instruments,
49
- division: division,
50
- isParamError: isParamError
48
+ }, (0, _labsWidgetCommon.renderComponent)({
49
+ Component: _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
50
+ instruments: instruments,
51
+ division: division,
52
+ isParamError: isParamError
53
+ }),
54
+ logoLink,
55
+ linkArea: 'logo'
51
56
  }))))));
52
57
  };
53
58
  exports.SpreadCostCalculatorWidget = SpreadCostCalculatorWidget;
@@ -1 +1 @@
1
- {"version":3,"file":"SpreadCostCalculatorWidget.js","names":["_react","_interopRequireWildcard","require","_client","_labsWidgetCommon","_labsLiveRatesTableWidget","_monoI18n","_translations","_ValidationWrapper","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","Suspense","ThemeProvider","ValidationWrapper","exports"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import React, { FC, Suspense } from 'react';\nimport { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport {\n getLocale, LiveRatesProvider, ThemeProvider,\n} from '@oanda/labs-widget-common';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { SpreadCostCalculatorWidgetConfig } from './types';\nimport { translations } from '../translations';\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}) => {\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 <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider theme={theme} removePadding={removePadding}>\n <ValidationWrapper\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAGA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAO,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,SAAAT,wBAAAS,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,CAA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C,aAAA,CAACjD,MAAA,CAAAyD,QAAQ,QACPzD,MAAA,CAAAe,OAAA,CAAAkC,aAAA,CAAC7C,iBAAA,CAAAsD,aAAa;IAACzB,KAAK,EAAEA,KAAM;IAACG,aAAa,EAAEA;EAAc,GACxDpC,MAAA,CAAAe,OAAA,CAAAkC,aAAA,CAACzC,kBAAA,CAAAmD,iBAAiB;IAChBrB,WAAW,EAAEA,WAAY;IACzBD,QAAQ,EAAEA,QAAS;IACnBF,YAAY,EAAEA;EAAa,CAC5B,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAACyB,OAAA,CAAA/B,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"file":"SpreadCostCalculatorWidget.js","names":["_react","_interopRequireWildcard","require","_client","_labsWidgetCommon","_labsLiveRatesTableWidget","_monoI18n","_translations","_ValidationWrapper","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","Suspense","ThemeProvider","renderComponent","Component","ValidationWrapper","linkArea","exports"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import React, { FC, Suspense } from 'react';\nimport { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport {\n getLocale, LiveRatesProvider, renderComponent, ThemeProvider,\n} from '@oanda/labs-widget-common';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { SpreadCostCalculatorWidgetConfig } from './types';\nimport { translations } from '../translations';\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 <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider theme={theme} removePadding={removePadding}>\n {renderComponent({\n Component: <ValidationWrapper\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />,\n logoLink,\n linkArea: 'logo',\n })}\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAGA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAO,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,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CA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e,OAAA,CAAAmC,aAAA,CAAC5C,SAAA,CAAA6C,cAAc;IAACjB,MAAM,EAAE,IAAAkB,2BAAS,EAAClB,MAAM,CAAE;IAACmB,YAAY,EAAEA;EAAa,GACpErD,MAAA,CAAAe,OAAA,CAAAmC,aAAA,CAAC9C,iBAAA,CAAAkD,iBAAiB;IAChBC,GAAG,EAAEvB,YAAa;IAClBwB,OAAO,EAAE;MAAEX,YAAY;MAAEI;IAAW;EAAE,GAEtCjD,MAAA,CAAAe,OAAA,CAAAmC,aAAA,CAAC/C,OAAA,CAAAsD,cAAc;IAACjB,MAAM,EAAEA;EAAO,GAC7BxC,MAAA,CAAAe,OAAA,CAAAmC,aAAA,CAAClD,MAAA,CAAA0D,QAAQ,QACP1D,MAAA,CAAAe,OAAA,CAAAmC,aAAA,CAAC9C,iBAAA,CAAAuD,aAAa;IAAC1B,KAAK,EAAEA,KAAM;IAACG,aAAa,EAAEA;EAAc,GACvD,IAAAwB,iCAAe,EAAC;IACfC,SAAS,EAAE7D,MAAA,CAAAe,OAAA,CAAAmC,aAAA,CAAC1C,kBAAA,CAAAsD,iBAAiB;MAC3BxB,WAAW,EAAEA,WAAY;MACzBD,QAAQ,EAAEA,QAAS;MACnBF,YAAY,EAAEA;IAAa,CAC5B,CAAC;IACFI,QAAQ;IACRwB,QAAQ,EAAE;EACZ,CAAC,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAACC,OAAA,CAAAnC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["_monoI18n","require"],"sources":["../../../src/SpreadCostCalculatorWidget/types.ts"],"sourcesContent":["import { WidgetWrapperProps } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport type SpreadCostCalculatorWidgetConfig = Pick<\nWidgetWrapperProps,\n'locale' | 'theme' | 'isParamError' | 'removePadding'\n> & {\n graphqlUrl: string;\n liveRatesUrl: string;\n division: Division;\n instruments: string[];\n};\n\nexport type InstrumentResponse = {\n name: string;\n displayName: string;\n};\n\nexport type MainProps = {\n instruments: InstrumentResponse[];\n};\n\nexport interface ValidationWrapperProps {\n division: Division;\n instruments: string[];\n isParamError?: boolean;\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["_monoI18n","require"],"sources":["../../../src/SpreadCostCalculatorWidget/types.ts"],"sourcesContent":["import { WidgetConfig, WidgetWrapperProps } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport type SpreadCostCalculatorWidgetConfig = WidgetConfig & Pick<\nWidgetWrapperProps,\n'removePadding'\n> & {\n liveRatesUrl: string;\n division: Division;\n instruments: string[];\n};\n\nexport type InstrumentResponse = {\n name: string;\n displayName: string;\n};\n\nexport type MainProps = {\n instruments: InstrumentResponse[];\n};\n\nexport interface ValidationWrapperProps {\n division: Division;\n instruments: string[];\n isParamError?: boolean;\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import React, { Suspense } from 'react';
2
2
  import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
3
- import { getLocale, LiveRatesProvider, ThemeProvider } from '@oanda/labs-widget-common';
3
+ import { getLocale, LiveRatesProvider, renderComponent, ThemeProvider } from '@oanda/labs-widget-common';
4
4
  import { Division } from '@oanda/labs-live-rates-table-widget';
5
5
  import { LocaleProvider } from '@oanda/mono-i18n';
6
6
  import { translations } from '../translations';
@@ -14,7 +14,8 @@ const SpreadCostCalculatorWidget = _ref => {
14
14
  isParamError,
15
15
  removePadding,
16
16
  division,
17
- instruments
17
+ instruments,
18
+ logoLink
18
19
  } = _ref;
19
20
  const client = new ApolloClient({
20
21
  uri: graphqlUrl,
@@ -36,10 +37,14 @@ const SpreadCostCalculatorWidget = _ref => {
36
37
  }, React.createElement(Suspense, null, React.createElement(ThemeProvider, {
37
38
  theme: theme,
38
39
  removePadding: removePadding
39
- }, React.createElement(ValidationWrapper, {
40
- instruments: instruments,
41
- division: division,
42
- isParamError: isParamError
40
+ }, renderComponent({
41
+ Component: React.createElement(ValidationWrapper, {
42
+ instruments: instruments,
43
+ division: division,
44
+ isParamError: isParamError
45
+ }),
46
+ logoLink,
47
+ linkArea: 'logo'
43
48
  }))))));
44
49
  };
45
50
  export { SpreadCostCalculatorWidget };
@@ -1 +1 @@
1
- {"version":3,"file":"SpreadCostCalculatorWidget.js","names":["React","Suspense","ApolloClient","ApolloProvider","InMemoryCache","getLocale","LiveRatesProvider","ThemeProvider","Division","LocaleProvider","translations","ValidationWrapper","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import React, { FC, Suspense } from 'react';\nimport { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport {\n getLocale, LiveRatesProvider, ThemeProvider,\n} from '@oanda/labs-widget-common';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { SpreadCostCalculatorWidgetConfig } from './types';\nimport { translations } from '../translations';\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}) => {\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 <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider theme={theme} removePadding={removePadding}>\n <ValidationWrapper\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,YAAY,EAAEC,cAAc,EAAEC,aAAa,QAAQ,gBAAgB;AAC5E,SACEC,SAAS,EAAEC,iBAAiB,EAAEC,aAAa,QACtC,2BAA2B;AAClC,SAASC,QAAQ,QAAQ,qCAAqC;AAC9D,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,0BAAgE,GAAGC,IAAA,IASnE;EAAA,IAToE;IACxEC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,YAAY;IACZC,aAAa;IACbC,QAAQ;IACRC;EACF,CAAC,GAAAR,IAAA;EACC,MAAMS,MAAM,GAAG,IAAIpB,YAAY,CAAC;IAC9BqB,GAAG,EAAET,UAAU;IACfU,KAAK,EAAE,IAAIpB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMqB,YAAY,GAAGL,QAAQ,KAAKZ,QAAQ,CAACkB,GAAG,GAAGlB,QAAQ,CAACmB,GAAG,GAAGP,QAAQ;EACxE,MAAMQ,UAAU,GAAGH,YAAY,KAAKjB,QAAQ,CAACmB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE3B,KAAA,CAAA6B,aAAA,CAACpB,cAAc;IAACQ,MAAM,EAAEZ,SAAS,CAACY,MAAM,CAAE;IAACP,YAAY,EAAEA;EAAa,GACpEV,KAAA,CAAA6B,aAAA,CAACvB,iBAAiB;IAChBwB,GAAG,EAAEf,YAAa;IAClBgB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC5B,KAAA,CAAA6B,aAAA,CAAC1B,cAAc;IAACmB,MAAM,EAAEA;EAAO,GAC7BtB,KAAA,CAAA6B,aAAA,CAAC5B,QAAQ,QACPD,KAAA,CAAA6B,aAAA,CAACtB,aAAa;IAACS,KAAK,EAAEA,KAAM;IAACG,aAAa,EAAEA;EAAc,GACxDnB,KAAA,CAAA6B,aAAA,CAAClB,iBAAiB;IAChBU,WAAW,EAAEA,WAAY;IACzBD,QAAQ,EAAEA,QAAS;IACnBF,YAAY,EAAEA;EAAa,CAC5B,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAED,SAASN,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"SpreadCostCalculatorWidget.js","names":["React","Suspense","ApolloClient","ApolloProvider","InMemoryCache","getLocale","LiveRatesProvider","renderComponent","ThemeProvider","Division","LocaleProvider","translations","ValidationWrapper","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options","Component","linkArea"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import React, { FC, Suspense } from 'react';\nimport { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport {\n getLocale, LiveRatesProvider, renderComponent, ThemeProvider,\n} from '@oanda/labs-widget-common';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { SpreadCostCalculatorWidgetConfig } from './types';\nimport { translations } from '../translations';\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 <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider theme={theme} removePadding={removePadding}>\n {renderComponent({\n Component: <ValidationWrapper\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />,\n logoLink,\n linkArea: 'logo',\n })}\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,YAAY,EAAEC,cAAc,EAAEC,aAAa,QAAQ,gBAAgB;AAC5E,SACEC,SAAS,EAAEC,iBAAiB,EAAEC,eAAe,EAAEC,aAAa,QACvD,2BAA2B;AAClC,SAASC,QAAQ,QAAQ,qCAAqC;AAC9D,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,0BAAgE,GAAGC,IAAA,IAUnE;EAAA,IAVoE;IACxEC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,YAAY;IACZC,aAAa;IACbC,QAAQ;IACRC,WAAW;IACXC;EACF,CAAC,GAAAT,IAAA;EACC,MAAMU,MAAM,GAAG,IAAItB,YAAY,CAAC;IAC9BuB,GAAG,EAAEV,UAAU;IACfW,KAAK,EAAE,IAAItB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMuB,YAAY,GAAGN,QAAQ,KAAKZ,QAAQ,CAACmB,GAAG,GAAGnB,QAAQ,CAACoB,GAAG,GAAGR,QAAQ;EACxE,MAAMS,UAAU,GAAGH,YAAY,KAAKlB,QAAQ,CAACoB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE7B,KAAA,CAAA+B,aAAA,CAACrB,cAAc;IAACQ,MAAM,EAAEb,SAAS,CAACa,MAAM,CAAE;IAACP,YAAY,EAAEA;EAAa,GACpEX,KAAA,CAAA+B,aAAA,CAACzB,iBAAiB;IAChB0B,GAAG,EAAEhB,YAAa;IAClBiB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC9B,KAAA,CAAA+B,aAAA,CAAC5B,cAAc;IAACqB,MAAM,EAAEA;EAAO,GAC7BxB,KAAA,CAAA+B,aAAA,CAAC9B,QAAQ,QACPD,KAAA,CAAA+B,aAAA,CAACvB,aAAa;IAACS,KAAK,EAAEA,KAAM;IAACG,aAAa,EAAEA;EAAc,GACvDb,eAAe,CAAC;IACf2B,SAAS,EAAElC,KAAA,CAAA+B,aAAA,CAACnB,iBAAiB;MAC3BU,WAAW,EAAEA,WAAY;MACzBD,QAAQ,EAAEA,QAAS;MACnBF,YAAY,EAAEA;IAAa,CAC5B,CAAC;IACFI,QAAQ;IACRY,QAAQ,EAAE;EACZ,CAAC,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAED,SAAStB,0BAA0B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["Locale"],"sources":["../../../src/SpreadCostCalculatorWidget/types.ts"],"sourcesContent":["import { WidgetWrapperProps } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport type SpreadCostCalculatorWidgetConfig = Pick<\nWidgetWrapperProps,\n'locale' | 'theme' | 'isParamError' | 'removePadding'\n> & {\n graphqlUrl: string;\n liveRatesUrl: string;\n division: Division;\n instruments: string[];\n};\n\nexport type InstrumentResponse = {\n name: string;\n displayName: string;\n};\n\nexport type MainProps = {\n instruments: InstrumentResponse[];\n};\n\nexport interface ValidationWrapperProps {\n division: Division;\n instruments: string[];\n isParamError?: boolean;\n}\n"],"mappings":"AAGA,SAASA,MAAM,QAAQ,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["Locale"],"sources":["../../../src/SpreadCostCalculatorWidget/types.ts"],"sourcesContent":["import { WidgetConfig, WidgetWrapperProps } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport type SpreadCostCalculatorWidgetConfig = WidgetConfig & Pick<\nWidgetWrapperProps,\n'removePadding'\n> & {\n liveRatesUrl: string;\n division: Division;\n instruments: string[];\n};\n\nexport type InstrumentResponse = {\n name: string;\n displayName: string;\n};\n\nexport type MainProps = {\n instruments: InstrumentResponse[];\n};\n\nexport interface ValidationWrapperProps {\n division: Division;\n instruments: string[];\n isParamError?: boolean;\n}\n"],"mappings":"AAGA,SAASA,MAAM,QAAQ,kBAAkB","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { WidgetWrapperProps } from '@oanda/labs-widget-common';
1
+ import { WidgetConfig, WidgetWrapperProps } from '@oanda/labs-widget-common';
2
2
  import { Division } from '../gql/types/graphql';
3
3
  export { Locale } from '@oanda/mono-i18n';
4
- export type SpreadCostCalculatorWidgetConfig = Pick<WidgetWrapperProps, 'locale' | 'theme' | 'isParamError' | 'removePadding'> & {
5
- graphqlUrl: string;
4
+ export type SpreadCostCalculatorWidgetConfig = WidgetConfig & Pick<WidgetWrapperProps, 'removePadding'> & {
6
5
  liveRatesUrl: string;
7
6
  division: Division;
8
7
  instruments: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oanda/labs-spread-cost-calculator-widget",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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.169",
15
+ "@oanda/labs-widget-common": "^1.0.171",
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": "e809eb04614639bd88d4e9d501940b8d08d26d88"
25
+ "gitHead": "f978676624ce706f807cbecc432c67ed809dbf48"
26
26
  }
@@ -1,7 +1,7 @@
1
1
  import React, { FC, Suspense } from 'react';
2
2
  import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
3
3
  import {
4
- getLocale, LiveRatesProvider, ThemeProvider,
4
+ getLocale, LiveRatesProvider, renderComponent, ThemeProvider,
5
5
  } from '@oanda/labs-widget-common';
6
6
  import { Division } from '@oanda/labs-live-rates-table-widget';
7
7
  import { LocaleProvider } from '@oanda/mono-i18n';
@@ -18,6 +18,7 @@ const SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({
18
18
  removePadding,
19
19
  division,
20
20
  instruments,
21
+ logoLink,
21
22
  }) => {
22
23
  const client = new ApolloClient({
23
24
  uri: graphqlUrl,
@@ -36,11 +37,15 @@ const SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({
36
37
  <ApolloProvider client={client}>
37
38
  <Suspense>
38
39
  <ThemeProvider theme={theme} removePadding={removePadding}>
39
- <ValidationWrapper
40
- instruments={instruments}
41
- division={division}
42
- isParamError={isParamError}
43
- />
40
+ {renderComponent({
41
+ Component: <ValidationWrapper
42
+ instruments={instruments}
43
+ division={division}
44
+ isParamError={isParamError}
45
+ />,
46
+ logoLink,
47
+ linkArea: 'logo',
48
+ })}
44
49
  </ThemeProvider>
45
50
  </Suspense>
46
51
  </ApolloProvider>
@@ -1,13 +1,12 @@
1
- import { WidgetWrapperProps } from '@oanda/labs-widget-common';
1
+ import { WidgetConfig, WidgetWrapperProps } from '@oanda/labs-widget-common';
2
2
  import { Division } from '../gql/types/graphql';
3
3
 
4
4
  export { Locale } from '@oanda/mono-i18n';
5
5
 
6
- export type SpreadCostCalculatorWidgetConfig = Pick<
6
+ export type SpreadCostCalculatorWidgetConfig = WidgetConfig & Pick<
7
7
  WidgetWrapperProps,
8
- 'locale' | 'theme' | 'isParamError' | 'removePadding'
8
+ 'removePadding'
9
9
  > & {
10
- graphqlUrl: string;
11
10
  liveRatesUrl: string;
12
11
  division: Division;
13
12
  instruments: string[];