@oanda/labs-currency-cross-table 1.0.23 → 1.0.25

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 (103) hide show
  1. package/CHANGELOG.md +204 -0
  2. package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +26 -27
  3. package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
  4. package/dist/main/CurrencyCrossTableWidget/Main.js +10 -10
  5. package/dist/main/CurrencyCrossTableWidget/Main.js.map +1 -1
  6. package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
  7. package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
  8. package/dist/main/CurrencyCrossTableWidget/components/Cell.js +1 -1
  9. package/dist/main/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
  10. package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
  11. package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
  12. package/dist/main/CurrencyCrossTableWidget/components/TextCell.js +1 -1
  13. package/dist/main/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
  14. package/dist/main/CurrencyCrossTableWidget/components/types.js.map +1 -1
  15. package/dist/main/CurrencyCrossTableWidget/constant.js.map +1 -1
  16. package/dist/main/CurrencyCrossTableWidget/index.js +8 -8
  17. package/dist/main/CurrencyCrossTableWidget/index.js.map +1 -1
  18. package/dist/main/CurrencyCrossTableWidget/render.js +6 -6
  19. package/dist/main/CurrencyCrossTableWidget/render.js.map +1 -1
  20. package/dist/main/CurrencyCrossTableWidget/types.js.map +1 -1
  21. package/dist/main/CurrencyCrossTableWidget/utils.js.map +1 -1
  22. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  23. package/dist/main/gql/types/gql.js +1 -1
  24. package/dist/main/gql/types/gql.js.map +1 -1
  25. package/dist/main/gql/types/graphql.js +73 -73
  26. package/dist/main/gql/types/graphql.js.map +1 -1
  27. package/dist/main/gql/types/index.js.map +1 -1
  28. package/dist/main/gql/validateInstruments.js +4 -1
  29. package/dist/main/gql/validateInstruments.js.map +1 -1
  30. package/dist/main/translations/index.js +1 -1
  31. package/dist/main/translations/index.js.map +1 -1
  32. package/dist/main/translations/translations.js.map +1 -1
  33. package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +27 -27
  34. package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
  35. package/dist/module/CurrencyCrossTableWidget/Main.js +10 -10
  36. package/dist/module/CurrencyCrossTableWidget/Main.js.map +1 -1
  37. package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
  38. package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
  39. package/dist/module/CurrencyCrossTableWidget/components/Cell.js +1 -1
  40. package/dist/module/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
  41. package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
  42. package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
  43. package/dist/module/CurrencyCrossTableWidget/components/TextCell.js +1 -1
  44. package/dist/module/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
  45. package/dist/module/CurrencyCrossTableWidget/components/types.js.map +1 -1
  46. package/dist/module/CurrencyCrossTableWidget/constant.js +1 -1
  47. package/dist/module/CurrencyCrossTableWidget/constant.js.map +1 -1
  48. package/dist/module/CurrencyCrossTableWidget/index.js +1 -1
  49. package/dist/module/CurrencyCrossTableWidget/index.js.map +1 -1
  50. package/dist/module/CurrencyCrossTableWidget/render.js +6 -6
  51. package/dist/module/CurrencyCrossTableWidget/render.js.map +1 -1
  52. package/dist/module/CurrencyCrossTableWidget/types.js.map +1 -1
  53. package/dist/module/CurrencyCrossTableWidget/utils.js +1 -1
  54. package/dist/module/CurrencyCrossTableWidget/utils.js.map +1 -1
  55. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  56. package/dist/module/gql/types/gql.js +1 -1
  57. package/dist/module/gql/types/gql.js.map +1 -1
  58. package/dist/module/gql/types/graphql.js +73 -73
  59. package/dist/module/gql/types/graphql.js.map +1 -1
  60. package/dist/module/gql/types/index.js +2 -2
  61. package/dist/module/gql/types/index.js.map +1 -1
  62. package/dist/module/gql/validateInstruments.js +4 -1
  63. package/dist/module/gql/validateInstruments.js.map +1 -1
  64. package/dist/module/translations/index.js +1 -1
  65. package/dist/module/translations/index.js.map +1 -1
  66. package/dist/module/translations/translations.js.map +1 -1
  67. package/dist/types/CurrencyCrossTableWidget/CurrencyCrossTableWidget.d.ts +1 -1
  68. package/dist/types/CurrencyCrossTableWidget/Main.d.ts +2 -2
  69. package/dist/types/CurrencyCrossTableWidget/ValidationWrapper.d.ts +1 -1
  70. package/dist/types/CurrencyCrossTableWidget/components/Cell.d.ts +1 -1
  71. package/dist/types/CurrencyCrossTableWidget/components/CellWithData.d.ts +1 -1
  72. package/dist/types/CurrencyCrossTableWidget/components/TextCell.d.ts +1 -1
  73. package/dist/types/CurrencyCrossTableWidget/components/types.d.ts +2 -2
  74. package/dist/types/CurrencyCrossTableWidget/constant.d.ts +1 -1
  75. package/dist/types/CurrencyCrossTableWidget/index.d.ts +1 -1
  76. package/dist/types/CurrencyCrossTableWidget/types.d.ts +2 -2
  77. package/dist/types/CurrencyCrossTableWidget/utils.d.ts +3 -3
  78. package/dist/types/gql/types/gql.d.ts +2 -2
  79. package/dist/types/gql/types/index.d.ts +2 -2
  80. package/dist/types/translations/index.d.ts +2 -2
  81. package/package.json +3 -3
  82. package/src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx +28 -31
  83. package/src/CurrencyCrossTableWidget/Main.tsx +21 -28
  84. package/src/CurrencyCrossTableWidget/ValidationWrapper.tsx +28 -21
  85. package/src/CurrencyCrossTableWidget/components/Cell.tsx +11 -8
  86. package/src/CurrencyCrossTableWidget/components/CellWithData.tsx +24 -15
  87. package/src/CurrencyCrossTableWidget/components/TextCell.tsx +14 -9
  88. package/src/CurrencyCrossTableWidget/components/types.ts +3 -2
  89. package/src/CurrencyCrossTableWidget/constant.ts +13 -4
  90. package/src/CurrencyCrossTableWidget/index.ts +1 -1
  91. package/src/CurrencyCrossTableWidget/render.tsx +44 -30
  92. package/src/CurrencyCrossTableWidget/types.tsx +3 -2
  93. package/src/CurrencyCrossTableWidget/utils.ts +10 -7
  94. package/src/gql/types/fragment-masking.ts +41 -21
  95. package/src/gql/types/gql.ts +7 -3
  96. package/src/gql/types/graphql.ts +129 -47
  97. package/src/gql/types/index.ts +2 -2
  98. package/src/gql/validateInstruments.ts +4 -1
  99. package/src/translations/index.ts +4 -4
  100. package/src/translations/translations.ts +2 -1
  101. package/test/Main.test.tsx +25 -11
  102. package/test/mocks.ts +23 -14
  103. package/test/utils.test.ts +119 -19
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyCrossTableWidget.js","names":["React","Suspense","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","renderComponent","translations","ValidationWrapper","Division","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options","Component","linkArea"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n LiveRatesProvider, ThemeProvider, getLocale,\n renderComponent,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme}>\n {renderComponent({\n Component: <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />,\n logoLink,\n linkArea: 'full',\n })}\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,EAC3CC,eAAe,QACV,2BAA2B;AAClC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAMC,wBAAwB,GAAGC,IAAA,IAUD;EAAA,IAVE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC;EACwB,CAAC,GAAAT,IAAA;EACzB,MAAMU,MAAM,GAAG,IAAItB,YAAY,CAAC;IAC9BuB,GAAG,EAAEV,UAAU;IACfW,KAAK,EAAE,IAAIvB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMwB,YAAY,GAAGT,QAAQ,KAAKN,QAAQ,CAACgB,GAAG,GAAGhB,QAAQ,CAACiB,GAAG,GAAGX,QAAQ;EACxE,MAAMY,UAAU,GAAGH,YAAY,KAAKf,QAAQ,CAACiB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE7B,KAAA,CAAA+B,aAAA,CAAC1B,cAAc;IAACc,MAAM,EAAEX,SAAS,CAACW,MAAM,CAAE;IAACT,YAAY,EAAEA;EAAa,GACpEV,KAAA,CAAA+B,aAAA,CAACzB,iBAAiB;IAChB0B,GAAG,EAAEhB,YAAa;IAClBiB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC9B,KAAA,CAAA+B,aAAA,CAAC3B,cAAc;IAACoB,MAAM,EAAEA;EAAO,GAC7BxB,KAAA,CAAA+B,aAAA,CAAC9B,QAAQ,QACPD,KAAA,CAAA+B,aAAA,CAACxB,aAAa;IAACe,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA;EAAM,GACvDX,eAAe,CAAC;IACfyB,SAAS,EAAElC,KAAA,CAAA+B,aAAA,CAACpB,iBAAiB;MAC3BM,UAAU,EAAEA,UAAW;MACvBC,QAAQ,EAAEA,QAAS;MACnBG,YAAY,EAAEA;IAAa,CAC5B,CAAC;IACFE,QAAQ;IACRY,QAAQ,EAAE;EACZ,CAAC,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAED,SAAStB,wBAAwB","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyCrossTableWidget.js","names":["ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","React","Division","translations","ValidationWrapper","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","withSuspense","liveRates","url","options","styling","linkArea"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { Division } from '../gql/types/graphql';\nimport { translations } from '../translations';\nimport type { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper linkArea=\"full\" logoLink={logoLink}>\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AACzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,wBAAwB,GAAGC,IAAA,IAUD;EAAA,IAVE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC;EACwB,CAAC,GAAAT,IAAA;EACzB,MAAMU,MAAM,GAAG,IAAInB,YAAY,CAAC;IAC9BoB,GAAG,EAAEV,UAAU;IACfW,KAAK,EAAE,IAAIpB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMqB,YAAY,GAAGT,QAAQ,KAAKR,QAAQ,CAACkB,GAAG,GAAGlB,QAAQ,CAACmB,GAAG,GAAGX,QAAQ;EACxE,MAAMY,UAAU,GAAGH,YAAY,KAAKjB,QAAQ,CAACmB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACEpB,KAAA,CAAAsB,aAAA,CAACxB,cAAc;IACbyB,YAAY;IACZR,MAAM,EAAEA,MAAO;IACfS,SAAS,EAAE;MACTC,GAAG,EAAElB,YAAY;MACjBmB,OAAO,EAAE;QAAER,YAAY;QAAEG;MAAW;IACtC,CAAE;IACFX,MAAM,EAAEA,MAAO;IACfiB,OAAO,EAAE;MACPd;IACF,CAAE;IACFF,KAAK,EAAEA,KAAM;IACbT,YAAY,EAAEA;EAAa,GAE3BF,KAAA,CAAAsB,aAAA,CAACvB,aAAa;IAAC6B,QAAQ,EAAC,MAAM;IAACd,QAAQ,EAAEA;EAAS,GAChDd,KAAA,CAAAsB,aAAA,CAACnB,iBAAiB;IAChBK,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAED,SAASR,wBAAwB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import React, { Fragment, useEffect, useState } from 'react';
2
1
  import { useLiveRatesQuery } from '@oanda/labs-widget-common';
2
+ import React, { Fragment, useEffect, useState } from 'react';
3
3
  import { CellWithData, TextCell } from './components';
4
4
  import { divisionMapper } from './utils';
5
5
  const Main = _ref => {
@@ -20,33 +20,33 @@ const Main = _ref => {
20
20
  });
21
21
  }, validInstruments);
22
22
  return React.createElement("div", {
23
- "data-testid": "currency-cross-table-wrapper",
24
- className: "lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary"
23
+ className: "lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary",
24
+ "data-testid": "currency-cross-table-wrapper"
25
25
  }, React.createElement("div", {
26
26
  className: "lw-flex lw-w-max lw-min-w-full"
27
27
  }, React.createElement(TextCell, {
28
28
  sticky: true
29
29
  }), currencies.map(pair => React.createElement(TextCell, {
30
30
  key: pair,
31
- label: pair,
32
- hovered: pair === selectedPair
31
+ hovered: pair === selectedPair,
32
+ label: pair
33
33
  }))), currencies.map((currency, index, arr) => React.createElement("div", {
34
34
  key: currency,
35
35
  className: "lw-flex lw-w-max lw-min-w-full"
36
36
  }, React.createElement(TextCell, {
37
- label: currency,
37
+ sticky: true,
38
38
  hovered: currency === selectedCurrency,
39
- sticky: true
39
+ label: currency
40
40
  }), arr.map(pair => React.createElement(Fragment, {
41
41
  key: `${currency}_${pair}`
42
42
  }, currency !== pair ? React.createElement(CellWithData, {
43
43
  currency: currency,
44
- pair: pair,
44
+ division: division,
45
45
  isValid: validInstruments.includes(`${currency}${divisionMapper(division)}${pair}`),
46
- target: target,
46
+ pair: pair,
47
47
  setSelectedCurrency: setSelectedCurrency,
48
48
  setSelectedPair: setSelectedPair,
49
- division: division
49
+ target: target
50
50
  }) : React.createElement(TextCell, {
51
51
  emptyIndicator: true
52
52
  }))))));
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["React","Fragment","useEffect","useState","useLiveRatesQuery","CellWithData","TextCell","divisionMapper","Main","_ref","currencies","validInstruments","division","selectedCurrency","setSelectedCurrency","selectedPair","setSelectedPair","target","setQuery","instruments","createElement","className","sticky","map","pair","key","label","hovered","currency","index","arr","isValid","includes","emptyIndicator"],"sources":["../../../src/CurrencyCrossTableWidget/Main.tsx"],"sourcesContent":["import React, {\n Fragment, useEffect, useState,\n} from 'react';\nimport { useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { MainProps } from './types';\nimport { CellWithData, TextCell } from './components';\nimport { divisionMapper } from './utils';\n\nconst Main = ({\n currencies,\n validInstruments,\n division,\n}: MainProps) => {\n const [selectedCurrency, setSelectedCurrency] = useState('');\n const [selectedPair, setSelectedPair] = useState('');\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n setQuery({ instruments: validInstruments });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, validInstruments);\n\n return (\n <div data-testid=\"currency-cross-table-wrapper\" className=\"lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary\">\n <div className=\"lw-flex lw-w-max lw-min-w-full\">\n <TextCell sticky />\n {currencies.map(((pair) => (\n <TextCell\n key={pair}\n label={pair}\n hovered={pair === selectedPair}\n />\n )))}\n </div>\n {currencies.map(((currency, index, arr) => (\n <div\n key={currency}\n className=\"lw-flex lw-w-max lw-min-w-full\"\n >\n <TextCell\n label={currency}\n hovered={currency === selectedCurrency}\n sticky\n />\n {arr.map((pair) => (\n <Fragment key={`${currency}_${pair}`}>\n {currency !== pair ? (\n <CellWithData\n currency={currency}\n pair={pair}\n isValid={validInstruments.includes(`${currency}${divisionMapper(division)}${pair}`)}\n target={target}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n division={division}\n />\n ) : (\n <TextCell emptyIndicator />\n )}\n </Fragment>\n ))}\n </div>\n )))}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QACxB,OAAO;AACd,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,YAAY,EAAEC,QAAQ,QAAQ,cAAc;AACrD,SAASC,cAAc,QAAQ,SAAS;AAExC,MAAMC,IAAI,GAAGC,IAAA,IAII;EAAA,IAJH;IACZC,UAAU;IACVC,gBAAgB;IAChBC;EACS,CAAC,GAAAH,IAAA;EACV,MAAM,CAACI,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EAC5D,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,GAAGb,QAAQ,CAAC,EAAE,CAAC;EACpD,MAAM;IAAEc,MAAM;IAAEC;EAAS,CAAC,GAAGd,iBAAiB,CAAC,CAAC;EAEhDF,SAAS,CAAC,MAAM;IACdgB,QAAQ,CAAC;MAAEC,WAAW,EAAER;IAAiB,CAAC,CAAC;EAE7C,CAAC,EAAEA,gBAAgB,CAAC;EAEpB,OACEX,KAAA,CAAAoB,aAAA;IAAK,eAAY,8BAA8B;IAACC,SAAS,EAAC;EAAoH,GAC5KrB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC;EAAgC,GAC7CrB,KAAA,CAAAoB,aAAA,CAACd,QAAQ;IAACgB,MAAM;EAAA,CAAE,CAAC,EAClBZ,UAAU,CAACa,GAAG,CAAGC,IAAI,IACpBxB,KAAA,CAAAoB,aAAA,CAACd,QAAQ;IACPmB,GAAG,EAAED,IAAK;IACVE,KAAK,EAAEF,IAAK;IACZG,OAAO,EAAEH,IAAI,KAAKT;EAAa,CAChC,CACD,CACC,CAAC,EACLL,UAAU,CAACa,GAAG,CAAE,CAACK,QAAQ,EAAEC,KAAK,EAAEC,GAAG,KACpC9B,KAAA,CAAAoB,aAAA;IACEK,GAAG,EAAEG,QAAS;IACdP,SAAS,EAAC;EAAgC,GAE1CrB,KAAA,CAAAoB,aAAA,CAACd,QAAQ;IACPoB,KAAK,EAAEE,QAAS;IAChBD,OAAO,EAAEC,QAAQ,KAAKf,gBAAiB;IACvCS,MAAM;EAAA,CACP,CAAC,EACDQ,GAAG,CAACP,GAAG,CAAEC,IAAI,IACZxB,KAAA,CAAAoB,aAAA,CAACnB,QAAQ;IAACwB,GAAG,EAAE,GAAGG,QAAQ,IAAIJ,IAAI;EAAG,GAClCI,QAAQ,KAAKJ,IAAI,GAChBxB,KAAA,CAAAoB,aAAA,CAACf,YAAY;IACXuB,QAAQ,EAAEA,QAAS;IACnBJ,IAAI,EAAEA,IAAK;IACXO,OAAO,EAAEpB,gBAAgB,CAACqB,QAAQ,CAAC,GAAGJ,QAAQ,GAAGrB,cAAc,CAACK,QAAQ,CAAC,GAAGY,IAAI,EAAE,CAAE;IACpFP,MAAM,EAAEA,MAAO;IACfH,mBAAmB,EAAEA,mBAAoB;IACzCE,eAAe,EAAEA,eAAgB;IACjCJ,QAAQ,EAAEA;EAAS,CACpB,CAAC,GAEFZ,KAAA,CAAAoB,aAAA,CAACd,QAAQ;IAAC2B,cAAc;EAAA,CAAE,CAEpB,CACX,CACE,CACL,CACC,CAAC;AAEV,CAAC;AAED,SAASzB,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["useLiveRatesQuery","React","Fragment","useEffect","useState","CellWithData","TextCell","divisionMapper","Main","_ref","currencies","validInstruments","division","selectedCurrency","setSelectedCurrency","selectedPair","setSelectedPair","target","setQuery","instruments","createElement","className","sticky","map","pair","key","hovered","label","currency","index","arr","isValid","includes","emptyIndicator"],"sources":["../../../src/CurrencyCrossTableWidget/Main.tsx"],"sourcesContent":["import { useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport React, { Fragment, useEffect, useState } from 'react';\n\nimport { CellWithData, TextCell } from './components';\nimport type { MainProps } from './types';\nimport { divisionMapper } from './utils';\n\nconst Main = ({ currencies, validInstruments, division }: MainProps) => {\n const [selectedCurrency, setSelectedCurrency] = useState('');\n const [selectedPair, setSelectedPair] = useState('');\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n setQuery({ instruments: validInstruments });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, validInstruments);\n\n return (\n <div\n className=\"lw-w-full lw-overflow-x-auto lw-overflow-y-hidden lw-border lw-border-b-0 lw-border-solid lw-border-border-primary\"\n data-testid=\"currency-cross-table-wrapper\"\n >\n <div className=\"lw-flex lw-w-max lw-min-w-full\">\n <TextCell sticky />\n {currencies.map((pair) => (\n <TextCell key={pair} hovered={pair === selectedPair} label={pair} />\n ))}\n </div>\n {currencies.map((currency, index, arr) => (\n <div key={currency} className=\"lw-flex lw-w-max lw-min-w-full\">\n <TextCell\n sticky\n hovered={currency === selectedCurrency}\n label={currency}\n />\n {arr.map((pair) => (\n <Fragment key={`${currency}_${pair}`}>\n {currency !== pair ? (\n <CellWithData\n currency={currency}\n division={division}\n isValid={validInstruments.includes(\n `${currency}${divisionMapper(division)}${pair}`\n )}\n pair={pair}\n setSelectedCurrency={setSelectedCurrency}\n setSelectedPair={setSelectedPair}\n target={target}\n />\n ) : (\n <TextCell emptyIndicator />\n )}\n </Fragment>\n ))}\n </div>\n ))}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,OAAOC,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE5D,SAASC,YAAY,EAAEC,QAAQ,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,SAAS;AAExC,MAAMC,IAAI,GAAGC,IAAA,IAA2D;EAAA,IAA1D;IAAEC,UAAU;IAAEC,gBAAgB;IAAEC;EAAoB,CAAC,GAAAH,IAAA;EACjE,MAAM,CAACI,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGV,QAAQ,CAAC,EAAE,CAAC;EAC5D,MAAM,CAACW,YAAY,EAAEC,eAAe,CAAC,GAAGZ,QAAQ,CAAC,EAAE,CAAC;EACpD,MAAM;IAAEa,MAAM;IAAEC;EAAS,CAAC,GAAGlB,iBAAiB,CAAC,CAAC;EAEhDG,SAAS,CAAC,MAAM;IACde,QAAQ,CAAC;MAAEC,WAAW,EAAER;IAAiB,CAAC,CAAC;EAE7C,CAAC,EAAEA,gBAAgB,CAAC;EAEpB,OACEV,KAAA,CAAAmB,aAAA;IACEC,SAAS,EAAC,oHAAoH;IAC9H,eAAY;EAA8B,GAE1CpB,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAC;EAAgC,GAC7CpB,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IAACgB,MAAM;EAAA,CAAE,CAAC,EAClBZ,UAAU,CAACa,GAAG,CAAEC,IAAI,IACnBvB,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IAACmB,GAAG,EAAED,IAAK;IAACE,OAAO,EAAEF,IAAI,KAAKT,YAAa;IAACY,KAAK,EAAEH;EAAK,CAAE,CACpE,CACE,CAAC,EACLd,UAAU,CAACa,GAAG,CAAC,CAACK,QAAQ,EAAEC,KAAK,EAAEC,GAAG,KACnC7B,KAAA,CAAAmB,aAAA;IAAKK,GAAG,EAAEG,QAAS;IAACP,SAAS,EAAC;EAAgC,GAC5DpB,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IACPgB,MAAM;IACNI,OAAO,EAAEE,QAAQ,KAAKf,gBAAiB;IACvCc,KAAK,EAAEC;EAAS,CACjB,CAAC,EACDE,GAAG,CAACP,GAAG,CAAEC,IAAI,IACZvB,KAAA,CAAAmB,aAAA,CAAClB,QAAQ;IAACuB,GAAG,EAAE,GAAGG,QAAQ,IAAIJ,IAAI;EAAG,GAClCI,QAAQ,KAAKJ,IAAI,GAChBvB,KAAA,CAAAmB,aAAA,CAACf,YAAY;IACXuB,QAAQ,EAAEA,QAAS;IACnBhB,QAAQ,EAAEA,QAAS;IACnBmB,OAAO,EAAEpB,gBAAgB,CAACqB,QAAQ,CAChC,GAAGJ,QAAQ,GAAGrB,cAAc,CAACK,QAAQ,CAAC,GAAGY,IAAI,EAC/C,CAAE;IACFA,IAAI,EAAEA,IAAK;IACXV,mBAAmB,EAAEA,mBAAoB;IACzCE,eAAe,EAAEA,eAAgB;IACjCC,MAAM,EAAEA;EAAO,CAChB,CAAC,GAEFhB,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IAAC2B,cAAc;EAAA,CAAE,CAEpB,CACX,CACE,CACN,CACE,CAAC;AAEV,CAAC;AAED,SAASzB,IAAI","ignoreList":[]}
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import classnames from 'classnames';
3
- import { ChartError } from '@oanda/labs-widget-common';
4
1
  import { useSuspenseQuery } from '@apollo/client';
2
+ import { ChartError } from '@oanda/labs-widget-common';
3
+ import classnames from 'classnames';
4
+ import React from 'react';
5
5
  import { validateInstruments } from '../gql/validateInstruments';
6
- import { currenciesToInstruments, validCurrencies } from './utils';
7
6
  import { Main } from './Main';
7
+ import { currenciesToInstruments, validCurrencies } from './utils';
8
8
  const ValidationWrapper = _ref => {
9
9
  let {
10
10
  currencies,
@@ -28,9 +28,9 @@ const ValidationWrapper = _ref => {
28
28
  return React.createElement(React.Fragment, null, React.createElement("div", {
29
29
  className: "lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary"
30
30
  }, !showError && React.createElement(Main, {
31
- validInstruments: validInstruments,
32
31
  currencies: currencies,
33
- division: division
32
+ division: division,
33
+ validInstruments: validInstruments
34
34
  }), showError && React.createElement("div", {
35
35
  className: classnames('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')
36
36
  }, React.createElement(ChartError, null))));
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationWrapper.js","names":["React","classnames","ChartError","useSuspenseQuery","validateInstruments","currenciesToInstruments","validCurrencies","Main","ValidationWrapper","_ref","currencies","division","isParamError","instruments","data","error","variables","fetchPolicy","errorPolicy","validInstruments","resolveInstrumentsByDivision","map","instrument","name","showError","length","createElement","Fragment","className"],"sources":["../../../src/CurrencyCrossTableWidget/ValidationWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { ChartError } from '@oanda/labs-widget-common';\nimport { useSuspenseQuery } from '@apollo/client';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { currenciesToInstruments, validCurrencies } from './utils';\nimport { ValidationWrapperProps } from './types';\nimport { Main } from './Main';\n\nconst ValidationWrapper = ({\n currencies,\n division,\n isParamError,\n}: ValidationWrapperProps) => {\n const instruments = currenciesToInstruments(currencies, division);\n\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const validInstruments = data\n ?.resolveInstrumentsByDivision\n ?.map((instrument) => instrument.name);\n const showError = !validCurrencies(currencies)\n || isParamError\n || error\n || !validInstruments\n || validInstruments.length === 0;\n\n return (\n <>\n <div\n className=\"lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary\"\n >\n {!showError && (\n <Main\n validInstruments={validInstruments}\n currencies={currencies}\n division={division}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary')}>\n <ChartError />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,SAAS;AAElE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,MAAMC,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,UAAU;IACVC,QAAQ;IACRC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAMI,WAAW,GAAGR,uBAAuB,CAACK,UAAU,EAAEC,QAAQ,CAAC;EAEjE,MAAM;IAAEG,IAAI;IAAEC;EAAM,CAAC,GAAGZ,gBAAgB,CAGtCC,mBAAmB,EAAE;IACrBY,SAAS,EAAE;MACTH,WAAW;MACXF;IACF,CAAC;IACDM,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,gBAAgB,GAAGL,IAAI,EACzBM,4BAA4B,EAC5BC,GAAG,CAAEC,UAAU,IAAKA,UAAU,CAACC,IAAI,CAAC;EACxC,MAAMC,SAAS,GAAG,CAAClB,eAAe,CAACI,UAAU,CAAC,IACzCE,YAAY,IACZG,KAAK,IACL,CAACI,gBAAgB,IACjBA,gBAAgB,CAACM,MAAM,KAAK,CAAC;EAElC,OACEzB,KAAA,CAAA0B,aAAA,CAAA1B,KAAA,CAAA2B,QAAA,QACE3B,KAAA,CAAA0B,aAAA;IACEE,SAAS,EAAC;EAAsE,GAE/E,CAACJ,SAAS,IACTxB,KAAA,CAAA0B,aAAA,CAACnB,IAAI;IACHY,gBAAgB,EAAEA,gBAAiB;IACnCT,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA;EAAS,CACpB,CACF,EACAa,SAAS,IACRxB,KAAA,CAAA0B,aAAA;IAAKE,SAAS,EAAE3B,UAAU,CAAC,mGAAmG;EAAE,GAC9HD,KAAA,CAAA0B,aAAA,CAACxB,UAAU,MAAE,CACV,CAEJ,CACL,CAAC;AAEP,CAAC;AAED,SAASM,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"ValidationWrapper.js","names":["useSuspenseQuery","ChartError","classnames","React","validateInstruments","Main","currenciesToInstruments","validCurrencies","ValidationWrapper","_ref","currencies","division","isParamError","instruments","data","error","variables","fetchPolicy","errorPolicy","validInstruments","resolveInstrumentsByDivision","map","instrument","name","showError","length","createElement","Fragment","className"],"sources":["../../../src/CurrencyCrossTableWidget/ValidationWrapper.tsx"],"sourcesContent":["import { useSuspenseQuery } from '@apollo/client';\nimport { ChartError } from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport type {\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { Main } from './Main';\nimport type { ValidationWrapperProps } from './types';\nimport { currenciesToInstruments, validCurrencies } from './utils';\n\nconst ValidationWrapper = ({\n currencies,\n division,\n isParamError,\n}: ValidationWrapperProps) => {\n const instruments = currenciesToInstruments(currencies, division);\n\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const validInstruments = data?.resolveInstrumentsByDivision?.map(\n (instrument) => instrument.name\n );\n const showError =\n !validCurrencies(currencies) ||\n isParamError ||\n error ||\n !validInstruments ||\n validInstruments.length === 0;\n\n return (\n <>\n <div className=\"lw-flex lw-w-full lw-text-sm lw-tracking-normal lw-text-text-primary\">\n {!showError && (\n <Main\n currencies={currencies}\n division={division}\n validInstruments={validInstruments}\n />\n )}\n {showError && (\n <div\n className={classnames(\n 'lw-flex lw-h-[250px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary'\n )}\n >\n <ChartError />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,UAAU,QAAQ,2BAA2B;AACtD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAMzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,SAAS;AAElE,MAAMC,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,UAAU;IACVC,QAAQ;IACRC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAMI,WAAW,GAAGP,uBAAuB,CAACI,UAAU,EAAEC,QAAQ,CAAC;EAEjE,MAAM;IAAEG,IAAI;IAAEC;EAAM,CAAC,GAAGf,gBAAgB,CAGtCI,mBAAmB,EAAE;IACrBY,SAAS,EAAE;MACTH,WAAW;MACXF;IACF,CAAC;IACDM,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,gBAAgB,GAAGL,IAAI,EAAEM,4BAA4B,EAAEC,GAAG,CAC7DC,UAAU,IAAKA,UAAU,CAACC,IAC7B,CAAC;EACD,MAAMC,SAAS,GACb,CAACjB,eAAe,CAACG,UAAU,CAAC,IAC5BE,YAAY,IACZG,KAAK,IACL,CAACI,gBAAgB,IACjBA,gBAAgB,CAACM,MAAM,KAAK,CAAC;EAE/B,OACEtB,KAAA,CAAAuB,aAAA,CAAAvB,KAAA,CAAAwB,QAAA,QACExB,KAAA,CAAAuB,aAAA;IAAKE,SAAS,EAAC;EAAsE,GAClF,CAACJ,SAAS,IACTrB,KAAA,CAAAuB,aAAA,CAACrB,IAAI;IACHK,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBQ,gBAAgB,EAAEA;EAAiB,CACpC,CACF,EACAK,SAAS,IACRrB,KAAA,CAAAuB,aAAA;IACEE,SAAS,EAAE1B,UAAU,CACnB,mGACF;EAAE,GAEFC,KAAA,CAAAuB,aAAA,CAACzB,UAAU,MAAE,CACV,CAEJ,CACL,CAAC;AAEP,CAAC;AAED,SAASO,iBAAiB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import classnames from 'classnames';
2
+ import React from 'react';
3
3
  import { CELL_EMPTY_VALUE, CELL_LOADING_VALUE } from '../constant';
4
4
  const Cell = _ref => {
5
5
  let {
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.js","names":["React","classnames","CELL_EMPTY_VALUE","CELL_LOADING_VALUE","Cell","_ref","children","isError","isLoading","hovered","mouseEnterHandler","mouseLeaveHandler","createElement","className","onMouseEnter","onMouseLeave"],"sources":["../../../../src/CurrencyCrossTableWidget/components/Cell.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { CellProps } from './types';\nimport { CELL_EMPTY_VALUE, CELL_LOADING_VALUE } from '../constant';\n\nconst Cell = ({\n children,\n isError,\n isLoading,\n hovered,\n mouseEnterHandler,\n mouseLeaveHandler,\n}: CellProps) => (\n <div\n className={classnames('lw-flex lw-h-11 lw-min-w-[70px] lw-flex-1 lw-items-center lw-justify-center lw-border-b lw-border-r lw-border-solid lw-border-border-primary last:lw-border-r-[0px]', {\n 'lw-bg-border-primary lw-font-semibold lw-shadow-innerBorderBgColor': hovered,\n })}\n onMouseEnter={mouseEnterHandler}\n onMouseLeave={mouseLeaveHandler}\n >\n {isLoading && <div className=\"lw-px-3 lw-py-3.5\">{CELL_LOADING_VALUE}</div>}\n {!isLoading && !isError && children}\n {!isLoading && isError && (\n <span>{CELL_EMPTY_VALUE}</span>\n )}\n </div>\n);\n\nexport { Cell };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,aAAa;AAElE,MAAMC,IAAI,GAAGC,IAAA;EAAA,IAAC;IACZC,QAAQ;IACRC,OAAO;IACPC,SAAS;IACTC,OAAO;IACPC,iBAAiB;IACjBC;EACS,CAAC,GAAAN,IAAA;EAAA,OACVL,KAAA,CAAAY,aAAA;IACEC,SAAS,EAAEZ,UAAU,CAAC,qKAAqK,EAAE;MAC3L,oEAAoE,EAAEQ;IACxE,CAAC,CAAE;IACHK,YAAY,EAAEJ,iBAAkB;IAChCK,YAAY,EAAEJ;EAAkB,GAE/BH,SAAS,IAAIR,KAAA,CAAAY,aAAA;IAAKC,SAAS,EAAC;EAAmB,GAAEV,kBAAwB,CAAC,EAC1E,CAACK,SAAS,IAAI,CAACD,OAAO,IAAID,QAAQ,EAClC,CAACE,SAAS,IAAID,OAAO,IACpBP,KAAA,CAAAY,aAAA,eAAOV,gBAAuB,CAE7B,CAAC;AAAA,CACP;AAED,SAASE,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Cell.js","names":["classnames","React","CELL_EMPTY_VALUE","CELL_LOADING_VALUE","Cell","_ref","children","isError","isLoading","hovered","mouseEnterHandler","mouseLeaveHandler","createElement","className","onMouseEnter","onMouseLeave"],"sources":["../../../../src/CurrencyCrossTableWidget/components/Cell.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { CELL_EMPTY_VALUE, CELL_LOADING_VALUE } from '../constant';\nimport type { CellProps } from './types';\n\nconst Cell = ({\n children,\n isError,\n isLoading,\n hovered,\n mouseEnterHandler,\n mouseLeaveHandler,\n}: CellProps) => (\n <div\n className={classnames(\n 'lw-flex lw-h-11 lw-min-w-[70px] lw-flex-1 lw-items-center lw-justify-center lw-border-b lw-border-r lw-border-solid lw-border-border-primary last:lw-border-r-[0px]',\n {\n 'lw-bg-border-primary lw-font-semibold lw-shadow-innerBorderBgColor':\n hovered,\n }\n )}\n onMouseEnter={mouseEnterHandler}\n onMouseLeave={mouseLeaveHandler}\n >\n {isLoading && <div className=\"lw-px-3 lw-py-3.5\">{CELL_LOADING_VALUE}</div>}\n {!isLoading && !isError && children}\n {!isLoading && isError && <span>{CELL_EMPTY_VALUE}</span>}\n </div>\n);\n\nexport { Cell };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,aAAa;AAGlE,MAAMC,IAAI,GAAGC,IAAA;EAAA,IAAC;IACZC,QAAQ;IACRC,OAAO;IACPC,SAAS;IACTC,OAAO;IACPC,iBAAiB;IACjBC;EACS,CAAC,GAAAN,IAAA;EAAA,OACVJ,KAAA,CAAAW,aAAA;IACEC,SAAS,EAAEb,UAAU,CACnB,qKAAqK,EACrK;MACE,oEAAoE,EAClES;IACJ,CACF,CAAE;IACFK,YAAY,EAAEJ,iBAAkB;IAChCK,YAAY,EAAEJ;EAAkB,GAE/BH,SAAS,IAAIP,KAAA,CAAAW,aAAA;IAAKC,SAAS,EAAC;EAAmB,GAAEV,kBAAwB,CAAC,EAC1E,CAACK,SAAS,IAAI,CAACD,OAAO,IAAID,QAAQ,EAClC,CAACE,SAAS,IAAID,OAAO,IAAIN,KAAA,CAAAW,aAAA,eAAOV,gBAAuB,CACrD,CAAC;AAAA,CACP;AAED,SAASE,IAAI","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import React, { useState } from 'react';
2
1
  import { Price, useLiveRatesMessage } from '@oanda/labs-widget-common';
3
- import { Cell } from './Cell';
2
+ import React, { useState } from 'react';
4
3
  import { divisionMapper, getBuyPrice, getPriceMovement } from '../utils';
4
+ import { Cell } from './Cell';
5
5
  const CellWithData = _ref => {
6
6
  let {
7
7
  currency,
@@ -26,7 +26,7 @@ const CellWithData = _ref => {
26
26
  buyPriceMovement: update?.askPriceMovement,
27
27
  displayPrecision: currency === 'JPY' && !isValid ? 6 : update?.displayPrecision
28
28
  };
29
- const checkLoading = id => !liveRatesError && updatedRecord?.[id] === undefined;
29
+ const checkLoading = () => !liveRatesError && updatedRecord.buy === undefined;
30
30
  const handleMouseEnter = () => {
31
31
  setHovered(true);
32
32
  setSelectedCurrency(currency);
@@ -38,14 +38,14 @@ const CellWithData = _ref => {
38
38
  setSelectedPair('');
39
39
  };
40
40
  return React.createElement(Cell, {
41
- isLoading: checkLoading('buy'),
42
- isError: !!liveRatesError,
43
41
  hovered: hovered,
42
+ isError: !!liveRatesError,
43
+ isLoading: checkLoading(),
44
44
  mouseEnterHandler: handleMouseEnter,
45
45
  mouseLeaveHandler: handleMouseLeave
46
46
  }, React.createElement(Price, {
47
- priceMovement: getPriceMovement(updatedRecord.buyPriceMovement, !isValid),
48
- movementIndicator: "background"
47
+ movementIndicator: "background",
48
+ priceMovement: getPriceMovement(updatedRecord.buyPriceMovement, !isValid)
49
49
  }, React.createElement("span", null, getBuyPrice(updatedRecord.buy, !isValid).toFixed(updatedRecord.displayPrecision))));
50
50
  };
51
51
  export { CellWithData };
@@ -1 +1 @@
1
- {"version":3,"file":"CellWithData.js","names":["React","useState","Price","useLiveRatesMessage","Cell","divisionMapper","getBuyPrice","getPriceMovement","CellWithData","_ref","currency","pair","isValid","target","division","setSelectedCurrency","setSelectedPair","hovered","setHovered","instrument","instrumentForUpdates","update","error","liveRatesError","updatedRecord","displayName","buy","ask","buyPriceMovement","askPriceMovement","displayPrecision","checkLoading","id","undefined","handleMouseEnter","handleMouseLeave","createElement","isLoading","isError","mouseEnterHandler","mouseLeaveHandler","priceMovement","movementIndicator","toFixed"],"sources":["../../../../src/CurrencyCrossTableWidget/components/CellWithData.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Price, useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport { Cell } from './Cell';\nimport { CellWithDataProps } from './types';\nimport { divisionMapper, getBuyPrice, getPriceMovement } from '../utils';\n\nconst CellWithData = ({\n currency,\n pair,\n isValid,\n target,\n division,\n setSelectedCurrency,\n setSelectedPair,\n}: CellWithDataProps) => {\n const [hovered, setHovered] = useState(false);\n\n const instrument = `${currency}${divisionMapper(division)}${pair}`;\n const instrumentForUpdates = isValid ? instrument : `${pair}${divisionMapper(division)}${currency}`;\n\n const { update, error: liveRatesError } = useLiveRatesMessage(\n instrumentForUpdates,\n target,\n );\n\n const updatedRecord: Record<string, any> = {\n displayName: `${currency}/${pair}`,\n instrument,\n buy: update?.ask,\n buyPriceMovement: update?.askPriceMovement,\n displayPrecision: currency === 'JPY' && !isValid ? 6 : update?.displayPrecision,\n };\n\n const checkLoading = (id: string) => (!liveRatesError && updatedRecord?.[id] === undefined);\n\n const handleMouseEnter = () => {\n setHovered(true);\n setSelectedCurrency(currency);\n setSelectedPair(pair);\n };\n\n const handleMouseLeave = () => {\n setHovered(false);\n setSelectedCurrency('');\n setSelectedPair('');\n };\n\n return (\n <Cell\n isLoading={checkLoading('buy')}\n isError={!!liveRatesError}\n hovered={hovered}\n mouseEnterHandler={handleMouseEnter}\n mouseLeaveHandler={handleMouseLeave}\n >\n <Price priceMovement={getPriceMovement(updatedRecord.buyPriceMovement, !isValid)} movementIndicator=\"background\">\n <span>\n {getBuyPrice(\n updatedRecord.buy,\n !isValid,\n ).toFixed(updatedRecord.displayPrecision)}\n </span>\n </Price>\n </Cell>\n );\n};\n\nexport { CellWithData };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,KAAK,EAAEC,mBAAmB,QAAQ,2BAA2B;AACtE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,SAASC,cAAc,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,UAAU;AAExE,MAAMC,YAAY,GAAGC,IAAA,IAQI;EAAA,IARH;IACpBC,QAAQ;IACRC,IAAI;IACJC,OAAO;IACPC,MAAM;IACNC,QAAQ;IACRC,mBAAmB;IACnBC;EACiB,CAAC,GAAAP,IAAA;EAClB,MAAM,CAACQ,OAAO,EAAEC,UAAU,CAAC,GAAGjB,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMkB,UAAU,GAAG,GAAGT,QAAQ,GAAGL,cAAc,CAACS,QAAQ,CAAC,GAAGH,IAAI,EAAE;EAClE,MAAMS,oBAAoB,GAAGR,OAAO,GAAGO,UAAU,GAAG,GAAGR,IAAI,GAAGN,cAAc,CAACS,QAAQ,CAAC,GAAGJ,QAAQ,EAAE;EAEnG,MAAM;IAAEW,MAAM;IAAEC,KAAK,EAAEC;EAAe,CAAC,GAAGpB,mBAAmB,CAC3DiB,oBAAoB,EACpBP,MACF,CAAC;EAED,MAAMW,aAAkC,GAAG;IACzCC,WAAW,EAAE,GAAGf,QAAQ,IAAIC,IAAI,EAAE;IAClCQ,UAAU;IACVO,GAAG,EAAEL,MAAM,EAAEM,GAAG;IAChBC,gBAAgB,EAAEP,MAAM,EAAEQ,gBAAgB;IAC1CC,gBAAgB,EAAEpB,QAAQ,KAAK,KAAK,IAAI,CAACE,OAAO,GAAG,CAAC,GAAGS,MAAM,EAAES;EACjE,CAAC;EAED,MAAMC,YAAY,GAAIC,EAAU,IAAM,CAACT,cAAc,IAAIC,aAAa,GAAGQ,EAAE,CAAC,KAAKC,SAAU;EAE3F,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7BhB,UAAU,CAAC,IAAI,CAAC;IAChBH,mBAAmB,CAACL,QAAQ,CAAC;IAC7BM,eAAe,CAACL,IAAI,CAAC;EACvB,CAAC;EAED,MAAMwB,gBAAgB,GAAGA,CAAA,KAAM;IAC7BjB,UAAU,CAAC,KAAK,CAAC;IACjBH,mBAAmB,CAAC,EAAE,CAAC;IACvBC,eAAe,CAAC,EAAE,CAAC;EACrB,CAAC;EAED,OACEhB,KAAA,CAAAoC,aAAA,CAAChC,IAAI;IACHiC,SAAS,EAAEN,YAAY,CAAC,KAAK,CAAE;IAC/BO,OAAO,EAAE,CAAC,CAACf,cAAe;IAC1BN,OAAO,EAAEA,OAAQ;IACjBsB,iBAAiB,EAAEL,gBAAiB;IACpCM,iBAAiB,EAAEL;EAAiB,GAEpCnC,KAAA,CAAAoC,aAAA,CAAClC,KAAK;IAACuC,aAAa,EAAElC,gBAAgB,CAACiB,aAAa,CAACI,gBAAgB,EAAE,CAAChB,OAAO,CAAE;IAAC8B,iBAAiB,EAAC;EAAY,GAC9G1C,KAAA,CAAAoC,aAAA,eACG9B,WAAW,CACVkB,aAAa,CAACE,GAAG,EACjB,CAACd,OACH,CAAC,CAAC+B,OAAO,CAACnB,aAAa,CAACM,gBAAgB,CACpC,CACD,CACH,CAAC;AAEX,CAAC;AAED,SAAStB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"CellWithData.js","names":["Price","useLiveRatesMessage","React","useState","divisionMapper","getBuyPrice","getPriceMovement","Cell","CellWithData","_ref","currency","pair","isValid","target","division","setSelectedCurrency","setSelectedPair","hovered","setHovered","instrument","instrumentForUpdates","update","error","liveRatesError","updatedRecord","displayName","buy","ask","buyPriceMovement","askPriceMovement","displayPrecision","checkLoading","undefined","handleMouseEnter","handleMouseLeave","createElement","isError","isLoading","mouseEnterHandler","mouseLeaveHandler","movementIndicator","priceMovement","toFixed"],"sources":["../../../../src/CurrencyCrossTableWidget/components/CellWithData.tsx"],"sourcesContent":["import { Price, useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport React, { useState } from 'react';\n\nimport { divisionMapper, getBuyPrice, getPriceMovement } from '../utils';\nimport { Cell } from './Cell';\nimport type { CellWithDataProps } from './types';\n\nconst CellWithData = ({\n currency,\n pair,\n isValid,\n target,\n division,\n setSelectedCurrency,\n setSelectedPair,\n}: CellWithDataProps) => {\n const [hovered, setHovered] = useState(false);\n\n const instrument = `${currency}${divisionMapper(division)}${pair}`;\n const instrumentForUpdates = isValid\n ? instrument\n : `${pair}${divisionMapper(division)}${currency}`;\n\n const { update, error: liveRatesError } = useLiveRatesMessage(\n instrumentForUpdates,\n target\n );\n\n const updatedRecord = {\n displayName: `${currency}/${pair}`,\n instrument,\n buy: update?.ask,\n buyPriceMovement: update?.askPriceMovement,\n displayPrecision:\n currency === 'JPY' && !isValid ? 6 : update?.displayPrecision,\n };\n\n const checkLoading = () => !liveRatesError && updatedRecord.buy === undefined;\n\n const handleMouseEnter = () => {\n setHovered(true);\n setSelectedCurrency(currency);\n setSelectedPair(pair);\n };\n\n const handleMouseLeave = () => {\n setHovered(false);\n setSelectedCurrency('');\n setSelectedPair('');\n };\n\n return (\n <Cell\n hovered={hovered}\n isError={!!liveRatesError}\n isLoading={checkLoading()}\n mouseEnterHandler={handleMouseEnter}\n mouseLeaveHandler={handleMouseLeave}\n >\n <Price\n movementIndicator=\"background\"\n priceMovement={getPriceMovement(\n updatedRecord.buyPriceMovement,\n !isValid\n )}\n >\n <span>\n {getBuyPrice(updatedRecord.buy, !isValid).toFixed(\n updatedRecord.displayPrecision\n )}\n </span>\n </Price>\n </Cell>\n );\n};\n\nexport { CellWithData };\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,mBAAmB,QAAQ,2BAA2B;AACtE,OAAOC,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AAEvC,SAASC,cAAc,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,UAAU;AACxE,SAASC,IAAI,QAAQ,QAAQ;AAG7B,MAAMC,YAAY,GAAGC,IAAA,IAQI;EAAA,IARH;IACpBC,QAAQ;IACRC,IAAI;IACJC,OAAO;IACPC,MAAM;IACNC,QAAQ;IACRC,mBAAmB;IACnBC;EACiB,CAAC,GAAAP,IAAA;EAClB,MAAM,CAACQ,OAAO,EAAEC,UAAU,CAAC,GAAGf,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMgB,UAAU,GAAG,GAAGT,QAAQ,GAAGN,cAAc,CAACU,QAAQ,CAAC,GAAGH,IAAI,EAAE;EAClE,MAAMS,oBAAoB,GAAGR,OAAO,GAChCO,UAAU,GACV,GAAGR,IAAI,GAAGP,cAAc,CAACU,QAAQ,CAAC,GAAGJ,QAAQ,EAAE;EAEnD,MAAM;IAAEW,MAAM;IAAEC,KAAK,EAAEC;EAAe,CAAC,GAAGtB,mBAAmB,CAC3DmB,oBAAoB,EACpBP,MACF,CAAC;EAED,MAAMW,aAAa,GAAG;IACpBC,WAAW,EAAE,GAAGf,QAAQ,IAAIC,IAAI,EAAE;IAClCQ,UAAU;IACVO,GAAG,EAAEL,MAAM,EAAEM,GAAG;IAChBC,gBAAgB,EAAEP,MAAM,EAAEQ,gBAAgB;IAC1CC,gBAAgB,EACdpB,QAAQ,KAAK,KAAK,IAAI,CAACE,OAAO,GAAG,CAAC,GAAGS,MAAM,EAAES;EACjD,CAAC;EAED,MAAMC,YAAY,GAAGA,CAAA,KAAM,CAACR,cAAc,IAAIC,aAAa,CAACE,GAAG,KAAKM,SAAS;EAE7E,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7Bf,UAAU,CAAC,IAAI,CAAC;IAChBH,mBAAmB,CAACL,QAAQ,CAAC;IAC7BM,eAAe,CAACL,IAAI,CAAC;EACvB,CAAC;EAED,MAAMuB,gBAAgB,GAAGA,CAAA,KAAM;IAC7BhB,UAAU,CAAC,KAAK,CAAC;IACjBH,mBAAmB,CAAC,EAAE,CAAC;IACvBC,eAAe,CAAC,EAAE,CAAC;EACrB,CAAC;EAED,OACEd,KAAA,CAAAiC,aAAA,CAAC5B,IAAI;IACHU,OAAO,EAAEA,OAAQ;IACjBmB,OAAO,EAAE,CAAC,CAACb,cAAe;IAC1Bc,SAAS,EAAEN,YAAY,CAAC,CAAE;IAC1BO,iBAAiB,EAAEL,gBAAiB;IACpCM,iBAAiB,EAAEL;EAAiB,GAEpChC,KAAA,CAAAiC,aAAA,CAACnC,KAAK;IACJwC,iBAAiB,EAAC,YAAY;IAC9BC,aAAa,EAAEnC,gBAAgB,CAC7BkB,aAAa,CAACI,gBAAgB,EAC9B,CAAChB,OACH;EAAE,GAEFV,KAAA,CAAAiC,aAAA,eACG9B,WAAW,CAACmB,aAAa,CAACE,GAAG,EAAE,CAACd,OAAO,CAAC,CAAC8B,OAAO,CAC/ClB,aAAa,CAACM,gBAChB,CACI,CACD,CACH,CAAC;AAEX,CAAC;AAED,SAAStB,YAAY","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import classnames from 'classnames';
2
+ import React from 'react';
3
3
  const TextCell = _ref => {
4
4
  let {
5
5
  label,
@@ -1 +1 @@
1
- {"version":3,"file":"TextCell.js","names":["React","classnames","TextCell","_ref","label","emptyIndicator","hovered","sticky","createElement","className"],"sources":["../../../../src/CurrencyCrossTableWidget/components/TextCell.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { TextCellProps } from './types';\n\nconst TextCell = ({\n label,\n emptyIndicator,\n hovered,\n sticky,\n}: TextCellProps) => (\n <span className={classnames('lw-h-11 lw-min-w-[70px] lw-flex-1 lw-border-b lw-border-r lw-border-solid lw-border-border-primary lw-py-3.5 lw-text-center last:lw-border-r-[0px]', {\n 'lw-bg-border-primary': emptyIndicator,\n 'lw-shadow-innerBorderBgColor': emptyIndicator && hovered,\n 'lw-bg-border-primary lw-font-semibold': hovered,\n 'lw-sticky lw-left-0 lw-z-10': sticky,\n 'lw-bg-bg-primary': sticky && !hovered,\n })}\n >\n {label}\n </span>\n);\n\nexport { TextCell };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,MAAMC,QAAQ,GAAGC,IAAA;EAAA,IAAC;IAChBC,KAAK;IACLC,cAAc;IACdC,OAAO;IACPC;EACa,CAAC,GAAAJ,IAAA;EAAA,OACdH,KAAA,CAAAQ,aAAA;IAAMC,SAAS,EAAER,UAAU,CAAC,oJAAoJ,EAAE;MAChL,sBAAsB,EAAEI,cAAc;MACtC,8BAA8B,EAAEA,cAAc,IAAIC,OAAO;MACzD,uCAAuC,EAAEA,OAAO;MAChD,6BAA6B,EAAEC,MAAM;MACrC,kBAAkB,EAAEA,MAAM,IAAI,CAACD;IACjC,CAAC;EAAE,GAEAF,KACG,CAAC;AAAA,CACR;AAED,SAASF,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"TextCell.js","names":["classnames","React","TextCell","_ref","label","emptyIndicator","hovered","sticky","createElement","className"],"sources":["../../../../src/CurrencyCrossTableWidget/components/TextCell.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport type { TextCellProps } from './types';\n\nconst TextCell = ({\n label,\n emptyIndicator,\n hovered,\n sticky,\n}: TextCellProps) => (\n <span\n className={classnames(\n 'lw-h-11 lw-min-w-[70px] lw-flex-1 lw-border-b lw-border-r lw-border-solid lw-border-border-primary lw-py-3.5 lw-text-center last:lw-border-r-[0px]',\n {\n 'lw-bg-border-primary': emptyIndicator,\n 'lw-shadow-innerBorderBgColor': emptyIndicator && hovered,\n 'lw-bg-border-primary lw-font-semibold': hovered,\n 'lw-sticky lw-left-0 lw-z-10': sticky,\n 'lw-bg-bg-primary': sticky && !hovered,\n }\n )}\n >\n {label}\n </span>\n);\n\nexport { TextCell };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAIzB,MAAMC,QAAQ,GAAGC,IAAA;EAAA,IAAC;IAChBC,KAAK;IACLC,cAAc;IACdC,OAAO;IACPC;EACa,CAAC,GAAAJ,IAAA;EAAA,OACdF,KAAA,CAAAO,aAAA;IACEC,SAAS,EAAET,UAAU,CACnB,oJAAoJ,EACpJ;MACE,sBAAsB,EAAEK,cAAc;MACtC,8BAA8B,EAAEA,cAAc,IAAIC,OAAO;MACzD,uCAAuC,EAAEA,OAAO;MAChD,6BAA6B,EAAEC,MAAM;MACrC,kBAAkB,EAAEA,MAAM,IAAI,CAACD;IACjC,CACF;EAAE,GAEDF,KACG,CAAC;AAAA,CACR;AAED,SAASF,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/CurrencyCrossTableWidget/components/types.ts"],"sourcesContent":["import { LoaderSize } from '@oanda/labs-widget-common';\nimport { Division } from '../../gql/types/graphql';\n\nexport interface CellWithDataProps {\n currency: string;\n pair: string;\n isValid: boolean;\n target: EventTarget | null;\n division: Division;\n setSelectedCurrency: React.Dispatch<React.SetStateAction<string>>;\n setSelectedPair: React.Dispatch<React.SetStateAction<string>>;\n}\n\nexport interface CellProps {\n children: React.ReactNode;\n isLoading?: boolean;\n isError?: boolean;\n loaderSize?: LoaderSize;\n hovered: boolean;\n mouseEnterHandler: () => void;\n mouseLeaveHandler: () => void;\n}\n\nexport interface TextCellProps {\n label?: string;\n emptyIndicator?: boolean;\n hovered?: boolean;\n sticky?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/CurrencyCrossTableWidget/components/types.ts"],"sourcesContent":["import type { LoaderSize } from '@oanda/labs-widget-common';\n\nimport type { Division } from '../../gql/types/graphql';\n\nexport interface CellWithDataProps {\n currency: string;\n pair: string;\n isValid: boolean;\n target: EventTarget | null;\n division: Division;\n setSelectedCurrency: React.Dispatch<React.SetStateAction<string>>;\n setSelectedPair: React.Dispatch<React.SetStateAction<string>>;\n}\n\nexport interface CellProps {\n children: React.ReactNode;\n isLoading?: boolean;\n isError?: boolean;\n loaderSize?: LoaderSize;\n hovered: boolean;\n mouseEnterHandler: () => void;\n mouseLeaveHandler: () => void;\n}\n\nexport interface TextCellProps {\n label?: string;\n emptyIndicator?: boolean;\n hovered?: boolean;\n sticky?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,5 +2,5 @@ const MAJOR_CURRENCIES = ['EUR', 'USD', 'JPY', 'GBP', 'CHF', 'AUD', 'CAD', 'NZD'
2
2
  const INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';
3
3
  const CELL_LOADING_VALUE = '...';
4
4
  const CELL_EMPTY_VALUE = '\u2014';
5
- export { MAJOR_CURRENCIES, INSTRUMENT_TOOLTIP_ID, CELL_LOADING_VALUE, CELL_EMPTY_VALUE };
5
+ export { CELL_EMPTY_VALUE, CELL_LOADING_VALUE, INSTRUMENT_TOOLTIP_ID, MAJOR_CURRENCIES };
6
6
  //# sourceMappingURL=constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constant.js","names":["MAJOR_CURRENCIES","INSTRUMENT_TOOLTIP_ID","CELL_LOADING_VALUE","CELL_EMPTY_VALUE"],"sources":["../../../src/CurrencyCrossTableWidget/constant.ts"],"sourcesContent":["const MAJOR_CURRENCIES = ['EUR', 'USD', 'JPY', 'GBP', 'CHF', 'AUD', 'CAD', 'NZD'];\n\nconst INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';\n\nconst CELL_LOADING_VALUE = '...';\n\nconst CELL_EMPTY_VALUE = '\\u2014';\n\nexport {\n MAJOR_CURRENCIES,\n INSTRUMENT_TOOLTIP_ID,\n CELL_LOADING_VALUE,\n CELL_EMPTY_VALUE,\n};\n"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AAEjF,MAAMC,qBAAqB,GAAG,uBAAuB;AAErD,MAAMC,kBAAkB,GAAG,KAAK;AAEhC,MAAMC,gBAAgB,GAAG,QAAQ;AAEjC,SACEH,gBAAgB,EAChBC,qBAAqB,EACrBC,kBAAkB,EAClBC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"constant.js","names":["MAJOR_CURRENCIES","INSTRUMENT_TOOLTIP_ID","CELL_LOADING_VALUE","CELL_EMPTY_VALUE"],"sources":["../../../src/CurrencyCrossTableWidget/constant.ts"],"sourcesContent":["const MAJOR_CURRENCIES = [\n 'EUR',\n 'USD',\n 'JPY',\n 'GBP',\n 'CHF',\n 'AUD',\n 'CAD',\n 'NZD',\n];\n\nconst INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';\n\nconst CELL_LOADING_VALUE = '...';\n\nconst CELL_EMPTY_VALUE = '\\u2014';\n\nexport {\n CELL_EMPTY_VALUE,\n CELL_LOADING_VALUE,\n INSTRUMENT_TOOLTIP_ID,\n MAJOR_CURRENCIES,\n};\n"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,CACvB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;AAED,MAAMC,qBAAqB,GAAG,uBAAuB;AAErD,MAAMC,kBAAkB,GAAG,KAAK;AAEhC,MAAMC,gBAAgB,GAAG,QAAQ;AAEjC,SACEA,gBAAgB,EAChBD,kBAAkB,EAClBD,qBAAqB,EACrBD,gBAAgB","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- export * from './types';
2
1
  export * from './CurrencyCrossTableWidget';
2
+ export * from './types';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/CurrencyCrossTableWidget/index.ts"],"sourcesContent":["export * from './types';\nexport * from './CurrencyCrossTableWidget';\n"],"mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,4BAA4B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/CurrencyCrossTableWidget/index.ts"],"sourcesContent":["export * from './CurrencyCrossTableWidget';\nexport * from './types';\n"],"mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,SAAS","ignoreList":[]}
@@ -1,8 +1,8 @@
1
+ import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
1
2
  import React from 'react';
2
3
  import { createRoot } from 'react-dom/client';
3
- import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
4
- import { CurrencyCrossTableWidget } from './CurrencyCrossTableWidget';
5
4
  import { Division } from '../gql/types/graphql';
5
+ import { CurrencyCrossTableWidget } from './CurrencyCrossTableWidget';
6
6
  const {
7
7
  graphqlUrl,
8
8
  liveRatesUrl
@@ -38,13 +38,13 @@ currencyCrossTableElements.forEach(element => {
38
38
  name: 'liveRatesUrl'
39
39
  }]);
40
40
  root.render(React.createElement(CurrencyCrossTableWidget, {
41
+ currencies: currencies,
42
+ division: division,
41
43
  graphqlUrl: graphqlUrl,
44
+ isParamError: isParamError,
42
45
  liveRatesUrl: liveRatesUrl,
43
- division: division,
44
- currencies: currencies,
45
46
  locale: locale,
46
- theme: mode,
47
- isParamError: isParamError
47
+ theme: mode
48
48
  }));
49
49
  });
50
50
  //# sourceMappingURL=render.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","CurrencyCrossTableWidget","Division","graphqlUrl","liveRatesUrl","window","widgetsConfig","currencyCrossTableElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","currencies","division","locale","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","length","render","createElement","theme"],"sources":["../../../src/CurrencyCrossTableWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyCrossTableWidget } from './CurrencyCrossTableWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\n\nconst currencyCrossTableElements = document.querySelectorAll('div[data-currency-cross-table-params]');\n\ncurrencyCrossTableElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-cross-table-params');\n const mode = element.getAttribute('data-mode');\n const {\n currencies, division, locale,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({\n division, locale, currencies, graphqlUrl, liveRatesUrl,\n }, [{\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'currencies',\n valueCheck: (value) => (value as string[]).length > 0 && (value as string[]).length <= 8,\n }, {\n name: 'graphqlUrl',\n }, {\n name: 'liveRatesUrl',\n }]);\n\n root.render(\n <CurrencyCrossTableWidget\n graphqlUrl={graphqlUrl}\n liveRatesUrl={liveRatesUrl}\n division={division}\n currencies={currencies}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n />,\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAM;EACJC,UAAU;EACVC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,0BAA0B,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,uCAAuC,CAAC;AAErGF,0BAA0B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAC9C,MAAMC,IAAI,GAAGd,UAAU,CAACa,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,kCAAkC,CAAC;EACvE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IACJE,UAAU;IAAEC,QAAQ;IAAEC;EACxB,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,MAAgB,CAAC;EAEhC,MAAMQ,YAAY,GAAGrB,kBAAkB,CAAC;IACtCiB,QAAQ;IAAEC,MAAM;IAAEF,UAAU;IAAEb,UAAU;IAAEC;EAC5C,CAAC,EAAE,CAAC;IACFkB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAK,IAAKzB,cAAc,CAACyB,KAAK;EAC7C,CAAC,EAAE;IACDF,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAGC,KAAK,IAAKC,MAAM,CAACC,MAAM,CAACxB,QAAQ,CAAC,CAACyB,QAAQ,CAACH,KAAK;EAC/D,CAAC,EAAE;IACDF,IAAI,EAAE,YAAY;IAClBC,UAAU,EAAGC,KAAK,IAAMA,KAAK,CAAcI,MAAM,GAAG,CAAC,IAAKJ,KAAK,CAAcI,MAAM,IAAI;EACzF,CAAC,EAAE;IACDN,IAAI,EAAE;EACR,CAAC,EAAE;IACDA,IAAI,EAAE;EACR,CAAC,CAAC,CAAC;EAEHV,IAAI,CAACiB,MAAM,CACThC,KAAA,CAAAiC,aAAA,CAAC7B,wBAAwB;IACvBE,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEA,YAAa;IAC3Ba,QAAQ,EAAEA,QAAS;IACnBD,UAAU,EAAEA,UAAW;IACvBE,MAAM,EAAEA,MAAO;IACfa,KAAK,EAAEhB,IAAc;IACrBM,YAAY,EAAEA;EAAa,CAC5B,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","Division","CurrencyCrossTableWidget","graphqlUrl","liveRatesUrl","window","widgetsConfig","currencyCrossTableElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","currencies","division","locale","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","length","render","createElement","theme"],"sources":["../../../src/CurrencyCrossTableWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { Division } from '../gql/types/graphql';\nimport { CurrencyCrossTableWidget } from './CurrencyCrossTableWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\n\nconst currencyCrossTableElements = document.querySelectorAll(\n 'div[data-currency-cross-table-params]'\n);\n\ncurrencyCrossTableElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-cross-table-params');\n const mode = element.getAttribute('data-mode');\n const { currencies, division, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n division,\n locale,\n currencies,\n graphqlUrl,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'division',\n valueCheck: (value: Division) =>\n Object.values(Division).includes(value),\n },\n {\n name: 'currencies',\n valueCheck: (value) =>\n (value as string[]).length > 0 && (value as string[]).length <= 8,\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n ]\n );\n\n root.render(\n <CurrencyCrossTableWidget\n currencies={currencies}\n division={division}\n graphqlUrl={graphqlUrl}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,wBAAwB,QAAQ,4BAA4B;AAErE,MAAM;EAAEC,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE/D,MAAMC,0BAA0B,GAAGC,QAAQ,CAACC,gBAAgB,CAC1D,uCACF,CAAC;AAEDF,0BAA0B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAC9C,MAAMC,IAAI,GAAGZ,UAAU,CAACW,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,kCAAkC,CAAC;EACvE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,UAAU;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,MAAgB,CAAC;EAErE,MAAMQ,YAAY,GAAGvB,kBAAkB,CACrC;IACEmB,QAAQ;IACRC,MAAM;IACNF,UAAU;IACVb,UAAU;IACVC;EACF,CAAC,EACD,CACE;IACEkB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAyB,IAAK3B,cAAc,CAAC2B,KAAK;EACjE,CAAC,EACD;IACEF,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAGC,KAAe,IAC1BC,MAAM,CAACC,MAAM,CAACzB,QAAQ,CAAC,CAAC0B,QAAQ,CAACH,KAAK;EAC1C,CAAC,EACD;IACEF,IAAI,EAAE,YAAY;IAClBC,UAAU,EAAGC,KAAK,IACfA,KAAK,CAAcI,MAAM,GAAG,CAAC,IAAKJ,KAAK,CAAcI,MAAM,IAAI;EACpE,CAAC,EACD;IACEN,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,CAEL,CAAC;EAEDV,IAAI,CAACiB,MAAM,CACT9B,KAAA,CAAA+B,aAAA,CAAC5B,wBAAwB;IACvBc,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBd,UAAU,EAAEA,UAAW;IACvBkB,YAAY,EAAEA,YAAa;IAC3BjB,YAAY,EAAEA,YAAa;IAC3Bc,MAAM,EAAEA,MAAO;IACfa,KAAK,EAAEhB;EAAc,CACtB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["Locale"],"sources":["../../../src/CurrencyCrossTableWidget/types.tsx"],"sourcesContent":["import { WidgetConfig } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport interface CurrencyCrossTableConfig extends WidgetConfig {\n division: Division;\n liveRatesUrl: string;\n currencies: string[];\n removePadding?: boolean;\n}\n\nexport interface ValidationWrapperProps {\n currencies: string[];\n division: Division;\n isParamError?: boolean;\n}\nexport interface MainProps {\n currencies: string[];\n validInstruments: string[];\n division: Division;\n}\n"],"mappings":"AAGA,SAASA,MAAM,QAAQ,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["Locale"],"sources":["../../../src/CurrencyCrossTableWidget/types.tsx"],"sourcesContent":["import type { WidgetConfig } from '@oanda/labs-widget-common';\n\nimport type { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\n\nexport interface CurrencyCrossTableConfig extends WidgetConfig {\n division: Division;\n liveRatesUrl: string;\n currencies: string[];\n removePadding?: boolean;\n}\n\nexport interface ValidationWrapperProps {\n currencies: string[];\n division: Division;\n isParamError?: boolean;\n}\nexport interface MainProps {\n currencies: string[];\n validInstruments: string[];\n division: Division;\n}\n"],"mappings":"AAIA,SAASA,MAAM,QAAQ,kBAAkB","ignoreList":[]}
@@ -16,5 +16,5 @@ const getBuyPrice = (price, isReversed) => {
16
16
  if (price === undefined) return 0;
17
17
  return isReversed ? 1 / price : price;
18
18
  };
19
- export { validCurrencies, currenciesToInstruments, divisionMapper, getPriceMovement, getBuyPrice };
19
+ export { currenciesToInstruments, divisionMapper, getBuyPrice, getPriceMovement, validCurrencies };
20
20
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["MAJOR_CURRENCIES","validCurrencies","currencies","every","currency","includes","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","priceMovement","isReversed","undefined","getBuyPrice","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import { MAJOR_CURRENCIES } from './constant';\nimport { Division } from '../gql/types/graphql';\n\nconst validCurrencies = (currencies: string[]) => currencies\n .every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: any) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = (priceMovement: number | undefined, isReversed: boolean) => {\n if (priceMovement === undefined) return 0;\n\n return isReversed ? priceMovement * -1 : priceMovement;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n validCurrencies,\n currenciesToInstruments,\n divisionMapper,\n getPriceMovement,\n getBuyPrice,\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,YAAY;AAG7C,MAAMC,eAAe,GAAIC,UAAoB,IAAKA,UAAU,CACzDC,KAAK,CAAEC,QAAQ,IAAKJ,gBAAgB,CAACK,QAAQ,CAACD,QAAQ,CAAC,CAAC;AAE3D,MAAME,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAE9E,MAAMC,uBAAuB,GAAGA,CAACN,UAAoB,EAAEK,QAAa,KAAK;EACvE,MAAME,KAAK,GAAGP,UAAU,CAACQ,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAED,MAAMY,gBAAgB,GAAGA,CAACC,aAAiC,EAAEC,UAAmB,KAAK;EACnF,IAAID,aAAa,KAAKE,SAAS,EAAE,OAAO,CAAC;EAEzC,OAAOD,UAAU,GAAGD,aAAa,GAAG,CAAC,CAAC,GAAGA,aAAa;AACxD,CAAC;AAED,MAAMG,WAAW,GAAGA,CAACC,KAAyB,EAAEH,UAAmB,KAAK;EACtE,IAAIG,KAAK,KAAKF,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOD,UAAU,GAAG,CAAC,GAAGG,KAAK,GAAGA,KAAK;AACvC,CAAC;AAED,SACEzB,eAAe,EACfO,uBAAuB,EACvBF,cAAc,EACde,gBAAgB,EAChBI,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["MAJOR_CURRENCIES","validCurrencies","currencies","every","currency","includes","divisionMapper","division","currenciesToInstruments","pairs","reduce","acc","cV","index","array","unique","filter","_item","idx","map","el","getPriceMovement","priceMovement","isReversed","undefined","getBuyPrice","price"],"sources":["../../../src/CurrencyCrossTableWidget/utils.ts"],"sourcesContent":["import type { Division } from '../gql/types/graphql';\nimport { MAJOR_CURRENCIES } from './constant';\n\nconst validCurrencies = (currencies: string[]) =>\n currencies.every((currency) => MAJOR_CURRENCIES.includes(currency));\n\nconst divisionMapper = (division: Division) => (division === 'OGM' ? '' : '_');\n\nconst currenciesToInstruments = (currencies: string[], division: Division) => {\n const pairs = currencies.reduce((acc, cV, index, array) => {\n const unique = array.filter((_item, idx) => index !== idx);\n\n return [\n ...acc,\n ...unique.map((el) => `${cV}${divisionMapper(division)}${el}`),\n ];\n }, [] as string[]);\n\n return pairs;\n};\n\nconst getPriceMovement = (\n priceMovement: number | undefined,\n isReversed: boolean\n) => {\n if (priceMovement === undefined) return 0;\n\n return isReversed ? priceMovement * -1 : priceMovement;\n};\n\nconst getBuyPrice = (price: number | undefined, isReversed: boolean) => {\n if (price === undefined) return 0;\n\n return isReversed ? 1 / price : price;\n};\n\nexport {\n currenciesToInstruments,\n divisionMapper,\n getBuyPrice,\n getPriceMovement,\n validCurrencies,\n};\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,YAAY;AAE7C,MAAMC,eAAe,GAAIC,UAAoB,IAC3CA,UAAU,CAACC,KAAK,CAAEC,QAAQ,IAAKJ,gBAAgB,CAACK,QAAQ,CAACD,QAAQ,CAAC,CAAC;AAErE,MAAME,cAAc,GAAIC,QAAkB,IAAMA,QAAQ,KAAK,KAAK,GAAG,EAAE,GAAG,GAAI;AAE9E,MAAMC,uBAAuB,GAAGA,CAACN,UAAoB,EAAEK,QAAkB,KAAK;EAC5E,MAAME,KAAK,GAAGP,UAAU,CAACQ,MAAM,CAAC,CAACC,GAAG,EAAEC,EAAE,EAAEC,KAAK,EAAEC,KAAK,KAAK;IACzD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAKL,KAAK,KAAKK,GAAG,CAAC;IAE1D,OAAO,CACL,GAAGP,GAAG,EACN,GAAGI,MAAM,CAACI,GAAG,CAAEC,EAAE,IAAK,GAAGR,EAAE,GAAGN,cAAc,CAACC,QAAQ,CAAC,GAAGa,EAAE,EAAE,CAAC,CAC/D;EACH,CAAC,EAAE,EAAc,CAAC;EAElB,OAAOX,KAAK;AACd,CAAC;AAED,MAAMY,gBAAgB,GAAGA,CACvBC,aAAiC,EACjCC,UAAmB,KAChB;EACH,IAAID,aAAa,KAAKE,SAAS,EAAE,OAAO,CAAC;EAEzC,OAAOD,UAAU,GAAGD,aAAa,GAAG,CAAC,CAAC,GAAGA,aAAa;AACxD,CAAC;AAED,MAAMG,WAAW,GAAGA,CAACC,KAAyB,EAAEH,UAAmB,KAAK;EACtE,IAAIG,KAAK,KAAKF,SAAS,EAAE,OAAO,CAAC;EAEjC,OAAOD,UAAU,GAAG,CAAC,GAAGG,KAAK,GAAGA,KAAK;AACvC,CAAC;AAED,SACElB,uBAAuB,EACvBF,cAAc,EACdmB,WAAW,EACXJ,gBAAgB,EAChBpB,eAAe","ignoreList":[]}
@@ -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 { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\n\nexport type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<\n infer TType,\n any\n>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__\n ?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every(field => data && field in data);\n}\n"],"mappings":"AAoCA,OAAO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAAmJ,EAClG;EACjD,OAAOA,YAAY;AACrB;AAGA,OAAO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACA,OAAO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAAiF,EACtC;EAC3C,MAAMK,cAAc,GAAIF,SAAS,CAAwEG,QAAQ,EAC7GD,cAAc;EAElB,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAAuC;EACjF,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAACC,KAAK,IAAIf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC1E","ignoreList":[]}
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":"AA6CA,OAAO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEA,OAAO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACA,OAAO,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,6 +1,6 @@
1
1
  import * as types from './graphql';
2
2
  const documents = {
3
- "\n query validateInstruments($instruments: [String]!, $division: Division!) {\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n": types.ValidateInstrumentsDocument
3
+ '\n query validateInstruments($instruments: [String]!, $division: Division!) {\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n': types.ValidateInstrumentsDocument
4
4
  };
5
5
  export function graphql(source) {
6
6
  return documents[source] ?? {};
@@ -1 +1 @@
1
- {"version":3,"file":"gql.js","names":["types","documents","ValidateInstrumentsDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n \"\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\": types.ValidateInstrumentsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\"): (typeof documents)[\"\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,WAAW;AAalC,MAAMC,SAAS,GAAG;EACd,iNAAiN,EAAED,KAAK,CAACE;AAC7N,CAAC;AAqBD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"file":"gql.js","names":["types","documents","ValidateInstrumentsDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n':\n types.ValidateInstrumentsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n'\n): (typeof documents)['\\n query validateInstruments($instruments: [String]!, $division: Division!) {\\n resolveInstrumentsByDivision(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n'];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,WAAW;AAalC,MAAMC,SAAS,GAAG;EAChB,iNAAiN,EAC/MD,KAAK,CAACE;AACV,CAAC;AAuBD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}