@redneckz/wildless-cms-uni-blocks 0.8.8 → 0.8.10

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 (404) hide show
  1. package/bin/migration-scripts/0.8.10.js +31 -0
  2. package/bundle/EventBus/EventBus.d.ts +1 -4
  3. package/bundle/EventBus/defaultEventBus.d.ts +7 -0
  4. package/bundle/blocks.schema.json +1 -1
  5. package/bundle/bundle.umd.js +112 -113
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  8. package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  9. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  10. package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  11. package/{dist/components/StepsBlock/renderStepContent.d.ts → bundle/components/StepsBlock/renderStep.d.ts} +5 -5
  12. package/bundle/components/Tile/TileContent.d.ts +2 -2
  13. package/bundle/hooks/useRouter.d.ts +6 -2
  14. package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  15. package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  16. package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  17. package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  18. package/dist/EventBus/EventBus.d.ts +1 -4
  19. package/dist/EventBus/EventBus.js +0 -1
  20. package/dist/EventBus/EventBus.js.map +1 -1
  21. package/dist/EventBus/defaultEventBus.d.ts +7 -0
  22. package/dist/EventBus/defaultEventBus.js +5 -0
  23. package/dist/EventBus/defaultEventBus.js.map +1 -0
  24. package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  25. package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  26. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  27. package/dist/components/Calculator/Rate.js +1 -1
  28. package/dist/components/Calculator/Rate.js.map +1 -1
  29. package/dist/components/Calculator/constants.js +2 -2
  30. package/dist/components/Calculator/constants.js.map +1 -1
  31. package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  32. package/dist/components/Calculator/rangeHelpers.js +12 -0
  33. package/dist/components/Calculator/rangeHelpers.js.map +1 -0
  34. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  35. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  36. package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  37. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  38. package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  39. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  40. package/dist/components/Carousel/Carousel.js +6 -4
  41. package/dist/components/Carousel/Carousel.js.map +1 -1
  42. package/dist/components/PictureText/renderBenefit.js +1 -0
  43. package/dist/components/PictureText/renderBenefit.js.map +1 -1
  44. package/dist/components/ProductTile/renderBenefit.js +1 -0
  45. package/dist/components/ProductTile/renderBenefit.js.map +1 -1
  46. package/dist/components/StepsBlock/StepsBlock.js +7 -13
  47. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  48. package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
  49. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  50. package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  51. package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  52. package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  53. package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  54. package/{bundle/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
  55. package/dist/components/StepsBlock/renderStep.js +34 -0
  56. package/dist/components/StepsBlock/renderStep.js.map +1 -0
  57. package/dist/components/Tabs/Tabs.js +4 -4
  58. package/dist/components/Tabs/Tabs.js.map +1 -1
  59. package/dist/components/Tile/Tile.js +3 -3
  60. package/dist/components/Tile/Tile.js.map +1 -1
  61. package/dist/components/Tile/TileContent.d.ts +2 -2
  62. package/dist/hooks/useLink.js +2 -3
  63. package/dist/hooks/useLink.js.map +1 -1
  64. package/dist/hooks/useRouter.d.ts +6 -2
  65. package/dist/hooks/useRouter.js.map +1 -1
  66. package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  67. package/dist/services/BlockRouter/BlockRouter.js +11 -30
  68. package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  69. package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  70. package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  71. package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  72. package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  73. package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  74. package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  75. package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  76. package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  77. package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  78. package/dist/ui-kit/BlockWrapper.js +2 -2
  79. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  80. package/lib/EventBus/EventBus.d.ts +1 -4
  81. package/lib/EventBus/EventBus.js +0 -1
  82. package/lib/EventBus/EventBus.js.map +1 -1
  83. package/lib/EventBus/defaultEventBus.d.ts +7 -0
  84. package/lib/EventBus/defaultEventBus.js +3 -0
  85. package/lib/EventBus/defaultEventBus.js.map +1 -0
  86. package/lib/common.css +1 -1
  87. package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  88. package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  89. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  90. package/lib/components/Calculator/Rate.js +1 -1
  91. package/lib/components/Calculator/Rate.js.map +1 -1
  92. package/lib/components/Calculator/constants.js +2 -2
  93. package/lib/components/Calculator/constants.js.map +1 -1
  94. package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  95. package/lib/components/Calculator/rangeHelpers.js +8 -0
  96. package/lib/components/Calculator/rangeHelpers.js.map +1 -0
  97. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  98. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  99. package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  100. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  101. package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  102. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  103. package/lib/components/Carousel/Carousel.js +6 -4
  104. package/lib/components/Carousel/Carousel.js.map +1 -1
  105. package/lib/components/PictureText/renderBenefit.js +1 -0
  106. package/lib/components/PictureText/renderBenefit.js.map +1 -1
  107. package/lib/components/ProductTile/renderBenefit.js +1 -0
  108. package/lib/components/ProductTile/renderBenefit.js.map +1 -1
  109. package/lib/components/StepsBlock/StepsBlock.js +7 -13
  110. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  111. package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
  112. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  113. package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  114. package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  115. package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  116. package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  117. package/{mobile/bundle/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
  118. package/lib/components/StepsBlock/renderStep.js +31 -0
  119. package/lib/components/StepsBlock/renderStep.js.map +1 -0
  120. package/lib/components/Tabs/Tabs.js +4 -4
  121. package/lib/components/Tabs/Tabs.js.map +1 -1
  122. package/lib/components/Tile/Tile.js +3 -3
  123. package/lib/components/Tile/Tile.js.map +1 -1
  124. package/lib/components/Tile/TileContent.d.ts +2 -2
  125. package/lib/hooks/useLink.js +2 -3
  126. package/lib/hooks/useLink.js.map +1 -1
  127. package/lib/hooks/useRouter.d.ts +6 -2
  128. package/lib/hooks/useRouter.js.map +1 -1
  129. package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  130. package/lib/services/BlockRouter/BlockRouter.js +8 -28
  131. package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  132. package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  133. package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  134. package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  135. package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  136. package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  137. package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  138. package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  139. package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  140. package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  141. package/lib/ui-kit/BlockWrapper.js +2 -2
  142. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  143. package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
  144. package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
  145. package/mobile/bundle/bundle.umd.js +58 -66
  146. package/mobile/bundle/bundle.umd.min.js +1 -1
  147. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  148. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  149. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  150. package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  151. package/{lib/components/StepsBlock/renderStepContent.d.ts → mobile/bundle/components/StepsBlock/renderStep.d.ts} +5 -5
  152. package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
  153. package/mobile/bundle/hooks/useRouter.d.ts +6 -2
  154. package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  155. package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  156. package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  157. package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  158. package/mobile/dist/EventBus/EventBus.d.ts +1 -4
  159. package/mobile/dist/EventBus/EventBus.js +0 -1
  160. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  161. package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
  162. package/mobile/dist/EventBus/defaultEventBus.js +5 -0
  163. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
  164. package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  165. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  166. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  167. package/mobile/dist/components/Calculator/Rate.js +1 -1
  168. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  169. package/mobile/dist/components/Calculator/constants.js +2 -2
  170. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  171. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  172. package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
  173. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
  174. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  175. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  176. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  177. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  178. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  179. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  180. package/mobile/dist/components/Carousel/Carousel.js +6 -4
  181. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  182. package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
  183. package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
  184. package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
  185. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
  186. package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
  187. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  188. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  189. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  190. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  191. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  192. package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
  193. package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
  194. package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
  195. package/mobile/dist/components/Tabs/Tabs.js +4 -4
  196. package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
  197. package/mobile/dist/components/Tile/Tile.js +3 -3
  198. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  199. package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
  200. package/mobile/dist/hooks/useLink.js +2 -3
  201. package/mobile/dist/hooks/useLink.js.map +1 -1
  202. package/mobile/dist/hooks/useRouter.d.ts +6 -2
  203. package/mobile/dist/hooks/useRouter.js.map +1 -1
  204. package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  205. package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
  206. package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  207. package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  208. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  209. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  210. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  211. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  212. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  213. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  214. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  215. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  216. package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
  217. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  218. package/mobile/lib/EventBus/EventBus.d.ts +1 -4
  219. package/mobile/lib/EventBus/EventBus.js +0 -1
  220. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  221. package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
  222. package/mobile/lib/EventBus/defaultEventBus.js +3 -0
  223. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
  224. package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  225. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  226. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  227. package/mobile/lib/components/Calculator/Rate.js +1 -1
  228. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  229. package/mobile/lib/components/Calculator/constants.js +2 -2
  230. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  231. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  232. package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
  233. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
  234. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  235. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  236. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  237. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  238. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  239. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  240. package/mobile/lib/components/Carousel/Carousel.js +6 -4
  241. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  242. package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
  243. package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
  244. package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
  245. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
  246. package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
  247. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  248. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  249. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  250. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  251. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  252. package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
  253. package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
  254. package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
  255. package/mobile/lib/components/Tabs/Tabs.js +4 -4
  256. package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
  257. package/mobile/lib/components/Tile/Tile.js +3 -3
  258. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  259. package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
  260. package/mobile/lib/hooks/useLink.js +2 -3
  261. package/mobile/lib/hooks/useLink.js.map +1 -1
  262. package/mobile/lib/hooks/useRouter.d.ts +6 -2
  263. package/mobile/lib/hooks/useRouter.js.map +1 -1
  264. package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  265. package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
  266. package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  267. package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  268. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  269. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  270. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  271. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  272. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  273. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  274. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  275. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  276. package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
  277. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  278. package/mobile/src/EventBus/EventBus.ts +1 -7
  279. package/mobile/src/EventBus/defaultEventBus.ts +8 -0
  280. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  281. package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  282. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  283. package/mobile/src/components/Calculator/Rate.tsx +1 -1
  284. package/mobile/src/components/Calculator/constants.ts +2 -2
  285. package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
  286. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  287. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  288. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  289. package/mobile/src/components/Carousel/Carousel.tsx +6 -4
  290. package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
  291. package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
  292. package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
  293. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  294. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  295. package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  296. package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
  297. package/mobile/src/components/Tabs/Tabs.tsx +4 -4
  298. package/mobile/src/components/Tile/Tile.example.json +1 -1
  299. package/mobile/src/components/Tile/Tile.tsx +4 -4
  300. package/mobile/src/components/Tile/Tile.ui.json +7 -1
  301. package/mobile/src/components/Tile/TileContent.ts +2 -2
  302. package/mobile/src/hooks/useLink.ts +2 -3
  303. package/mobile/src/hooks/useRouter.ts +6 -2
  304. package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
  305. package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  306. package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  307. package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  308. package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
  309. package/package.json +1 -1
  310. package/src/EventBus/EventBus.ts +1 -7
  311. package/src/EventBus/defaultEventBus.ts +8 -0
  312. package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  313. package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  314. package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  315. package/src/components/Calculator/Rate.tsx +1 -1
  316. package/src/components/Calculator/constants.ts +2 -2
  317. package/src/components/Calculator/rangeHelpers.ts +24 -0
  318. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  319. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  320. package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  321. package/src/components/Carousel/Carousel.tsx +6 -4
  322. package/src/components/PictureText/renderBenefit.tsx +1 -0
  323. package/src/components/ProductTile/renderBenefit.tsx +1 -0
  324. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
  325. package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
  326. package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
  327. package/src/components/StepsBlock/StepsBlock.tsx +28 -16
  328. package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  329. package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  330. package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  331. package/src/components/StepsBlock/renderStep.tsx +83 -0
  332. package/src/components/Tabs/Tabs.tsx +4 -4
  333. package/src/components/Tile/Tile.example.json +1 -1
  334. package/src/components/Tile/Tile.fixture.tsx +2 -2
  335. package/src/components/Tile/Tile.tsx +4 -4
  336. package/src/components/Tile/Tile.ui.json +7 -1
  337. package/src/components/Tile/TileContent.ts +2 -2
  338. package/src/hooks/useLink.ts +2 -3
  339. package/src/hooks/useRouter.ts +6 -2
  340. package/src/services/BlockRouter/BlockRouter.ts +8 -47
  341. package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  342. package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  343. package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  344. package/src/ui-kit/BlockWrapper.tsx +2 -2
  345. package/bundle/EventBus/EventMap.d.ts +0 -4
  346. package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  347. package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  348. package/dist/EventBus/EventMap.d.ts +0 -4
  349. package/dist/EventBus/EventMap.js +0 -2
  350. package/dist/EventBus/EventMap.js.map +0 -1
  351. package/dist/components/StepsBlock/renderStepContent.js +0 -19
  352. package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  353. package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  354. package/dist/services/BlockRouter/useBlockRouter.js +0 -8
  355. package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  356. package/dist/utils/checkIsIconRenderable.d.ts +0 -2
  357. package/dist/utils/checkIsIconRenderable.js +0 -5
  358. package/dist/utils/checkIsIconRenderable.js.map +0 -1
  359. package/lib/EventBus/EventMap.d.ts +0 -4
  360. package/lib/EventBus/EventMap.js +0 -2
  361. package/lib/EventBus/EventMap.js.map +0 -1
  362. package/lib/components/StepsBlock/renderStepContent.js +0 -16
  363. package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  364. package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  365. package/lib/services/BlockRouter/useBlockRouter.js +0 -5
  366. package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  367. package/lib/utils/checkIsIconRenderable.d.ts +0 -2
  368. package/lib/utils/checkIsIconRenderable.js +0 -2
  369. package/lib/utils/checkIsIconRenderable.js.map +0 -1
  370. package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
  371. package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  372. package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  373. package/mobile/dist/EventBus/EventMap.d.ts +0 -4
  374. package/mobile/dist/EventBus/EventMap.js +0 -2
  375. package/mobile/dist/EventBus/EventMap.js.map +0 -1
  376. package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
  377. package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
  378. package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  379. package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  380. package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
  381. package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  382. package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
  383. package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
  384. package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
  385. package/mobile/lib/EventBus/EventMap.d.ts +0 -4
  386. package/mobile/lib/EventBus/EventMap.js +0 -2
  387. package/mobile/lib/EventBus/EventMap.js.map +0 -1
  388. package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
  389. package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
  390. package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  391. package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  392. package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
  393. package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  394. package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
  395. package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
  396. package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
  397. package/mobile/src/EventBus/EventMap.ts +0 -5
  398. package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
  399. package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
  400. package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
  401. package/src/EventBus/EventMap.ts +0 -5
  402. package/src/components/StepsBlock/renderStepContent.tsx +0 -83
  403. package/src/services/BlockRouter/useBlockRouter.ts +0 -5
  404. package/src/utils/checkIsIconRenderable.tsx +0 -3
@@ -1,25 +1,14 @@
1
- import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
1
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
2
  import { useIntersectionObserver } from '../../hooks/useIntersectionObserver.js';
3
- import { BlockRouter } from './BlockRouter.js';
4
- export function useBlockIntersectionObserver(block, router = BlockRouter.inst) {
3
+ import { blockRouterEventBus } from './blockRouterEventBus.js';
4
+ export function useBlockIntersectionObserver(block) {
5
5
  const observerCallback = useCallback((entries) => {
6
6
  if (!block || !entries?.length) {
7
7
  return;
8
8
  }
9
9
  const intersection = entries[entries.length - 1];
10
- router.eventBus.fire('intersection', { block, intersection });
11
- }, [block, router]);
12
- const ref = useIntersectionObserver(observerCallback, { sensitivity: 1 });
13
- useEffect(() => {
14
- if (!ref.current) {
15
- return undefined;
16
- }
17
- return router.eventBus.subscribe('goto', ({ anchor }) => {
18
- if (ref.current && block?.anchor === anchor) {
19
- ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
20
- }
21
- });
22
- }, [block, router]);
23
- return ref;
10
+ blockRouterEventBus.fire('intersection', { block, intersection });
11
+ }, [block]);
12
+ return useIntersectionObserver(observerCallback, { sensitivity: 1 });
24
13
  }
25
14
  //# sourceMappingURL=useBlockIntersectionObserver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,UAAU,4BAA4B,CAC1C,KAAgB,EAChB,SAAsB,WAAW,CAAC,IAAI;IAEtC,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IAChE,CAAC,EACD,CAAC,KAAK,EAAE,MAAM,CAAC,CAChB,CAAC;IAEF,MAAM,GAAG,GAAG,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YAChB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACtD,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE;gBAC3C,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpB,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
@@ -1,2 +1 @@
1
- import { BlockRouter } from './BlockRouter';
2
- export declare function useBlockRouterProvider(router?: BlockRouter, scrollTarget?: EventTarget): void;
1
+ export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,27 +1,26 @@
1
1
  import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useRouter } from '../../hooks/useRouter.js';
2
3
  import { debounce } from '../../utils/debounce.js';
3
- import { BlockRouter } from './BlockRouter.js';
4
+ import { trackBlock } from './BlockRouter.js';
5
+ import { blockRouterEventBus } from './blockRouterEventBus.js';
4
6
  import { findActiveBlock } from './findActiveBlock.js';
5
7
  const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
6
- export function useBlockRouterProvider(router = BlockRouter.inst, scrollTarget = globalThis) {
8
+ export function useBlockRouterProvider(scrollTarget = globalThis) {
9
+ const router = useRouter();
7
10
  const intersectionsMapRef = useRef(new Map());
8
- useEffect(() => router.eventBus.subscribe('intersection', ({ block, intersection }) => {
11
+ useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
9
12
  if (intersectionsMapRef.current) {
10
13
  intersectionsMapRef.current.set(block, intersection);
11
14
  }
12
- }), [router]);
15
+ }), []);
13
16
  useEffect(() => {
14
17
  const handleScroll = debounce(() => {
15
- if (!isScrolledEnough()) {
16
- router.reset();
17
- return;
18
+ if (isScrolledEnough()) {
19
+ const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
20
+ trackBlock(router, activeBlock);
18
21
  }
19
- const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
20
- if (activeBlock?.anchor) {
21
- router.replace(activeBlock.anchor);
22
- }
23
- else if (!activeBlock) {
24
- router.reset();
22
+ else {
23
+ trackBlock(router);
25
24
  }
26
25
  }, 100);
27
26
  scrollTarget.addEventListener('scroll', handleScroll);
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAA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AAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC9E,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACL,UAAU,CAAC,MAAM,CAAC,CAAC;aACpB;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
4
- import { EventBus } from '../EventBus/EventBus.js';
4
+ import { defaultEventBus } from '../EventBus/defaultEventBus.js';
5
5
  import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver.js';
6
6
  import { style } from '../utils/style.js';
7
7
  export const blockStyles = {
@@ -15,7 +15,7 @@ export const BlockWrapper = JSX(({ className = '', version = 'primary', block, t
15
15
  const Tag = tag;
16
16
  const ref = useBlockIntersectionObserver(block);
17
17
  const [isVisible, setVisible] = useState(true);
18
- useEffect(() => EventBus.inst.subscribe('tab', (event) => {
18
+ useEffect(() => defaultEventBus.subscribe('tab', (event) => {
19
19
  if (event.type === 'group') {
20
20
  const hasSettings = block?.labels?.length || block?.anchor;
21
21
  setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MA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
-
3
- export type BaseEventMap = Record<string, any>;
4
-
5
- export class EventBus<EM extends BaseEventMap> {
6
- public static readonly inst = new EventBus<EventMap>();
7
-
1
+ export class EventBus<EM extends Record<string, any>> {
8
2
  private subscribers: Partial<Record<keyof EM, Array<(ev: EM[keyof EM]) => void>>> = {};
9
3
  private subjectsStateMap: Partial<EM> = {};
10
4
 
@@ -0,0 +1,8 @@
1
+ import type { TabActivationEvent } from '../components/Tabs/Tabs';
2
+ import { EventBus } from './EventBus';
3
+
4
+ interface GlobalEventMap {
5
+ tab: TabActivationEvent;
6
+ }
7
+
8
+ export const defaultEventBus = new EventBus<GlobalEventMap>();
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "content": {
3
3
  "button": {
4
- "href": "/credit-cards",
5
- "text": "Подробнее",
4
+ "href": "#",
5
+ "text": "Кнопка",
6
6
  "target": "_blank",
7
7
  "version": "primary"
8
8
  }
@@ -2,10 +2,13 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
4
  import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
5
+ import { style } from '../../utils/style';
5
6
  import type { ButtonBlockContent } from './ButtonBlockContent';
6
7
 
7
8
  interface ButtonBlockProps extends ButtonBlockContent, UniBlockProps {}
8
9
 
9
- export const ButtonBlock = JSX<ButtonBlockProps>(({ button, ...rest }) => (
10
- <BlockWrapper {...rest}>{renderButtonsSection([button])}</BlockWrapper>
10
+ export const ButtonBlock = JSX<ButtonBlockProps>(({ button, className, ...rest }) => (
11
+ <BlockWrapper className={style('!bg-transparent', className)} {...rest}>
12
+ {renderButtonsSection([button])}
13
+ </BlockWrapper>
11
14
  ));
@@ -4,6 +4,10 @@ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
4
  * @title Блок Кнопка
5
5
  */
6
6
  export interface ButtonBlockContent {
7
- /** @title Кнопка */
7
+ /**
8
+ * @title Кнопка
9
+ * @default {"icon": {"format": "webp", "size": { "width": 24, "height": 24 }},
10
+ * "iconRight": {"format": "webp", "size": { "width": 24, "height": 24 }}}
11
+ */
8
12
  button?: ButtonWithIconProps;
9
13
  }
@@ -25,7 +25,7 @@ export const Rate = JSX<RateProps>(
25
25
  rateBlockClassName,
26
26
  )}
27
27
  >
28
- {String(rate).replace('.', ',')}
28
+ {String(rate.toFixed(2)).replace('.', ',')}
29
29
  </span>
30
30
  {unit ? (
31
31
  <span className="gradient-color-text text-[65px] leading-[75px]">{unit}</span>
@@ -54,7 +54,7 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParam
54
54
  maxSum: 5000000,
55
55
  minMonths: 2,
56
56
  maxMonths: 120,
57
- rate: 5.9,
57
+ rate: 7,
58
58
  isMonthlyInterestPayment: true,
59
59
  };
60
60
 
@@ -64,7 +64,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
64
64
  maxSum: 500000,
65
65
  minDays: BUSINESS_MIN_DAYS,
66
66
  maxDays: BUSINESS_MAX_DAYS,
67
- rate: 5.9,
67
+ rate: 6.6,
68
68
  isMonthlyInterestPayment: true,
69
69
  isReplenished: false,
70
70
  isPartialWithdrawal: false,
@@ -0,0 +1,24 @@
1
+ import { maxBy } from '../../utils/maxBy';
2
+ import { minBy } from '../../utils/minBy';
3
+
4
+ export const getRangeByKeys = <
5
+ MinKey extends string,
6
+ MaxKey extends string,
7
+ T extends Record<MinKey | MaxKey, number>,
8
+ >(
9
+ [minKey, maxKey]: [MinKey, MaxKey],
10
+ rows: T[] = [],
11
+ ) => ({
12
+ [minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
13
+ [maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
14
+ });
15
+
16
+ export const checkRangeByKeys = <
17
+ MinKey extends string,
18
+ MaxKey extends string,
19
+ T extends Record<MinKey | MaxKey, number>,
20
+ >(
21
+ value: number,
22
+ [minKey, maxKey]: [MinKey, MaxKey],
23
+ sourceBookRow: T,
24
+ ): boolean => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
@@ -5,6 +5,7 @@ import {
5
5
  BUSINESS_RATE_MIN_DAYS,
6
6
  DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
7
7
  } from './constants';
8
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
8
9
  import { useCalculatorParams } from './useCalculatorParams';
9
10
  import type { CommonDepositParams } from './useDepositCalculatorParams';
10
11
 
@@ -72,9 +73,9 @@ export const useBusinessDepositCalculatorParams = (
72
73
  return (
73
74
  isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
74
75
  isSmallBusiness === _.isSmallBusiness &&
75
- (isOperatingDeposit
76
- ? _.isReplenished && _.isPartialWithdrawal
77
- : !_.isReplenished && !_.isPartialWithdrawal)
76
+ checkIsOperatingDeposit(isOperatingDeposit, _) &&
77
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
78
+ checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _)
78
79
  );
79
80
  }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
80
81
 
@@ -82,9 +83,12 @@ export const useBusinessDepositCalculatorParams = (
82
83
 
83
84
  const income = getDepositIncome(rate, userInputParams);
84
85
  const finalSum = moneyValue + income;
86
+ const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
85
87
 
86
88
  return {
87
89
  ...businessDepositCalculatorSourceBookParams,
90
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
91
+ ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
88
92
  ...userInputParams,
89
93
  isDisabledOperatingDeposit,
90
94
  income,
@@ -92,6 +96,14 @@ export const useBusinessDepositCalculatorParams = (
92
96
  };
93
97
  };
94
98
 
99
+ const checkIsOperatingDeposit = (
100
+ isOperatingDeposit: boolean,
101
+ sourceBookRow: BusinessDepositCalculatorSourceBookParams,
102
+ ) =>
103
+ isOperatingDeposit
104
+ ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
105
+ : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
106
+
95
107
  const getDepositIncome = (
96
108
  rate: number,
97
109
  userInputParams: BusinessDepositCalculatorUserInputParams,
@@ -1,5 +1,6 @@
1
1
  import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
2
2
  import { getMonthlyPayment } from './getMonthlyPayment';
3
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
3
4
  import { useCalculatorParams } from './useCalculatorParams';
4
5
 
5
6
  export interface CommonCreditParams {
@@ -38,7 +39,7 @@ export const useCreditCalculatorParams = (
38
39
  userInputParams: CreditCalculatorUserInputParams,
39
40
  sourceBookDir?: string,
40
41
  ): CreditCalculatorParams => {
41
- const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
42
+ const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
42
43
 
43
44
  const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
44
45
  const creditCalculatorSourceBookParams =
@@ -46,16 +47,21 @@ export const useCreditCalculatorParams = (
46
47
  return (
47
48
  isInsurance === _.isInsurance &&
48
49
  isSalaryClient === _.isSalaryClient &&
49
- isStateEmployee === _.isStateEmployee
50
+ isStateEmployee === _.isStateEmployee &&
51
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
52
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)
50
53
  );
51
54
  }) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
52
55
 
53
56
  const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
54
57
  const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
55
58
  const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
59
+ const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
56
60
 
57
61
  return {
58
62
  ...creditCalculatorSourceBookParams,
63
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
64
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
59
65
  ...userInputParams,
60
66
  finalRate,
61
67
  monthlyPayment,
@@ -1,9 +1,11 @@
1
1
  import { DEFAULT_DEPOSIT_CALCULATOR_PARAMS, DEPOSIT_CALC_DEFAULT_DIR } from './constants';
2
+ import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
2
3
  import { useCalculatorParams } from './useCalculatorParams';
3
4
 
4
5
  export interface CommonDepositParams {
5
6
  isMonthlyInterestPayment: boolean;
6
7
  }
8
+
7
9
  export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
8
10
  minSum: number;
9
11
  maxSum: number;
@@ -32,22 +34,34 @@ export const useDepositCalculatorParams = (
32
34
  userInputParams: DepositCalculatorUserInputParams,
33
35
  sourceBookDir?: string,
34
36
  ): DepositCalculatorParams => {
35
- const { isMonthlyInterestPayment, moneyValue } = userInputParams;
37
+ const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
36
38
 
37
39
  const data = useCalculatorParams<DepositCalculatorData>(
38
40
  sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
39
41
  );
40
42
 
41
43
  const depositCalculatorSourceBookParams =
42
- data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
43
- DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
44
+ data?.rows?.find(
45
+ (_) =>
46
+ isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
47
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
48
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
49
+ ) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
44
50
 
45
51
  const { rate } = depositCalculatorSourceBookParams;
46
52
 
47
53
  const income = getDepositIncome(rate, userInputParams);
48
54
  const finalSum = moneyValue + income;
55
+ const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
49
56
 
50
- return { ...depositCalculatorSourceBookParams, ...userInputParams, income, finalSum };
57
+ return {
58
+ ...depositCalculatorSourceBookParams,
59
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
60
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
61
+ ...userInputParams,
62
+ income,
63
+ finalSum,
64
+ };
51
65
  };
52
66
 
53
67
  const getDepositIncome = (rate: number, userInputParams: DepositCalculatorUserInputParams) => {
@@ -52,10 +52,12 @@ export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
52
52
  gap={ITEMS_GAP}
53
53
  onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
54
54
  >
55
- {renderChildren({
56
- ...rest,
57
- block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
58
- })}
55
+ {isBankHistoryCarousel
56
+ ? renderChildren({
57
+ ...rest,
58
+ block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
59
+ })
60
+ : renderChildren(rest)}
59
61
  </SwipeListContainer>
60
62
  <CarouselScrollButtons
61
63
  scroll={scroll}
@@ -4,6 +4,7 @@ import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemPr
4
4
  import { RichText } from '../../ui-kit/RichText/RichText';
5
5
  import { assertUnreachable } from '../../utils/assertUnreachable';
6
6
 
7
+ // TODO: Create universal function for this case
7
8
  export const renderBenefit =
8
9
  // Linter doesn't understand that switch processes all cases
9
10
  // eslint-disable-next-line consistent-return
@@ -3,6 +3,7 @@ import { Text } from '../../ui-kit/Text/Text';
3
3
  import { assertUnreachable } from '../../utils/assertUnreachable';
4
4
  import type { Benefit } from './ProductTileContent';
5
5
 
6
+ // TODO: Create universal function for this case
6
7
  export const renderBenefit =
7
8
  // Linter doesn't understand that switch processes all cases
8
9
  // eslint-disable-next-line consistent-return
@@ -5,9 +5,11 @@ import type { SizeVersion } from '../../model/SizeVersion';
5
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
- import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
8
+ import { RichText } from '../../ui-kit/RichText/RichText';
9
+ import { assertUnreachable } from '../../utils/assertUnreachable';
9
10
  import { getIconWithVersion } from '../../utils/getIconWithVersion';
10
- import type { Step, StepsBlockContent } from './StepsBlockContent';
11
+ import { checkCanRenderIcon } from './checkCanRenderIcon';
12
+ import type { DefaultStep, Step, StepsBlockContent } from './StepsBlockContent';
11
13
  import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
12
14
 
13
15
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
@@ -50,7 +52,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
50
52
  {steps?.length ? (
51
53
  <div className={`box-border py-0.5 mb-0.5 mt-5`}>
52
54
  <div className="flex flex-col justify-between gap-x-[101px]">
53
- {steps.map(renderStepTitle(size, version, showLines))}
55
+ {steps.map(renderStep(size, version, showLines))}
54
56
  </div>
55
57
  </div>
56
58
  ) : null}
@@ -59,9 +61,31 @@ export const StepsBlock = JSX<StepsBlockProps>(
59
61
  },
60
62
  );
61
63
 
62
- const renderStepTitle =
64
+ // TODO: Create universal function for this case
65
+ const renderStep =
63
66
  (size: SizeVersion, version: BlockVersion, showLines: boolean) =>
67
+ // Linter doesn't understand that switch processes all cases
68
+ // eslint-disable-next-line consistent-return
64
69
  (step: Step, i: number, steps: Step[]) => {
70
+ const { type } = step;
71
+
72
+ if (!(type === 'default' || type === 'rte')) {
73
+ return null;
74
+ }
75
+
76
+ switch (type) {
77
+ case 'default':
78
+ return renderDefaultStep(size, version, showLines)(step, i, steps);
79
+ case 'rte':
80
+ return <RichText __html={step.__html} />;
81
+ default:
82
+ assertUnreachable(step);
83
+ }
84
+ };
85
+
86
+ const renderDefaultStep =
87
+ (size: SizeVersion, version: BlockVersion, showLines: boolean) =>
88
+ (step: DefaultStep, i: number, steps: Step[]) => {
65
89
  const isLastStep = steps.length - 1 === i;
66
90
  const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
67
91
  const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
@@ -106,7 +130,7 @@ const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step
106
130
  className={`${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`}
107
131
  >
108
132
  <span className={`font-medium flex self-center ${iconTextSize}`}>
109
- {checkIsIconRenderable(step?.icon) ? (
133
+ {checkCanRenderIcon(step?.icon) ? (
110
134
  <Img
111
135
  image={getIconWithVersion({ ...step.icon }, version)}
112
136
  width={iconSize}
@@ -12,6 +12,12 @@
12
12
  "iconRight": {
13
13
  "ui:field": "icon"
14
14
  }
15
+ },
16
+ "__html": {
17
+ "ui:widget": "html"
18
+ },
19
+ "type": {
20
+ "ui:widget": "hidden"
15
21
  }
16
22
  }
17
23
  }
@@ -1,6 +1,8 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { DefaultListItemType } from '../../model/DefaultListItemType';
2
3
  import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
3
4
  import type { IconProps } from '../../model/Picture';
5
+ import type { RichTextItem } from '../../model/RichTextItem';
4
6
  import type { SizeVersion } from '../../model/SizeVersion';
5
7
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
6
8
 
@@ -16,10 +18,20 @@ type StepCommonProps = IconProps & {
16
18
  items?: string[];
17
19
  };
18
20
 
21
+ /**
22
+ * @title Стандартный
23
+ */
24
+ export type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
25
+
26
+ /**
27
+ * @title Форматированный текст
28
+ */
29
+ type RichTextStep = RichTextItem & IconProps;
30
+
19
31
  /**
20
32
  * @title Шаг
21
33
  */
22
- export type Step = DescriptionProps & LabelProps & StepCommonProps;
34
+ export type Step = DefaultStep | RichTextStep;
23
35
 
24
36
  /**
25
37
  * @title Блок шаги
@@ -0,0 +1,3 @@
1
+ import type { Picture } from '../../model/Picture';
2
+
3
+ export const checkCanRenderIcon = (icon?: Picture) => Boolean(icon?.icon || icon?.src);
@@ -0,0 +1,83 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { ButtonVersion } from '../../model/ButtonVersion';
3
+ import type { VNode } from '../../model/VNode';
4
+ import { Button } from '../../ui-kit/Button/Button';
5
+ import { List } from '../../ui-kit/List/List';
6
+ import { RichText } from '../../ui-kit/RichText/RichText';
7
+ import { Text } from '../../ui-kit/Text/Text';
8
+ import { assertUnreachable } from '../../utils/assertUnreachable';
9
+ import { style } from '../../utils/style';
10
+ import type { DefaultStep, Step } from './StepsBlockContent';
11
+ import type { StyleType } from './StepsBlockStyleMaps';
12
+
13
+ interface RenderStepProps {
14
+ styleMap: StyleType;
15
+ isMainButton: boolean;
16
+ version?: BlockVersion;
17
+ }
18
+
19
+ // TODO: Create universal function for this case
20
+ export const renderStep =
21
+ (props: RenderStepProps) =>
22
+ // Linter doesn't understand that switch processes all cases
23
+ // eslint-disable-next-line consistent-return
24
+ (step: Step, i: number, arr: Step[]): VNode => {
25
+ const { type } = step;
26
+
27
+ if (!(type === 'default' || type === 'rte')) {
28
+ return null;
29
+ }
30
+
31
+ switch (type) {
32
+ case 'default':
33
+ return renderDefaultStep(props)(step, i, arr);
34
+ case 'rte':
35
+ return <RichText __html={step.__html} />;
36
+ default:
37
+ assertUnreachable(step);
38
+ }
39
+ };
40
+
41
+ const renderDefaultStep =
42
+ ({ styleMap, isMainButton, version }: RenderStepProps) =>
43
+ (step: DefaultStep, i: number, arr: Step[]) => {
44
+ const { label, description, button, items, isDotted } = step;
45
+
46
+ return (
47
+ <div
48
+ key={String(i)}
49
+ className={style(
50
+ 'relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden',
51
+ getContainerWidth(arr.length),
52
+ )}
53
+ >
54
+ <div className={style(button?.text ? 'mb-8' : '', 'text-center')}>
55
+ {label ? (
56
+ <div className="mb-2">
57
+ <Text size="text-h6">{label}</Text>
58
+ </div>
59
+ ) : null}
60
+ <div className="flex flex-col items-center">
61
+ {description ? <div className={styleMap.description}>{description}</div> : null}
62
+ <List
63
+ className={style(description ? `${styleMap.description} mt-0.5` : 'text-h6')}
64
+ items={items}
65
+ listItemSize="M"
66
+ isDotted={isDotted}
67
+ />
68
+ </div>
69
+ </div>
70
+ {button?.text && !isMainButton ? (
71
+ <Button
72
+ className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
73
+ version={version as ButtonVersion}
74
+ {...button}
75
+ >
76
+ {button?.text}
77
+ </Button>
78
+ ) : null}
79
+ </div>
80
+ );
81
+ };
82
+
83
+ const getContainerWidth = (length: number): string => (length < 5 ? 'w-[276px]' : 'w-[210px]');