@stokr/components-library 2.3.58-beta.6 → 2.3.58-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/dist/api/StokrWeb3.js +3 -3
  2. package/dist/api/auth.js +16 -53
  3. package/dist/api/fetchData.js +26 -66
  4. package/dist/api/fetchDataPublic.js +20 -57
  5. package/dist/components/2FA/Connect2FA.js +10 -11
  6. package/dist/components/2FA/EnterCode.js +32 -30
  7. package/dist/components/2FA/EnterCode.stories.js +4 -8
  8. package/dist/components/2FA/InstallAuthApp.js +8 -9
  9. package/dist/components/2FA/ResetCode.js +11 -12
  10. package/dist/components/2FA/Sucess2FA.js +12 -16
  11. package/dist/components/2FA/disable-2fa-flow.js +53 -104
  12. package/dist/components/2FA/disable-2fa-flow.stories.js +4 -8
  13. package/dist/components/2FA/enable-2fa-flow.js +73 -144
  14. package/dist/components/2FA/enable-2fa-flow.stories.js +4 -8
  15. package/dist/components/2FA/index.js +9 -9
  16. package/dist/components/2FA/login-with-otp-flow.js +126 -206
  17. package/dist/components/2FA/login-with-otp-flow.stories.js +4 -8
  18. package/dist/components/2FA/main-flow.js +70 -144
  19. package/dist/components/2FA/main-flow.stories.js +4 -8
  20. package/dist/components/AccountBalance/AccountBalance.js +14 -13
  21. package/dist/components/AccountBalance/AccountBalance.stories.js +6 -12
  22. package/dist/components/AccountBalance/AccountBalance.styles.js +9 -17
  23. package/dist/components/AdminDashboard/Table/ReactTable.js +77 -84
  24. package/dist/components/AdminDashboard/Table/ReactTable.stories.js +87 -63
  25. package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +24 -30
  26. package/dist/components/AdminDashboard/Table/Table.js +88 -123
  27. package/dist/components/AdminDashboard/Table/Table.styles.js +28 -90
  28. package/dist/components/AgreementItem/AgreementItem.js +10 -11
  29. package/dist/components/AgreementItem/AgreementItem.stories.js +5 -10
  30. package/dist/components/AgreementItem/AgreementItem.styles.js +8 -12
  31. package/dist/components/AnalyticGraphs/Analytic.js +504 -743
  32. package/dist/components/AnalyticGraphs/Analytic.styles.js +14 -26
  33. package/dist/components/BackButton/BackButton.js +9 -10
  34. package/dist/components/BackButton/BackButton.stories.js +4 -8
  35. package/dist/components/BackButton/BackButton.styles.js +13 -51
  36. package/dist/components/Background/Background.js +12 -11
  37. package/dist/components/Background/Background.stories.js +8 -14
  38. package/dist/components/Background/Background.styles.js +17 -33
  39. package/dist/components/BarChart/BarChart.js +138 -181
  40. package/dist/components/BarChart/BarChart.stories.js +5 -10
  41. package/dist/components/BarChart/BarChart.styles.js +8 -15
  42. package/dist/components/BarChartLegend/BarChartLegend.js +40 -67
  43. package/dist/components/BarChartLegend/BarChartLegend.styles.js +5 -10
  44. package/dist/components/BasicTable/BasicTable.js +12 -13
  45. package/dist/components/BasicTable/BasicTable.stories.js +5 -10
  46. package/dist/components/BasicTable/BasicTable.styles.js +11 -27
  47. package/dist/components/BlogPost/BlogPost.js +34 -53
  48. package/dist/components/BlogPost/BlogPost.stories.js +33 -46
  49. package/dist/components/BlogPost/BlogPost.styles.js +67 -59
  50. package/dist/components/Button/Button-stoDetails.js +150 -129
  51. package/dist/components/Button/Button.stories.js +27 -44
  52. package/dist/components/Button/Button.styles.js +24 -62
  53. package/dist/components/Button/GlareButton.js +61 -89
  54. package/dist/components/Button/GlareButton.stories.js +19 -29
  55. package/dist/components/ButtonContainer/ButtonContainer.styles.js +5 -10
  56. package/dist/components/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +4 -8
  57. package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +9 -10
  58. package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +8 -17
  59. package/dist/components/Card/Card.styles.js +14 -41
  60. package/dist/components/ChartBox/ChartBox.js +5 -8
  61. package/dist/components/ChartBox/ChartBox.stories.js +3 -6
  62. package/dist/components/ChartBox/ChartBox.styles.js +8 -14
  63. package/dist/components/ChartBox/ChartBoxDistribution.js +5 -8
  64. package/dist/components/ChartBox/ChartBoxDistribution.stories.js +3 -6
  65. package/dist/components/ChartLegend/ChartLegend.js +30 -46
  66. package/dist/components/ChartLegend/ChartLegend.stories.js +22 -28
  67. package/dist/components/ChartLegend/ChartLegend.styles.js +16 -41
  68. package/dist/components/Checkbox/Checkbox.js +32 -32
  69. package/dist/components/Checkbox/Checkbox.stories.js +5 -10
  70. package/dist/components/Checkbox/Checkbox.styles.js +10 -23
  71. package/dist/components/Checklist/ChecklistCard.js +33 -35
  72. package/dist/components/Checklist/ChecklistCard.stories.js +77 -100
  73. package/dist/components/Checklist/ChecklistCard.styles.js +12 -15
  74. package/dist/components/Chips/Chip.js +14 -13
  75. package/dist/components/Chips/Chip.stories.js +10 -19
  76. package/dist/components/Chips/Chip.styles.js +14 -14
  77. package/dist/components/Chips/ChipWrapper.js +23 -41
  78. package/dist/components/Chips/ChipsWrapper.stories.js +9 -17
  79. package/dist/components/ComponentScroll/ComponentScroll.js +25 -34
  80. package/dist/components/ComponentScroll/ComponentScroll.stories.js +16 -23
  81. package/dist/components/ComponentScroll/ComponentScroll.styles.js +22 -47
  82. package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +7 -61
  83. package/dist/components/CryptoAddress/ComponentWrap.js +10 -11
  84. package/dist/components/CryptoAddress/CryptoAddress.js +51 -68
  85. package/dist/components/CryptoAddress/CryptoAddress.stories.js +7 -13
  86. package/dist/components/CryptoAddress/CryptoAddress.styles.js +55 -124
  87. package/dist/components/CryptoAddress/RadioWrap.js +9 -10
  88. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +24 -25
  89. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.stories.js +5 -10
  90. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +12 -42
  91. package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +10 -9
  92. package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +16 -27
  93. package/dist/components/DonutChart/DonutChart.js +101 -130
  94. package/dist/components/DonutChart/DonutChart.stories.js +4 -8
  95. package/dist/components/DonutChart/DonutChart.styles.js +15 -27
  96. package/dist/components/DoubleButton/DoubleButton.styles.js +8 -8
  97. package/dist/components/ErrorMessage/ErrorMessage.styles.js +3 -5
  98. package/dist/components/FAQ/FAQ.js +29 -45
  99. package/dist/components/FAQ/FAQ.stories.js +4 -9
  100. package/dist/components/FAQ/FAQ.styles.js +23 -39
  101. package/dist/components/Footer/Footer.js +9 -10
  102. package/dist/components/Footer/Footer.stories.js +6 -12
  103. package/dist/components/Footer/Footer.styles.js +22 -46
  104. package/dist/components/Footer/FooterLayout.js +16 -20
  105. package/dist/components/Footer/FooterLayout.stories.js +4 -8
  106. package/dist/components/Footer/FooterMenu.js +61 -83
  107. package/dist/components/Footer/FooterMenu.stories.js +4 -8
  108. package/dist/components/Footer/FooterMenu.styles.js +16 -39
  109. package/dist/components/Footer/index.js +4 -4
  110. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +92 -114
  111. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +4 -8
  112. package/dist/components/Form/Form.js +15 -14
  113. package/dist/components/Form/Form.stories.js +4 -8
  114. package/dist/components/Form/Form.styles.js +16 -36
  115. package/dist/components/FullscreenCard/FullscreenCard.styles.js +7 -12
  116. package/dist/components/Grid/Grid.styles.js +17 -68
  117. package/dist/components/Header/Header.js +98 -163
  118. package/dist/components/Header/Header.stories.js +17 -28
  119. package/dist/components/Header/Header.styles.js +61 -124
  120. package/dist/components/HeroBlock/HeroVideoBlock.js +20 -25
  121. package/dist/components/Icon/Icon.style.js +10 -22
  122. package/dist/components/Icon/Icon2.js +11 -13
  123. package/dist/components/InfoIcon/InfoIcon.js +18 -17
  124. package/dist/components/InfoIcon/InfoIcon.stories.js +5 -10
  125. package/dist/components/InfoIcon/InfoIcon.styles.js +5 -21
  126. package/dist/components/InfoPanel/InfoPanel.js +26 -48
  127. package/dist/components/Input/DatePickerInput.js +21 -33
  128. package/dist/components/Input/DatePickerInput.stories.js +5 -10
  129. package/dist/components/Input/DatePickerInput.styles.js +5 -19
  130. package/dist/components/Input/Input.js +43 -51
  131. package/dist/components/Input/Input.stories.js +9 -16
  132. package/dist/components/Input/Input.styles.js +8 -43
  133. package/dist/components/Input/InputPassword.js +30 -50
  134. package/dist/components/Input/InputPassword.stories.js +6 -12
  135. package/dist/components/Input/InputPassword.styles.js +30 -57
  136. package/dist/components/Input/InputUsername.js +83 -102
  137. package/dist/components/Input/InputWithButton.js +20 -19
  138. package/dist/components/Input/InputWithButton.stories.js +5 -9
  139. package/dist/components/Input/InputWithButton.styles.js +7 -19
  140. package/dist/components/Input/OtpInput.js +27 -42
  141. package/dist/components/Input/OtpInput.stories.js +5 -11
  142. package/dist/components/Input/RangeInput.js +29 -25
  143. package/dist/components/Input/RangeInput.stories.js +4 -8
  144. package/dist/components/Input/RangeInput.styles.js +15 -42
  145. package/dist/components/Input/Select.js +68 -89
  146. package/dist/components/Input/Select.stories.js +6 -12
  147. package/dist/components/Input/Select.styles.js +12 -32
  148. package/dist/components/InvestCalculator/InvestCalculator.js +245 -243
  149. package/dist/components/InvestCalculator/InvestCalculator.stories.js +18 -21
  150. package/dist/components/InvestCalculator/InvestCalculator.styles.js +14 -33
  151. package/dist/components/InvestmentStat/InvestmentStat.js +11 -10
  152. package/dist/components/InvestmentStat/InvestmentStat.stories.js +5 -10
  153. package/dist/components/InvestmentStat/InvestmentStat.styles.js +12 -24
  154. package/dist/components/KYCFlow/BasicInfo.js +419 -460
  155. package/dist/components/KYCFlow/Confirmation.js +12 -17
  156. package/dist/components/KYCFlow/DocumentFileUpload.js +214 -227
  157. package/dist/components/KYCFlow/DocumentScan.js +16 -15
  158. package/dist/components/KYCFlow/DocumentScanUpload.js +203 -210
  159. package/dist/components/KYCFlow/DocumentSelect.js +87 -117
  160. package/dist/components/KYCFlow/DocumentSuccess.js +14 -15
  161. package/dist/components/KYCFlow/DocumentUpload.js +10 -11
  162. package/dist/components/KYCFlow/DocumentVerificationType.js +98 -128
  163. package/dist/components/KYCFlow/FaceScan.js +10 -11
  164. package/dist/components/KYCFlow/FaceScanRecognition.js +14 -13
  165. package/dist/components/KYCFlow/FaceScanSuccess.js +10 -13
  166. package/dist/components/KYCFlow/Terms.js +90 -113
  167. package/dist/components/KYCFlow/_styles.js +37 -86
  168. package/dist/components/KYCFlow/index.js +14 -14
  169. package/dist/components/KYCSelectBox/KYCSelectBox.styles.js +7 -19
  170. package/dist/components/LatestUpdate/LatestUpdate.js +12 -11
  171. package/dist/components/LatestUpdate/LatestUpdate.stories.js +5 -10
  172. package/dist/components/LatestUpdate/LatestUpdate.styles.js +15 -28
  173. package/dist/components/Layout/Layout-func-no-work.js +24 -24
  174. package/dist/components/Layout/Layout.js +47 -68
  175. package/dist/components/Layout/Layout.stories.js +5 -12
  176. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +13 -12
  177. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.stories.js +5 -10
  178. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +10 -22
  179. package/dist/components/LearnMorePage/LearnMore.js +134 -174
  180. package/dist/components/LearnMorePage/LearnMore.shared.styles.js +7 -22
  181. package/dist/components/LearnMorePage/LearnMore.stories.js +4 -8
  182. package/dist/components/LearnMorePage/LearnMore.styles.js +24 -74
  183. package/dist/components/LearnMorePage/LearnMoreExampleObject.js +3 -5
  184. package/dist/components/LearnMorePage/LearnMoreItem.js +11 -16
  185. package/dist/components/LearnMorePage/LearnMoreItem.stories.js +4 -8
  186. package/dist/components/LearnMorePage/LearnMoreItem.styles.js +18 -54
  187. package/dist/components/LearnMoreSection/LearnMore.js +119 -158
  188. package/dist/components/LearnMoreSection/LearnMore.stories.js +4 -8
  189. package/dist/components/LearnMoreSection/LearnMore.styles.js +15 -41
  190. package/dist/components/LearnMoreSection/LearnMoreItem.js +14 -15
  191. package/dist/components/LearnMoreSection/LearnMoreItem.stories.js +4 -8
  192. package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +9 -23
  193. package/dist/components/LoginModal/LoginModal.js +35 -41
  194. package/dist/components/LoginModal/LoginModal.stories.js +8 -12
  195. package/dist/components/MainMenu/DynamicMainMenu.js +11 -14
  196. package/dist/components/MainMenu/MainMenu.js +157 -190
  197. package/dist/components/MainMenu/MainMenu.styles.js +48 -89
  198. package/dist/components/MatomoConnect/Matomo.js +201 -463
  199. package/dist/components/MenuNav/MenuNav.styles.js +5 -9
  200. package/dist/components/Modal/Modal.js +46 -48
  201. package/dist/components/Modal/Modal.stories.js +8 -16
  202. package/dist/components/Modal/Modal.styles.js +34 -96
  203. package/dist/components/Modal/NewVentureModal/NewVentureModal.js +69 -95
  204. package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +22 -43
  205. package/dist/components/Modal/PaymentModal.js +43 -54
  206. package/dist/components/Modal/PaymentModal.stories.js +4 -8
  207. package/dist/components/MultiProgressBar/MultiProgressBar.js +19 -23
  208. package/dist/components/MultiProgressBar/MultiProgressBar.stories.js +6 -12
  209. package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +9 -22
  210. package/dist/components/Newsletter/Newsletter.js +65 -100
  211. package/dist/components/Newsletter/Newsletter.stories.js +4 -8
  212. package/dist/components/Newsletter/Newsletter.styles.js +47 -44
  213. package/dist/components/NotificationContext/NotificationContext.js +93 -125
  214. package/dist/components/NotificationCounter/NotificationCounter.styles.js +4 -16
  215. package/dist/components/Number/Number.js +13 -10
  216. package/dist/components/Number/Number.stories.js +23 -41
  217. package/dist/components/Number/Number.styles.js +4 -10
  218. package/dist/components/PageTransition/PageTransition.js +16 -19
  219. package/dist/components/Pagination/Pagination.js +22 -25
  220. package/dist/components/Pagination/Pagination.stories.js +29 -36
  221. package/dist/components/Pagination/Pagination.styles.js +8 -15
  222. package/dist/components/Pagination/PaginationControls.js +32 -36
  223. package/dist/components/Pagination/PaginationControls.stories.js +33 -62
  224. package/dist/components/Pagination/usePagination.js +29 -37
  225. package/dist/components/Process/Process.stories.js +6 -12
  226. package/dist/components/Process/Process.styles.js +6 -16
  227. package/dist/components/ProfileBadge/ProfileBadge.js +12 -11
  228. package/dist/components/ProfileBadge/ProfileBadge.stories.js +5 -9
  229. package/dist/components/ProfileBadge/ProfileBadge.styles.js +13 -19
  230. package/dist/components/ProfileBox/ProfileBox.js +15 -17
  231. package/dist/components/ProfileBox/ProfileBox.stories.js +5 -9
  232. package/dist/components/ProfileBox/ProfileBox.styles.js +9 -21
  233. package/dist/components/ProfileHeader/ProfileHeader.js +163 -199
  234. package/dist/components/ProfileHeader/ProfileHeader.styles.js +24 -46
  235. package/dist/components/ProfileStat/ProfileStat.js +12 -11
  236. package/dist/components/ProfileStat/ProfileStat.stories.js +6 -12
  237. package/dist/components/ProfileStat/ProfileStat.styles.js +9 -23
  238. package/dist/components/ProofOfAddress/ProofOfAddress.styles.js +20 -36
  239. package/dist/components/QRCode/QRCode.js +30 -30
  240. package/dist/components/QRCode/QRCode.stories.js +14 -26
  241. package/dist/components/ROI/ROI.js +225 -261
  242. package/dist/components/ROI/ROI.styles.js +13 -25
  243. package/dist/components/ROI/ROIChart.js +196 -303
  244. package/dist/components/ROI/ROIChart.styles.js +7 -11
  245. package/dist/components/ROI/ROIModal.js +13 -20
  246. package/dist/components/ROI/ROIParkingo.js +208 -244
  247. package/dist/components/ROI/ROIPixelmatic.js +209 -245
  248. package/dist/components/ROI/ROIScenarioBox.js +9 -8
  249. package/dist/components/ROI/ROIScenarioBox.styles.js +10 -33
  250. package/dist/components/Radio/Radio.js +19 -18
  251. package/dist/components/Radio/Radio.stories.js +4 -8
  252. package/dist/components/Radio/Radio.styles.js +5 -14
  253. package/dist/components/RefreshButton/RefreshButton.js +6 -5
  254. package/dist/components/RefreshButton/RefreshButton.stories.js +5 -10
  255. package/dist/components/RefreshButton/RefreshButton.styles.js +9 -24
  256. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +17 -18
  257. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +5 -9
  258. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +3 -4
  259. package/dist/components/RegisterLiquidSteps/RegisterLiquidSteps.js +46 -70
  260. package/dist/components/RegisterLiquidSteps/RegisterLiquidSteps.styles.js +10 -22
  261. package/dist/components/RegisterLiquidSteps/complete.js +4 -5
  262. package/dist/components/RegisterLiquidSteps/flow.js +53 -99
  263. package/dist/components/RegisterLiquidSteps/index.js +7 -22
  264. package/dist/components/RegisterLiquidSteps/register-liquid.js +62 -102
  265. package/dist/components/RegisterModal/RegisterModal.js +82 -118
  266. package/dist/components/RegisterModal/RegisterModal.stories.js +5 -9
  267. package/dist/components/RequestDataBox/RequestDataBox.js +9 -8
  268. package/dist/components/RequestDataBox/RequestDataBox.stories.js +4 -8
  269. package/dist/components/RequestDataBox/RequestDataBox.styles.js +7 -12
  270. package/dist/components/ResetConfirmModal/ResetConfirmModal.js +10 -11
  271. package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +3 -4
  272. package/dist/components/ResetPasswordModal/ResetPasswordModal.js +29 -28
  273. package/dist/components/SEO/SEO.js +11 -10
  274. package/dist/components/SEO/SEO.stories.js +4 -8
  275. package/dist/components/SectionTitle/SectionTitle.styles.js +3 -5
  276. package/dist/components/ShareButton/ShareButton.js +132 -145
  277. package/dist/components/SideLine/SideLine.js +3 -6
  278. package/dist/components/SideLine/SideLine.stories.js +3 -6
  279. package/dist/components/SideLine/SideLine.styles.js +6 -12
  280. package/dist/components/SigningSubflow/SignSubIntro.js +9 -8
  281. package/dist/components/SigningSubflow/_styles.js +9 -20
  282. package/dist/components/SigningSubflow/index.js +5 -5
  283. package/dist/components/Slider/Slider.js +16 -16
  284. package/dist/components/Slider/Slider.stories.js +5 -10
  285. package/dist/components/Slider/Slider.styles.js +5 -8
  286. package/dist/components/SpanButton/SpanButton.styles.js +3 -6
  287. package/dist/components/StatusBadge/StatusBadge.styles.js +4 -10
  288. package/dist/components/StepController/StepController.js +49 -74
  289. package/dist/components/StepController/StepController.stories.js +4 -8
  290. package/dist/components/StepController/StepController.styles.js +6 -12
  291. package/dist/components/StepController/StepControllerContext.js +46 -68
  292. package/dist/components/StepController/StepControllerProgress.js +16 -19
  293. package/dist/components/StepController/StepControllerProgress.stories.js +4 -8
  294. package/dist/components/StepsProgress/StepsProgress.js +44 -58
  295. package/dist/components/StepsProgress/StepsProgress.stories.js +33 -35
  296. package/dist/components/StepsProgress/StepsProgress.styles.js +7 -15
  297. package/dist/components/StokrLoader/StokrLoader.js +20 -23
  298. package/dist/components/StokrLoader/media.js +5 -7
  299. package/dist/components/SvgIcons/AdminBadgeSvg.js +16 -19
  300. package/dist/components/SvgIcons/CameraSvg.js +26 -29
  301. package/dist/components/SvgIcons/CapsLockSvg.js +21 -24
  302. package/dist/components/SvgIcons/DocumentBackSvg.js +25 -28
  303. package/dist/components/SvgIcons/DocumentSmallSvg.js +51 -54
  304. package/dist/components/SvgIcons/DocumentSvg.js +28 -31
  305. package/dist/components/SvgIcons/Early.js +14 -17
  306. package/dist/components/SvgIcons/EthSvg.js +30 -33
  307. package/dist/components/SvgIcons/EurSvg.js +16 -19
  308. package/dist/components/SvgIcons/FaceScanIconSvg.js +21 -24
  309. package/dist/components/SvgIcons/FourSvg.js +11 -14
  310. package/dist/components/SvgIcons/Glassess.js +19 -22
  311. package/dist/components/SvgIcons/LogoSvg.js +14 -17
  312. package/dist/components/SvgIcons/OneSvg.js +13 -16
  313. package/dist/components/SvgIcons/PassportSvg.js +46 -49
  314. package/dist/components/SvgIcons/RefreshSvg.js +17 -20
  315. package/dist/components/SvgIcons/SocialFacebook.js +20 -23
  316. package/dist/components/SvgIcons/SocialInstagram.js +11 -14
  317. package/dist/components/SvgIcons/SocialLinkedIn.js +25 -28
  318. package/dist/components/SvgIcons/SocialMedium.js +15 -18
  319. package/dist/components/SvgIcons/SocialReddit.js +15 -18
  320. package/dist/components/SvgIcons/SocialTelegram.js +49 -52
  321. package/dist/components/SvgIcons/SocialTwitter.js +44 -47
  322. package/dist/components/SvgIcons/SocialYoutube.js +15 -18
  323. package/dist/components/SvgIcons/ThreeSvg.js +10 -13
  324. package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +72 -75
  325. package/dist/components/SvgIcons/TwoSvg.js +13 -16
  326. package/dist/components/SvgIcons/UpdateDefaultSvg.js +19 -22
  327. package/dist/components/SvgIcons/UpdateHardSvg.js +15 -18
  328. package/dist/components/SvgIcons/UpdateSoftSvg.js +17 -20
  329. package/dist/components/SvgIcons/UploadSvg.js +24 -27
  330. package/dist/components/SvgIcons/VerifiedBadge.js +13 -16
  331. package/dist/components/SvgIcons/index.js +32 -32
  332. package/dist/components/Switch/Switch.js +23 -37
  333. package/dist/components/Switch/Switch.stories.js +8 -14
  334. package/dist/components/Switch/Switch.styles.js +8 -33
  335. package/dist/components/Tabs/Tabs.js +19 -21
  336. package/dist/components/Tabs/Tabs.stories.js +4 -8
  337. package/dist/components/Tabs/Tabs.styles.js +4 -6
  338. package/dist/components/TabsNav/TabNav.js +14 -13
  339. package/dist/components/TabsNav/TabNav.stories.js +5 -10
  340. package/dist/components/TabsNav/TabsNav.js +14 -14
  341. package/dist/components/TabsNav/TabsNav.stories.js +4 -8
  342. package/dist/components/TabsNav/TabsNav.styles.js +10 -25
  343. package/dist/components/TeamOverview/TeamOverview.js +38 -84
  344. package/dist/components/TeamOverview/TeamOverview.stories.js +5 -10
  345. package/dist/components/TeamOverview/TeamOverview.styles.js +18 -35
  346. package/dist/components/TermsModal/TermsModal.js +49 -79
  347. package/dist/components/TermsModal/TermsModal.stories.js +4 -8
  348. package/dist/components/TermsModal/_styles.js +35 -100
  349. package/dist/components/Text/Headline.js +15 -14
  350. package/dist/components/Text/Headline.stories.js +4 -8
  351. package/dist/components/Text/StyledText.js +5 -8
  352. package/dist/components/Text/Text.stories.js +5 -10
  353. package/dist/components/Text/Text.styles.js +15 -37
  354. package/dist/components/TextLink/TextLink.styles.js +6 -17
  355. package/dist/components/ToDoList/ToDoList.js +76 -85
  356. package/dist/components/ToDoList/ToDoList.stories.js +7 -14
  357. package/dist/components/ToDoList/ToDoList.styles.js +34 -43
  358. package/dist/components/ToDoList/ToDoListTask.js +22 -35
  359. package/dist/components/ToDoList/ToDoListTask.stories.js +5 -10
  360. package/dist/components/ToDoList/ToDoListTask.styles.js +13 -40
  361. package/dist/components/TransactionDetails/TransactionDetails.js +9 -19
  362. package/dist/components/TransactionDetails/TransactionDetails.stories.js +5 -10
  363. package/dist/components/TransactionDetails/TransactionDetails.styles.js +6 -15
  364. package/dist/components/TransactionInfo/TransactionInfo.js +18 -17
  365. package/dist/components/TransactionInfo/TransactionInfo.stories.js +4 -8
  366. package/dist/components/TransactionInfo/TransactionInfo.styles.js +10 -31
  367. package/dist/components/TwoFactorModal/TwoFactorModal.js +72 -94
  368. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +49 -48
  369. package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +6 -11
  370. package/dist/components/breakdown/Breakdown.js +38 -36
  371. package/dist/components/breakdown/index.js +3 -5
  372. package/dist/components/headerHo/HeaderHo.js +585 -769
  373. package/dist/components/headerHo/HeaderHo.stories.js +9 -13
  374. package/dist/components/headerHo/index.js +3 -5
  375. package/dist/components/icons/Arrow.js +43 -46
  376. package/dist/components/icons/Arrow.stories.js +7 -14
  377. package/dist/components/icons/ArrowSimple.js +32 -35
  378. package/dist/components/icons/ArrowSimple.stories.js +7 -14
  379. package/dist/components/icons/Check.js +28 -31
  380. package/dist/components/icons/Check.stories.js +3 -6
  381. package/dist/components/icons/Facebook.js +11 -14
  382. package/dist/components/icons/Facebook.stories.js +3 -6
  383. package/dist/components/icons/Info.js +40 -43
  384. package/dist/components/icons/Info.stories.js +3 -6
  385. package/dist/components/icons/Instagram.js +11 -14
  386. package/dist/components/icons/Instagram.stories.js +3 -6
  387. package/dist/components/icons/LinkIcon.js +19 -22
  388. package/dist/components/icons/LinkIcon.stories.js +3 -6
  389. package/dist/components/icons/LinkedIn.js +28 -31
  390. package/dist/components/icons/LinkedIn.stories.js +3 -6
  391. package/dist/components/icons/Medium.js +27 -30
  392. package/dist/components/icons/Medium.stories.js +3 -6
  393. package/dist/components/icons/Reddit.js +17 -20
  394. package/dist/components/icons/Reddit.stories.js +3 -6
  395. package/dist/components/icons/Share.js +47 -50
  396. package/dist/components/icons/Share.stories.js +3 -6
  397. package/dist/components/icons/Telegram.js +27 -30
  398. package/dist/components/icons/Telegram.stories.js +3 -6
  399. package/dist/components/icons/Twitter.js +11 -14
  400. package/dist/components/icons/Twitter.stories.js +3 -6
  401. package/dist/components/icons/X.js +11 -14
  402. package/dist/components/icons/X.stories.js +3 -6
  403. package/dist/components/icons/Youtube.js +11 -14
  404. package/dist/components/icons/Youtube.stories.js +3 -6
  405. package/dist/components/icons/index.js +15 -15
  406. package/dist/components/landing-page/List.js +3 -5
  407. package/dist/components/landing-page/PageContent.js +5 -7
  408. package/dist/components/landing-page/PageText.js +12 -16
  409. package/dist/components/landing-page/PageTitle.js +16 -47
  410. package/dist/components/logo/Logo.js +49 -71
  411. package/dist/components/logo/index.js +3 -5
  412. package/dist/components/renderToBody/index.js +3 -5
  413. package/dist/components/renderToBody/renderToBody.js +39 -60
  414. package/dist/components/taxId/TaxId.stories.js +11 -16
  415. package/dist/components/taxId/complete.js +9 -11
  416. package/dist/components/taxId/flow.js +22 -34
  417. package/dist/components/taxId/index.js +4 -4
  418. package/dist/components/taxId/register-taxid.js +54 -92
  419. package/dist/components/video/Video.js +69 -84
  420. package/dist/components/video/Video.stories.js +5 -9
  421. package/dist/components/video/index.js +3 -5
  422. package/dist/constants/globalVariables.js +10 -20
  423. package/dist/constants/style.js +23 -46
  424. package/dist/context/Auth.js +247 -340
  425. package/dist/context/AuthContext.js +545 -1023
  426. package/dist/context/Checkbox/CheckboxContext.js +65 -117
  427. package/dist/firebase-config.js +4 -6
  428. package/dist/hooks/useNewVentureForm.js +128 -193
  429. package/dist/hooks/useTimer.js +29 -51
  430. package/dist/index.js +134 -134
  431. package/dist/model/axios.js +4 -5
  432. package/dist/model/axiosPublic.js +4 -5
  433. package/dist/services/TimerService.js +70 -89
  434. package/dist/static/images/copy_icon.svg +4 -0
  435. package/dist/styles/colors.js +2 -4
  436. package/dist/styles/fonts.js +3 -4
  437. package/dist/styles/global.js +3 -4
  438. package/dist/styles/grid.js +4 -5
  439. package/dist/styles/reactTippy.js +3 -4
  440. package/dist/styles/rwd.js +12 -26
  441. package/dist/styles/semanticUi.js +3 -4
  442. package/dist/styles/spacing.js +2 -3
  443. package/dist/styles/theme.js +6 -9
  444. package/dist/utils/allowed-countries-list.js +2 -3
  445. package/dist/utils/analytics.js +32 -48
  446. package/dist/utils/check-sale-time-left.js +37 -39
  447. package/dist/utils/check-todo-status.js +3 -4
  448. package/dist/utils/checklistGenerator.js +46 -46
  449. package/dist/utils/copyToClipboard.js +65 -131
  450. package/dist/utils/countries-list.js +2 -3
  451. package/dist/utils/customHooks.js +40 -67
  452. package/dist/utils/delete-redirect-cookie-and-navigate.js +3 -3
  453. package/dist/utils/fix-decimals.js +4 -5
  454. package/dist/utils/formatCurrencyValue.js +41 -52
  455. package/dist/utils/get-cookie-domain.js +3 -4
  456. package/dist/utils/get-short-address.js +1 -3
  457. package/dist/utils/isUSInvestor.js +2 -4
  458. package/dist/utils/km_ify.js +3 -3
  459. package/dist/utils/lock-body.js +3 -5
  460. package/dist/utils/moment.js +10 -12
  461. package/dist/utils/redirect-url.js +2 -3
  462. package/dist/utils/saveAs.js +5 -5
  463. package/dist/utils/scrollUtils.js +33 -36
  464. package/dist/utils/set-redirect-cookie.js +6 -7
  465. package/dist/utils/withRouter.js +6 -6
  466. package/package.json +134 -141
@@ -10,25 +10,13 @@ var d3 = _interopRequireWildcard(require("d3"));
10
10
  var _reactTippy = require("react-tippy");
11
11
  var _BarChartLegend = _interopRequireDefault(require("../BarChartLegend/BarChartLegend"));
12
12
  var _rwd = require("../../styles/rwd");
13
- var _ROIChart = require("./ROIChart.styles");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
22
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
24
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
- var gradients = {
13
+ var _ROIChart2 = require("./ROIChart.styles");
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ 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); }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
+ const gradients = {
32
20
  red: {
33
21
  start: '#f24f45',
34
22
  end: '#ee220d'
@@ -38,176 +26,138 @@ var gradients = {
38
26
  end: '#0050ca'
39
27
  }
40
28
  };
41
- var ROIChart = /*#__PURE__*/function (_PureComponent) {
42
- _inherits(ROIChart, _PureComponent);
43
- var _super = _createSuper(ROIChart);
44
- function ROIChart() {
45
- var _this;
46
- _classCallCheck(this, ROIChart);
47
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
48
- args[_key] = arguments[_key];
49
- }
50
- _this = _super.call.apply(_super, [this].concat(args));
51
- _defineProperty(_assertThisInitialized(_this), "transitionDuration", 800);
52
- _defineProperty(_assertThisInitialized(_this), "transitionDatumDelay", 100);
53
- _defineProperty(_assertThisInitialized(_this), "state", {
29
+ class ROIChart extends _react.PureComponent {
30
+ constructor() {
31
+ super(...arguments);
32
+ _defineProperty(this, "transitionDuration", 800);
33
+ _defineProperty(this, "transitionDatumDelay", 100);
34
+ _defineProperty(this, "state", {
54
35
  tooltipOpen: false,
55
36
  dataIndex: 0
56
37
  });
57
- _defineProperty(_assertThisInitialized(_this), "checkIsMobile", function () {
58
- return !window.matchMedia((0, _rwd.getMedia)('Medium')).matches;
59
- });
60
- _defineProperty(_assertThisInitialized(_this), "onResize", function () {
61
- clearTimeout(_this.resizeTimeout);
62
- _this.resizeTimeout = setTimeout(_this.onResizeTimeout, 200);
38
+ _defineProperty(this, "checkIsMobile", () => !window.matchMedia((0, _rwd.getMedia)('Medium')).matches);
39
+ _defineProperty(this, "onResize", () => {
40
+ clearTimeout(this.resizeTimeout);
41
+ this.resizeTimeout = setTimeout(this.onResizeTimeout, 200);
63
42
  });
64
- _defineProperty(_assertThisInitialized(_this), "onResizeTimeout", function () {
65
- _this.updateChart(true);
43
+ _defineProperty(this, "onResizeTimeout", () => {
44
+ this.updateChart(true);
66
45
  });
67
- _defineProperty(_assertThisInitialized(_this), "onScroll", function (e) {
68
- if (_this.drawn) return;
69
- if (_this.chartEl.getBoundingClientRect().top < window.innerHeight) {
70
- _this.initialDrawChart();
46
+ _defineProperty(this, "onScroll", e => {
47
+ if (this.drawn) return;
48
+ if (this.chartEl.getBoundingClientRect().top < window.innerHeight) {
49
+ this.initialDrawChart();
71
50
  }
72
51
  });
73
- _defineProperty(_assertThisInitialized(_this), "initialDrawChart", function () {
74
- _this.updateChart();
75
- _this.drawn = true;
52
+ _defineProperty(this, "initialDrawChart", () => {
53
+ this.updateChart();
54
+ this.drawn = true;
76
55
  });
77
- _defineProperty(_assertThisInitialized(_this), "createChart", function () {
78
- if (!_this.chartEl) return;
79
- var _this$props = _this.props,
80
- id = _this$props.id,
81
- data = _this$props.data;
82
- var dataIndex = _this.state.dataIndex;
83
- var tooltip = data[dataIndex] && !!data[dataIndex].tooltip;
84
- var wrapperWidth = _this.chartEl.offsetWidth;
85
- var wrapperHeight = 320;
86
- var margin = {
56
+ _defineProperty(this, "createChart", () => {
57
+ if (!this.chartEl) return;
58
+ const {
59
+ id,
60
+ data
61
+ } = this.props;
62
+ const {
63
+ dataIndex
64
+ } = this.state;
65
+ const tooltip = data[dataIndex] && !!data[dataIndex].tooltip;
66
+ const wrapperWidth = this.chartEl.offsetWidth;
67
+ const wrapperHeight = 320;
68
+ const margin = {
87
69
  top: 20,
88
70
  left: 0,
89
71
  right: 40,
90
72
  bottom: 30
91
73
  };
92
- var width = wrapperWidth - (margin.left + margin.right);
93
- var height = wrapperHeight - (margin.top + margin.bottom);
94
- var thickness = 6;
95
- var hThickness = thickness / 2;
96
- var minBarHeight = 12;
97
- _this.hThickness = hThickness;
74
+ const width = wrapperWidth - (margin.left + margin.right);
75
+ const height = wrapperHeight - (margin.top + margin.bottom);
76
+ const thickness = 6;
77
+ const hThickness = thickness / 2;
78
+ const minBarHeight = 12;
79
+ this.hThickness = hThickness;
98
80
 
99
81
  // #region x scale
100
- var xScale = _this.getXScale(data, width);
82
+ const xScale = this.getXScale(data, width);
101
83
  // #endregion x scale
102
84
 
103
85
  // #region y scale
104
- var yScale = _this.getYScale(data, height);
86
+ const yScale = this.getYScale(data, height);
105
87
  // #endregion y scale
106
88
 
107
- _this.svg = d3.select(_this.chartEl).append('svg').attr('width', wrapperWidth).attr('height', wrapperHeight);
108
- _this.chart = _this.svg.append('g').attr('transform', "translate(".concat(margin.left, ", ").concat(margin.top, ")"));
109
- _this.defs = _this.svg.append('defs');
89
+ this.svg = d3.select(this.chartEl).append('svg').attr('width', wrapperWidth).attr('height', wrapperHeight);
90
+ this.chart = this.svg.append('g').attr('transform', "translate(".concat(margin.left, ", ").concat(margin.top, ")"));
91
+ this.defs = this.svg.append('defs');
110
92
 
111
93
  // #region gradient
112
- _this.redGradient = _this.defs.append('linearGradient').attr('id', "".concat(id, "-barChart-redgradient")).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
113
- _this.redGradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients.red.start).attr('stop-opacity', 1);
114
- _this.redGradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients.red.end).attr('stop-opacity', 1);
115
- _this.blueGradient = _this.defs.append('linearGradient').attr('id', "".concat(id, "-barChart-bluegradient")).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
116
- _this.blueGradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients.blue.start).attr('stop-opacity', 1);
117
- _this.blueGradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients.blue.end).attr('stop-opacity', 1);
94
+ this.redGradient = this.defs.append('linearGradient').attr('id', "".concat(id, "-barChart-redgradient")).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
95
+ this.redGradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients.red.start).attr('stop-opacity', 1);
96
+ this.redGradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients.red.end).attr('stop-opacity', 1);
97
+ this.blueGradient = this.defs.append('linearGradient').attr('id', "".concat(id, "-barChart-bluegradient")).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
98
+ this.blueGradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients.blue.start).attr('stop-opacity', 1);
99
+ this.blueGradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients.blue.end).attr('stop-opacity', 1);
118
100
  // #endregion gradient
119
101
 
120
102
  // #region x axis
121
- _this.xAxis = _this.chart.append('g').attr('class', 'axisX').attr('transform', "translate(0, ".concat(yScale(0), ")")).call(d3.axisBottom(xScale).tickPadding(height - yScale(0) + minBarHeight));
103
+ this.xAxis = this.chart.append('g').attr('class', 'axisX').attr('transform', "translate(0, ".concat(yScale(0), ")")).call(d3.axisBottom(xScale).tickPadding(height - yScale(0) + minBarHeight));
122
104
  // #endregion x axis
123
105
 
124
106
  // #region y axis
125
- _this.yAxis = _this.chart.append('g').attr('class', 'axisY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
107
+ this.yAxis = this.chart.append('g').attr('class', 'axisY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
126
108
  // #endregion y axis
127
109
 
128
110
  // #region grid x axis
129
- _this.xGrid = _this.chart.append('g').attr('class', 'gridX').attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
111
+ this.xGrid = this.chart.append('g').attr('class', 'gridX').attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
130
112
  // #endregion grid x axis
131
113
 
132
114
  // #region grid y axis
133
- _this.yGrid = _this.chart.append('g').attr('class', 'gridY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
115
+ this.yGrid = this.chart.append('g').attr('class', 'gridY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
134
116
  // #endregion grid y axis
135
117
 
136
118
  // #region bar measures functions
137
- var gainBarY = function gainBarY(d) {
138
- return d.gain < 0 ? yScale(0) : yScale(d.gain) - minBarHeight;
139
- };
140
- var gainBarHeight = function gainBarHeight(d) {
141
- return Math.abs(yScale(0) - yScale(d.gain)) + minBarHeight;
142
- };
143
- var profitBarY = function profitBarY(d) {
144
- return d.profit < 0 ? yScale(0) + gainBarHeight(d) : yScale(d.profit) - minBarHeight * 2;
145
- };
146
- var profitBarHeight = function profitBarHeight(d) {
147
- return Math.abs(yScale(d.gain) - yScale(d.profit)) + minBarHeight;
148
- };
119
+ const gainBarY = d => d.gain < 0 ? yScale(0) : yScale(d.gain) - minBarHeight;
120
+ const gainBarHeight = d => Math.abs(yScale(0) - yScale(d.gain)) + minBarHeight;
121
+ const profitBarY = d => d.profit < 0 ? yScale(0) + gainBarHeight(d) : yScale(d.profit) - minBarHeight * 2;
122
+ const profitBarHeight = d => Math.abs(yScale(d.gain) - yScale(d.profit)) + minBarHeight;
149
123
 
150
124
  // #endregion bar measures functions
151
125
 
152
126
  // #region bars
153
- var chartContext = _assertThisInitialized(_this);
154
- var barGroups = _this.chart.selectAll('.stackedBar').data(data).enter().append('g').attr('class', 'stackedBar').attr('transform', "translate(".concat(-hThickness, ", 0)"))
127
+ const chartContext = this;
128
+ const barGroups = this.chart.selectAll('.stackedBar').data(data).enter().append('g').attr('class', 'stackedBar').attr('transform', "translate(".concat(-hThickness, ", 0)"))
155
129
  // end series create
156
130
  .each(function bindContext(d, i) {
157
131
  d3.select(this).node().chartContext = chartContext;
158
132
  d3.select(this).node().xScale = xScale;
159
- }).on('mouseenter', tooltip ? _this.onMouseEnter : function () {}).on('mouseleave', tooltip ? _this.onMouseLeave : function () {});
133
+ }).on('mouseenter', tooltip ? this.onMouseEnter : () => {}).on('mouseleave', tooltip ? this.onMouseLeave : () => {});
160
134
 
161
135
  // #region gainBar
162
- barGroups.append('rect').attr('class', 'stackedBar__gain').attr('fill', "url(#".concat(id, "-barChart-bluegradient)")).attr('x', function (d, i) {
163
- return xScale(d.year);
164
- }).attr('y', gainBarY).attr('height', gainBarHeight).attr('width', 6);
136
+ barGroups.append('rect').attr('class', 'stackedBar__gain').attr('fill', "url(#".concat(id, "-barChart-bluegradient)")).attr('x', (d, i) => xScale(d.year)).attr('y', gainBarY).attr('height', gainBarHeight).attr('width', 6);
165
137
  // #endregion gainBar
166
138
 
167
139
  // #region profitBar
168
- barGroups.append('rect').attr('class', 'stackedBar__profit').attr('fill', "url(#".concat(id, "-barChart-redgradient)")).attr('x', function (d, i) {
169
- return xScale(d.year);
170
- }).attr('y', profitBarY).attr('height', profitBarHeight).attr('width', 6);
140
+ barGroups.append('rect').attr('class', 'stackedBar__profit').attr('fill', "url(#".concat(id, "-barChart-redgradient)")).attr('x', (d, i) => xScale(d.year)).attr('y', profitBarY).attr('height', profitBarHeight).attr('width', 6);
171
141
  // #endregion profitBar
172
142
 
173
- barGroups.append('text').attr('class', 'stackedBar__gainText').attr('fill', '#fff').attr('x', function (d, i) {
174
- return xScale(d.year) + xScale.bandwidth() / 2;
175
- }).attr('y', gainBarY).text(function (d) {
176
- return "\u20AC ".concat(d.gain);
177
- }).attr('opacity', 0);
178
- barGroups.append('text').attr('class', 'stackedBar__profitText').attr('fill', '#fff').attr('x', function (d, i) {
179
- return xScale(d.year) + xScale.bandwidth() / 2;
180
- }).attr('y', profitBarY).text(function (d) {
181
- return "\u20AC ".concat(d.profit);
182
- }).attr('opacity', 0);
143
+ barGroups.append('text').attr('class', 'stackedBar__gainText').attr('fill', '#fff').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', gainBarY).text(d => "\u20AC ".concat(d.gain)).attr('opacity', 0);
144
+ barGroups.append('text').attr('class', 'stackedBar__profitText').attr('fill', '#fff').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', profitBarY).text(d => "\u20AC ".concat(d.profit)).attr('opacity', 0);
183
145
  // #endregion bars
184
146
  });
185
- _defineProperty(_assertThisInitialized(_this), "getXScale", function (data, width) {
186
- return d3.scaleBand().range([0, width]).domain(data.map(function (datum) {
187
- return datum.year;
188
- })).padding(0.2);
189
- });
190
- _defineProperty(_assertThisInitialized(_this), "getYScale", function (data, height) {
191
- return d3.scaleLinear().range([height, 0]).domain([Math.min(d3.min(data, function (datum) {
192
- return datum.gain + datum.profit;
193
- }), 0), Math.max(d3.max(data, function (datum) {
194
- return datum.gain + datum.profit;
195
- }), Math.abs(d3.min(data, function (datum) {
196
- return datum.gain + datum.profit;
197
- })))]);
198
- });
199
- _defineProperty(_assertThisInitialized(_this), "setTooltip", function (opened, dataIndex) {
200
- var newState = {
147
+ _defineProperty(this, "getXScale", (data, width) => d3.scaleBand().range([0, width]).domain(data.map(datum => datum.year)).padding(0.2));
148
+ _defineProperty(this, "getYScale", (data, height) => d3.scaleLinear().range([height, 0]).domain([Math.min(d3.min(data, datum => datum.gain + datum.profit), 0), Math.max(d3.max(data, datum => datum.gain + datum.profit), Math.abs(d3.min(data, datum => datum.gain + datum.profit)))]));
149
+ _defineProperty(this, "setTooltip", (opened, dataIndex) => {
150
+ const newState = {
201
151
  tooltipOpen: opened
202
152
  };
203
153
  if (dataIndex !== undefined) newState.dataIndex = dataIndex;
204
- _this.setState(newState);
154
+ this.setState(newState);
205
155
  });
206
- _defineProperty(_assertThisInitialized(_this), "onMouseEnter", function onMouseEnter(d, i) {
207
- var chartRect = this.chartContext.chartEl.getBoundingClientRect();
208
- var barRect = this.getBoundingClientRect();
209
- var y = barRect.y - chartRect.y;
210
- var x = this.xScale(d.year) + this.xScale.bandwidth() / 2;
156
+ _defineProperty(this, "onMouseEnter", function onMouseEnter(d, i) {
157
+ const chartRect = this.chartContext.chartEl.getBoundingClientRect();
158
+ const barRect = this.getBoundingClientRect();
159
+ const y = barRect.y - chartRect.y;
160
+ const x = this.xScale(d.year) + this.xScale.bandwidth() / 2;
211
161
  if (this.chartContext.tooltipEl) {
212
162
  this.chartContext.tooltipEl.style.left = "".concat(x, "px");
213
163
  this.chartContext.tooltipEl.style.top = "".concat(y, "px");
@@ -216,245 +166,189 @@ var ROIChart = /*#__PURE__*/function (_PureComponent) {
216
166
  if (this.chartContext.checkIsMobile()) {
217
167
  return;
218
168
  }
219
- var barGroup = d3.select(this);
220
- var shift = Math.min(this.xScale.bandwidth(), 100);
169
+ const barGroup = d3.select(this);
170
+ const shift = Math.min(this.xScale.bandwidth(), 100);
221
171
  barGroup.transition().duration(300).attr('transform', "translate(".concat(-shift / 2, ", 0)"));
222
- var gainBar = barGroup.select('.stackedBar__gain');
223
- var profitBar = barGroup.select('.stackedBar__profit');
224
- var gainText = barGroup.select('.stackedBar__gainText');
225
- var profitText = barGroup.select('.stackedBar__profitText');
226
- var gainTextWidth = gainText.node().getBoundingClientRect().width;
227
- var profitTextWidth = profitText.node().getBoundingClientRect().width;
172
+ const gainBar = barGroup.select('.stackedBar__gain');
173
+ const profitBar = barGroup.select('.stackedBar__profit');
174
+ const gainText = barGroup.select('.stackedBar__gainText');
175
+ const profitText = barGroup.select('.stackedBar__profitText');
176
+ const gainTextWidth = gainText.node().getBoundingClientRect().width;
177
+ const profitTextWidth = profitText.node().getBoundingClientRect().width;
228
178
  gainBar.transition().duration(300).attr('width', shift);
229
179
  profitBar.transition().duration(300).attr('width', shift);
230
180
  gainText.attr('transform', "translate(".concat(shift / 2 - gainTextWidth / 2, ", 0)")).transition().duration(300).delay(200).attr('opacity', 1);
231
181
  profitText.attr('transform', "translate(".concat(shift / 2 - profitTextWidth / 2, ", 0)")).transition().duration(300).delay(200).attr('opacity', 1);
232
182
  });
233
- _defineProperty(_assertThisInitialized(_this), "onMouseLeave", function onMouseLeave(d, i) {
234
- var width = 6;
183
+ _defineProperty(this, "onMouseLeave", function onMouseLeave(d, i) {
184
+ const width = 6;
235
185
  this.chartContext.setTooltip(false);
236
186
  if (this.chartContext.checkIsMobile()) {
237
187
  return;
238
188
  }
239
- var barGroup = d3.select(this);
189
+ const barGroup = d3.select(this);
240
190
  barGroup.transition().duration(300).delay(200).attr('transform', "translate(".concat(-width / 2, ", 0)"));
241
191
  barGroup.select('.stackedBar__gain').transition().duration(300).delay(200).attr('width', width);
242
192
  barGroup.select('.stackedBar__profit').transition().duration(300).delay(200).attr('width', width);
243
193
  barGroup.select('.stackedBar__gainText').transition().duration(300).attr('opacity', 0);
244
194
  barGroup.select('.stackedBar__profitText').transition().duration(300).attr('opacity', 0);
245
195
  });
246
- _defineProperty(_assertThisInitialized(_this), "updateChart", function (resizeUpdate) {
247
- if (!_this.chartEl) return;
248
- var _this$props2 = _this.props,
249
- data = _this$props2.data,
250
- id = _this$props2.id;
251
- var dataIndex = _this.state.dataIndex;
252
- var tooltip = data[dataIndex] && !!data[dataIndex].tooltip;
253
- var duration = _this.transitionDuration;
254
- var delay = _this.transitionDatumDelay;
255
- var wrapperWidth = _this.chartEl.offsetWidth;
256
- var wrapperHeight = 320;
257
- var margin = {
196
+ _defineProperty(this, "updateChart", resizeUpdate => {
197
+ if (!this.chartEl) return;
198
+ const {
199
+ data,
200
+ id
201
+ } = this.props;
202
+ const {
203
+ dataIndex
204
+ } = this.state;
205
+ const tooltip = data[dataIndex] && !!data[dataIndex].tooltip;
206
+ const duration = this.transitionDuration;
207
+ const delay = this.transitionDatumDelay;
208
+ const wrapperWidth = this.chartEl.offsetWidth;
209
+ const wrapperHeight = 320;
210
+ const margin = {
258
211
  top: 20,
259
212
  left: 0,
260
213
  right: 40,
261
214
  bottom: 30
262
215
  };
263
- var width = wrapperWidth - (margin.left + margin.right);
264
- var height = wrapperHeight - (margin.top + margin.bottom);
265
- var thickness = 6;
266
- var hThickness = thickness / 2;
267
- var minBarHeight = 12;
268
- var textOffsetTop = 3;
216
+ const width = wrapperWidth - (margin.left + margin.right);
217
+ const height = wrapperHeight - (margin.top + margin.bottom);
218
+ const thickness = 6;
219
+ const hThickness = thickness / 2;
220
+ const minBarHeight = 12;
221
+ const textOffsetTop = 3;
269
222
  // #region x scale
270
- var xScale = _this.getXScale(data, width);
223
+ const xScale = this.getXScale(data, width);
271
224
  // #endregion x scale
272
225
 
273
226
  // #region y scale
274
- var yScale = _this.getYScale(data, height);
227
+ const yScale = this.getYScale(data, height);
275
228
  // #endregion y scale
276
229
  // #region root svg
277
- _this.svg.transition().duration(duration).attr('width', wrapperWidth).attr('height', wrapperHeight);
230
+ this.svg.transition().duration(duration).attr('width', wrapperWidth).attr('height', wrapperHeight);
278
231
  // #endregion root svg
279
232
 
280
233
  // #region grid x axis
281
- _this.xGrid.transition().duration(duration).attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
234
+ this.xGrid.transition().duration(duration).attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
282
235
  // #endregion grid x axis
283
236
 
284
237
  // #region grid y axis
285
- _this.yGrid.transition().duration(duration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
238
+ this.yGrid.transition().duration(duration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
286
239
  // #endregion grid y axis
287
240
 
288
241
  // #region x axis
289
- _this.xAxis.transition().delay(function () {
290
- return resizeUpdate ? 0 : delay;
291
- }).duration(duration).attr('transform', "translate(0, ".concat(yScale(0), ")")).call(d3.axisBottom().scale(xScale).tickPadding(height - yScale(0) + minBarHeight));
242
+ this.xAxis.transition().delay(() => resizeUpdate ? 0 : delay).duration(duration).attr('transform', "translate(0, ".concat(yScale(0), ")")).call(d3.axisBottom().scale(xScale).tickPadding(height - yScale(0) + minBarHeight));
292
243
  // #endregion x axis
293
244
 
294
245
  // #region y axis
295
- _this.yAxis.transition().duration(duration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
246
+ this.yAxis.transition().duration(duration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
296
247
  // #endregion y axis
297
248
 
298
249
  // #region bar measures functions
299
- var gainBarY = function gainBarY(d) {
300
- return d.gain < 0 ? yScale(0) : yScale(d.gain) - minBarHeight;
301
- };
302
- var gainBarHeight = function gainBarHeight(d) {
303
- return Math.abs(yScale(0) - yScale(d.gain)) + minBarHeight;
304
- };
305
- var profitBarY = function profitBarY(d) {
306
- return d.profit < 0 ? yScale(0) + gainBarHeight(d) : yScale(d.profit) - minBarHeight * 2;
307
- };
308
- var profitBarHeight = function profitBarHeight(d) {
309
- return Math.abs(yScale(d.gain) - yScale(d.profit)) + minBarHeight;
310
- };
250
+ const gainBarY = d => d.gain < 0 ? yScale(0) : yScale(d.gain) - minBarHeight;
251
+ const gainBarHeight = d => Math.abs(yScale(0) - yScale(d.gain)) + minBarHeight;
252
+ const profitBarY = d => d.profit < 0 ? yScale(0) + gainBarHeight(d) : yScale(d.profit) - minBarHeight * 2;
253
+ const profitBarHeight = d => Math.abs(yScale(d.gain) - yScale(d.profit)) + minBarHeight;
311
254
 
312
255
  // #endregion bar measures functions
313
256
 
314
- var chartContext = _assertThisInitialized(_this);
257
+ const chartContext = this;
315
258
  // #region bars
316
- var barGroups = _this.chart.selectAll('.stackedBar').data(data);
259
+ const barGroups = this.chart.selectAll('.stackedBar').data(data);
317
260
  barGroups.each(function bindContext(d, i) {
318
261
  d3.select(this).node().chartContext = chartContext;
319
262
  d3.select(this).node().xScale = xScale;
320
263
  });
321
- var barGroupsEnter = barGroups.enter().append('g').attr('class', 'stackedBar').attr('transform', "translate(".concat(-hThickness, ", 0)")).each(function bindContext(d, i) {
264
+ const barGroupsEnter = barGroups.enter().append('g').attr('class', 'stackedBar').attr('transform', "translate(".concat(-hThickness, ", 0)")).each(function bindContext(d, i) {
322
265
  d3.select(this).node().chartContext = chartContext;
323
266
  d3.select(this).node().xScale = xScale;
324
- }).on('mouseenter', tooltip ? _this.onMouseEnter : function () {}).on('mouseleave', tooltip ? _this.onMouseLeave : function () {});
267
+ }).on('mouseenter', tooltip ? this.onMouseEnter : () => {}).on('mouseleave', tooltip ? this.onMouseLeave : () => {});
325
268
 
326
269
  // #region gainBar
327
- barGroupsEnter.append('rect').attr('class', 'stackedBar__gain').attr('fill', "url(#".concat(id, "-barChart-bluegradient)")).attr('x', function (d, i) {
328
- return xScale(d.year) + xScale.bandwidth() / 2;
329
- }).attr('y', yScale(0)).attr('height', 0).attr('width', 6).transition().delay(function () {
330
- return delay * 4;
331
- }).duration(duration).attr('y', gainBarY).attr('height', gainBarHeight);
270
+ barGroupsEnter.append('rect').attr('class', 'stackedBar__gain').attr('fill', "url(#".concat(id, "-barChart-bluegradient)")).attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', yScale(0)).attr('height', 0).attr('width', 6).transition().delay(() => delay * 4).duration(duration).attr('y', gainBarY).attr('height', gainBarHeight);
332
271
  // #endregion gainBar
333
272
 
334
273
  // #region profitBar
335
- barGroupsEnter.append('rect').attr('class', 'stackedBar__profit').attr('fill', "url(#".concat(id, "-barChart-redgradient)")).attr('x', function (d, i) {
336
- return xScale(d.year) + xScale.bandwidth() / 2;
337
- }).attr('y', yScale(0)).attr('height', 0).attr('width', 6).transition().delay(function () {
338
- return delay * 4;
339
- }).duration(duration).attr('y', profitBarY).attr('height', profitBarHeight);
274
+ barGroupsEnter.append('rect').attr('class', 'stackedBar__profit').attr('fill', "url(#".concat(id, "-barChart-redgradient)")).attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', yScale(0)).attr('height', 0).attr('width', 6).transition().delay(() => delay * 4).duration(duration).attr('y', profitBarY).attr('height', profitBarHeight);
340
275
 
341
276
  // #endregion profitBar
342
277
 
343
- barGroupsEnter.append('text').attr('class', 'stackedBar__gainText').attr('fill', '#fff').attr('x', function (d, i) {
344
- return xScale(d.year) + xScale.bandwidth() / 2;
345
- }).attr('y', function (d) {
346
- return gainBarY(d) + gainBarHeight(d) / 2 + textOffsetTop;
347
- }).text(function (d) {
348
- return "\u20AC ".concat(d.gain);
349
- }).attr('opacity', 0);
350
- barGroupsEnter.append('text').attr('class', 'stackedBar__profitText').attr('fill', '#fff').attr('x', function (d, i) {
351
- return xScale(d.year) + xScale.bandwidth() / 2;
352
- }).attr('y', function (d) {
353
- return profitBarY(d) + profitBarHeight(d) / 2 + textOffsetTop;
354
- }).text(function (d) {
355
- return "\u20AC ".concat(d.profit);
356
- }).attr('opacity', 0);
278
+ barGroupsEnter.append('text').attr('class', 'stackedBar__gainText').attr('fill', '#fff').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', d => gainBarY(d) + gainBarHeight(d) / 2 + textOffsetTop).text(d => "\u20AC ".concat(d.gain)).attr('opacity', 0);
279
+ barGroupsEnter.append('text').attr('class', 'stackedBar__profitText').attr('fill', '#fff').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', d => profitBarY(d) + profitBarHeight(d) / 2 + textOffsetTop).text(d => "\u20AC ".concat(d.profit)).attr('opacity', 0);
357
280
 
358
281
  // #endregion bars
359
282
 
360
- barGroups.select('.stackedBar__gain').attr('width', 6).transition().delay(function () {
361
- return resizeUpdate ? 0 : delay;
362
- }).duration(duration).attr('x', function (d, i) {
363
- return xScale(d.year) + xScale.bandwidth() / 2;
364
- }).attr('y', gainBarY).attr('height', gainBarHeight);
365
- barGroups.select('.stackedBar__profit').attr('width', 6).transition().delay(function () {
366
- return resizeUpdate ? 0 : delay;
367
- }).duration(duration).attr('x', function (d, i) {
368
- return xScale(d.year) + xScale.bandwidth() / 2;
369
- }).attr('y', profitBarY).attr('height', profitBarHeight);
370
- barGroups.select('.stackedBar__gainText').attr('x', function (d, i) {
371
- return xScale(d.year) + xScale.bandwidth() / 2;
372
- }).attr('y', function (d) {
373
- return gainBarY(d) + gainBarHeight(d) / 2 + textOffsetTop;
374
- }).text(function (d) {
375
- return "\u20AC ".concat(d.gain);
376
- });
377
- barGroups.select('.stackedBar__profitText').attr('x', function (d, i) {
378
- return xScale(d.year) + xScale.bandwidth() / 2;
379
- }).attr('y', function (d) {
380
- return profitBarY(d) + profitBarHeight(d) / 2 + textOffsetTop;
381
- }).text(function (d) {
382
- return "\u20AC ".concat(d.profit);
383
- });
283
+ barGroups.select('.stackedBar__gain').attr('width', 6).transition().delay(() => resizeUpdate ? 0 : delay).duration(duration).attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', gainBarY).attr('height', gainBarHeight);
284
+ barGroups.select('.stackedBar__profit').attr('width', 6).transition().delay(() => resizeUpdate ? 0 : delay).duration(duration).attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', profitBarY).attr('height', profitBarHeight);
285
+ barGroups.select('.stackedBar__gainText').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', d => gainBarY(d) + gainBarHeight(d) / 2 + textOffsetTop).text(d => "\u20AC ".concat(d.gain));
286
+ barGroups.select('.stackedBar__profitText').attr('x', (d, i) => xScale(d.year) + xScale.bandwidth() / 2).attr('y', d => profitBarY(d) + profitBarHeight(d) / 2 + textOffsetTop).text(d => "\u20AC ".concat(d.profit));
384
287
  barGroups.exit().remove();
385
288
  });
386
- return _this;
387
289
  }
388
- _createClass(ROIChart, [{
389
- key: "componentDidMount",
390
- value: function componentDidMount() {
391
- this.createChart();
392
- window.addEventListener('resize', this.onResize);
393
- window.addEventListener('scroll', this.onScroll);
394
- this.onScroll();
290
+ componentDidMount() {
291
+ this.createChart();
292
+ window.addEventListener('resize', this.onResize);
293
+ window.addEventListener('scroll', this.onScroll);
294
+ this.onScroll();
295
+ }
296
+ componentDidUpdate(prevProps) {
297
+ const {
298
+ data
299
+ } = this.props;
300
+ const hasDataLengthChange = prevProps.data.length !== data.length;
301
+ if (hasDataLengthChange) {
302
+ this.updateChart();
303
+ return;
395
304
  }
396
- }, {
397
- key: "componentDidUpdate",
398
- value: function componentDidUpdate(prevProps) {
399
- var data = this.props.data;
400
- var hasDataLengthChange = prevProps.data.length !== data.length;
401
- if (hasDataLengthChange) {
402
- this.updateChart();
403
- return;
305
+ const hasDataChange = prevProps.data.some((datum, index) => datum.profit !== data[index].profit);
306
+ if (hasDataChange) {
307
+ this.updateChart();
308
+ }
309
+ }
310
+ componentWillUnmount() {
311
+ clearTimeout(this.resizeTimeout);
312
+ window.removeEventListener('resize', this.onResize);
313
+ window.removeEventListener('scroll', this.onScroll);
314
+ }
315
+ render() {
316
+ const {
317
+ tooltipOpen,
318
+ dataIndex
319
+ } = this.state;
320
+ const {
321
+ data
322
+ } = this.props;
323
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_ROIChart2.Chart, {
324
+ ref: el => {
325
+ this.chartEl = el;
404
326
  }
405
- var hasDataChange = prevProps.data.some(function (datum, index) {
406
- return datum.profit !== data[index].profit;
407
- });
408
- if (hasDataChange) {
409
- this.updateChart();
327
+ }, data[dataIndex] && data[dataIndex].tooltip && /*#__PURE__*/_react.default.createElement(_ROIChart2.TooltipWrapper, {
328
+ ref: el => {
329
+ this.tooltipEl = el;
410
330
  }
411
- }
412
- }, {
413
- key: "componentWillUnmount",
414
- value: function componentWillUnmount() {
415
- clearTimeout(this.resizeTimeout);
416
- window.removeEventListener('resize', this.onResize);
417
- window.removeEventListener('scroll', this.onScroll);
418
- }
419
- }, {
420
- key: "render",
421
- value: function render() {
422
- var _this2 = this;
423
- var _this$state = this.state,
424
- tooltipOpen = _this$state.tooltipOpen,
425
- dataIndex = _this$state.dataIndex;
426
- var data = this.props.data;
427
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_ROIChart.Chart, {
428
- ref: function ref(el) {
429
- _this2.chartEl = el;
430
- }
431
- }, data[dataIndex] && data[dataIndex].tooltip && /*#__PURE__*/_react.default.createElement(_ROIChart.TooltipWrapper, {
432
- ref: function ref(el) {
433
- _this2.tooltipEl = el;
434
- }
435
- }, /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
436
- open: tooltipOpen,
437
- position: "top",
438
- animation: "fade",
439
- html: data[dataIndex].tooltip,
440
- theme: "light",
441
- arrow: true,
442
- duration: 200
443
- }))), /*#__PURE__*/_react.default.createElement(_ROIChart.LegendWrapper, {
444
- noPaddingHorizontal: true
445
- }, /*#__PURE__*/_react.default.createElement(_BarChartLegend.default, {
446
- id: "roi-profit",
447
- label: "Cumulative profit payouts",
448
- colorTheme: "blue"
449
- }), /*#__PURE__*/_react.default.createElement(_BarChartLegend.default, {
450
- id: "roi-gain",
451
- label: "Gain on price",
452
- colorTheme: "red"
453
- })));
454
- }
455
- }]);
456
- return ROIChart;
457
- }(_react.PureComponent);
331
+ }, /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
332
+ open: tooltipOpen,
333
+ position: "top",
334
+ animation: "fade",
335
+ html: data[dataIndex].tooltip,
336
+ theme: "light",
337
+ arrow: true,
338
+ duration: 200
339
+ }))), /*#__PURE__*/_react.default.createElement(_ROIChart2.LegendWrapper, {
340
+ noPaddingHorizontal: true
341
+ }, /*#__PURE__*/_react.default.createElement(_BarChartLegend.default, {
342
+ id: "roi-profit",
343
+ label: "Cumulative profit payouts",
344
+ colorTheme: "blue"
345
+ }), /*#__PURE__*/_react.default.createElement(_BarChartLegend.default, {
346
+ id: "roi-gain",
347
+ label: "Gain on price",
348
+ colorTheme: "red"
349
+ })));
350
+ }
351
+ }
458
352
  exports.ROIChart = ROIChart;
459
353
  ROIChart.propTypes = {
460
354
  id: _propTypes.default.string.isRequired,
@@ -465,5 +359,4 @@ ROIChart.propTypes = {
465
359
  tooltip: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node])
466
360
  })).isRequired
467
361
  };
468
- var _default = ROIChart;
469
- exports.default = _default;
362
+ var _default = exports.default = ROIChart;