@oanda/labs-currency-strength-widget 1.0.140 → 1.0.142

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 (32) hide show
  1. package/CHANGELOG.md +1140 -0
  2. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +15 -11
  3. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  4. package/dist/main/CurrencyStrengthWidget/Main.js +2 -2
  5. package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -1
  6. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +1 -2
  7. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  8. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js +1 -5
  9. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  10. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  11. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  12. package/dist/main/gql/getCurrencyStrength.js +3 -12
  13. package/dist/main/gql/getCurrencyStrength.js.map +1 -1
  14. package/dist/main/gql/types/fragment-masking.js +3 -2
  15. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  16. package/dist/main/gql/types/gql.js +3 -3
  17. package/dist/main/gql/types/gql.js.map +1 -1
  18. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +15 -11
  19. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  20. package/dist/module/CurrencyStrengthWidget/Main.js +2 -2
  21. package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -1
  22. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js +1 -5
  23. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  24. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  25. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  26. package/dist/module/gql/getCurrencyStrength.js +3 -12
  27. package/dist/module/gql/getCurrencyStrength.js.map +1 -1
  28. package/dist/module/gql/types/fragment-masking.js +3 -2
  29. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  30. package/dist/module/gql/types/gql.js +2 -1
  31. package/dist/module/gql/types/gql.js.map +1 -1
  32. package/package.json +4 -4
@@ -14,6 +14,7 @@ var _Chart = require("./components/Chart");
14
14
  var _formatters = require("./components/Chart/formatters");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  const ChartWithData = _ref => {
17
+ var _data$currencyStrengt, _data$currencyStrengt2, _data$currencyStrengt3, _data$currencyStrengt4, _;
17
18
  let {
18
19
  currency
19
20
  } = _ref;
@@ -31,9 +32,9 @@ const ChartWithData = _ref => {
31
32
  } = (0, _client.useQuery)(_getCurrencyStrength.getCurrencyStrength, {
32
33
  fetchPolicy: 'cache-and-network'
33
34
  });
34
- const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;
35
- const showError = data?.currencyStrength?.length === 0 || error;
36
- const currencyData = currency ? data?.currencyStrength?.filter(item => item.currency === currency) : data?.currencyStrength?.slice().sort(_formatters.sortCurrencies);
35
+ const showChart = (data === null || data === void 0 ? void 0 : data.currencyStrength) && (data === null || data === void 0 || (_data$currencyStrengt = data.currencyStrength) === null || _data$currencyStrengt === void 0 ? void 0 : _data$currencyStrengt.length) > 0;
36
+ const showError = (data === null || data === void 0 || (_data$currencyStrengt2 = data.currencyStrength) === null || _data$currencyStrengt2 === void 0 ? void 0 : _data$currencyStrengt2.length) === 0 || error;
37
+ const currencyData = currency ? data === null || data === void 0 || (_data$currencyStrengt3 = data.currencyStrength) === null || _data$currencyStrengt3 === void 0 ? void 0 : _data$currencyStrengt3.filter(item => item.currency === currency) : data === null || data === void 0 || (_data$currencyStrengt4 = data.currencyStrength) === null || _data$currencyStrengt4 === void 0 ? void 0 : _data$currencyStrengt4.slice().sort(_formatters.sortCurrencies);
37
38
  return _react.default.createElement(_react.default.Fragment, null, loading && _react.default.createElement("div", {
38
39
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
39
40
  'lw-h-[461px]': !currency,
@@ -47,13 +48,16 @@ const ChartWithData = _ref => {
47
48
  'lw-grid-cols-1': !isDesktop || currency
48
49
  }),
49
50
  "data-testid": "currency-strength-chart-wrapper"
50
- }, currencyData && currencyData.map(item => _react.default.createElement("div", {
51
- key: item.currency,
52
- className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
53
- }, _react.default.createElement(_Chart.Chart, {
54
- currency: item.currency,
55
- values: item.strengthRelation?.slice().sort(_formatters.sortCurrencies)
56
- })))), !loading && showError && _react.default.createElement("div", {
51
+ }, currencyData && currencyData.map(item => {
52
+ var _item$strengthRelatio;
53
+ return _react.default.createElement("div", {
54
+ key: item.currency,
55
+ className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
56
+ }, _react.default.createElement(_Chart.Chart, {
57
+ currency: item.currency,
58
+ values: (_item$strengthRelatio = item.strengthRelation) === null || _item$strengthRelatio === void 0 ? void 0 : _item$strengthRelatio.slice().sort(_formatters.sortCurrencies)
59
+ }));
60
+ })), !loading && showError && _react.default.createElement("div", {
57
61
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
58
62
  'lw-h-[425px]': !currency,
59
63
  'lw-h-[135px]': currency
@@ -62,7 +66,7 @@ const ChartWithData = _ref => {
62
66
  className: "lw-mt-2 lw-h-8"
63
67
  }, _react.default.createElement(_labsWidgetCommon.LastUpdated, {
64
68
  labelCallback: lang,
65
- timestamp: data?.currencyStrength[0]?.updatedAt
69
+ timestamp: data === null || data === void 0 || (_ = data.currencyStrength[0]) === null || _ === void 0 ? void 0 : _.updatedAt
66
70
  })));
67
71
  };
68
72
  exports.ChartWithData = ChartWithData;
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["_client","require","_labsWidgetCommon","_monoI18n","_classnames","_interopRequireDefault","_react","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","ChartWithData","_ref","currency","size","useLayoutProvider","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","key","Chart","values","strengthRelation","ChartError","LastUpdated","labelCallback","timestamp","updatedAt","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAQA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAEA,IAAAM,oBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA+D,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG/D,MAAMG,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAC9C,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EACpC,MAAMC,SAAS,GAAGF,IAAI,KAAKG,sBAAI,CAACC,OAAO;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CAAE;IACH,eAAY;EAAiC,GAE5CkB,YAAY,IACXA,YAAY,CAACa,GAAG,CAAEX,IAAI,IACpB7B,MAAA,CAAAM,OAAA,CAAA2B,aAAA;IACEQ,GAAG,EAAEZ,IAAI,CAACpB,QAAS;IACnB0B,SAAS,EAAC;EAAkE,GAE5EnC,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAAC/B,MAAA,CAAAwC,KAAK;IACJjC,QAAQ,EAAEoB,IAAI,CAACpB,QAAS;IACxBkC,MAAM,EAAEd,IAAI,CAACe,gBAAgB,EAAEd,KAAK,CAAC,CAAC,CAACC,IAAI,CAACC,0BAAc;EAAG,CAC9D,CACE,CACN,CACA,CACN,EACA,CAACf,OAAO,IAAIS,SAAS,IACpB1B,MAAA,CAAAM,OAAA,CAAA2B,aAAA;IACEE,SAAS,EAAE,IAAAC,mBAAU,EACnB,sFAAsF,EACtF;MACE,cAAc,EAAE,CAAC3B,QAAQ;MACzB,cAAc,EAAEA;IAClB,CACF;EAAE,GAEFT,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAACrC,iBAAA,CAAAiD,UAAU,MAAE,CACV,CACN,EACA,CAAC5B,OAAO,IAAI,CAACS,SAAS,IACrB1B,MAAA,CAAAM,OAAA,CAAA2B,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BnC,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAACrC,iBAAA,CAAAkD,WAAW;IACVC,aAAa,EAAEhC,IAAK;IACpBiC,SAAS,EAAE9B,IAAI,EAAEM,gBAAgB,CAAE,CAAC,CAAC,EAAEyB;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA3C,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"ChartsWithData.js","names":["_client","require","_labsWidgetCommon","_monoI18n","_classnames","_interopRequireDefault","_react","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","ChartWithData","_ref","_data$currencyStrengt","_data$currencyStrengt2","_data$currencyStrengt3","_data$currencyStrengt4","_","currency","size","useLayoutProvider","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","_item$strengthRelatio","key","Chart","values","strengthRelation","ChartError","LastUpdated","labelCallback","timestamp","updatedAt","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAQA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAEA,IAAAM,oBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA+D,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG/D,MAAMG,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,CAAA;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAN,IAAA;EAC9C,MAAM;IAAEO;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EACpC,MAAMC,SAAS,GA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,CAAAM,OAAA,CAAAgC,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BxC,MAAA,CAAAM,OAAA,CAAAgC,aAAA,CAAC1C,iBAAA,CAAAwD,WAAW;IACVC,aAAa,EAAEjC,IAAK;IACpBkC,SAAS,EAAE/B,IAAI,aAAJA,IAAI,gBAAAV,CAAA,GAAJU,IAAI,CAAEM,gBAAgB,CAAE,CAAC,CAAC,cAAAhB,CAAA,uBAA1BA,CAAA,CAA4B0C;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAAjD,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -23,9 +23,9 @@ const Main = _ref => {
23
23
  "data-testid": "currency-strength-wrapper"
24
24
  }, _react.default.createElement("div", {
25
25
  className: "lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold"
26
- }, _react.default.createElement("span", null, `${lang('daily')} (${lang('minute', {
26
+ }, _react.default.createElement("span", null, "".concat(lang('daily'), " (").concat(lang('minute', {
27
27
  count: 5
28
- })})`)), _react.default.createElement(_ChartsWithData.ChartWithData, {
28
+ }), ")"))), _react.default.createElement(_ChartsWithData.ChartWithData, {
29
29
  currency: currency
30
30
  })));
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_ChartsWithData","e","__esModule","default","Main","_ref","currency","lang","useLocale","size","useLayoutProvider","createElement","Fragment","className","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAAiD,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,MAAMG,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEpC,OACEZ,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAAAb,MAAA,CAAAK,OAAA,CAAAS,QAAA,QACGH,IAAI,IACHX,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAK,eAAY;EAA2B,GAC1Cb,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFf,MAAA,CAAAK,OAAA,CAAAQ,aAAA,eAAO,GAAGJ,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEO,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNhB,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAACX,eAAA,CAAAe,aAAa;IAACT,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAACU,OAAA,CAAAZ,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_ChartsWithData","e","__esModule","default","Main","_ref","currency","lang","useLocale","size","useLayoutProvider","createElement","Fragment","className","concat","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAAiD,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,MAAMG,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEpC,OACEZ,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAAAb,MAAA,CAAAK,OAAA,CAAAS,QAAA,QACGH,IAAI,IACHX,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAK,eAAY;EAA2B,GAC1Cb,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFf,MAAA,CAAAK,OAAA,CAAAQ,aAAA,kBAAAG,MAAA,CAAUP,IAAI,CAAC,OAAO,CAAC,QAAAO,MAAA,CAAKP,IAAI,CAAC,QAAQ,EAAE;IAAEQ,KAAK,EAAE;EAAE,CAAC,CAAC,MAAU,CAC/D,CAAC,EACNjB,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAACX,eAAA,CAAAgB,aAAa;IAACV,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAACW,OAAA,CAAAb,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -14,8 +14,7 @@ var _react = _interopRequireDefault(require("react"));
14
14
  var _constants = require("./constants");
15
15
  var _getOption = require("./getOption");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- 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); }
18
- 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; }
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
18
  echarts.use([_components.GridSimpleComponent, _components.GraphicComponent, _components.TooltipComponent, _components.TitleComponent, _charts.BarChart, _renderers.CanvasRenderer]);
20
19
  echarts.registerTheme('dark_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Dark));
21
20
  echarts.registerTheme('light_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Light));
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_react","_interopRequireDefault","_constants","_getOption","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useLayoutProvider","createElement","BaseChart","chartHeight","CHART_HEIGHT","option","getOption","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <BaseChart\n chartHeight={CHART_HEIGHT}\n echarts={echarts}\n isDark={isDark}\n option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAC,sBAAA,CAAAR,OAAA;AAEA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,SAAAQ,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,S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O,EAAEA,OAAQ;IACjB6C,MAAM,EAAEA,MAAO;IACfM,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBX,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJE;IACF,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC;AAACQ,OAAA,CAAAd,KAAA,GAAAA,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_react","_interopRequireDefault","_constants","_getOption","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useLayoutProvider","createElement","BaseChart","chartHeight","CHART_HEIGHT","option","getOption","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <BaseChart\n chartHeight={CHART_H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
17
- <div>
18
- <div style="margin-bottom:5px;">${currency} ${lang('vs')} ${name}</div>
19
- <div style="display:flex;align-items:center;">${marker} ${value}%</div>
20
- </div>`;
16
+ return "\n<div>\n <div style=\"margin-bottom:5px;\">".concat(currency, " ").concat(lang('vs'), " ").concat(name, "</div>\n <div style=\"display:flex;align-items:center;\">").concat(marker, " ").concat(value, "%</div>\n</div>");
21
17
  };
22
18
  exports.tooltipFormatter = tooltipFormatter;
23
19
  const sortCurrencies = (a, b) => _constants.instrumentsConfig.indexOf(a.currency) - _constants.instrumentsConfig.indexOf(b.currency);
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","names":["_constants","require","tooltipFormatter","_ref","marker","name","value","currency","lang","exports","sortCurrencies","a","b","instrumentsConfig","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAACG,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAER,MAAMQ,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDC,4BAAiB,CAACC,OAAO,CAACH,CAAC,CAACJ,QAAQ,CAAC,GAAGM,4BAAiB,CAACC,OAAO,CAACF,CAAC,CAACL,QAAQ,CAAC;AAACE,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"file":"formatters.js","names":["_constants","require","tooltipFormatter","_ref","marker","name","value","currency","lang","concat","exports","sortCurrencies","a","b","instrumentsConfig","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,uDAAAM,MAAA,CAEWF,QAAQ,OAAAE,MAAA,CAAID,IAAI,CAAC,IAAI,CAAC,OAAAC,MAAA,CAAIJ,IAAI,gEAAAI,MAAA,CAChBL,MAAM,OAAAK,MAAA,CAAIH,KAAK;AAAA,CAC1D;AAACI,OAAA,CAAAR,gBAAA,GAAAA,gBAAA;AAER,MAAMS,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDC,4BAAiB,CAACC,OAAO,CAACH,CAAC,CAACL,QAAQ,CAAC,GAAGO,4BAAiB,CAACC,OAAO,CAACF,CAAC,CAACN,QAAQ,CAAC;AAACG,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -29,7 +29,7 @@ const getOption = _ref => {
29
29
  title: {
30
30
  top: '0px',
31
31
  left: 'center',
32
- text: `${currency} vs`,
32
+ text: "".concat(currency, " vs"),
33
33
  textStyle: {
34
34
  fontSize: 12,
35
35
  lineHeight: 20,
@@ -40,8 +40,8 @@ const getOption = _ref => {
40
40
  name: 'main-grid',
41
41
  top: '30px',
42
42
  right: '0px',
43
- left: `${_constants.Y_LABEL_SIZE}px`,
44
- bottom: `${_constants.X_LABEL_SIZE}px`
43
+ left: "".concat(_constants.Y_LABEL_SIZE, "px"),
44
+ bottom: "".concat(_constants.X_LABEL_SIZE, "px")
45
45
  }],
46
46
  graphic: [...gridLines],
47
47
  tooltip: {
@@ -1 +1 @@
1
- {"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","darkBarColors","lightBarColors","gridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT","xLabelsSize","yLabelSize","animation","title","top","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","right","Y_LABEL_SIZE","bottom","X_LABEL_SIZE","graphic","tooltip","trigger","formatter","_ref2","marker","value","tooltipFormatter","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n top: '0px',\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;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IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOvC,SAAS,CAAC6D,QAAQ;UAC3B;UACA,OAAO7D,SAAS,CAAC8D,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA1E,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","darkBarColors","lightBarColors","gridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT","xLabelsSize","yLabelSize","animation","title","top","left","text","concat","textStyle","fontSize","lineHeight","fontWeight","grid","name","right","Y_LABEL_SIZE","bottom","X_LABEL_SIZE","graphic","tooltip","trigger","formatter","_ref2","marker","value","tooltipFormatter","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n top: '0px',\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAGO,MAAMG,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGQ,wBAAa,GAAG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;QAAEF,IAAI,EAAE;MAAM,CAAC;MAC1BG,SAAS,EAAE;QACT3B,QAAQ,EAAE;MACZ;IACF,CAAC;IACD4B,KAAK,EAAE;MACLP,IAAI,EAAE,OAAO;MACbQ,QAAQ,EAAE,MAAM;MAChBC,GAAG,EAAEC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACD,GAAG,CAAC,GAAGlD,WAAW,CAAC,CAAC;MACzCqD,GAAG,EAAEF,IAAI,CAACG,IAAI,CAACH,IAAI,CAACE,GAAG,CAAC,GAAGrD,WAAW,CAAC,CAAC;MACxCuD,QAAQ,EAAE,CAAC;MACXV,QAAQ,EAAE;QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTf,SAAS,EAAE,UAAU;QACrBZ,QAAQ,EAAE;MACZ;IACF,CAAC;IACDoC,MAAM,EAAE,CACN;MACEd,IAAI,EAAE1C,WAAW;MACjByC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOxC,SAAS,CAAC6D,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOxC,SAAS,CAAC8D,QAAQ;UAC3B;UACA,OAAO9D,SAAS,CAAC+D,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA3E,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -5,16 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getCurrencyStrength = void 0;
7
7
  var _client = require("@apollo/client");
8
- const getCurrencyStrength = exports.getCurrencyStrength = (0, _client.gql)`
9
- query GetCurrencyStrength {
10
- currencyStrength {
11
- currency
12
- strengthRelation {
13
- currency
14
- percentage
15
- }
16
- updatedAt
17
- }
18
- }
19
- `;
8
+ var _templateObject;
9
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
+ const getCurrencyStrength = exports.getCurrencyStrength = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n"])));
20
11
  //# sourceMappingURL=getCurrencyStrength.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCurrencyStrength.js","names":["_client","require","getCurrencyStrength","exports","gql"],"sources":["../../../src/gql/getCurrencyStrength.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getCurrencyStrength = gql`\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n`;\n\nexport { getCurrencyStrength };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,WAAG;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"getCurrencyStrength.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getCurrencyStrength","exports","gql"],"sources":["../../../src/gql/getCurrencyStrength.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getCurrencyStrength = gql`\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n`;\n\nexport { getCurrencyStrength };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,uLAW9B","ignoreList":[]}
@@ -13,10 +13,11 @@ function makeFragmentData(data, _fragment) {
13
13
  return data;
14
14
  }
15
15
  function isFragmentReady(queryNode, fragmentNode, data) {
16
- const deferredFields = queryNode.__meta__?.deferredFields;
16
+ var _meta__, _fragDef$name;
17
+ const deferredFields = (_meta__ = queryNode.__meta__) === null || _meta__ === void 0 ? void 0 : _meta__.deferredFields;
17
18
  if (!deferredFields) return true;
18
19
  const fragDef = fragmentNode.definitions[0];
19
- const fragName = fragDef?.name?.value;
20
+ const fragName = fragDef === null || fragDef === void 0 || (_fragDef$name = fragDef.name) === null || _fragDef$name === void 0 ? void 0 : _fragDef$name.value;
20
21
  const fields = fragName && deferredFields[fragName] || [];
21
22
  return fields.length > 0 && fields.every(field => data && field in data);
22
23
  }
@@ -1 +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 {\n ResultOf,\n DocumentTypeDecoration,\n TypedDocumentNode,\n} from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\nexport type FragmentType<\n TDocumentType extends DocumentTypeDecoration<any, any>,\n> =\n TDocumentType extends DocumentTypeDecoration<infer TType, any>\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:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | null\n | 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:\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\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:\n | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>\n | null\n | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (\n queryNode as {\n __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };\n }\n ).__meta__?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as\n | FragmentDefinitionNode\n | 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":";;;;;;;;AA6CO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAGa,EAC8B;EAC3C,MAAMK,cAAc,GAClBF,SAAS,CAGTG,QAAQ,EAAED,cAAc;EAE1B,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAE7B;EACb,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,CAAEC,KAAK,IAAKf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC5E","ignoreList":[]}
1
+ {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","_meta__","_fragDef$name","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import {\n ResultOf,\n DocumentTypeDecoration,\n TypedDocumentNode,\n} from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\nexport type FragmentType<\n TDocumentType extends DocumentTypeDecoration<any, any>,\n> =\n TDocumentType extends DocumentTypeDecoration<infer TType, any>\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:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | null\n | 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:\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\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:\n | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>\n | null\n | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (\n queryNode as {\n __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };\n }\n ).__meta__?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as\n | FragmentDefinitionNode\n | 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":";;;;;;;;AA6CO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAGa,EAC8B;EAAA,IAAAK,OAAA,EAAAC,aAAA;EAC3C,MAAMC,cAAc,IAAAF,OAAA,GAClBF,SAAS,CAGTK,QAAQ,cAAAH,OAAA,uBAJaA,OAAA,CAIXE,cAAc;EAE1B,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGL,YAAY,CAACM,WAAW,CAAC,CAAC,CAE7B;EACb,MAAMC,QAAQ,GAAGF,OAAO,aAAPA,OAAO,gBAAAH,aAAA,GAAPG,OAAO,CAAEG,IAAI,cAAAN,aAAA,uBAAbA,aAAA,CAAeO,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAAEC,KAAK,IAAKjB,IAAI,IAAIiB,KAAK,IAAIjB,IAAI,CAAC;AAC5E","ignoreList":[]}
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.graphql = graphql;
7
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; }
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
9
  const documents = {
11
10
  '\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n': types.GetCurrencyStrengthDocument
12
11
  };
13
12
  function graphql(source) {
14
- return documents[source] ?? {};
13
+ var _source;
14
+ return (_source = documents[source]) !== null && _source !== void 0 ? _source : {};
15
15
  }
16
16
  //# sourceMappingURL=gql.js.map
@@ -1 +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","GetCurrencyStrengthDocument","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 GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n':\n types.GetCurrencyStrengthDocument,\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(\n source: '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'\n): (typeof documents)['\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\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>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"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;EAChB,iLAAiL,EAC/KvB,KAAK,CAACwB;AACV,CAAC;AAuBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","documents","GetCurrencyStrengthDocument","graphql","source","_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 GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n':\n types.GetCurrencyStrengthDocument,\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(\n source: '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'\n): (typeof documents)['\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\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>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAanC,MAAMkB,SAAS,GAAG;EAChB,iLAAiL,EAC/KtB,KAAK,CAACuB;AACV,CAAC;AAuBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EAAA,IAAAC,OAAA;EACtC,QAAAA,OAAA,GAAQJ,SAAS,CAASG,MAAM,CAAC,cAAAC,OAAA,cAAAA,OAAA,GAAI,CAAC,CAAC;AACzC","ignoreList":[]}
@@ -7,6 +7,7 @@ import { getCurrencyStrength } from '../gql/getCurrencyStrength';
7
7
  import { Chart } from './components/Chart';
8
8
  import { sortCurrencies } from './components/Chart/formatters';
9
9
  const ChartWithData = _ref => {
10
+ var _data$currencyStrengt, _data$currencyStrengt2, _data$currencyStrengt3, _data$currencyStrengt4, _;
10
11
  let {
11
12
  currency
12
13
  } = _ref;
@@ -24,9 +25,9 @@ const ChartWithData = _ref => {
24
25
  } = useQuery(getCurrencyStrength, {
25
26
  fetchPolicy: 'cache-and-network'
26
27
  });
27
- const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;
28
- const showError = data?.currencyStrength?.length === 0 || error;
29
- const currencyData = currency ? data?.currencyStrength?.filter(item => item.currency === currency) : data?.currencyStrength?.slice().sort(sortCurrencies);
28
+ const showChart = (data === null || data === void 0 ? void 0 : data.currencyStrength) && (data === null || data === void 0 || (_data$currencyStrengt = data.currencyStrength) === null || _data$currencyStrengt === void 0 ? void 0 : _data$currencyStrengt.length) > 0;
29
+ const showError = (data === null || data === void 0 || (_data$currencyStrengt2 = data.currencyStrength) === null || _data$currencyStrengt2 === void 0 ? void 0 : _data$currencyStrengt2.length) === 0 || error;
30
+ const currencyData = currency ? data === null || data === void 0 || (_data$currencyStrengt3 = data.currencyStrength) === null || _data$currencyStrengt3 === void 0 ? void 0 : _data$currencyStrengt3.filter(item => item.currency === currency) : data === null || data === void 0 || (_data$currencyStrengt4 = data.currencyStrength) === null || _data$currencyStrengt4 === void 0 ? void 0 : _data$currencyStrengt4.slice().sort(sortCurrencies);
30
31
  return React.createElement(React.Fragment, null, loading && React.createElement("div", {
31
32
  className: classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
32
33
  'lw-h-[461px]': !currency,
@@ -40,13 +41,16 @@ const ChartWithData = _ref => {
40
41
  'lw-grid-cols-1': !isDesktop || currency
41
42
  }),
42
43
  "data-testid": "currency-strength-chart-wrapper"
43
- }, currencyData && currencyData.map(item => React.createElement("div", {
44
- key: item.currency,
45
- className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
46
- }, React.createElement(Chart, {
47
- currency: item.currency,
48
- values: item.strengthRelation?.slice().sort(sortCurrencies)
49
- })))), !loading && showError && React.createElement("div", {
44
+ }, currencyData && currencyData.map(item => {
45
+ var _item$strengthRelatio;
46
+ return React.createElement("div", {
47
+ key: item.currency,
48
+ className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
49
+ }, React.createElement(Chart, {
50
+ currency: item.currency,
51
+ values: (_item$strengthRelatio = item.strengthRelation) === null || _item$strengthRelatio === void 0 ? void 0 : _item$strengthRelatio.slice().sort(sortCurrencies)
52
+ }));
53
+ })), !loading && showError && React.createElement("div", {
50
54
  className: classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
51
55
  'lw-h-[425px]': !currency,
52
56
  'lw-h-[135px]': currency
@@ -55,7 +59,7 @@ const ChartWithData = _ref => {
55
59
  className: "lw-mt-2 lw-h-8"
56
60
  }, React.createElement(LastUpdated, {
57
61
  labelCallback: lang,
58
- timestamp: data?.currencyStrength[0]?.updatedAt
62
+ timestamp: data === null || data === void 0 || (_ = data.currencyStrength[0]) === null || _ === void 0 ? void 0 : _.updatedAt
59
63
  })));
60
64
  };
61
65
  export { ChartWithData };
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["useQuery","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","useLocale","classnames","React","getCurrencyStrength","Chart","sortCurrencies","ChartWithData","_ref","currency","size","isDesktop","DESKTOP","lang","loading","data","error","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","createElement","Fragment","className","lg","map","key","values","strengthRelation","labelCallback","timestamp","updatedAt"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SAASA,QAAQ,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,EAAEkB;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAAS9B,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"ChartsWithData.js","names":["useQuery","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","useLocale","classnames","React","getCurrencyStrength","Chart","sortCurrencies","ChartWithData","_ref","_data$currencyStrengt","_data$currencyStrengt2","_data$currencyStrengt3","_data$currencyStrengt4","_","currency","size","isDesktop","DESKTOP","lang","loading","data","error","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","createElement","Fragment","className","lg","map","_item$strengthRelatio","key","values","strengthRelation","labelCallback","timestamp","updatedAt"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,+BAA+B;AAG9D,MAAMC,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,CAAA;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAN,IAAA;EAC9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AAI,aAAJA,IAAI,gBAAAP,CAAA,GAAJO,IAAI,CAAEI,gBAAgB,CAAE,CAAC,CAAC,cAAAX,CAAA,uBAA1BA,CAAA,CAA4B8B;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAASpC,aAAa","ignoreList":[]}
@@ -16,9 +16,9 @@ const Main = _ref => {
16
16
  "data-testid": "currency-strength-wrapper"
17
17
  }, React.createElement("div", {
18
18
  className: "lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold"
19
- }, React.createElement("span", null, `${lang('daily')} (${lang('minute', {
19
+ }, React.createElement("span", null, "".concat(lang('daily'), " (").concat(lang('minute', {
20
20
  count: 5
21
- })})`)), React.createElement(ChartWithData, {
21
+ }), ")"))), React.createElement(ChartWithData, {
22
22
  currency: currency
23
23
  })));
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,MAAMC,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAGN,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EAEpC,OACEE,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,IAAI,IACHN,KAAA,CAAAO,aAAA;IAAK,eAAY;EAA2B,GAC1CP,KAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFT,KAAA,CAAAO,aAAA,eAAO,GAAGF,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEK,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNV,KAAA,CAAAO,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","concat","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,MAAMC,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAGN,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EAEpC,OACEE,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,IAAI,IACHN,KAAA,CAAAO,aAAA;IAAK,eAAY;EAA2B,GAC1CP,KAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFT,KAAA,CAAAO,aAAA,kBAAAG,MAAA,CAAUL,IAAI,CAAC,OAAO,CAAC,QAAAK,MAAA,CAAKL,IAAI,CAAC,QAAQ,EAAE;IAAEM,KAAK,EAAE;EAAE,CAAC,CAAC,MAAU,CAC/D,CAAC,EACNX,KAAA,CAAAO,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
@@ -7,11 +7,7 @@ const tooltipFormatter = _ref => {
7
7
  currency,
8
8
  lang
9
9
  } = _ref;
10
- return `
11
- <div>
12
- <div style="margin-bottom:5px;">${currency} ${lang('vs')} ${name}</div>
13
- <div style="display:flex;align-items:center;">${marker} ${value}%</div>
14
- </div>`;
10
+ return "\n<div>\n <div style=\"margin-bottom:5px;\">".concat(currency, " ").concat(lang('vs'), " ").concat(name, "</div>\n <div style=\"display:flex;align-items:center;\">").concat(marker, " ").concat(value, "%</div>\n</div>");
15
11
  };
16
12
  const sortCurrencies = (a, b) => instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);
17
13
  export { sortCurrencies, tooltipFormatter };
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAEP,MAAMG,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDV,iBAAiB,CAACW,OAAO,CAACF,CAAC,CAACH,QAAQ,CAAC,GAAGN,iBAAiB,CAACW,OAAO,CAACD,CAAC,CAACJ,QAAQ,CAAC;AAE/E,SAASE,cAAc,EAAEP,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","concat","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,uDAAAM,MAAA,CAEWF,QAAQ,OAAAE,MAAA,CAAID,IAAI,CAAC,IAAI,CAAC,OAAAC,MAAA,CAAIJ,IAAI,gEAAAI,MAAA,CAChBL,MAAM,OAAAK,MAAA,CAAIH,KAAK;AAAA,CAC1D;AAEP,MAAMI,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDX,iBAAiB,CAACY,OAAO,CAACF,CAAC,CAACJ,QAAQ,CAAC,GAAGN,iBAAiB,CAACY,OAAO,CAACD,CAAC,CAACL,QAAQ,CAAC;AAE/E,SAASG,cAAc,EAAER,gBAAgB","ignoreList":[]}
@@ -23,7 +23,7 @@ export const getOption = _ref => {
23
23
  title: {
24
24
  top: '0px',
25
25
  left: 'center',
26
- text: `${currency} vs`,
26
+ text: "".concat(currency, " vs"),
27
27
  textStyle: {
28
28
  fontSize: 12,
29
29
  lineHeight: 20,
@@ -34,8 +34,8 @@ export const getOption = _ref => {
34
34
  name: 'main-grid',
35
35
  top: '30px',
36
36
  right: '0px',
37
- left: `${Y_LABEL_SIZE}px`,
38
- bottom: `${X_LABEL_SIZE}px`
37
+ left: "".concat(Y_LABEL_SIZE, "px"),
38
+ bottom: "".concat(X_LABEL_SIZE, "px")
39
39
  }],
40
40
  graphic: [...gridLines],
41
41
  tooltip: {
@@ -1 +1 @@
1
- {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","darkBarColors","lightBarColors","X_LABEL_SIZE","Y_LABEL_SIZE","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","top","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n top: '0px',\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,aAAa;AACpB,SAASC,gBAAgB,QAAQ,cAAc;AAG/C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGT,aAAa,GAAGC,cAAc;EAEzD,MAAMgB,SAAS,GAAGpB,YAAY,CAAC;IAC7BY,MAAM;IACNS,UAAU,EAAEnB,WAAW;IACvBoB,WAAW,EAAErB,YAAY;IACzBsB,WAAW,EA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GAAG,EAAEC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACD,GAAG,CAAC,GAAGzC,WAAW,CAAC,CAAC;MACzC4C,GAAG,EAAEF,IAAI,CAACG,IAAI,CAACH,IAAI,CAACE,GAAG,CAAC,GAAG5C,WAAW,CAAC,CAAC;MACxC8C,QAAQ,EAAE,CAAC;MACXV,QAAQ,EAAE;QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTd,SAAS,EAAE,UAAU;QACrBV,QAAQ,EAAE;MACZ;IACF,CAAC;IACDiC,MAAM,EAAE,CACN;MACEd,IAAI,EAAEjC,WAAW;MACjBgC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAO/B,SAAS,CAACoD,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAO/B,SAAS,CAACqD,QAAQ;UAC3B;UACA,OAAOrD,SAAS,CAACsD,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","darkBarColors","lightBarColors","X_LABEL_SIZE","Y_LABEL_SIZE","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","top","left","text","concat","textStyle","fontSize","lineHeight","fontWeight","grid","name","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n top: '0px',\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,aAAa;AACpB,SAASC,gBAAgB,QAAQ,cAAc;AAG/C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGT,aAAa,GAAGC,cAAc;EAEzD,MAAMgB,SAAS,GAAGpB,YAAY,CAAC;IAC7BY,MAAM;IACNS,UAAU,EAAEnB,WAAW;IACvBoB,WAAW,EAAErB,YAAY;IACzBsB,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CAAC;EACf,CAAC,CAAC;EAEF,OAAO;IACLC,SAAS,EAAE,KAAK;IAChBC,KAAK,EAAE;MACLC,GAAG,EAAE,KAAK;MACVC,IAAI,EAAE,QAAQ;MACdC,IAAI,KAAAC,MAAA,CAAKnB,QAAQ,QAAK;MACtBoB,SAAS,EAAE;QACTC,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,EAAE;QACdC,UAAU,EAAE;MACd;IACF,CAAC;IACDC,IAAI,EAAE,CACJ;MACEC,IAAI,EAAE,WAAW;MACjBT,GAAG,EAAE,M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