@redneckz/wildless-cms-uni-blocks 0.10.6 → 0.10.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 (473) hide show
  1. package/bundle/bundle.umd.js +198 -266
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Calculator/Rate.d.ts +1 -0
  4. package/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  5. package/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  6. package/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  7. package/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  8. package/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  9. package/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  10. package/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  11. package/bundle/components/Carousel/itemsGap.d.ts +1 -0
  12. package/bundle/components/Carousel/itemsGap.mobile.d.ts +1 -0
  13. package/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  14. package/bundle/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  15. package/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  16. package/bundle/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  17. package/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  18. package/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  19. package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  20. package/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  21. package/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  22. package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  23. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  24. package/dist/components/Blocks.mobile.js +4 -0
  25. package/dist/components/Blocks.mobile.js.map +1 -1
  26. package/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  27. package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  28. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  29. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  30. package/dist/components/Calculator/Calculator.js +4 -4
  31. package/dist/components/Calculator/Calculator.js.map +1 -1
  32. package/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  33. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  34. package/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  35. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  36. package/dist/components/Calculator/Rate.d.ts +1 -0
  37. package/dist/components/Calculator/Rate.js +1 -1
  38. package/dist/components/Calculator/Rate.js.map +1 -1
  39. package/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  40. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  41. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  42. package/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  43. package/dist/components/Calculator/renderDaysInput.js +2 -9
  44. package/dist/components/Calculator/renderDaysInput.js.map +1 -1
  45. package/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  46. package/dist/components/Calculator/renderInterestPayment.js +8 -18
  47. package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  48. package/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  49. package/dist/components/Calculator/renderMonthsInput.js +2 -10
  50. package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  51. package/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  52. package/dist/components/Calculator/renderPaymentType.js +9 -19
  53. package/dist/components/Calculator/renderPaymentType.js.map +1 -1
  54. package/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  55. package/dist/components/Calculator/renderRegistrationType.js +8 -18
  56. package/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  57. package/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  58. package/dist/components/Calculator/renderWantedSumInput.js +4 -6
  59. package/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  60. package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  61. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  62. package/dist/components/Carousel/Carousel.js +3 -3
  63. package/dist/components/Carousel/Carousel.js.map +1 -1
  64. package/dist/components/Carousel/itemsGap.d.ts +1 -0
  65. package/dist/components/Carousel/itemsGap.js +4 -0
  66. package/dist/components/Carousel/itemsGap.js.map +1 -0
  67. package/dist/components/Carousel/itemsGap.mobile.d.ts +1 -0
  68. package/dist/components/Carousel/itemsGap.mobile.js +4 -0
  69. package/dist/components/Carousel/itemsGap.mobile.js.map +1 -0
  70. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  71. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  72. package/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  73. package/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  74. package/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  75. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  76. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js +4 -0
  77. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  78. package/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  79. package/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  80. package/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  81. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  82. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js +5 -0
  83. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  84. package/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  85. package/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  86. package/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  87. package/dist/components/Headline/Headline.js +2 -1
  88. package/dist/components/Headline/Headline.js.map +1 -1
  89. package/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  90. package/dist/components/Headline/headlineVersionStyles.js +6 -6
  91. package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  92. package/dist/hooks/useForm.js +2 -2
  93. package/dist/hooks/useForm.js.map +1 -1
  94. package/dist/ui-kit/Checkbox/Checkbox.js +4 -1
  95. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  96. package/dist/ui-kit/InputRange/InputRange.js +22 -16
  97. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  98. package/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  99. package/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  100. package/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  101. package/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  102. package/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  103. package/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  104. package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  105. package/dist/utils/getSanitizedValue.js +1 -1
  106. package/dist/utils/getSanitizedValue.js.map +1 -1
  107. package/dist/wlc.json +1 -2
  108. package/lib/common.css +1 -1
  109. package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  110. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  111. package/lib/components/Blocks.mobile.js +4 -0
  112. package/lib/components/Blocks.mobile.js.map +1 -1
  113. package/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  114. package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  115. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  116. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  117. package/lib/components/Calculator/Calculator.js +4 -4
  118. package/lib/components/Calculator/Calculator.js.map +1 -1
  119. package/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  120. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  121. package/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  122. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  123. package/lib/components/Calculator/Rate.d.ts +1 -0
  124. package/lib/components/Calculator/Rate.js +1 -1
  125. package/lib/components/Calculator/Rate.js.map +1 -1
  126. package/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  127. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  128. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  129. package/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  130. package/lib/components/Calculator/renderDaysInput.js +2 -9
  131. package/lib/components/Calculator/renderDaysInput.js.map +1 -1
  132. package/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  133. package/lib/components/Calculator/renderInterestPayment.js +8 -18
  134. package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  135. package/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  136. package/lib/components/Calculator/renderMonthsInput.js +2 -10
  137. package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  138. package/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  139. package/lib/components/Calculator/renderPaymentType.js +8 -18
  140. package/lib/components/Calculator/renderPaymentType.js.map +1 -1
  141. package/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  142. package/lib/components/Calculator/renderRegistrationType.js +8 -18
  143. package/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  144. package/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  145. package/lib/components/Calculator/renderWantedSumInput.js +4 -6
  146. package/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  147. package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  148. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  149. package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +11 -0
  150. package/lib/components/Carousel/Carousel.js +2 -2
  151. package/lib/components/Carousel/Carousel.js.map +1 -1
  152. package/lib/components/Carousel/itemsGap.d.ts +1 -0
  153. package/lib/components/Carousel/itemsGap.js +2 -0
  154. package/lib/components/Carousel/itemsGap.js.map +1 -0
  155. package/lib/components/Carousel/itemsGap.mobile.d.ts +1 -0
  156. package/lib/components/Carousel/itemsGap.mobile.js +2 -0
  157. package/lib/components/Carousel/itemsGap.mobile.js.map +1 -0
  158. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.d.ts +9 -0
  159. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  160. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  161. package/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  162. package/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  163. package/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  164. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  165. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js +2 -0
  166. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  167. package/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  168. package/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  169. package/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  170. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  171. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js +2 -0
  172. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  173. package/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  174. package/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  175. package/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  176. package/lib/components/Headline/Headline.fixture.mobile.d.ts +22 -0
  177. package/lib/components/Headline/Headline.js +2 -1
  178. package/lib/components/Headline/Headline.js.map +1 -1
  179. package/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  180. package/lib/components/Headline/headlineVersionStyles.js +6 -6
  181. package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  182. package/lib/hooks/useForm.js +2 -2
  183. package/lib/hooks/useForm.js.map +1 -1
  184. package/lib/ui-kit/Checkbox/Checkbox.js +4 -1
  185. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  186. package/lib/ui-kit/InputRange/InputRange.js +22 -16
  187. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  188. package/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  189. package/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  190. package/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  191. package/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  192. package/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  193. package/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  194. package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  195. package/lib/utils/getSanitizedValue.js +1 -1
  196. package/lib/utils/getSanitizedValue.js.map +1 -1
  197. package/lib/wlc.json +1 -2
  198. package/mobile/bundle/bundle.umd.js +363 -265
  199. package/mobile/bundle/bundle.umd.min.js +1 -1
  200. package/mobile/bundle/components/Calculator/Rate.d.ts +1 -0
  201. package/mobile/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  202. package/mobile/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  203. package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  204. package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  205. package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  206. package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  207. package/mobile/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  208. package/mobile/bundle/components/Carousel/itemsGap.d.ts +1 -0
  209. package/mobile/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  210. package/mobile/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  211. package/mobile/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  212. package/mobile/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  213. package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  214. package/mobile/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  215. package/mobile/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  216. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  217. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  218. package/mobile/dist/components/Blocks.js +4 -0
  219. package/mobile/dist/components/Blocks.js.map +1 -1
  220. package/mobile/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  221. package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  222. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  223. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  224. package/mobile/dist/components/Calculator/Calculator.js +4 -4
  225. package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
  226. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  227. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  228. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  229. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  230. package/mobile/dist/components/Calculator/Rate.d.ts +1 -0
  231. package/mobile/dist/components/Calculator/Rate.js +1 -1
  232. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  233. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  234. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  235. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  236. package/mobile/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  237. package/mobile/dist/components/Calculator/renderDaysInput.js +2 -9
  238. package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -1
  239. package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  240. package/mobile/dist/components/Calculator/renderInterestPayment.js +8 -18
  241. package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  242. package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  243. package/mobile/dist/components/Calculator/renderMonthsInput.js +2 -10
  244. package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  245. package/mobile/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  246. package/mobile/dist/components/Calculator/renderPaymentType.js +9 -19
  247. package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -1
  248. package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  249. package/mobile/dist/components/Calculator/renderRegistrationType.js +8 -18
  250. package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  251. package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  252. package/mobile/dist/components/Calculator/renderWantedSumInput.js +4 -6
  253. package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  254. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  255. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  256. package/mobile/dist/components/Carousel/Carousel.js +3 -3
  257. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  258. package/mobile/dist/components/Carousel/itemsGap.d.ts +1 -0
  259. package/mobile/dist/components/Carousel/itemsGap.js +4 -0
  260. package/mobile/dist/components/Carousel/itemsGap.js.map +1 -0
  261. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  262. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  263. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  264. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  265. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  266. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  267. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  268. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  269. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  270. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  271. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  272. package/mobile/dist/components/Headline/Headline.js +2 -1
  273. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  274. package/mobile/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  275. package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
  276. package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  277. package/mobile/dist/hooks/useForm.js +2 -2
  278. package/mobile/dist/hooks/useForm.js.map +1 -1
  279. package/mobile/dist/ui-kit/Checkbox/Checkbox.js +4 -1
  280. package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  281. package/mobile/dist/ui-kit/InputRange/InputRange.js +22 -16
  282. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  283. package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  284. package/mobile/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  285. package/mobile/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  286. package/mobile/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  287. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  288. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  289. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  290. package/mobile/dist/utils/getSanitizedValue.js +1 -1
  291. package/mobile/dist/utils/getSanitizedValue.js.map +1 -1
  292. package/mobile/dist/wlc.json +1 -2
  293. package/mobile/lib/common.css +1 -1
  294. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  295. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  296. package/mobile/lib/components/Blocks.js +4 -0
  297. package/mobile/lib/components/Blocks.js.map +1 -1
  298. package/mobile/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  299. package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  300. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  301. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  302. package/mobile/lib/components/Calculator/Calculator.js +4 -4
  303. package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
  304. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  305. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  306. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  307. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  308. package/mobile/lib/components/Calculator/Rate.d.ts +1 -0
  309. package/mobile/lib/components/Calculator/Rate.js +1 -1
  310. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  311. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  312. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  313. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  314. package/mobile/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  315. package/mobile/lib/components/Calculator/renderDaysInput.js +2 -9
  316. package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -1
  317. package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  318. package/mobile/lib/components/Calculator/renderInterestPayment.js +8 -18
  319. package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  320. package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  321. package/mobile/lib/components/Calculator/renderMonthsInput.js +2 -10
  322. package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  323. package/mobile/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  324. package/mobile/lib/components/Calculator/renderPaymentType.js +8 -18
  325. package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -1
  326. package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  327. package/mobile/lib/components/Calculator/renderRegistrationType.js +8 -18
  328. package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  329. package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  330. package/mobile/lib/components/Calculator/renderWantedSumInput.js +4 -6
  331. package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  332. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  333. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  334. package/mobile/lib/components/Carousel/Carousel.js +2 -2
  335. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  336. package/mobile/lib/components/Carousel/itemsGap.d.ts +1 -0
  337. package/mobile/lib/components/Carousel/itemsGap.js +2 -0
  338. package/mobile/lib/components/Carousel/itemsGap.js.map +1 -0
  339. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  340. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  341. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  342. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  343. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  344. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  345. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  346. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  347. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  348. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  349. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  350. package/mobile/lib/components/Headline/Headline.js +2 -1
  351. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  352. package/mobile/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  353. package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
  354. package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  355. package/mobile/lib/hooks/useForm.js +2 -2
  356. package/mobile/lib/hooks/useForm.js.map +1 -1
  357. package/mobile/lib/ui-kit/Checkbox/Checkbox.js +4 -1
  358. package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  359. package/mobile/lib/ui-kit/InputRange/InputRange.js +22 -16
  360. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  361. package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  362. package/mobile/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  363. package/mobile/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  364. package/mobile/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  365. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  366. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  367. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  368. package/mobile/lib/utils/getSanitizedValue.js +1 -1
  369. package/mobile/lib/utils/getSanitizedValue.js.map +1 -1
  370. package/mobile/lib/wlc.json +1 -2
  371. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  372. package/mobile/src/components/Blocks.ts +4 -0
  373. package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  374. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  375. package/mobile/src/components/Calculator/Calculator.tsx +11 -5
  376. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  377. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  378. package/mobile/src/components/Calculator/Rate.tsx +14 -14
  379. package/mobile/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  380. package/mobile/src/components/Calculator/renderDaysInput.tsx +10 -31
  381. package/mobile/src/components/Calculator/renderInterestPayment.tsx +13 -52
  382. package/mobile/src/components/Calculator/renderMonthsInput.tsx +17 -39
  383. package/mobile/src/components/Calculator/renderPaymentType.tsx +13 -49
  384. package/mobile/src/components/Calculator/renderRegistrationType.tsx +13 -51
  385. package/mobile/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  386. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  387. package/mobile/src/components/Carousel/Carousel.tsx +2 -3
  388. package/mobile/src/components/Carousel/itemsGap.ts +1 -0
  389. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  390. package/mobile/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  391. package/mobile/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  392. package/mobile/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  393. package/mobile/src/components/Headline/Headline.tsx +10 -5
  394. package/mobile/src/components/Headline/headlineVersionStyles.ts +7 -7
  395. package/mobile/src/hooks/useForm.ts +17 -14
  396. package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
  397. package/mobile/src/ui-kit/InputRange/InputRange.tsx +56 -43
  398. package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  399. package/mobile/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  400. package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  401. package/mobile/src/utils/getSanitizedValue.ts +1 -1
  402. package/mobile/src/wlc.json +1 -2
  403. package/package.json +1 -1
  404. package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  405. package/src/components/Blocks.mobile.ts +4 -0
  406. package/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  407. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  408. package/src/components/Calculator/Calculator.tsx +11 -5
  409. package/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  410. package/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  411. package/src/components/Calculator/Rate.tsx +14 -14
  412. package/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  413. package/src/components/Calculator/renderDaysInput.tsx +10 -31
  414. package/src/components/Calculator/renderInterestPayment.tsx +13 -52
  415. package/src/components/Calculator/renderMonthsInput.tsx +17 -39
  416. package/src/components/Calculator/renderPaymentType.tsx +13 -49
  417. package/src/components/Calculator/renderRegistrationType.tsx +13 -51
  418. package/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  419. package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  420. package/src/components/Carousel/Carousel.fixture.mobile.tsx +93 -0
  421. package/src/components/Carousel/Carousel.tsx +2 -3
  422. package/src/components/Carousel/itemsGap.mobile.ts +1 -0
  423. package/src/components/Carousel/itemsGap.ts +1 -0
  424. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +74 -0
  425. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  426. package/src/components/CarouselTariffsCard/descriptionSize.mobile.tsx +1 -0
  427. package/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  428. package/src/components/CarouselTariffsCard/getPaddingStyle.mobile.tsx +2 -0
  429. package/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  430. package/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  431. package/src/components/Headline/Headline.fixture.mobile.tsx +95 -0
  432. package/src/components/Headline/Headline.tsx +10 -5
  433. package/src/components/Headline/headlineVersionStyles.ts +7 -7
  434. package/src/hooks/useForm.ts +17 -14
  435. package/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
  436. package/src/ui-kit/InputRange/InputRange.tsx +56 -43
  437. package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  438. package/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  439. package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  440. package/src/utils/getSanitizedValue.ts +1 -1
  441. package/src/wlc.json +1 -2
  442. package/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  443. package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  444. package/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  445. package/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  446. package/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  447. package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  448. package/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  449. package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  450. package/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  451. package/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  452. package/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  453. package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  454. package/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  455. package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  456. package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  457. package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  458. package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  459. package/mobile/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  460. package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  461. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  462. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  463. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  464. package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  465. package/mobile/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  466. package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  467. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  468. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  469. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  470. package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  471. package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
  472. package/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  473. package/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
@@ -363,7 +363,7 @@
363
363
  const [isDirtyForm, setDirtyForm] = useState(false);
364
364
  const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
365
365
  const handlersMap = useRef({});
366
- const field = (fieldName) => {
366
+ const field = useCallback((fieldName) => {
367
367
  if (!handlersMap.current) {
368
368
  handlersMap.current = {};
369
369
  }
@@ -376,7 +376,7 @@
376
376
  isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
377
377
  onChange: handlersMap.current[fieldName],
378
378
  };
379
- };
379
+ }, [formState, isDirtyForm, dirtyFieldsMap]);
380
380
  const reset = useCallback(() => {
381
381
  setFormState(initialState);
382
382
  setDirtyForm(false);
@@ -904,26 +904,44 @@
904
904
 
905
905
  const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
906
906
 
907
- const getSanitizedValue = (_) => _.split(/\s+/).join('');
907
+ function parseDecimal(value) {
908
+ const rawValue = (value || '').replace(/\D/g, '');
909
+ const unsafeDecimal = parseInt(rawValue, 10);
910
+ return Number.isNaN(unsafeDecimal) ? 0 : unsafeDecimal;
911
+ }
908
912
 
909
- const DISABLED_INPUT_CLASSES$1 = 'disabled:border-gray disabled:bg-main-divider';
910
- const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, disabled = false, onChange, }) => {
911
- const handleChange = (e) => {
912
- if (!onChange) {
913
- return;
914
- }
915
- onChange(clamp(Number(getSanitizedValue(e.target.value)), min, max));
916
- };
913
+ function renderRangeWithTicks({ list = [], min, max, step, value = list[0] || min, disabled, onChange, }) {
914
+ const rangeValue = list.length ? list.indexOf(value) : value;
917
915
  const inputStyle = {
918
- backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
916
+ backgroundSize: `${(((rangeValue - min) * 100) / (max - min)).toFixed(2)}% 100%`,
919
917
  };
920
- return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? jsx("span", { className: "text-m-light text-primary-text", children: title }) : null, jsx("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
921
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES$1}`, value: addSpacesBetweenNumbers(value), disabled: disabled, onChange: handleChange, onBlur: handleChange }), jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, disabled: disabled, onChange: handleChange, style: inputStyle }) })] }), renderRangeCaption$1(items)] }));
922
- });
923
- function renderRangeCaption$1(items) {
924
- return (jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (jsx("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
918
+ return (jsxs("div", { children: [list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map((_, i) => (jsx("div", { className: `w-2 h-2 rounded-full ${rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)))) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((e) => {
919
+ const rawValue = parseDecimal(e.target?.value);
920
+ const newValue = list.length ? list[rawValue] : rawValue;
921
+ onChange && onChange(newValue || 0);
922
+ }) }) })] }));
925
923
  }
926
924
 
925
+ const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
926
+ const DEFAULT_MIN = 1;
927
+ const DEFAULT_MAX = 100;
928
+ const InputRange = JSX(({ className, title, items = [], list = [], min = list.length ? 0 : DEFAULT_MIN, max = list.length ? list.length - 1 : DEFAULT_MAX, step = 1, value = list[0] || min, disabled = false, onChange, }) => {
929
+ const [isFocused, setFocused] = useState(false);
930
+ const handleChange = useCallback((e) => {
931
+ onChange && onChange(parseDecimal(e.target?.value));
932
+ }, [onChange]);
933
+ const handleFocus = useCallback(() => {
934
+ setFocused(true);
935
+ }, []);
936
+ const handleBlur = useCallback(() => {
937
+ setFocused(false);
938
+ onChange && onChange(list.length ? closestValue(list)(value) : clamp(value || 0, min, max));
939
+ }, [onChange, value]);
940
+ return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? (jsx(Text, { size: "text-m", font: "font-light", color: "text-primary-text", children: title })) : null, jsx("input", { className: style('m-0 mt-2 font-sans text-h3 w-full h-14', 'border border-solid border-gray rounded-md outline-none', 'p-0 pl-4 box-border', 'text-primary-text hover:border-primary-hover focus:border-primary-text', DISABLED_INPUT_CLASSES), value: isFocused ? value : addSpacesBetweenNumbers(value), disabled: disabled, onInput: handleChange, onFocus: handleFocus, onBlur: handleBlur }), renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })] }), renderRangeCaption(items)] }));
941
+ });
942
+ const closestValue = (list) => (_) => list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
943
+ const renderRangeCaption = (items) => (jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (jsx(Text, { size: "text-s-light", color: "text-secondary-text", children: item }, String(i)))) }));
944
+
927
945
  const renderCreditParameters = (field) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsxs("div", { className: "w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m-light", children: "\u0421\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m-light", children: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
928
946
 
929
947
  const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
@@ -1043,9 +1061,12 @@
1043
1061
  ];
1044
1062
  const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1045
1063
  const handleChange = useCallback((e) => {
1064
+ if (disabled) {
1065
+ return;
1066
+ }
1046
1067
  e.preventDefault();
1047
1068
  onChange && onChange(!value);
1048
- }, [onChange, value]);
1069
+ }, [onChange, disabled, value]);
1049
1070
  const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1050
1071
  return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: "checkbox", "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? jsx("span", { className: "font-sans ml-3 text-l-light", children: text }) : null] }) }));
1051
1072
  });
@@ -1114,7 +1135,7 @@
1114
1135
  setResponseType(status);
1115
1136
  return status;
1116
1137
  }, []);
1117
- return (jsx(BlockWrapper, { className: style('font-sans bg-white p-12 pb-9', className), ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, onSubmit: handleSubmit }), responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1138
+ return (jsx(BlockWrapper, { className: style('font-sans bg-white p-default pb-9', className), ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, onSubmit: handleSubmit }), responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1118
1139
  });
1119
1140
 
1120
1141
  const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-default flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep$1) })) : null] })));
@@ -1146,34 +1167,34 @@
1146
1167
 
1147
1168
  const headlineVersionStyles = {
1148
1169
  XXL: {
1149
- wrapper: 'gap-[18px]',
1150
1170
  title: { headingType: 'h0', as: 'h1' },
1151
1171
  descriptionSize: 'text-h5',
1172
+ descriptionStyle: 'mt-5',
1152
1173
  },
1153
1174
  XL: {
1154
- wrapper: 'gap-4',
1155
1175
  title: { headingType: 'h1', as: 'h1' },
1156
1176
  descriptionSize: 'text-xl-light',
1177
+ descriptionStyle: 'mt-4',
1157
1178
  },
1158
1179
  L: {
1159
- wrapper: 'gap-4',
1160
1180
  title: { headingType: 'h2', as: 'h2' },
1161
1181
  descriptionSize: 'text-xl-light',
1182
+ descriptionStyle: 'mt-4',
1162
1183
  },
1163
1184
  M: {
1164
- wrapper: 'gap-3',
1165
1185
  title: { headingType: 'h3', as: 'h3' },
1166
1186
  descriptionSize: 'text-xl-light',
1187
+ descriptionStyle: 'mt-3',
1167
1188
  },
1168
1189
  S: {
1169
- wrapper: 'gap-2',
1170
1190
  title: { headingType: 'h4', as: 'h4' },
1171
1191
  descriptionSize: 'text-xl-light',
1192
+ descriptionStyle: 'mt-2',
1172
1193
  },
1173
1194
  XS: {
1174
- wrapper: 'gap-2',
1175
1195
  title: { headingType: 'h5', as: 'h5' },
1176
1196
  descriptionSize: 'text-l-light',
1197
+ descriptionStyle: 'mt-2',
1177
1198
  },
1178
1199
  };
1179
1200
  // TODO Move to Gallery and rename
@@ -1191,7 +1212,8 @@
1191
1212
  const Headline = JSX(({ className, title, description, headlineVersion = 'XL', align = 'text-center', as, isPadding = true, isTheme = false, version = '', ...rest }) => {
1192
1213
  const versionStyle = headlineVersionStyles[headlineVersion];
1193
1214
  const paddingStyle = isPadding ? 'p-default' : '';
1194
- return (jsxs(BlockWrapper, { className: style('flex flex-col', paddingStyle, versionStyle.wrapper, className), version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, align: align, children: description })) : null] }));
1215
+ const descriptionStyle = { marginTop: versionStyle.descriptionStyle };
1216
+ return (jsxs(BlockWrapper, { className: style(paddingStyle, className), version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, align: align, ...descriptionStyle, children: description })) : null] }));
1195
1217
  });
1196
1218
 
1197
1219
  const Bonus = JSX((props) => {
@@ -1347,18 +1369,17 @@
1347
1369
  const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
1348
1370
  const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
1349
1371
 
1350
- const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(2)).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
1372
+ const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName, fractionDigits = 2, }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start gradient-color-text", children: [jsx("span", { className: style('font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(fractionDigits)).replace('.', ',') }), unit ? jsx("span", { className: "text-7xl", children: unit }) : null] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
1351
1373
 
1352
1374
  const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
1353
1375
 
1354
1376
  const DEFAULT_MONEY_STEP = 1000;
1355
- function renderWantedSumInput(title, params, callback) {
1356
- const { moneyValue, minSum, maxSum, step = DEFAULT_MONEY_STEP, isShowItems = true } = params;
1377
+ function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
1357
1378
  const items = [
1358
- `От ${addSpacesBetweenNumbers(minSum)} ₽`,
1359
- `До ${addSpacesBetweenNumbers(maxSum)} ₽`,
1379
+ `От ${addSpacesBetweenNumbers(rest.min || 0)} ₽`,
1380
+ `До ${addSpacesBetweenNumbers(rest.max || 0)} ₽`,
1360
1381
  ];
1361
- return (jsx(InputRange, { title: title, items: isShowItems ? items : [], min: minSum, max: maxSum, step: step, value: clamp(moneyValue, minSum, maxSum), onChange: callback }));
1382
+ return jsx(InputRange, { items: isShowItems ? items : [], step: step, ...rest });
1362
1383
  }
1363
1384
 
1364
1385
  const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
@@ -1392,40 +1413,32 @@
1392
1413
  };
1393
1414
 
1394
1415
  const BonusCalculatorForm = JSX(({ className = '', sourceBookDir = '', buttons, footnote }) => {
1395
- const [travelExpenseValue, setTravelExpenseValue] = useState(DEFAULT_TRAVEL_MIN_SUM);
1396
- const handleTravelExpenseValue = useCallback((_) => setTravelExpenseValue(_), []);
1397
- const [restExpenseValue, setRestExpenseValue] = useState(DEFAULT_REST_MIN_SUM);
1398
- const handleRestExpenseValue = useCallback((_) => setRestExpenseValue(_), []);
1399
- const userInputParams = {
1400
- travelExpenseValue,
1401
- restExpenseValue,
1402
- };
1416
+ const [userInputParams, { field }] = useForm({
1417
+ travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
1418
+ restExpenseValue: DEFAULT_REST_MIN_SUM,
1419
+ });
1403
1420
  const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } = useBonusCalculatorParams(userInputParams, sourceBookDir);
1404
- return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма покупок в категории путешествия, ₽', {
1405
- minSum: minSumTravel,
1406
- maxSum: maxSumTravel,
1407
- moneyValue: travelExpenseValue,
1421
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
1422
+ title: 'Сумма покупок в категории путешествия, ₽',
1423
+ min: minSumTravel,
1424
+ max: maxSumTravel,
1408
1425
  step: 500,
1409
1426
  isShowItems: false,
1410
- }, handleTravelExpenseValue), renderWantedSumInput('Сумма покупок в остальных категориях, ₽', {
1427
+ ...field('travelExpenseValue'),
1428
+ }), renderWantedSumInput({
1429
+ title: 'Сумма покупок в остальных категориях, ₽',
1411
1430
  className: 'mt-7',
1412
- minSum: minSumOther,
1413
- maxSum: maxSumOther,
1414
- moneyValue: restExpenseValue,
1431
+ min: minSumOther,
1432
+ max: maxSumOther,
1415
1433
  step: 500,
1416
1434
  isShowItems: false,
1417
- }, handleRestExpenseValue)] }), jsx("div", { children: monthBonus >= 0 ? (jsx(Rate, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u043C\u0435\u0441\u044F\u0446", rate: monthBonus, rateBlockClassName: "tracking-[-14px]" })) : null }), jsxs("div", { className: "w-full max-w-[350px]", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1435
+ ...field('restExpenseValue'),
1436
+ })] }), jsx("div", { children: monthBonus >= 0 ? (jsx(Rate, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u043C\u0435\u0441\u044F\u0446", rate: monthBonus, rateBlockClassName: "tracking-[-14px]", fractionDigits: 0 })) : null }), jsxs("div", { className: "w-full max-w-[350px]", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1418
1437
  });
1419
1438
 
1420
1439
  const STEP_DAYS = 1;
1421
- function renderDaysInput(title, params, callback) {
1422
- const { minDays, maxDays, daysValue } = params;
1423
- const daysText = (days) => {
1424
- const text = Number(days) % 10 === 1 ? 'дня' : 'дней';
1425
- return `${days} ${text}`;
1426
- };
1427
- return (jsx(InputRange, { className: "mt-7", title: title, items: [`От ${daysText(minDays)}`, `До ${daysText(maxDays)}`], min: minDays, max: maxDays, step: STEP_DAYS, value: clamp(daysValue, minDays, maxDays), onChange: callback }));
1428
- }
1440
+ const renderDaysInput = (props) => (jsx(InputRange, { className: "mt-7", items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
1441
+ const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
1429
1442
 
1430
1443
  const orientationStyleMap = {
1431
1444
  horizontal: 'gap-10',
@@ -1433,21 +1446,15 @@
1433
1446
  };
1434
1447
  const RadioButtonGroup = JSX(({ items, checkedItem, onChange: onChangeCheckedItem, orientation = 'horizontal' }) => (jsx("div", { className: `flex ${orientationStyleMap[orientation]}`, children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
1435
1448
 
1436
- const EVERY_MONTH = 'everyMonth';
1437
- const AT_END_TERM = 'atEndTerm';
1438
- const depositTypeItems = [
1439
- {
1440
- id: EVERY_MONTH,
1441
- text: 'Ежемесячно',
1442
- },
1443
- {
1444
- id: AT_END_TERM,
1445
- text: 'В конце срока',
1446
- },
1447
- ];
1448
- function renderInterestPayment({ isMonthlyInterestPayment, callback, title, orientation = 'horizontal', }) {
1449
- return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx("div", { children: jsx(RadioButtonGroup, { orientation: orientation, items: depositTypeItems, checkedItem: isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM, onChange: (text) => callback && callback(text === EVERY_MONTH) }) })] }));
1450
- }
1449
+ const renderBinaryRadioButtonGroup = ({ items, title, orientation = 'horizontal', value, onChange, }) => (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
1450
+
1451
+ const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
1452
+ ...props,
1453
+ items: [
1454
+ { id: 'everyMonth', text: 'Ежемесячно' },
1455
+ { id: 'atEndTerm', text: 'В конце срока' },
1456
+ ],
1457
+ });
1451
1458
 
1452
1459
  const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(Icon, { name: "PercentIcon", width: "90", height: "85" }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
1453
1460
 
@@ -1537,101 +1544,47 @@
1537
1544
  };
1538
1545
 
1539
1546
  const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
1540
- const [moneyValue, setMoneyValue] = useState(BUSINESS_DEFAULT_SUM);
1541
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1542
- const [daysValue, setDaysValue] = useState(BUSINESS_DEFAULT_DAYS);
1543
- const handleDaysValue = useCallback((_) => setDaysValue(_), []);
1544
- const [isReplenished, toggleIsReplenished] = useState(false);
1545
- const handleIsReplenished = useCallback((_) => toggleIsReplenished(_), []);
1546
- const [isPartialWithdrawal, toggleIsPartialWithdrawal] = useState(false);
1547
- const handleIsPartialWithdrawal = useCallback((_) => toggleIsPartialWithdrawal(_), []);
1548
- const [isSmallBusiness, toggleIsSmallBusiness] = useState(false);
1549
- const handleIsSmallBusiness = useCallback((_) => toggleIsSmallBusiness(_), []);
1550
- const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1551
- const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1552
- const userInputParams = {
1553
- moneyValue,
1554
- daysValue,
1555
- isReplenished,
1556
- isPartialWithdrawal,
1557
- isSmallBusiness,
1558
- isMonthlyInterestPayment,
1559
- };
1547
+ const [userInputParams, { field }] = useForm({
1548
+ moneyValue: BUSINESS_DEFAULT_SUM,
1549
+ daysValue: BUSINESS_DEFAULT_DAYS,
1550
+ isReplenished: false,
1551
+ isPartialWithdrawal: false,
1552
+ isSmallBusiness: false,
1553
+ isMonthlyInterestPayment: false,
1554
+ });
1560
1555
  const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
1561
1556
  const { income, finalSum, rate, depositeName, isShowUnknownRate } = calculatorParams;
1562
- return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "w-[486px]", children: [renderWantedSumInput('Сумма вклада, ₽', calculatorParams, handleMoneyValue), renderDaysInput('Срок вклада, дни', calculatorParams, handleDaysValue), jsxs("div", { className: "mt-7 flex justify-between", children: [renderBusinessDepositParamsForm({
1563
- ...calculatorParams,
1564
- handleIsReplenished,
1565
- handleIsPartialWithdrawal,
1566
- handleIsSmallBusiness,
1567
- }), renderInterestPayment({
1568
- isMonthlyInterestPayment,
1569
- callback: handleIsMonthlyInterestPayment,
1557
+ return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "w-[486px]", children: [renderWantedSumInput({
1558
+ title: 'Сумма вклада, ₽',
1559
+ min: calculatorParams.minSum,
1560
+ max: calculatorParams.maxSum,
1561
+ ...field('moneyValue'),
1562
+ value: calculatorParams.moneyValue,
1563
+ }), renderDaysInput({
1564
+ title: 'Срок вклада, дни',
1565
+ min: calculatorParams.minDays,
1566
+ max: calculatorParams.maxDays,
1567
+ ...field('daysValue'),
1568
+ value: calculatorParams.daysValue,
1569
+ }), jsxs("div", { className: "mt-7 flex justify-between", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderInterestPayment({
1570
1570
  title: 'Выплата процентов',
1571
1571
  orientation: 'vertical',
1572
+ ...field('isMonthlyInterestPayment'),
1572
1573
  })] })] }), isShowUnknownRate ? (jsx(UnknownRate, {})) : (jsx(Rate, { rate: rate, depositeName: depositeName, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" })), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), jsx("div", { className: "mt-7", children: renderFootnote(footnote) })] })] }), jsx("div", { className: "mt-5", children: renderFootnote(bottomFootnote) })] }));
1573
1574
  });
1574
- const renderBusinessDepositParamsForm = ({ isDisabledOperatingDeposit, isReplenished, isPartialWithdrawal, isSmallBusiness, handleIsReplenished, handleIsPartialWithdrawal, handleIsSmallBusiness, }) => (jsxs("div", { children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: isDisabledOperatingDeposit, value: isReplenished, onChange: handleIsReplenished }), jsx(Checkbox, { className: "mt-3", disabled: isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", value: isPartialWithdrawal, onChange: handleIsPartialWithdrawal }), jsx(Checkbox, { className: "mt-3", text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043C\u0430\u043B\u044B\u043C \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435\u043C", value: isSmallBusiness, onChange: handleIsSmallBusiness })] }));
1575
-
1576
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
1577
- const InputListRange = JSX(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
1578
- const min = 0;
1579
- const max = list.length - 1;
1580
- const step = 1;
1581
- const handleTextChange = (e) => {
1582
- if (!onChange) {
1583
- return;
1584
- }
1585
- const newValue = parseInt(e.target.value);
1586
- const closetValue = list.reduce(function (prev, curr) {
1587
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
1588
- });
1589
- onChange(Number(getSanitizedValue(closetValue.toString())));
1590
- };
1591
- const handleRangeChange = (e) => {
1592
- if (!onChange) {
1593
- return;
1594
- }
1595
- const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
1596
- onChange(Number(getSanitizedValue(val.toString())));
1597
- };
1598
- const valueIndex = list.findIndex((item) => item === value) || 0;
1599
- const inputStyle = {
1600
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
1601
- };
1602
- return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? jsx("span", { className: "text-m-light text-primary-text", children: title }) : null, jsx("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
1603
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: addSpacesBetweenNumbers(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
1604
- });
1605
- const renderTick = (valueIndex, disabled) => (value, i) => (jsx("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
1606
- function renderRangeCaption(items) {
1607
- return (jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (jsx("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
1608
- }
1575
+ const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { className: "mt-3", disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal }), jsx(Checkbox, { className: "mt-3", text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043C\u0430\u043B\u044B\u043C \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435\u043C", ...field('isSmallBusiness'), value: calculatorParams.isSmallBusiness })] }));
1609
1576
 
1610
1577
  const STEP_MONTHS = 1;
1611
- function renderMonthsInput(title, params, callback) {
1612
- const { minMonths, maxMonths, monthsValue, availableMonths } = params;
1613
- const monthText = (month) => {
1614
- const text = Number(month) % 10 === 1 ? 'месяца' : 'месяцев';
1615
- return `${month} ${text}`;
1616
- };
1617
- return availableMonths?.length ? (jsx(InputListRange, { className: "mt-7", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], list: availableMonths, value: clamp(monthsValue, minMonths, maxMonths), onChange: callback })) : (jsx(InputRange, { className: "mt-7", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: clamp(monthsValue, minMonths, maxMonths), onChange: callback }));
1618
- }
1578
+ const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { className: "mt-7", items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
1579
+ const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
1619
1580
 
1620
- const ANNUITY = 'annuity';
1621
- const DIFFERENTIAL = 'differential';
1622
- const paymentTypeItems = [
1623
- {
1624
- id: ANNUITY,
1625
- text: 'Аннуитетный',
1626
- },
1627
- {
1628
- id: DIFFERENTIAL,
1629
- text: 'Дифференцированный',
1630
- },
1631
- ];
1632
- function renderPaymentType({ isAnnuity, callback, title, orientation = 'horizontal', }) {
1633
- return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: paymentTypeItems, checkedItem: isAnnuity ? ANNUITY : DIFFERENTIAL, onChange: (text) => callback && callback(text === ANNUITY) })] }));
1634
- }
1581
+ const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
1582
+ ...props,
1583
+ items: [
1584
+ { id: 'annuity', text: 'Аннуитетный' },
1585
+ { id: 'differential', text: 'Дифференцированный' },
1586
+ ],
1587
+ });
1635
1588
 
1636
1589
  /**
1637
1590
  * Формулы расчёта аннуитетных и дифференцированных платежей:
@@ -1702,72 +1655,48 @@
1702
1655
  return isExclude || userInputParams[fieldKey] === row[fieldKey];
1703
1656
  };
1704
1657
 
1705
- const CreditCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1706
- const [isAnnuity, toggleIsAnnuity] = useState(false);
1707
- const [isSalaryClient, toggleIsSalaryClient] = useState(false);
1708
- const handleIsSalaryClient = useCallback((_) => toggleIsSalaryClient(_), []);
1709
- const [isStateEmployee, toggleIsStateEmployee] = useState(false);
1710
- const handleIsStateEmployee = useCallback((_) => toggleIsStateEmployee(_), []);
1711
- const [isPensionClient, toggleIsPensionClient] = useState(false);
1712
- const handleIsPensionClient = useCallback((_) => toggleIsPensionClient(_), []);
1713
- const [isInsurance, toggleIsInsurance] = useState(true);
1714
- const handleIsInsurance = useCallback((_) => toggleIsInsurance(_), []);
1715
- const [moneyValue, setMoneyValue] = useState(CREDIT_DEFAULT_SUM);
1716
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1717
- const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
1718
- const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
1719
- const userInputParams = {
1720
- isAnnuity,
1721
- isInsurance,
1722
- isSalaryClient,
1723
- isPensionClient,
1724
- isStateEmployee,
1725
- moneyValue,
1726
- monthsValue,
1727
- };
1658
+ const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1659
+ const [userInputParams, { field }] = useForm({
1660
+ isAnnuity: false,
1661
+ isInsurance: true,
1662
+ isSalaryClient: false,
1663
+ isPensionClient: false,
1664
+ isStateEmployee: false,
1665
+ moneyValue: CREDIT_DEFAULT_SUM,
1666
+ monthsValue: DEFAULT_MONTHS,
1667
+ });
1728
1668
  const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
1729
- useEffect(() => {
1730
- setMoneyValue(clamp(moneyValue, calculatorParams.minSum, calculatorParams.maxSum));
1731
- setMonthsValue(clamp(monthsValue, calculatorParams.minMonths, calculatorParams.maxMonths));
1732
- }, [calculatorParams]);
1733
- return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма кредита, ₽', { ...calculatorParams, step: 500 }, handleMoneyValue), renderMonthsInput('Срок кредита, месяцев', calculatorParams, handleMonthsValue), jsx("div", { className: "mt-7", children: renderCreditParamsForm({
1734
- ...calculatorParams,
1735
- ...paramsViewSettings,
1736
- handleIsSalaryClient,
1737
- handleIsStateEmployee,
1738
- handleIsPensionClient,
1739
- handleIsInsurance,
1740
- }) })] }), renderRate(calculatorParams.rate), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), renderPaymentType({
1741
- isAnnuity,
1742
- orientation: 'vertical',
1743
- callback: toggleIsAnnuity,
1744
- }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1745
- });
1746
- const renderRate = (rate) => (jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }));
1747
- const renderCreditParamsForm = ({ isSalaryClient, isStateEmployee, isPensionClient, isInsurance, isShowSalaryClient, isShowStateEmployee, isShowPensionClient, isShowInsurance, handleIsSalaryClient, handleIsStateEmployee, handleIsPensionClient, handleIsInsurance, }) => (jsxs("div", { children: [isShowSalaryClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", value: isSalaryClient, onChange: handleIsSalaryClient })) : null, isShowStateEmployee ? (jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", value: isStateEmployee, onChange: handleIsStateEmployee })) : null, isShowPensionClient ? (jsx(Checkbox, { className: "mt-3", text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", value: isPensionClient, onChange: handleIsPensionClient })) : null, isShowInsurance ? (jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", value: isInsurance, onChange: handleIsInsurance })) : null] }));
1748
-
1749
- const REMOTE_REGISTRATION = 'remote';
1750
- const OFFICE_REGISTRATION = 'office';
1751
- const registrationTypeItems = [
1752
- {
1753
- id: OFFICE_REGISTRATION,
1754
- text: 'Офис Банка',
1755
- },
1756
- {
1757
- id: REMOTE_REGISTRATION,
1758
- text: 'Дистанционно',
1759
- },
1760
- ];
1761
- function renderRegistrationType({ isRemoteRegistration, callback, title, orientation = 'horizontal', }) {
1762
- return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx("div", { children: jsx(RadioButtonGroup, { orientation: orientation, items: registrationTypeItems, checkedItem: isRemoteRegistration ? REMOTE_REGISTRATION : OFFICE_REGISTRATION, onChange: (text) => callback && callback(text === REMOTE_REGISTRATION) }) })] }));
1763
- }
1669
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
1670
+ title: 'Сумма кредита, ₽',
1671
+ step: 500,
1672
+ min: calculatorParams.minSum,
1673
+ max: calculatorParams.maxSum,
1674
+ ...field('moneyValue'),
1675
+ value: calculatorParams.moneyValue,
1676
+ }), renderMonthsInput({
1677
+ title: 'Срок кредита, месяцев',
1678
+ min: calculatorParams.minMonths,
1679
+ max: calculatorParams.maxMonths,
1680
+ ...field('monthsValue'),
1681
+ value: calculatorParams.monthsValue,
1682
+ }), jsx("div", { className: "mt-7", children: renderCreditParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) })] }), jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: calculatorParams.rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), renderPaymentType({ orientation: 'vertical', ...field('isAnnuity') }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1683
+ });
1684
+ const renderCreditParamsForm = (params, field) => (jsxs("div", { children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { className: "mt-3", text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
1685
+
1686
+ const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
1687
+ ...props,
1688
+ items: [
1689
+ { id: 'remote', text: 'Дистанционно' },
1690
+ { id: 'office', text: 'Офис Банка' },
1691
+ ],
1692
+ });
1764
1693
 
1765
1694
  const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
1766
1695
 
1767
1696
  const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
1768
1697
  const { moneyValue, monthsValue } = userInputParams;
1769
1698
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
1770
- const defaultMonth = data?.rateRows[0]
1699
+ const defaultMonth = data?.rateRows?.[0]
1771
1700
  ? getMiddleMonth(data.rateRows[0].minMonths, data.rateRows[0].maxMonths)
1772
1701
  : 1;
1773
1702
  const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
@@ -1816,48 +1745,45 @@
1816
1745
  const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
1817
1746
  const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
1818
1747
 
1819
- const DepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1820
- const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
1821
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1822
- const [monthsValue, setMonthsValue] = useState(0);
1823
- const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1824
- const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1825
- const [isRemoteRegistration, toggleIsRemoteRegistration] = useState(false);
1826
- const handleIsRemoteRegistration = useCallback((_) => toggleIsRemoteRegistration(_), []);
1827
- const userInputParams = {
1828
- moneyValue,
1829
- monthsValue,
1830
- isMonthlyInterestPayment,
1831
- isRemoteRegistration,
1832
- };
1833
- const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
1748
+ const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1749
+ const [userInputParams, { field }] = useForm({
1750
+ moneyValue: DEPOSIT_DEFAULT_SUM,
1751
+ monthsValue: 0,
1752
+ isMonthlyInterestPayment: false,
1753
+ isRemoteRegistration: false,
1754
+ });
1834
1755
  const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
1835
1756
  const { defaultMonth, income, finalSum, rate } = calculatorParams;
1757
+ const { onChange: setMonthsValue } = field('monthsValue');
1836
1758
  useEffect(() => {
1837
- setMonthsValue(defaultMonth);
1759
+ setMonthsValue && setMonthsValue(defaultMonth);
1838
1760
  }, [defaultMonth]);
1839
- return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма вклада, ₽', {
1840
- ...calculatorParams,
1841
- }, handleMoneyValue), renderMonthsInput('Срок вклада, месяцев', {
1842
- ...calculatorParams,
1843
- }, handleMonthsValue), jsx("div", { className: "mt-7", children: renderDepositParamsForm({
1844
- ...calculatorParams,
1845
- ...paramsViewSettings,
1846
- handleIsMonthlyInterestPayment,
1847
- handleIsRemoteRegistration,
1848
- }) })] }), jsx(Rate, { rate: rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1849
- });
1850
- const renderDepositParamsForm = ({ isMonthlyInterestPayment, isRemoteRegistration, isShowMonthlyInterestPayment, isShowRemoteRegistration, handleIsMonthlyInterestPayment, handleIsRemoteRegistration, }) => (jsxs("div", { className: "flex flex-col gap-y-7", children: [isShowMonthlyInterestPayment
1761
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
1762
+ title: 'Сумма вклада, ₽',
1763
+ min: calculatorParams.minSum,
1764
+ max: calculatorParams.maxSum,
1765
+ ...field('moneyValue'),
1766
+ value: calculatorParams.moneyValue,
1767
+ }), renderMonthsInput({
1768
+ title: 'Срок вклада, месяцев',
1769
+ min: calculatorParams.minMonths,
1770
+ max: calculatorParams.maxMonths,
1771
+ availableMonths: calculatorParams.availableMonths,
1772
+ ...field('monthsValue'),
1773
+ value: calculatorParams.monthsValue,
1774
+ }), jsx("div", { className: "mt-7", children: renderDepositParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) })] }), jsx(Rate, { rate: rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1775
+ });
1776
+ const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-7", children: [params.isShowMonthlyInterestPayment
1851
1777
  ? renderInterestPayment({
1852
- isMonthlyInterestPayment,
1853
- callback: handleIsMonthlyInterestPayment,
1854
1778
  title: 'Выплата процентов',
1779
+ ...field('isMonthlyInterestPayment'),
1780
+ value: params.isMonthlyInterestPayment,
1855
1781
  })
1856
- : null, isShowRemoteRegistration
1782
+ : null, params.isShowRemoteRegistration
1857
1783
  ? renderRegistrationType({
1858
- isRemoteRegistration,
1859
- callback: handleIsRemoteRegistration,
1860
1784
  title: 'Оформление',
1785
+ ...field('isRemoteRegistration'),
1786
+ value: params.isRemoteRegistration,
1861
1787
  })
1862
1788
  : null] }));
1863
1789
 
@@ -1887,7 +1813,7 @@
1887
1813
  itemCount: calculatorTabs?.length,
1888
1814
  visibleItemCount: COLUMNS_FOR_SCROLL,
1889
1815
  });
1890
- return (jsxs(BlockWrapper, { className: `box-border overflow-hidden relative w-100 ${className}`, ...rest, children: [jsxs("div", { className: "bg-white", children: [tabsNav.length > 1
1816
+ return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden relative w-100', className), ...rest, children: [jsxs("div", { className: "bg-white", children: [tabsNav.length > 1
1891
1817
  ? renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
1892
1818
  : null, renderArrows({
1893
1819
  ...controls,
@@ -1906,11 +1832,10 @@
1906
1832
  const iconClassName = isActive ? '' : `text-primary-main`;
1907
1833
  const iconVersion = tab?.icon?.iconVersion;
1908
1834
  const activeIconStyle = isActive ? 'white' : 'normal';
1909
- return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border relative border border-gray cursor-pointer text-left border-b-0 flex hover:h-[88px]
1910
- ${btnClassName}`, children: [jsx(ImgInner, { className: `h-6 w-6 min-w-6 min-h-6 mr-4 ${iconClassName}`, image: {
1835
+ return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: style('box-border relative border border-gray cursor-pointer text-left border-b-0 flex hover:h-[88px]', btnClassName), children: [jsx(ImgInner, { className: `h-6 w-6 min-w-6 min-h-6 mr-4 ${iconClassName}`, image: {
1911
1836
  ...tab?.icon,
1912
1837
  iconVersion: iconVersion ?? activeIconStyle,
1913
- }, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className: `${btnTitleClassName}`, children: tab?.title }), jsx("div", { className: `${btnDescClassName}`, children: tab.description })] })] }, String(i)));
1838
+ }, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className: btnTitleClassName, children: tab?.title }), jsx("div", { className: btnDescClassName, children: tab.description })] })] }, String(i)));
1914
1839
  }
1915
1840
  function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }) {
1916
1841
  const CARD_SHIFT = 388;
@@ -1922,6 +1847,8 @@
1922
1847
  })) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
1923
1848
  }
1924
1849
 
1850
+ const getSanitizedValue = (_) => _.replace(/\s/g, '');
1851
+
1925
1852
  const adjustValue = (val) => onlyOneDot(setZeroStart(replaceCommaToDot(getSanitizedValue(val))));
1926
1853
  const localNumberFormat = (val) => new Intl.NumberFormat('ru-RU', {
1927
1854
  minimumFractionDigits: 0,
@@ -2189,6 +2116,7 @@
2189
2116
  const renderBlur = (isBlur, scroll) => isBlur ? (jsxs("div", { children: [scroll.canScrollLeft ? (jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white') })) : null, scroll.canScrollRight ? (jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white') })) : null] })) : null;
2190
2117
 
2191
2118
  const ITEMS_GAP = 4;
2119
+
2192
2120
  const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, arrowsPadded = true, isPadding = true, showDots = false, isAlignCenter = false, ...rest }) => {
2193
2121
  const { blocks: childBlocks = [] } = rest.block || {};
2194
2122
  const count = itemCount || childBlocks?.length;
@@ -2201,7 +2129,7 @@
2201
2129
  });
2202
2130
  const [dotsActiveIndex] = scroll.visibleIndicesRange;
2203
2131
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
2204
- return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), 'group-data-secondary:bg-primary-main group-data-secondary:text-white', className), ...rest, children: jsxs("div", { className: style(getAlignStyle(isAlignCenter), 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
2132
+ return (jsx(BlockWrapper, { className: style(getPaddingStyle$1(isPadding), 'group-data-secondary:bg-primary-main group-data-secondary:text-white', className), ...rest, children: jsxs("div", { className: style(getAlignStyle(isAlignCenter), 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
2205
2133
  ...rest,
2206
2134
  renderProps: isBankHistoryCarousel
2207
2135
  ? (block, options) => renderBlock$1(block, options, {
@@ -2209,7 +2137,7 @@
2209
2137
  activeIndex: activeIndex,
2210
2138
  })
2211
2139
  : renderBlock$1,
2212
- }) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? renderDots(containerRef, dotsActiveIndex, itemCount) : null] }) }));
2140
+ }) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? renderDots(containerRef, dotsActiveIndex, count) : null] }) }));
2213
2141
  });
2214
2142
  Carousel.childrenTypes = [
2215
2143
  'CarouselCard',
@@ -2224,7 +2152,7 @@
2224
2152
  'CarouselInvestmentCard',
2225
2153
  'CarouselEventCard',
2226
2154
  ];
2227
- const getPaddingStyle = (isPadding) => (isPadding ? 'p-default' : '');
2155
+ const getPaddingStyle$1 = (isPadding) => (isPadding ? 'p-default' : '');
2228
2156
  const getAlignStyle = (isAlignCenter) => isAlignCenter ? 'flex justify-center' : '';
2229
2157
  const renderDots = (containerRef, dotsActiveIndex, itemCount) => (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: itemCount, listType: 'horizontal-list' }));
2230
2158
 
@@ -2457,20 +2385,24 @@
2457
2385
  return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
2458
2386
  });
2459
2387
 
2388
+ const getPaddingStyle = (isHighlighting) => isHighlighting ? 'p-8 mt-8 pt-20' : 'p-8 mt-20';
2389
+
2390
+ const descriptionSize = 'text-h6';
2391
+
2392
+ const renderCardInfo = (cell, i) => {
2393
+ const { title, description, buttons } = cell;
2394
+ return (jsxs("div", { className: "py-5 border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-1", children: jsx(Text, { size: descriptionSize, color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
2395
+ };
2396
+
2460
2397
  const VISIBLE_CELLS_COUNT = 1;
2461
- const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
2398
+ const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting = false, button, cardCells = [], ...rest }) => {
2462
2399
  const cellsNode = cardCells.map(renderCardInfo);
2463
2400
  const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
2464
2401
  const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
2465
- return (jsxs(BlockWrapper, { className: style('relative border border-gray p-8 flex flex-col', getHitStyle(isHighlighting), className), ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock$1(icon), title ? jsx(Heading, { className: "text-center pt-2", headingType: "h5", title: title }) : null, button ? jsx(Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$1 : null })) : null] }));
2402
+ return (jsxs(BlockWrapper, { className: style('relative border border-gray flex flex-col', getPaddingStyle(isHighlighting), className), ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock$1(icon), title ? jsx(Heading, { className: "text-center pt-2", headingType: "h5", title: title }) : null, button ? jsx(Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$1 : null })) : null] }));
2466
2403
  });
2467
- const renderIconBlock$1 = (icon) => (jsxs("div", { className: "w-[267px] min-w-[267px] self-center", children: [icon?.src ? jsx(ImgInner, { image: icon }) : null, icon?.icon ? jsx(ImgInner, { image: icon }) : null] }));
2468
- const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-8 pt-20' : 'mt-20 pt-8';
2404
+ const renderIconBlock$1 = (icon) => (jsx("div", { className: "w-[267px] min-w-[267px] self-center", children: icon?.src || icon?.icon ? jsx(ImgInner, { image: icon }) : null }));
2469
2405
  const renderFoldButton$1 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
2470
- const renderCardInfo = (cell, i) => {
2471
- const { title, description, buttons } = cell;
2472
- return (jsxs("div", { className: "py-5 border-b border-main-divider", children: [title ? (jsx("div", { className: "text-secondary-text text-m-light opacity-80", children: cell.title })) : null, description ? (jsx("div", { className: "text-primary-text text-h6 mt-1", children: cell.description })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
2473
- };
2474
2406
  const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
2475
2407
 
2476
2408
  const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
@@ -5074,7 +5006,7 @@
5074
5006
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
5075
5007
  }
5076
5008
 
5077
- const packageVersion = "0.10.6";
5009
+ const packageVersion = "0.10.7";
5078
5010
 
5079
5011
  exports.Blocks = Blocks;
5080
5012
  exports.ContentPage = ContentPage;