@redneckz/wildless-cms-uni-blocks 0.10.5 → 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 (1407) hide show
  1. package/bin/migration-scripts/0.9.9.js +8 -6
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +493 -661
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  6. package/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  7. package/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  8. package/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  9. package/bundle/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  10. package/bundle/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  11. package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  12. package/bundle/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  13. package/bundle/components/ApplicationForm/CreditFormState.d.ts +13 -0
  14. package/bundle/components/ApplicationForm/CreditParameters.d.ts +3 -3
  15. package/bundle/components/ApplicationForm/DepositFormState.d.ts +4 -0
  16. package/bundle/components/ApplicationForm/InputControl.d.ts +4 -5
  17. package/bundle/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  18. package/bundle/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  19. package/bundle/components/ApplicationForm/SelectControl.d.ts +2 -9
  20. package/bundle/components/ApplicationForm/WedFormState.d.ts +10 -0
  21. package/bundle/components/ApplicationForm/models.d.ts +0 -6
  22. package/bundle/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  23. package/bundle/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  24. package/bundle/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  25. package/bundle/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  26. package/bundle/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  27. package/bundle/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  28. package/bundle/components/ApplicationForm/renderRegion.d.ts +6 -8
  29. package/bundle/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  30. package/bundle/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  31. package/bundle/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  32. package/bundle/components/ApplicationForm/validators.d.ts +4 -0
  33. package/bundle/components/Calculator/Rate.d.ts +1 -0
  34. package/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  35. package/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  36. package/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  37. package/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  38. package/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  39. package/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  40. package/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  41. package/bundle/components/Carousel/itemsGap.d.ts +1 -0
  42. package/bundle/components/Carousel/itemsGap.mobile.d.ts +1 -0
  43. package/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  44. package/bundle/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  45. package/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  46. package/bundle/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  47. package/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  48. package/bundle/components/Filtration/renderFormItem.d.ts +2 -2
  49. package/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  50. package/bundle/components/TextBlock/TextBlockContent.d.ts +1 -2
  51. package/bundle/hooks/useForm.d.ts +13 -12
  52. package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  53. package/bundle/ui-kit/Input/InputProps.d.ts +4 -2
  54. package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  55. package/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  56. package/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  57. package/bundle/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  58. package/bundle/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  59. package/bundle/ui-kit/Select/Select.d.ts +6 -7
  60. package/bundle/validation/and.d.ts +2 -0
  61. package/bundle/validation/objectValidator.d.ts +2 -0
  62. package/bundle/validation/pattern.d.ts +1 -0
  63. package/bundle/validation/required.d.ts +1 -0
  64. package/bundle/validation/validator.d.ts +10 -0
  65. package/bundle/validation/withValidator.d.ts +10 -0
  66. package/dist/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  67. package/dist/{ui-kit/InputListRange/InputListRangeProps.js → components/ApplicationForm/AcquiringFormState.js} +1 -1
  68. package/dist/components/ApplicationForm/AcquiringFormState.js.map +1 -0
  69. package/dist/components/ApplicationForm/ApplicationForm.js +4 -3
  70. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  71. package/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  72. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +28 -48
  73. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  74. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  75. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +24 -32
  76. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  77. package/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  78. package/dist/components/ApplicationForm/ApplicationFormCredit.js +28 -48
  79. package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  80. package/dist/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  81. package/dist/components/ApplicationForm/ApplicationFormDeposit.js +21 -23
  82. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  83. package/dist/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  84. package/dist/components/ApplicationForm/ApplicationFormWed.js +22 -37
  85. package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  86. package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  87. package/dist/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  88. package/dist/components/ApplicationForm/BusinessCardFormState.js +2 -0
  89. package/dist/components/ApplicationForm/BusinessCardFormState.js.map +1 -0
  90. package/dist/components/ApplicationForm/CreditFormState.d.ts +13 -0
  91. package/{mobile/dist/ui-kit/InputListRange/InputListRangeProps.js → dist/components/ApplicationForm/CreditFormState.js} +1 -1
  92. package/dist/components/ApplicationForm/CreditFormState.js.map +1 -0
  93. package/dist/components/ApplicationForm/CreditParameters.d.ts +3 -3
  94. package/dist/components/ApplicationForm/CreditParameters.js +5 -5
  95. package/dist/components/ApplicationForm/CreditParameters.js.map +1 -1
  96. package/dist/components/ApplicationForm/DepositFormState.d.ts +4 -0
  97. package/dist/components/ApplicationForm/DepositFormState.js +2 -0
  98. package/dist/components/ApplicationForm/DepositFormState.js.map +1 -0
  99. package/dist/components/ApplicationForm/InputControl.d.ts +4 -5
  100. package/dist/components/ApplicationForm/InputControl.js +1 -3
  101. package/dist/components/ApplicationForm/InputControl.js.map +1 -1
  102. package/dist/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  103. package/dist/components/ApplicationForm/PhoneInputControl.js +8 -0
  104. package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -0
  105. package/dist/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  106. package/dist/components/ApplicationForm/ResponseNotification.js +4 -4
  107. package/dist/components/ApplicationForm/SelectControl.d.ts +2 -9
  108. package/dist/components/ApplicationForm/SelectControl.js +1 -7
  109. package/dist/components/ApplicationForm/SelectControl.js.map +1 -1
  110. package/dist/components/ApplicationForm/WedFormState.d.ts +10 -0
  111. package/dist/components/ApplicationForm/WedFormState.js +2 -0
  112. package/dist/components/ApplicationForm/WedFormState.js.map +1 -0
  113. package/dist/components/ApplicationForm/models.d.ts +0 -6
  114. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  115. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +4 -2
  116. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  117. package/dist/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  118. package/dist/components/ApplicationForm/renderAcquiringRegion.js +3 -2
  119. package/dist/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
  120. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  121. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +4 -2
  122. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  123. package/dist/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  124. package/dist/components/ApplicationForm/renderCreditDataOrganization.js +4 -2
  125. package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  126. package/dist/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  127. package/dist/components/ApplicationForm/renderCreditParameters.js +3 -16
  128. package/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  129. package/dist/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  130. package/dist/components/ApplicationForm/renderQuestionsInterested.js +4 -1
  131. package/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  132. package/dist/components/ApplicationForm/renderRegion.d.ts +6 -8
  133. package/dist/components/ApplicationForm/renderRegion.js +3 -2
  134. package/dist/components/ApplicationForm/renderRegion.js.map +1 -1
  135. package/dist/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  136. package/dist/components/ApplicationForm/renderRegionDepartment.js +6 -2
  137. package/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  138. package/dist/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  139. package/dist/components/ApplicationForm/renderSlideCheckboxes.js +1 -1
  140. package/dist/components/ApplicationForm/renderSlideCheckboxes.js.map +1 -1
  141. package/dist/components/ApplicationForm/renderSubmitButton.js +2 -1
  142. package/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  143. package/dist/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  144. package/dist/components/ApplicationForm/renderWedDataOrganization.js +4 -2
  145. package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  146. package/dist/components/ApplicationForm/validators.d.ts +4 -0
  147. package/dist/components/ApplicationForm/validators.js +11 -0
  148. package/dist/components/ApplicationForm/validators.js.map +1 -0
  149. package/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  150. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  151. package/dist/components/Blocks.mobile.js +9 -1
  152. package/dist/components/Blocks.mobile.js.map +1 -1
  153. package/dist/components/Bonus/Bonus.js +1 -1
  154. package/dist/components/Bonus/Bonus.js.map +1 -1
  155. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +1 -1
  156. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  157. package/dist/components/BusinessBlock/BusinessBlock.js +1 -1
  158. package/dist/components/BusinessBlock/BusinessBlock.js.map +1 -1
  159. package/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  160. package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  161. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  162. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  163. package/dist/components/Calculator/Calculator.js +4 -4
  164. package/dist/components/Calculator/Calculator.js.map +1 -1
  165. package/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  166. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  167. package/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  168. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  169. package/dist/components/Calculator/Rate.d.ts +1 -0
  170. package/dist/components/Calculator/Rate.js +1 -1
  171. package/dist/components/Calculator/Rate.js.map +1 -1
  172. package/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  173. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  174. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  175. package/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  176. package/dist/components/Calculator/renderDaysInput.js +2 -9
  177. package/dist/components/Calculator/renderDaysInput.js.map +1 -1
  178. package/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  179. package/dist/components/Calculator/renderInterestPayment.js +8 -18
  180. package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  181. package/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  182. package/dist/components/Calculator/renderMonthsInput.js +2 -10
  183. package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  184. package/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  185. package/dist/components/Calculator/renderPaymentType.js +9 -19
  186. package/dist/components/Calculator/renderPaymentType.js.map +1 -1
  187. package/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  188. package/dist/components/Calculator/renderRegistrationType.js +8 -18
  189. package/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  190. package/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  191. package/dist/components/Calculator/renderWantedSumInput.js +4 -6
  192. package/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  193. package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  194. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  195. package/dist/components/CardTransfer/CardTransfer.js +1 -1
  196. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  197. package/dist/components/Carousel/Carousel.js +4 -4
  198. package/dist/components/Carousel/Carousel.js.map +1 -1
  199. package/dist/components/Carousel/CarouselScrollButtons.js +1 -1
  200. package/dist/components/Carousel/CarouselScrollButtons.js.map +1 -1
  201. package/dist/components/Carousel/itemsGap.d.ts +1 -0
  202. package/dist/components/Carousel/itemsGap.js +4 -0
  203. package/dist/components/Carousel/itemsGap.js.map +1 -0
  204. package/dist/components/Carousel/itemsGap.mobile.d.ts +1 -0
  205. package/dist/components/Carousel/itemsGap.mobile.js +4 -0
  206. package/dist/components/Carousel/itemsGap.mobile.js.map +1 -0
  207. package/dist/components/CarouselProductCard/CarouselProductCard.js +2 -2
  208. package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  209. package/dist/components/CarouselRichTextCard/CarouselRichTextCard.js +1 -1
  210. package/dist/components/CarouselRichTextCard/CarouselRichTextCard.js.map +1 -1
  211. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  212. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  213. package/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  214. package/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  215. package/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  216. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  217. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js +4 -0
  218. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  219. package/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  220. package/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  221. package/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  222. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  223. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js +5 -0
  224. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  225. package/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  226. package/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  227. package/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  228. package/dist/components/ContactsBlock/ContactsBlock.js +1 -1
  229. package/dist/components/ContactsBlock/ContactsBlock.js.map +1 -1
  230. package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  231. package/dist/components/Filtration/Filtration.js +3 -2
  232. package/dist/components/Filtration/Filtration.js.map +1 -1
  233. package/dist/components/Filtration/renderFormItem.d.ts +2 -2
  234. package/dist/components/Filtration/renderFormItem.js +4 -4
  235. package/dist/components/Filtration/renderFormItem.js.map +1 -1
  236. package/dist/components/GracePeriod/GracePeriod.js +1 -1
  237. package/dist/components/GracePeriod/GracePeriod.js.map +1 -1
  238. package/dist/components/Headline/Headline.js +3 -2
  239. package/dist/components/Headline/Headline.js.map +1 -1
  240. package/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  241. package/dist/components/Headline/headlineVersionStyles.js +6 -6
  242. package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  243. package/dist/components/HorizontalLayout/HorizontalLayout.js +1 -1
  244. package/dist/components/HorizontalLayout/HorizontalLayout.js.map +1 -1
  245. package/dist/components/LinkDocs/LinkDocs.js +1 -1
  246. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  247. package/dist/components/LinkDocs/LinkDocs.mobile.js +1 -1
  248. package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
  249. package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
  250. package/dist/components/ProductBlock/ProductBlock.js +2 -2
  251. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  252. package/dist/components/SafeDepositRental/WrapperSelect.js.map +1 -1
  253. package/dist/components/SafeDepositRental/useGetRegions.js +2 -1
  254. package/dist/components/SafeDepositRental/useGetRegions.js.map +1 -1
  255. package/dist/components/TariffsTable/TariffsTable.js +1 -1
  256. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  257. package/dist/components/TextBlock/TextBlock.js +8 -4
  258. package/dist/components/TextBlock/TextBlock.js.map +1 -1
  259. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -2
  260. package/dist/components/VerticalLayout/VerticalLayout.js +1 -1
  261. package/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
  262. package/dist/hooks/useForm.d.ts +13 -12
  263. package/dist/hooks/useForm.js +32 -9
  264. package/dist/hooks/useForm.js.map +1 -1
  265. package/dist/ui-kit/Checkbox/Checkbox.js +12 -4
  266. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  267. package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  268. package/dist/ui-kit/CurrencyInput/CurrencyInput.js +8 -14
  269. package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  270. package/dist/ui-kit/Input/Input.js +4 -11
  271. package/dist/ui-kit/Input/Input.js.map +1 -1
  272. package/dist/ui-kit/Input/InputProps.d.ts +4 -2
  273. package/dist/ui-kit/InputRange/InputRange.js +22 -16
  274. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  275. package/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  276. package/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  277. package/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  278. package/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  279. package/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  280. package/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  281. package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  282. package/dist/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  283. package/dist/ui-kit/PhoneInput/PhoneInput.js +12 -0
  284. package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -0
  285. package/dist/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  286. package/dist/ui-kit/PhoneInput/normalizePhone.js +17 -0
  287. package/dist/ui-kit/PhoneInput/normalizePhone.js.map +1 -0
  288. package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
  289. package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  290. package/dist/ui-kit/Select/Select.d.ts +6 -7
  291. package/dist/ui-kit/Select/Select.js +16 -25
  292. package/dist/ui-kit/Select/Select.js.map +1 -1
  293. package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +2 -1
  294. package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -1
  295. package/dist/utils/getSanitizedValue.js +1 -1
  296. package/dist/utils/getSanitizedValue.js.map +1 -1
  297. package/dist/validation/and.d.ts +2 -0
  298. package/dist/validation/and.js +5 -0
  299. package/dist/validation/and.js.map +1 -0
  300. package/dist/validation/objectValidator.d.ts +2 -0
  301. package/dist/validation/objectValidator.js +7 -0
  302. package/dist/validation/objectValidator.js.map +1 -0
  303. package/dist/validation/pattern.d.ts +1 -0
  304. package/dist/validation/pattern.js +6 -0
  305. package/dist/validation/pattern.js.map +1 -0
  306. package/dist/validation/required.d.ts +1 -0
  307. package/dist/validation/required.js +5 -0
  308. package/dist/validation/required.js.map +1 -0
  309. package/dist/validation/validator.d.ts +10 -0
  310. package/dist/validation/validator.js +9 -0
  311. package/dist/validation/validator.js.map +1 -0
  312. package/dist/validation/withValidator.d.ts +10 -0
  313. package/dist/validation/withValidator.js +13 -0
  314. package/dist/validation/withValidator.js.map +1 -0
  315. package/dist/wlc.json +1 -2
  316. package/lib/common.css +1 -1
  317. package/lib/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  318. package/lib/components/ApplicationForm/AcquiringFormState.js +2 -0
  319. package/lib/components/ApplicationForm/AcquiringFormState.js.map +1 -0
  320. package/lib/components/ApplicationForm/ApplicationForm.js +4 -3
  321. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  322. package/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  323. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +28 -48
  324. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  325. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  326. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +24 -32
  327. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  328. package/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  329. package/lib/components/ApplicationForm/ApplicationFormCredit.js +28 -48
  330. package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  331. package/lib/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  332. package/lib/components/ApplicationForm/ApplicationFormDeposit.js +21 -23
  333. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  334. package/lib/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  335. package/lib/components/ApplicationForm/ApplicationFormWed.js +22 -37
  336. package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  337. package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  338. package/lib/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  339. package/lib/components/ApplicationForm/BusinessCardFormState.js +2 -0
  340. package/lib/components/ApplicationForm/BusinessCardFormState.js.map +1 -0
  341. package/lib/components/ApplicationForm/CreditFormState.d.ts +13 -0
  342. package/lib/components/ApplicationForm/CreditFormState.js +2 -0
  343. package/lib/components/ApplicationForm/CreditFormState.js.map +1 -0
  344. package/lib/components/ApplicationForm/CreditParameters.d.ts +3 -3
  345. package/lib/components/ApplicationForm/CreditParameters.js +5 -5
  346. package/lib/components/ApplicationForm/CreditParameters.js.map +1 -1
  347. package/lib/components/ApplicationForm/DepositFormState.d.ts +4 -0
  348. package/lib/components/ApplicationForm/DepositFormState.js +2 -0
  349. package/lib/components/ApplicationForm/DepositFormState.js.map +1 -0
  350. package/lib/components/ApplicationForm/InputControl.d.ts +4 -5
  351. package/lib/components/ApplicationForm/InputControl.js +1 -3
  352. package/lib/components/ApplicationForm/InputControl.js.map +1 -1
  353. package/lib/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  354. package/lib/components/ApplicationForm/PhoneInputControl.js +6 -0
  355. package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -0
  356. package/lib/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  357. package/lib/components/ApplicationForm/ResponseNotification.js +4 -4
  358. package/lib/components/ApplicationForm/SelectControl.d.ts +2 -9
  359. package/lib/components/ApplicationForm/SelectControl.js +1 -7
  360. package/lib/components/ApplicationForm/SelectControl.js.map +1 -1
  361. package/lib/components/ApplicationForm/WedFormState.d.ts +10 -0
  362. package/lib/components/ApplicationForm/WedFormState.js +2 -0
  363. package/lib/components/ApplicationForm/WedFormState.js.map +1 -0
  364. package/lib/components/ApplicationForm/models.d.ts +0 -6
  365. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  366. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +4 -2
  367. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  368. package/lib/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  369. package/lib/components/ApplicationForm/renderAcquiringRegion.js +3 -2
  370. package/lib/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
  371. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  372. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +4 -2
  373. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  374. package/lib/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  375. package/lib/components/ApplicationForm/renderCreditDataOrganization.js +4 -2
  376. package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  377. package/lib/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  378. package/lib/components/ApplicationForm/renderCreditParameters.js +4 -17
  379. package/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  380. package/lib/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  381. package/lib/components/ApplicationForm/renderQuestionsInterested.js +4 -1
  382. package/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  383. package/lib/components/ApplicationForm/renderRegion.d.ts +6 -8
  384. package/lib/components/ApplicationForm/renderRegion.js +3 -2
  385. package/lib/components/ApplicationForm/renderRegion.js.map +1 -1
  386. package/lib/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  387. package/lib/components/ApplicationForm/renderRegionDepartment.js +6 -2
  388. package/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  389. package/lib/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  390. package/lib/components/ApplicationForm/renderSlideCheckboxes.js +1 -1
  391. package/lib/components/ApplicationForm/renderSlideCheckboxes.js.map +1 -1
  392. package/lib/components/ApplicationForm/renderSubmitButton.js +2 -1
  393. package/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  394. package/lib/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  395. package/lib/components/ApplicationForm/renderWedDataOrganization.js +4 -2
  396. package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  397. package/lib/components/ApplicationForm/validators.d.ts +4 -0
  398. package/lib/components/ApplicationForm/validators.js +9 -0
  399. package/lib/components/ApplicationForm/validators.js.map +1 -0
  400. package/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  401. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  402. package/lib/components/Blocks.mobile.js +9 -1
  403. package/lib/components/Blocks.mobile.js.map +1 -1
  404. package/lib/components/Bonus/Bonus.js +1 -1
  405. package/lib/components/Bonus/Bonus.js.map +1 -1
  406. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +1 -1
  407. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  408. package/lib/components/BusinessBlock/BusinessBlock.js +1 -1
  409. package/lib/components/BusinessBlock/BusinessBlock.js.map +1 -1
  410. package/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  411. package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  412. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  413. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  414. package/lib/components/Calculator/Calculator.js +4 -4
  415. package/lib/components/Calculator/Calculator.js.map +1 -1
  416. package/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  417. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  418. package/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  419. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  420. package/lib/components/Calculator/Rate.d.ts +1 -0
  421. package/lib/components/Calculator/Rate.js +1 -1
  422. package/lib/components/Calculator/Rate.js.map +1 -1
  423. package/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  424. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  425. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  426. package/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  427. package/lib/components/Calculator/renderDaysInput.js +2 -9
  428. package/lib/components/Calculator/renderDaysInput.js.map +1 -1
  429. package/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  430. package/lib/components/Calculator/renderInterestPayment.js +8 -18
  431. package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  432. package/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  433. package/lib/components/Calculator/renderMonthsInput.js +2 -10
  434. package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  435. package/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  436. package/lib/components/Calculator/renderPaymentType.js +8 -18
  437. package/lib/components/Calculator/renderPaymentType.js.map +1 -1
  438. package/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  439. package/lib/components/Calculator/renderRegistrationType.js +8 -18
  440. package/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  441. package/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  442. package/lib/components/Calculator/renderWantedSumInput.js +4 -6
  443. package/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  444. package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  445. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  446. package/lib/components/CardTransfer/CardTransfer.js +1 -1
  447. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  448. package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +11 -0
  449. package/lib/components/Carousel/Carousel.js +3 -3
  450. package/lib/components/Carousel/Carousel.js.map +1 -1
  451. package/lib/components/Carousel/CarouselScrollButtons.js +1 -1
  452. package/lib/components/Carousel/CarouselScrollButtons.js.map +1 -1
  453. package/lib/components/Carousel/itemsGap.d.ts +1 -0
  454. package/lib/components/Carousel/itemsGap.js +2 -0
  455. package/lib/components/Carousel/itemsGap.js.map +1 -0
  456. package/lib/components/Carousel/itemsGap.mobile.d.ts +1 -0
  457. package/lib/components/Carousel/itemsGap.mobile.js +2 -0
  458. package/lib/components/Carousel/itemsGap.mobile.js.map +1 -0
  459. package/lib/components/CarouselProductCard/CarouselProductCard.js +2 -2
  460. package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  461. package/lib/components/CarouselRichTextCard/CarouselRichTextCard.js +1 -1
  462. package/lib/components/CarouselRichTextCard/CarouselRichTextCard.js.map +1 -1
  463. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.d.ts +9 -0
  464. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  465. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  466. package/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  467. package/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  468. package/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  469. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  470. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js +2 -0
  471. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  472. package/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  473. package/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  474. package/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  475. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  476. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js +2 -0
  477. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  478. package/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  479. package/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  480. package/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  481. package/lib/components/ContactsBlock/ContactsBlock.js +1 -1
  482. package/lib/components/ContactsBlock/ContactsBlock.js.map +1 -1
  483. package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  484. package/lib/components/Filtration/Filtration.js +3 -2
  485. package/lib/components/Filtration/Filtration.js.map +1 -1
  486. package/lib/components/Filtration/renderFormItem.d.ts +2 -2
  487. package/lib/components/Filtration/renderFormItem.js +4 -4
  488. package/lib/components/Filtration/renderFormItem.js.map +1 -1
  489. package/lib/components/GracePeriod/GracePeriod.js +1 -1
  490. package/lib/components/GracePeriod/GracePeriod.js.map +1 -1
  491. package/lib/components/Headline/Headline.fixture.mobile.d.ts +22 -0
  492. package/lib/components/Headline/Headline.js +3 -2
  493. package/lib/components/Headline/Headline.js.map +1 -1
  494. package/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  495. package/lib/components/Headline/headlineVersionStyles.js +6 -6
  496. package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  497. package/lib/components/HorizontalLayout/HorizontalLayout.js +1 -1
  498. package/lib/components/HorizontalLayout/HorizontalLayout.js.map +1 -1
  499. package/lib/components/ImgBlock/ImgBlock.fixture.mobile.d.ts +6 -0
  500. package/lib/components/LinkDocs/LinkDocs.js +1 -1
  501. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  502. package/lib/components/LinkDocs/LinkDocs.mobile.js +1 -1
  503. package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
  504. package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
  505. package/lib/components/ProductBlock/ProductBlock.js +2 -2
  506. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  507. package/lib/components/ProductTile/renderBenefit.d.ts +0 -1
  508. package/lib/components/RichTextBlock/RichTextBlock.fixture.mobile.d.ts +9 -0
  509. package/lib/components/SafeDepositRental/WrapperSelect.js.map +1 -1
  510. package/lib/components/SafeDepositRental/useGetRegions.js +2 -1
  511. package/lib/components/SafeDepositRental/useGetRegions.js.map +1 -1
  512. package/lib/components/TariffsTable/TariffsTable.js +1 -1
  513. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  514. package/lib/components/TextBlock/TextBlock.fixture.d.ts +1 -1
  515. package/lib/components/TextBlock/TextBlock.fixture.mobile.d.ts +6 -2
  516. package/lib/components/TextBlock/TextBlock.js +8 -4
  517. package/lib/components/TextBlock/TextBlock.js.map +1 -1
  518. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -2
  519. package/lib/components/VerticalLayout/VerticalLayout.fixture.mobile.d.ts +8 -0
  520. package/lib/components/VerticalLayout/VerticalLayout.js +1 -1
  521. package/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
  522. package/lib/hooks/useForm.d.ts +13 -12
  523. package/lib/hooks/useForm.js +32 -9
  524. package/lib/hooks/useForm.js.map +1 -1
  525. package/lib/ui-kit/Checkbox/Checkbox.js +12 -4
  526. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  527. package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  528. package/lib/ui-kit/CurrencyInput/CurrencyInput.js +8 -14
  529. package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  530. package/lib/ui-kit/Input/Input.js +4 -11
  531. package/lib/ui-kit/Input/Input.js.map +1 -1
  532. package/lib/ui-kit/Input/InputProps.d.ts +4 -2
  533. package/lib/ui-kit/InputRange/InputRange.js +22 -16
  534. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  535. package/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  536. package/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  537. package/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  538. package/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  539. package/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  540. package/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  541. package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  542. package/lib/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  543. package/lib/ui-kit/PhoneInput/PhoneInput.js +10 -0
  544. package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -0
  545. package/lib/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  546. package/lib/ui-kit/PhoneInput/normalizePhone.js +14 -0
  547. package/lib/ui-kit/PhoneInput/normalizePhone.js.map +1 -0
  548. package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
  549. package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  550. package/lib/ui-kit/Select/Select.d.ts +6 -7
  551. package/lib/ui-kit/Select/Select.js +17 -26
  552. package/lib/ui-kit/Select/Select.js.map +1 -1
  553. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +2 -1
  554. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -1
  555. package/lib/utils/getSanitizedValue.js +1 -1
  556. package/lib/utils/getSanitizedValue.js.map +1 -1
  557. package/lib/validation/and.d.ts +2 -0
  558. package/lib/validation/and.js +2 -0
  559. package/lib/validation/and.js.map +1 -0
  560. package/lib/validation/objectValidator.d.ts +2 -0
  561. package/lib/validation/objectValidator.js +4 -0
  562. package/lib/validation/objectValidator.js.map +1 -0
  563. package/lib/validation/pattern.d.ts +1 -0
  564. package/lib/validation/pattern.js +3 -0
  565. package/lib/validation/pattern.js.map +1 -0
  566. package/lib/validation/required.d.ts +1 -0
  567. package/lib/validation/required.js +3 -0
  568. package/lib/validation/required.js.map +1 -0
  569. package/lib/validation/validator.d.ts +10 -0
  570. package/lib/validation/validator.js +4 -0
  571. package/lib/validation/validator.js.map +1 -0
  572. package/lib/validation/withValidator.d.ts +10 -0
  573. package/lib/validation/withValidator.js +10 -0
  574. package/lib/validation/withValidator.js.map +1 -0
  575. package/lib/wlc.json +1 -2
  576. package/mobile/bundle/bundle.umd.js +388 -277
  577. package/mobile/bundle/bundle.umd.min.js +1 -1
  578. package/mobile/bundle/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  579. package/mobile/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  580. package/mobile/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  581. package/mobile/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  582. package/mobile/bundle/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  583. package/mobile/bundle/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  584. package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  585. package/mobile/bundle/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  586. package/mobile/bundle/components/ApplicationForm/CreditFormState.d.ts +13 -0
  587. package/mobile/bundle/components/ApplicationForm/CreditParameters.d.ts +3 -3
  588. package/mobile/bundle/components/ApplicationForm/DepositFormState.d.ts +4 -0
  589. package/mobile/bundle/components/ApplicationForm/InputControl.d.ts +4 -5
  590. package/mobile/bundle/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  591. package/mobile/bundle/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  592. package/mobile/bundle/components/ApplicationForm/SelectControl.d.ts +2 -9
  593. package/mobile/bundle/components/ApplicationForm/WedFormState.d.ts +10 -0
  594. package/mobile/bundle/components/ApplicationForm/models.d.ts +0 -6
  595. package/mobile/bundle/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  596. package/mobile/bundle/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  597. package/mobile/bundle/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  598. package/mobile/bundle/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  599. package/mobile/bundle/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  600. package/mobile/bundle/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  601. package/mobile/bundle/components/ApplicationForm/renderRegion.d.ts +6 -8
  602. package/mobile/bundle/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  603. package/mobile/bundle/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  604. package/mobile/bundle/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  605. package/mobile/bundle/components/ApplicationForm/validators.d.ts +4 -0
  606. package/mobile/bundle/components/Calculator/Rate.d.ts +1 -0
  607. package/mobile/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  608. package/mobile/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  609. package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  610. package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  611. package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  612. package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  613. package/mobile/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  614. package/mobile/bundle/components/Carousel/itemsGap.d.ts +1 -0
  615. package/mobile/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  616. package/mobile/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  617. package/mobile/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  618. package/mobile/bundle/components/Filtration/renderFormItem.d.ts +2 -2
  619. package/mobile/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  620. package/mobile/bundle/components/TextBlock/TextBlockContent.d.ts +1 -2
  621. package/mobile/bundle/hooks/useForm.d.ts +13 -12
  622. package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  623. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +4 -2
  624. package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  625. package/mobile/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  626. package/mobile/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  627. package/mobile/bundle/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  628. package/mobile/bundle/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  629. package/mobile/bundle/ui-kit/Select/Select.d.ts +6 -7
  630. package/mobile/bundle/validation/and.d.ts +2 -0
  631. package/mobile/bundle/validation/objectValidator.d.ts +2 -0
  632. package/mobile/bundle/validation/pattern.d.ts +1 -0
  633. package/mobile/bundle/validation/required.d.ts +1 -0
  634. package/mobile/bundle/validation/validator.d.ts +10 -0
  635. package/mobile/bundle/validation/withValidator.d.ts +10 -0
  636. package/mobile/dist/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  637. package/mobile/dist/components/ApplicationForm/AcquiringFormState.js +2 -0
  638. package/mobile/dist/components/ApplicationForm/AcquiringFormState.js.map +1 -0
  639. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +4 -3
  640. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  641. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  642. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +28 -48
  643. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  644. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  645. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +24 -32
  646. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  647. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  648. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +28 -48
  649. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  650. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  651. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +21 -23
  652. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  653. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  654. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js +22 -37
  655. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  656. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  657. package/mobile/dist/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  658. package/mobile/dist/components/ApplicationForm/BusinessCardFormState.js +2 -0
  659. package/mobile/dist/components/ApplicationForm/BusinessCardFormState.js.map +1 -0
  660. package/mobile/dist/components/ApplicationForm/CreditFormState.d.ts +13 -0
  661. package/mobile/dist/components/ApplicationForm/CreditFormState.js +2 -0
  662. package/mobile/dist/components/ApplicationForm/CreditFormState.js.map +1 -0
  663. package/mobile/dist/components/ApplicationForm/CreditParameters.d.ts +3 -3
  664. package/mobile/dist/components/ApplicationForm/CreditParameters.js +5 -5
  665. package/mobile/dist/components/ApplicationForm/CreditParameters.js.map +1 -1
  666. package/mobile/dist/components/ApplicationForm/DepositFormState.d.ts +4 -0
  667. package/mobile/dist/components/ApplicationForm/DepositFormState.js +2 -0
  668. package/mobile/dist/components/ApplicationForm/DepositFormState.js.map +1 -0
  669. package/mobile/dist/components/ApplicationForm/InputControl.d.ts +4 -5
  670. package/mobile/dist/components/ApplicationForm/InputControl.js +1 -3
  671. package/mobile/dist/components/ApplicationForm/InputControl.js.map +1 -1
  672. package/mobile/dist/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  673. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js +8 -0
  674. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -0
  675. package/mobile/dist/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  676. package/mobile/dist/components/ApplicationForm/ResponseNotification.js +4 -4
  677. package/mobile/dist/components/ApplicationForm/SelectControl.d.ts +2 -9
  678. package/mobile/dist/components/ApplicationForm/SelectControl.js +1 -7
  679. package/mobile/dist/components/ApplicationForm/SelectControl.js.map +1 -1
  680. package/mobile/dist/components/ApplicationForm/WedFormState.d.ts +10 -0
  681. package/mobile/dist/components/ApplicationForm/WedFormState.js +2 -0
  682. package/mobile/dist/components/ApplicationForm/WedFormState.js.map +1 -0
  683. package/mobile/dist/components/ApplicationForm/models.d.ts +0 -6
  684. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  685. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +4 -2
  686. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  687. package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  688. package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js +3 -2
  689. package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
  690. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  691. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +4 -2
  692. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  693. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  694. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +4 -2
  695. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  696. package/mobile/dist/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  697. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +3 -16
  698. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  699. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  700. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js +4 -1
  701. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  702. package/mobile/dist/components/ApplicationForm/renderRegion.d.ts +6 -8
  703. package/mobile/dist/components/ApplicationForm/renderRegion.js +3 -2
  704. package/mobile/dist/components/ApplicationForm/renderRegion.js.map +1 -1
  705. package/mobile/dist/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  706. package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +6 -2
  707. package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  708. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  709. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.js +1 -1
  710. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.js.map +1 -1
  711. package/mobile/dist/components/ApplicationForm/renderSubmitButton.js +2 -1
  712. package/mobile/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  713. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  714. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +4 -2
  715. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  716. package/mobile/dist/components/ApplicationForm/validators.d.ts +4 -0
  717. package/mobile/dist/components/ApplicationForm/validators.js +11 -0
  718. package/mobile/dist/components/ApplicationForm/validators.js.map +1 -0
  719. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  720. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  721. package/mobile/dist/components/Blocks.js +9 -1
  722. package/mobile/dist/components/Blocks.js.map +1 -1
  723. package/mobile/dist/components/Bonus/Bonus.js +1 -1
  724. package/mobile/dist/components/Bonus/Bonus.js.map +1 -1
  725. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +1 -1
  726. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  727. package/mobile/dist/components/BusinessBlock/BusinessBlock.js +1 -1
  728. package/mobile/dist/components/BusinessBlock/BusinessBlock.js.map +1 -1
  729. package/mobile/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  730. package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  731. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  732. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  733. package/mobile/dist/components/Calculator/Calculator.js +4 -4
  734. package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
  735. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  736. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  737. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  738. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  739. package/mobile/dist/components/Calculator/Rate.d.ts +1 -0
  740. package/mobile/dist/components/Calculator/Rate.js +1 -1
  741. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  742. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  743. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  744. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  745. package/mobile/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  746. package/mobile/dist/components/Calculator/renderDaysInput.js +2 -9
  747. package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -1
  748. package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  749. package/mobile/dist/components/Calculator/renderInterestPayment.js +8 -18
  750. package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  751. package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  752. package/mobile/dist/components/Calculator/renderMonthsInput.js +2 -10
  753. package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  754. package/mobile/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  755. package/mobile/dist/components/Calculator/renderPaymentType.js +9 -19
  756. package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -1
  757. package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  758. package/mobile/dist/components/Calculator/renderRegistrationType.js +8 -18
  759. package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  760. package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  761. package/mobile/dist/components/Calculator/renderWantedSumInput.js +4 -6
  762. package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  763. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  764. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  765. package/mobile/dist/components/CardTransfer/CardTransfer.js +1 -1
  766. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  767. package/mobile/dist/components/Carousel/Carousel.js +4 -4
  768. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  769. package/mobile/dist/components/Carousel/CarouselScrollButtons.js +1 -1
  770. package/mobile/dist/components/Carousel/CarouselScrollButtons.js.map +1 -1
  771. package/mobile/dist/components/Carousel/itemsGap.d.ts +1 -0
  772. package/mobile/dist/components/Carousel/itemsGap.js +4 -0
  773. package/mobile/dist/components/Carousel/itemsGap.js.map +1 -0
  774. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +2 -2
  775. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  776. package/mobile/dist/components/CarouselRichTextCard/CarouselRichTextCard.js +1 -1
  777. package/mobile/dist/components/CarouselRichTextCard/CarouselRichTextCard.js.map +1 -1
  778. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  779. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  780. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  781. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  782. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  783. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  784. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  785. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  786. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  787. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  788. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  789. package/mobile/dist/components/ContactsBlock/ContactsBlock.js +1 -1
  790. package/mobile/dist/components/ContactsBlock/ContactsBlock.js.map +1 -1
  791. package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  792. package/mobile/dist/components/Filtration/Filtration.js +3 -2
  793. package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
  794. package/mobile/dist/components/Filtration/renderFormItem.d.ts +2 -2
  795. package/mobile/dist/components/Filtration/renderFormItem.js +4 -4
  796. package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
  797. package/mobile/dist/components/GracePeriod/GracePeriod.js +1 -1
  798. package/mobile/dist/components/GracePeriod/GracePeriod.js.map +1 -1
  799. package/mobile/dist/components/Headline/Headline.js +3 -2
  800. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  801. package/mobile/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  802. package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
  803. package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  804. package/mobile/dist/components/HorizontalLayout/HorizontalLayout.js +1 -1
  805. package/mobile/dist/components/HorizontalLayout/HorizontalLayout.js.map +1 -1
  806. package/mobile/dist/components/LinkDocs/LinkDocs.js +1 -1
  807. package/mobile/dist/components/SafeDepositRental/WrapperSelect.js.map +1 -1
  808. package/mobile/dist/components/SafeDepositRental/useGetRegions.js +2 -1
  809. package/mobile/dist/components/SafeDepositRental/useGetRegions.js.map +1 -1
  810. package/mobile/dist/components/TextBlock/TextBlock.js +14 -9
  811. package/mobile/dist/components/TextBlock/TextBlock.js.map +1 -1
  812. package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +1 -2
  813. package/mobile/dist/components/VerticalLayout/VerticalLayout.js +1 -1
  814. package/mobile/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
  815. package/mobile/dist/hooks/useForm.d.ts +13 -12
  816. package/mobile/dist/hooks/useForm.js +32 -9
  817. package/mobile/dist/hooks/useForm.js.map +1 -1
  818. package/mobile/dist/ui-kit/Checkbox/Checkbox.js +12 -4
  819. package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  820. package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  821. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +8 -14
  822. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  823. package/mobile/dist/ui-kit/Input/Input.js +4 -11
  824. package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
  825. package/mobile/dist/ui-kit/Input/InputProps.d.ts +4 -2
  826. package/mobile/dist/ui-kit/InputRange/InputRange.js +22 -16
  827. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  828. package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  829. package/mobile/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  830. package/mobile/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  831. package/mobile/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  832. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  833. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  834. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  835. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  836. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +12 -0
  837. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -0
  838. package/mobile/dist/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  839. package/mobile/dist/ui-kit/PhoneInput/normalizePhone.js +17 -0
  840. package/mobile/dist/ui-kit/PhoneInput/normalizePhone.js.map +1 -0
  841. package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
  842. package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  843. package/mobile/dist/ui-kit/Select/Select.d.ts +6 -7
  844. package/mobile/dist/ui-kit/Select/Select.js +16 -25
  845. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  846. package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +2 -1
  847. package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -1
  848. package/mobile/dist/utils/getSanitizedValue.js +1 -1
  849. package/mobile/dist/utils/getSanitizedValue.js.map +1 -1
  850. package/mobile/dist/validation/and.d.ts +2 -0
  851. package/mobile/dist/validation/and.js +5 -0
  852. package/mobile/dist/validation/and.js.map +1 -0
  853. package/mobile/dist/validation/objectValidator.d.ts +2 -0
  854. package/mobile/dist/validation/objectValidator.js +7 -0
  855. package/mobile/dist/validation/objectValidator.js.map +1 -0
  856. package/mobile/dist/validation/pattern.d.ts +1 -0
  857. package/mobile/dist/validation/pattern.js +6 -0
  858. package/mobile/dist/validation/pattern.js.map +1 -0
  859. package/mobile/dist/validation/required.d.ts +1 -0
  860. package/mobile/dist/validation/required.js +5 -0
  861. package/mobile/dist/validation/required.js.map +1 -0
  862. package/mobile/dist/validation/validator.d.ts +10 -0
  863. package/mobile/dist/validation/validator.js +9 -0
  864. package/mobile/dist/validation/validator.js.map +1 -0
  865. package/mobile/dist/validation/withValidator.d.ts +10 -0
  866. package/mobile/dist/validation/withValidator.js +13 -0
  867. package/mobile/dist/validation/withValidator.js.map +1 -0
  868. package/mobile/dist/wlc.json +1 -2
  869. package/mobile/lib/common.css +1 -0
  870. package/mobile/lib/components/ApplicationForm/AcquiringFormState.d.ts +11 -0
  871. package/mobile/lib/components/ApplicationForm/AcquiringFormState.js +2 -0
  872. package/mobile/lib/components/ApplicationForm/AcquiringFormState.js.map +1 -0
  873. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +4 -3
  874. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  875. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -11
  876. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +28 -48
  877. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  878. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +1 -8
  879. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +24 -32
  880. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  881. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +1 -13
  882. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +28 -48
  883. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  884. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.d.ts +1 -5
  885. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +21 -23
  886. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  887. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.d.ts +1 -11
  888. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js +22 -37
  889. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  890. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  891. package/mobile/lib/components/ApplicationForm/BusinessCardFormState.d.ts +8 -0
  892. package/mobile/lib/components/ApplicationForm/BusinessCardFormState.js +2 -0
  893. package/mobile/lib/components/ApplicationForm/BusinessCardFormState.js.map +1 -0
  894. package/mobile/lib/components/ApplicationForm/CreditFormState.d.ts +13 -0
  895. package/mobile/lib/components/ApplicationForm/CreditFormState.js +2 -0
  896. package/mobile/lib/components/ApplicationForm/CreditFormState.js.map +1 -0
  897. package/mobile/lib/components/ApplicationForm/CreditParameters.d.ts +3 -3
  898. package/mobile/lib/components/ApplicationForm/CreditParameters.js +5 -5
  899. package/mobile/lib/components/ApplicationForm/CreditParameters.js.map +1 -1
  900. package/mobile/lib/components/ApplicationForm/DepositFormState.d.ts +4 -0
  901. package/mobile/lib/components/ApplicationForm/DepositFormState.js +2 -0
  902. package/mobile/lib/components/ApplicationForm/DepositFormState.js.map +1 -0
  903. package/mobile/lib/components/ApplicationForm/InputControl.d.ts +4 -5
  904. package/mobile/lib/components/ApplicationForm/InputControl.js +1 -3
  905. package/mobile/lib/components/ApplicationForm/InputControl.js.map +1 -1
  906. package/mobile/lib/components/ApplicationForm/PhoneInputControl.d.ts +2 -0
  907. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js +6 -0
  908. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -0
  909. package/mobile/lib/components/ApplicationForm/ResponseNotification.d.ts +1 -1
  910. package/mobile/lib/components/ApplicationForm/ResponseNotification.js +4 -4
  911. package/mobile/lib/components/ApplicationForm/SelectControl.d.ts +2 -9
  912. package/mobile/lib/components/ApplicationForm/SelectControl.js +1 -7
  913. package/mobile/lib/components/ApplicationForm/SelectControl.js.map +1 -1
  914. package/mobile/lib/components/ApplicationForm/WedFormState.d.ts +10 -0
  915. package/mobile/lib/components/ApplicationForm/WedFormState.js +2 -0
  916. package/mobile/lib/components/ApplicationForm/WedFormState.js.map +1 -0
  917. package/mobile/lib/components/ApplicationForm/models.d.ts +0 -6
  918. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +3 -10
  919. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +4 -2
  920. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  921. package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.d.ts +6 -9
  922. package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js +3 -2
  923. package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
  924. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +3 -10
  925. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +4 -2
  926. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  927. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.d.ts +3 -12
  928. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +4 -2
  929. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  930. package/mobile/lib/components/ApplicationForm/renderCreditParameters.d.ts +3 -9
  931. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +4 -17
  932. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  933. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.d.ts +3 -11
  934. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js +4 -1
  935. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  936. package/mobile/lib/components/ApplicationForm/renderRegion.d.ts +6 -8
  937. package/mobile/lib/components/ApplicationForm/renderRegion.js +3 -2
  938. package/mobile/lib/components/ApplicationForm/renderRegion.js.map +1 -1
  939. package/mobile/lib/components/ApplicationForm/renderRegionDepartment.d.ts +6 -9
  940. package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +6 -2
  941. package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  942. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.d.ts +3 -9
  943. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.js +1 -1
  944. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.js.map +1 -1
  945. package/mobile/lib/components/ApplicationForm/renderSubmitButton.js +2 -1
  946. package/mobile/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  947. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.d.ts +3 -10
  948. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +4 -2
  949. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  950. package/mobile/lib/components/ApplicationForm/validators.d.ts +4 -0
  951. package/mobile/lib/components/ApplicationForm/validators.js +9 -0
  952. package/mobile/lib/components/ApplicationForm/validators.js.map +1 -0
  953. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  954. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  955. package/mobile/lib/components/Blocks.js +9 -1
  956. package/mobile/lib/components/Blocks.js.map +1 -1
  957. package/mobile/lib/components/Bonus/Bonus.js +1 -1
  958. package/mobile/lib/components/Bonus/Bonus.js.map +1 -1
  959. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +1 -1
  960. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  961. package/mobile/lib/components/BusinessBlock/BusinessBlock.js +1 -1
  962. package/mobile/lib/components/BusinessBlock/BusinessBlock.js.map +1 -1
  963. package/mobile/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  964. package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  965. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  966. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  967. package/mobile/lib/components/Calculator/Calculator.js +4 -4
  968. package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
  969. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  970. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  971. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  972. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  973. package/mobile/lib/components/Calculator/Rate.d.ts +1 -0
  974. package/mobile/lib/components/Calculator/Rate.js +1 -1
  975. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  976. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  977. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  978. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  979. package/mobile/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  980. package/mobile/lib/components/Calculator/renderDaysInput.js +2 -9
  981. package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -1
  982. package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  983. package/mobile/lib/components/Calculator/renderInterestPayment.js +8 -18
  984. package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  985. package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  986. package/mobile/lib/components/Calculator/renderMonthsInput.js +2 -10
  987. package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  988. package/mobile/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  989. package/mobile/lib/components/Calculator/renderPaymentType.js +8 -18
  990. package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -1
  991. package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  992. package/mobile/lib/components/Calculator/renderRegistrationType.js +8 -18
  993. package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  994. package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  995. package/mobile/lib/components/Calculator/renderWantedSumInput.js +4 -6
  996. package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  997. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  998. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  999. package/mobile/lib/components/CardTransfer/CardTransfer.js +1 -1
  1000. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  1001. package/mobile/lib/components/Carousel/Carousel.js +3 -3
  1002. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  1003. package/mobile/lib/components/Carousel/CarouselScrollButtons.js +1 -1
  1004. package/mobile/lib/components/Carousel/CarouselScrollButtons.js.map +1 -1
  1005. package/mobile/lib/components/Carousel/itemsGap.d.ts +1 -0
  1006. package/mobile/lib/components/Carousel/itemsGap.js +2 -0
  1007. package/mobile/lib/components/Carousel/itemsGap.js.map +1 -0
  1008. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +2 -2
  1009. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  1010. package/mobile/lib/components/CarouselRichTextCard/CarouselRichTextCard.js +1 -1
  1011. package/mobile/lib/components/CarouselRichTextCard/CarouselRichTextCard.js.map +1 -1
  1012. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  1013. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  1014. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  1015. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  1016. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  1017. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  1018. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  1019. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  1020. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  1021. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  1022. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  1023. package/mobile/lib/components/ContactsBlock/ContactsBlock.js +1 -1
  1024. package/mobile/lib/components/ContactsBlock/ContactsBlock.js.map +1 -1
  1025. package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  1026. package/mobile/lib/components/Filtration/Filtration.js +3 -2
  1027. package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
  1028. package/mobile/lib/components/Filtration/renderFormItem.d.ts +2 -2
  1029. package/mobile/lib/components/Filtration/renderFormItem.js +4 -4
  1030. package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
  1031. package/mobile/lib/components/GracePeriod/GracePeriod.js +1 -1
  1032. package/mobile/lib/components/GracePeriod/GracePeriod.js.map +1 -1
  1033. package/mobile/lib/components/Headline/Headline.js +3 -2
  1034. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  1035. package/mobile/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  1036. package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
  1037. package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  1038. package/mobile/lib/components/HorizontalLayout/HorizontalLayout.js +1 -1
  1039. package/mobile/lib/components/HorizontalLayout/HorizontalLayout.js.map +1 -1
  1040. package/mobile/lib/components/LinkDocs/LinkDocs.js +1 -1
  1041. package/mobile/lib/components/SafeDepositRental/WrapperSelect.js.map +1 -1
  1042. package/mobile/lib/components/SafeDepositRental/useGetRegions.js +2 -1
  1043. package/mobile/lib/components/SafeDepositRental/useGetRegions.js.map +1 -1
  1044. package/mobile/lib/components/TextBlock/TextBlock.js +14 -9
  1045. package/mobile/lib/components/TextBlock/TextBlock.js.map +1 -1
  1046. package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +1 -2
  1047. package/mobile/lib/components/VerticalLayout/VerticalLayout.js +1 -1
  1048. package/mobile/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
  1049. package/mobile/lib/hooks/useForm.d.ts +13 -12
  1050. package/mobile/lib/hooks/useForm.js +32 -9
  1051. package/mobile/lib/hooks/useForm.js.map +1 -1
  1052. package/mobile/lib/ui-kit/Checkbox/Checkbox.js +12 -4
  1053. package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  1054. package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +2 -2
  1055. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +8 -14
  1056. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  1057. package/mobile/lib/ui-kit/Input/Input.js +4 -11
  1058. package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
  1059. package/mobile/lib/ui-kit/Input/InputProps.d.ts +4 -2
  1060. package/mobile/lib/ui-kit/InputRange/InputRange.js +22 -16
  1061. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  1062. package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  1063. package/mobile/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  1064. package/mobile/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  1065. package/mobile/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  1066. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  1067. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  1068. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  1069. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.d.ts +2 -0
  1070. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +10 -0
  1071. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -0
  1072. package/mobile/lib/ui-kit/PhoneInput/normalizePhone.d.ts +1 -0
  1073. package/mobile/lib/ui-kit/PhoneInput/normalizePhone.js +14 -0
  1074. package/mobile/lib/ui-kit/PhoneInput/normalizePhone.js.map +1 -0
  1075. package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
  1076. package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  1077. package/mobile/lib/ui-kit/Select/Select.d.ts +6 -7
  1078. package/mobile/lib/ui-kit/Select/Select.js +17 -26
  1079. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  1080. package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +2 -1
  1081. package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -1
  1082. package/mobile/lib/utils/getSanitizedValue.js +1 -1
  1083. package/mobile/lib/utils/getSanitizedValue.js.map +1 -1
  1084. package/mobile/lib/validation/and.d.ts +2 -0
  1085. package/mobile/lib/validation/and.js +2 -0
  1086. package/mobile/lib/validation/and.js.map +1 -0
  1087. package/mobile/lib/validation/objectValidator.d.ts +2 -0
  1088. package/mobile/lib/validation/objectValidator.js +4 -0
  1089. package/mobile/lib/validation/objectValidator.js.map +1 -0
  1090. package/mobile/lib/validation/pattern.d.ts +1 -0
  1091. package/mobile/lib/validation/pattern.js +3 -0
  1092. package/mobile/lib/validation/pattern.js.map +1 -0
  1093. package/mobile/lib/validation/required.d.ts +1 -0
  1094. package/mobile/lib/validation/required.js +3 -0
  1095. package/mobile/lib/validation/required.js.map +1 -0
  1096. package/mobile/lib/validation/validator.d.ts +10 -0
  1097. package/mobile/lib/validation/validator.js +4 -0
  1098. package/mobile/lib/validation/validator.js.map +1 -0
  1099. package/mobile/lib/validation/withValidator.d.ts +10 -0
  1100. package/mobile/lib/validation/withValidator.js +10 -0
  1101. package/mobile/lib/validation/withValidator.js.map +1 -0
  1102. package/mobile/lib/wlc.json +1 -2
  1103. package/mobile/src/components/ApplicationForm/AcquiringFormState.ts +12 -0
  1104. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +6 -5
  1105. package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +43 -71
  1106. package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +37 -51
  1107. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +49 -84
  1108. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +41 -67
  1109. package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +40 -64
  1110. package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  1111. package/mobile/src/components/ApplicationForm/BusinessCardFormState.ts +9 -0
  1112. package/mobile/src/components/ApplicationForm/CreditFormState.ts +14 -0
  1113. package/mobile/src/components/ApplicationForm/CreditParameters.ts +5 -5
  1114. package/mobile/src/components/ApplicationForm/DepositFormState.ts +4 -0
  1115. package/mobile/src/components/ApplicationForm/InputControl.tsx +21 -21
  1116. package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +26 -0
  1117. package/mobile/src/components/ApplicationForm/ResponseNotification.tsx +7 -7
  1118. package/mobile/src/components/ApplicationForm/SelectControl.tsx +14 -48
  1119. package/mobile/src/components/ApplicationForm/WedFormState.ts +10 -0
  1120. package/mobile/src/components/ApplicationForm/models.ts +0 -8
  1121. package/mobile/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +11 -36
  1122. package/mobile/src/components/ApplicationForm/renderAcquiringRegion.tsx +12 -33
  1123. package/mobile/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +13 -36
  1124. package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +13 -44
  1125. package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +27 -30
  1126. package/mobile/src/components/ApplicationForm/renderQuestionsInterested.tsx +21 -40
  1127. package/mobile/src/components/ApplicationForm/renderRegion.tsx +10 -22
  1128. package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +15 -32
  1129. package/mobile/src/components/ApplicationForm/renderSlideCheckboxes.tsx +5 -23
  1130. package/mobile/src/components/ApplicationForm/renderSubmitButton.tsx +2 -1
  1131. package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +11 -36
  1132. package/mobile/src/components/ApplicationForm/validators.ts +17 -0
  1133. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  1134. package/mobile/src/components/Blocks.ts +9 -1
  1135. package/mobile/src/components/Bonus/Bonus.tsx +1 -1
  1136. package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +1 -1
  1137. package/mobile/src/components/BusinessBlock/BusinessBlock.tsx +1 -1
  1138. package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  1139. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  1140. package/mobile/src/components/Calculator/Calculator.tsx +11 -5
  1141. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  1142. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  1143. package/mobile/src/components/Calculator/Rate.tsx +14 -14
  1144. package/mobile/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  1145. package/mobile/src/components/Calculator/renderDaysInput.tsx +10 -31
  1146. package/mobile/src/components/Calculator/renderInterestPayment.tsx +13 -52
  1147. package/mobile/src/components/Calculator/renderMonthsInput.tsx +17 -39
  1148. package/mobile/src/components/Calculator/renderPaymentType.tsx +13 -49
  1149. package/mobile/src/components/Calculator/renderRegistrationType.tsx +13 -51
  1150. package/mobile/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  1151. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  1152. package/mobile/src/components/CardTransfer/CardTransfer.tsx +1 -1
  1153. package/mobile/src/components/Carousel/Carousel.tsx +3 -4
  1154. package/mobile/src/components/Carousel/CarouselScrollButtons.tsx +7 -3
  1155. package/mobile/src/components/Carousel/itemsGap.ts +1 -0
  1156. package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +2 -1
  1157. package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +2 -2
  1158. package/mobile/src/components/CarouselRichTextCard/CarouselRichTextCard.tsx +1 -1
  1159. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  1160. package/mobile/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  1161. package/mobile/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  1162. package/mobile/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  1163. package/mobile/src/components/ContactsBlock/ContactsBlock.tsx +1 -1
  1164. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +3 -3
  1165. package/mobile/src/components/Filtration/Filtration.tsx +6 -4
  1166. package/mobile/src/components/Filtration/renderFormItem.tsx +5 -5
  1167. package/mobile/src/components/GracePeriod/GracePeriod.tsx +1 -1
  1168. package/mobile/src/components/Headline/Headline.tsx +11 -6
  1169. package/mobile/src/components/Headline/headlineVersionStyles.ts +7 -7
  1170. package/mobile/src/components/HorizontalLayout/HorizontalLayout.tsx +1 -1
  1171. package/mobile/src/components/LinkDocs/LinkDocs.tsx +1 -1
  1172. package/mobile/src/components/SafeDepositRental/WrapperSelect.tsx +2 -2
  1173. package/mobile/src/components/SafeDepositRental/useGetRegions.ts +3 -1
  1174. package/mobile/src/components/TariffsTable/TariffsTable.ui.json +3 -0
  1175. package/mobile/src/components/TextBlock/TextBlock.tsx +56 -22
  1176. package/mobile/src/components/TextBlock/TextBlockContent.ts +1 -3
  1177. package/mobile/src/components/VerticalLayout/VerticalLayout.tsx +1 -1
  1178. package/mobile/src/hooks/useForm.ts +68 -17
  1179. package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +43 -25
  1180. package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +2 -2
  1181. package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +8 -16
  1182. package/mobile/src/ui-kit/Input/Input.tsx +11 -19
  1183. package/mobile/src/ui-kit/Input/InputProps.ts +4 -2
  1184. package/mobile/src/ui-kit/InputRange/InputRange.tsx +56 -43
  1185. package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  1186. package/mobile/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  1187. package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  1188. package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +19 -0
  1189. package/mobile/src/ui-kit/PhoneInput/normalizePhone.ts +23 -0
  1190. package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +1 -1
  1191. package/mobile/src/ui-kit/Select/Select.tsx +48 -55
  1192. package/mobile/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +13 -12
  1193. package/mobile/src/utils/getSanitizedValue.ts +1 -1
  1194. package/mobile/src/validation/and.ts +6 -0
  1195. package/mobile/src/validation/objectValidator.ts +10 -0
  1196. package/mobile/src/validation/pattern.ts +4 -0
  1197. package/mobile/src/validation/required.ts +3 -0
  1198. package/mobile/src/validation/validator.ts +21 -0
  1199. package/mobile/src/validation/withValidator.ts +21 -0
  1200. package/mobile/src/wlc.json +1 -2
  1201. package/package.json +2 -2
  1202. package/src/components/ApplicationForm/AcquiringFormState.ts +12 -0
  1203. package/src/components/ApplicationForm/ApplicationForm.tsx +6 -5
  1204. package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +43 -71
  1205. package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +37 -51
  1206. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +49 -84
  1207. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +41 -67
  1208. package/src/components/ApplicationForm/ApplicationFormWed.tsx +40 -64
  1209. package/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  1210. package/src/components/ApplicationForm/BusinessCardFormState.ts +9 -0
  1211. package/src/components/ApplicationForm/CreditFormState.ts +14 -0
  1212. package/src/components/ApplicationForm/CreditParameters.ts +5 -5
  1213. package/src/components/ApplicationForm/DepositFormState.ts +4 -0
  1214. package/src/components/ApplicationForm/InputControl.tsx +21 -21
  1215. package/src/components/ApplicationForm/PhoneInputControl.tsx +26 -0
  1216. package/src/components/ApplicationForm/ResponseNotification.tsx +7 -7
  1217. package/src/components/ApplicationForm/SelectControl.tsx +14 -48
  1218. package/src/components/ApplicationForm/WedFormState.ts +10 -0
  1219. package/src/components/ApplicationForm/models.ts +0 -8
  1220. package/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +11 -36
  1221. package/src/components/ApplicationForm/renderAcquiringRegion.tsx +12 -33
  1222. package/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +13 -36
  1223. package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +13 -44
  1224. package/src/components/ApplicationForm/renderCreditParameters.tsx +27 -30
  1225. package/src/components/ApplicationForm/renderQuestionsInterested.tsx +21 -40
  1226. package/src/components/ApplicationForm/renderRegion.tsx +10 -22
  1227. package/src/components/ApplicationForm/renderRegionDepartment.tsx +15 -32
  1228. package/src/components/ApplicationForm/renderSlideCheckboxes.tsx +5 -23
  1229. package/src/components/ApplicationForm/renderSubmitButton.tsx +2 -1
  1230. package/src/components/ApplicationForm/renderWedDataOrganization.tsx +11 -36
  1231. package/src/components/ApplicationForm/validators.ts +17 -0
  1232. package/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  1233. package/src/components/Blocks.mobile.ts +9 -1
  1234. package/src/components/Bonus/Bonus.tsx +1 -1
  1235. package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +1 -1
  1236. package/src/components/BusinessBlock/BusinessBlock.tsx +1 -1
  1237. package/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  1238. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  1239. package/src/components/Calculator/Calculator.tsx +11 -5
  1240. package/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  1241. package/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  1242. package/src/components/Calculator/Rate.tsx +14 -14
  1243. package/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  1244. package/src/components/Calculator/renderDaysInput.tsx +10 -31
  1245. package/src/components/Calculator/renderInterestPayment.tsx +13 -52
  1246. package/src/components/Calculator/renderMonthsInput.tsx +17 -39
  1247. package/src/components/Calculator/renderPaymentType.tsx +13 -49
  1248. package/src/components/Calculator/renderRegistrationType.tsx +13 -51
  1249. package/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  1250. package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  1251. package/src/components/CardTransfer/CardTransfer.tsx +1 -1
  1252. package/src/components/Carousel/Carousel.fixture.mobile.tsx +93 -0
  1253. package/src/components/Carousel/Carousel.fixture.tsx +1 -1
  1254. package/src/components/Carousel/Carousel.tsx +3 -4
  1255. package/src/components/Carousel/CarouselScrollButtons.tsx +7 -3
  1256. package/src/components/Carousel/itemsGap.mobile.ts +1 -0
  1257. package/src/components/Carousel/itemsGap.ts +1 -0
  1258. package/src/components/CarouselProductCard/CarouselProductCard.example.json +2 -1
  1259. package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +1 -0
  1260. package/src/components/CarouselProductCard/CarouselProductCard.tsx +2 -2
  1261. package/src/components/CarouselRichTextCard/CarouselRichTextCard.tsx +1 -1
  1262. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +74 -0
  1263. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  1264. package/src/components/CarouselTariffsCard/descriptionSize.mobile.tsx +1 -0
  1265. package/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  1266. package/src/components/CarouselTariffsCard/getPaddingStyle.mobile.tsx +2 -0
  1267. package/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  1268. package/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  1269. package/src/components/ContactsBlock/ContactsBlock.tsx +1 -1
  1270. package/src/components/ExchangeRateTile/renderInput.tsx +3 -3
  1271. package/src/components/Filtration/Filtration.tsx +6 -4
  1272. package/src/components/Filtration/renderFormItem.tsx +5 -5
  1273. package/src/components/GracePeriod/GracePeriod.tsx +1 -1
  1274. package/src/components/Headline/Headline.fixture.mobile.tsx +95 -0
  1275. package/src/components/Headline/Headline.tsx +11 -6
  1276. package/src/components/Headline/headlineVersionStyles.ts +7 -7
  1277. package/src/components/HorizontalLayout/HorizontalLayout.tsx +1 -1
  1278. package/src/components/ImgBlock/ImgBlock.fixture.mobile.tsx +21 -0
  1279. package/src/components/LinkDocs/LinkDocs.mobile.tsx +1 -1
  1280. package/src/components/LinkDocs/LinkDocs.tsx +1 -1
  1281. package/src/components/MobileAppTile/MobileAppTile.tsx +1 -1
  1282. package/src/components/ProductBlock/ProductBlock.tsx +5 -2
  1283. package/src/components/RichTextBlock/RichTextBlock.fixture.mobile.tsx +51 -0
  1284. package/src/components/SafeDepositRental/WrapperSelect.tsx +2 -2
  1285. package/src/components/SafeDepositRental/useGetRegions.ts +3 -1
  1286. package/src/components/TariffsTable/TariffsTable.tsx +1 -1
  1287. package/src/components/TariffsTable/TariffsTable.ui.json +3 -0
  1288. package/src/components/TextBlock/TextBlock.fixture.mobile.tsx +43 -50
  1289. package/src/components/TextBlock/TextBlock.fixture.tsx +1 -1
  1290. package/src/components/TextBlock/TextBlock.tsx +36 -12
  1291. package/src/components/TextBlock/TextBlockContent.ts +1 -3
  1292. package/src/components/VerticalLayout/VerticalLayout.fixture.mobile.tsx +90 -0
  1293. package/src/components/VerticalLayout/VerticalLayout.tsx +1 -1
  1294. package/src/hooks/useForm.ts +68 -17
  1295. package/src/ui-kit/Checkbox/Checkbox.tsx +43 -25
  1296. package/src/ui-kit/Checkbox/CheckboxProps.ts +2 -2
  1297. package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +8 -16
  1298. package/src/ui-kit/Input/Input.tsx +11 -19
  1299. package/src/ui-kit/Input/InputProps.ts +4 -2
  1300. package/src/ui-kit/InputRange/InputRange.tsx +56 -43
  1301. package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  1302. package/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  1303. package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  1304. package/src/ui-kit/List/List.fixture.tsx +4 -4
  1305. package/src/ui-kit/PhoneInput/PhoneInput.tsx +19 -0
  1306. package/src/ui-kit/PhoneInput/normalizePhone.ts +23 -0
  1307. package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +1 -1
  1308. package/src/ui-kit/RichText/RichText.fixture.tsx +1 -1
  1309. package/src/ui-kit/Select/Select.tsx +48 -55
  1310. package/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +13 -12
  1311. package/src/ui-kit/Tags/Tags.fixture.tsx +1 -1
  1312. package/src/utils/getSanitizedValue.ts +1 -1
  1313. package/src/validation/and.ts +6 -0
  1314. package/src/validation/objectValidator.ts +10 -0
  1315. package/src/validation/pattern.ts +4 -0
  1316. package/src/validation/required.ts +3 -0
  1317. package/src/validation/validator.ts +21 -0
  1318. package/src/validation/withValidator.ts +21 -0
  1319. package/src/wlc.json +1 -2
  1320. package/tailwind.config.cjs +3 -0
  1321. package/bin/migration-scripts/0.9.3.js +0 -88
  1322. package/bundle/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1323. package/bundle/components/ApplicationForm/useForm.d.ts +0 -14
  1324. package/bundle/components/ApplicationForm/validate.d.ts +0 -1
  1325. package/bundle/components/TextBlock/TextBlock.mobile.d.ts +0 -5
  1326. package/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1327. package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1328. package/dist/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1329. package/dist/components/ApplicationForm/renderInputRange.js +0 -8
  1330. package/dist/components/ApplicationForm/renderInputRange.js.map +0 -1
  1331. package/dist/components/ApplicationForm/useForm.d.ts +0 -14
  1332. package/dist/components/ApplicationForm/useForm.js +0 -37
  1333. package/dist/components/ApplicationForm/useForm.js.map +0 -1
  1334. package/dist/components/ApplicationForm/validate.d.ts +0 -1
  1335. package/dist/components/ApplicationForm/validate.js +0 -22
  1336. package/dist/components/ApplicationForm/validate.js.map +0 -1
  1337. package/dist/components/TextBlock/TextBlock.mobile.d.ts +0 -5
  1338. package/dist/components/TextBlock/TextBlock.mobile.js +0 -16
  1339. package/dist/components/TextBlock/TextBlock.mobile.js.map +0 -1
  1340. package/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1341. package/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  1342. package/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  1343. package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1344. package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  1345. package/lib/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1346. package/lib/components/ApplicationForm/renderInputRange.js +0 -5
  1347. package/lib/components/ApplicationForm/renderInputRange.js.map +0 -1
  1348. package/lib/components/ApplicationForm/useForm.d.ts +0 -14
  1349. package/lib/components/ApplicationForm/useForm.js +0 -34
  1350. package/lib/components/ApplicationForm/useForm.js.map +0 -1
  1351. package/lib/components/ApplicationForm/validate.d.ts +0 -1
  1352. package/lib/components/ApplicationForm/validate.js +0 -19
  1353. package/lib/components/ApplicationForm/validate.js.map +0 -1
  1354. package/lib/components/TextBlock/TextBlock.mobile.d.ts +0 -5
  1355. package/lib/components/TextBlock/TextBlock.mobile.js +0 -14
  1356. package/lib/components/TextBlock/TextBlock.mobile.js.map +0 -1
  1357. package/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1358. package/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  1359. package/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  1360. package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1361. package/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  1362. package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  1363. package/mobile/bundle/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1364. package/mobile/bundle/components/ApplicationForm/useForm.d.ts +0 -14
  1365. package/mobile/bundle/components/ApplicationForm/validate.d.ts +0 -1
  1366. package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1367. package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1368. package/mobile/dist/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1369. package/mobile/dist/components/ApplicationForm/renderInputRange.js +0 -8
  1370. package/mobile/dist/components/ApplicationForm/renderInputRange.js.map +0 -1
  1371. package/mobile/dist/components/ApplicationForm/useForm.d.ts +0 -14
  1372. package/mobile/dist/components/ApplicationForm/useForm.js +0 -37
  1373. package/mobile/dist/components/ApplicationForm/useForm.js.map +0 -1
  1374. package/mobile/dist/components/ApplicationForm/validate.d.ts +0 -1
  1375. package/mobile/dist/components/ApplicationForm/validate.js +0 -22
  1376. package/mobile/dist/components/ApplicationForm/validate.js.map +0 -1
  1377. package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1378. package/mobile/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  1379. package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  1380. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1381. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  1382. package/mobile/lib/components/ApplicationForm/renderInputRange.d.ts +0 -11
  1383. package/mobile/lib/components/ApplicationForm/renderInputRange.js +0 -5
  1384. package/mobile/lib/components/ApplicationForm/renderInputRange.js.map +0 -1
  1385. package/mobile/lib/components/ApplicationForm/useForm.d.ts +0 -14
  1386. package/mobile/lib/components/ApplicationForm/useForm.js +0 -34
  1387. package/mobile/lib/components/ApplicationForm/useForm.js.map +0 -1
  1388. package/mobile/lib/components/ApplicationForm/validate.d.ts +0 -1
  1389. package/mobile/lib/components/ApplicationForm/validate.js +0 -19
  1390. package/mobile/lib/components/ApplicationForm/validate.js.map +0 -1
  1391. package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  1392. package/mobile/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  1393. package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  1394. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  1395. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  1396. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  1397. package/mobile/src/components/ApplicationForm/renderInputRange.tsx +0 -20
  1398. package/mobile/src/components/ApplicationForm/useForm.ts +0 -65
  1399. package/mobile/src/components/ApplicationForm/validate.ts +0 -22
  1400. package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  1401. package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
  1402. package/src/components/ApplicationForm/renderInputRange.tsx +0 -20
  1403. package/src/components/ApplicationForm/useForm.ts +0 -65
  1404. package/src/components/ApplicationForm/validate.ts +0 -22
  1405. package/src/components/TextBlock/TextBlock.mobile.tsx +0 -42
  1406. package/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  1407. package/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
@@ -358,6 +358,53 @@
358
358
  };
359
359
  const Heading = JSX(({ className = '', headingType = 'h3', as: Tag = 'h3', title, children }) => (jsx(Tag, { className: `font-sans m-0 ${styles$4[headingType]} ${className}`, children: title || children })));
360
360
 
361
+ const useForm = (initialState, onSubmit) => {
362
+ const [formState, setFormState] = useState(initialState);
363
+ const [isDirtyForm, setDirtyForm] = useState(false);
364
+ const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
365
+ const handlersMap = useRef({});
366
+ const field = useCallback((fieldName) => {
367
+ if (!handlersMap.current) {
368
+ handlersMap.current = {};
369
+ }
370
+ handlersMap.current[fieldName] ||= (value) => {
371
+ setFormState((prev) => ({ ...prev, [fieldName]: value }));
372
+ setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
373
+ };
374
+ return {
375
+ value: formState[fieldName],
376
+ isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
377
+ onChange: handlersMap.current[fieldName],
378
+ };
379
+ }, [formState, isDirtyForm, dirtyFieldsMap]);
380
+ const reset = useCallback(() => {
381
+ setFormState(initialState);
382
+ setDirtyForm(false);
383
+ setDirtyFieldsMap({});
384
+ }, [initialState]);
385
+ const handleSubmit = useCallback((e) => {
386
+ e.preventDefault();
387
+ setDirtyForm(true);
388
+ onSubmit && onSubmit(formState);
389
+ }, [onSubmit, formState]);
390
+ return [
391
+ formState,
392
+ {
393
+ isDirty: isDirtyForm || Object.values(dirtyFieldsMap).some(Boolean),
394
+ field,
395
+ reset,
396
+ onSubmit: handleSubmit,
397
+ },
398
+ ];
399
+ };
400
+
401
+ const objectValidator = (validatorsMap) => (o) => (o &&
402
+ Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
403
+ [];
404
+
405
+ const isValidationSuccess = (info) => !info?.length;
406
+ const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
407
+
361
408
  const consistentDataMap = new Map();
362
409
  function useAsyncData(key, fetcher, { fallback } = {}) {
363
410
  const args = useMemo(() => keyToArgs(key), [key]);
@@ -439,9 +486,10 @@
439
486
  }
440
487
 
441
488
  const REGIONS_URL$1 = '/api/v1/regions';
489
+ const EMPTY_VALUE$2 = [];
442
490
  function useGetRegions() {
443
491
  const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
444
- return data || [];
492
+ return data || EMPTY_VALUE$2;
445
493
  }
446
494
 
447
495
  const useDialog = (id = '') => ({
@@ -606,49 +654,61 @@
606
654
 
607
655
  const Footnote = JSX(({ link }) => (jsxs(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), link ? (jsx(Button, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target, className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
608
656
 
609
- const Input = JSX(({ className = '', inputClassName = '', id, name, type = 'text', label, value = '', valid = true, children, onChange, onBlur, ...inputProps }) => {
657
+ const withValidator = (props, validator) => {
658
+ const { value, isDirty } = props;
659
+ const errors = isDirty ? validator(value) : [];
660
+ return {
661
+ ...props,
662
+ errors,
663
+ error: errors[0],
664
+ };
665
+ };
666
+
667
+ const Input = JSX(({ className = '', inputClassName = '', id, name, type = 'text', label, value = '', valid = true, children, onChange, ...inputProps }) => {
610
668
  const handleChange = useCallback((e) => {
611
- const validInputValue = e.target.validity.valid ? e.target.value : value;
612
- onChange(validInputValue);
669
+ onChange && onChange(e.target?.value || '');
613
670
  }, [onChange]);
614
- const handleBlur = useCallback((e) => {
615
- if (!onBlur) {
616
- return;
617
- }
618
- const validInputValue = e.target.validity.valid ? e.target.value : value;
619
- onBlur(validInputValue);
620
- }, [onBlur]);
621
671
  const paddingStyle = children ? 'pr-8' : '';
622
672
  const validStyle = valid
623
673
  ? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
624
674
  : 'border-error';
625
- return (jsxs("div", { className: `relative ${className}`, children: [label ? jsx("label", { className: "block text-m-light mb-2", children: label }) : null, jsx("input", { className: `w-full border rounded-md text-primary-text outline-none p-4 ${paddingStyle} ${validStyle} ${inputClassName}`, id: id, name: name || id, type: type, value: value, onChange: handleChange, onBlur: handleBlur, ...inputProps }), children] }));
626
- });
675
+ return (jsxs("div", { className: style('relative', className), children: [label ? jsx("label", { className: "block text-m-light mb-2", children: label }) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-4', paddingStyle, validStyle, inputClassName), id: id, name: name || id, type: type, value: value, onInput: handleChange, ...inputProps }), children] }));
676
+ });
677
+
678
+ const InputControl = JSX(({ className, label, value = '', error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs-light", color: "text-error", children: error })) : null })] })));
679
+
680
+ const isPlaceholder = (_) => _ === '_';
681
+ const isDigit = (_) => /\d/.test(_);
682
+ const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
683
+ const phonePattern = [...'+7 (___) ___-__-__'];
684
+ const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
685
+ const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
686
+ function normalizePhone(phone) {
687
+ const phoneNumbers = phone.replace(/\D/g, '');
688
+ const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
689
+ const result = phonePattern.map(applyPlaceholder);
690
+ const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
691
+ return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
692
+ }
627
693
 
628
- const InputControl = JSX(({ className, label, value, error, onChange, onBlur }) => {
629
- return (jsxs("div", { className: className, children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: jsx(Text, { size: "text-xs-light", color: "text-error", children: error ? error : null }) })] }));
694
+ const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
695
+ const handleChange = useCallback(({ target: { value } }) => onChange && onChange(normalizePhone(value || '')), [onChange]);
696
+ return (jsx(Input, { onInput: handleChange, onFocus: handleChange, ...inputProps, children: children }));
630
697
  });
631
698
 
632
- const ERROR_EMPTY = 'Некорректно заполненное поле';
633
- const validate = (key, value) => {
634
- switch (key) {
635
- case 'name':
636
- return isName(value);
637
- case 'inn':
638
- return isTin(value);
639
- case 'mail':
640
- return isEmpty(value);
641
- case 'phone':
642
- return isEmpty(value);
643
- default:
644
- return isEmpty(value);
645
- }
646
- };
647
- const isEmpty = (value) => (value ? '' : ERROR_EMPTY);
648
- const isName = (value) => (value.length > 1 ? '' : ERROR_EMPTY);
649
- const isTin = (value) => (value.length === 10 || value.length === 12 ? '' : ERROR_EMPTY);
699
+ const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(PhoneInput, { "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs-light", color: "text-error", children: error })) : null })] })));
700
+
701
+ const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
702
+
703
+ const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
704
+
705
+ const ERROR_MESSAGE = 'Некорректно заполненное поле';
706
+ const defaultValidator = required(ERROR_MESSAGE);
707
+ const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
708
+ const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
709
+ const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
650
710
 
651
- const renderAcquiringDataOrganization = ({ fullName, inn, name, phone, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "flex justify-between gap-5 mb-5", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", error: errors['fullName'], value: fullName, onChange: (value) => handleChange({ fullName: value }), onBlur: (value) => handleChangeErrors({ fullName: validate('fullName', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", error: errors['name'], value: name, onChange: (value) => handleChange({ name: value }), onBlur: (value) => handleChangeErrors({ name: validate('name', value) }) })] }), jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", error: errors['inn'], value: inn, onChange: (value) => handleChange({ inn: value }), onBlur: (value) => handleChangeErrors({ inn: validate('inn', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", error: errors['phone'], value: phone, onChange: (value) => handleChange({ phone: value }), onBlur: (value) => handleChangeErrors({ phone: validate('phone', value) }) })] })] }));
711
+ const renderAcquiringDataOrganization = (field) => (jsxs("div", { className: "flex justify-between gap-5 mb-5", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) })] }), jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] })] }));
652
712
 
653
713
  const ACQUIRING_TYPES = [
654
714
  {
@@ -668,6 +728,14 @@
668
728
  },
669
729
  ];
670
730
 
731
+ function useBool(defaultValue = false) {
732
+ const [value, setValue] = useState(defaultValue);
733
+ const setTrue = useCallback(() => setValue(true), []);
734
+ const setFalse = useCallback(() => setValue(false), []);
735
+ const toggle = useCallback(() => setValue((_) => !_), []);
736
+ return [value, { setValue, setTrue, setFalse, toggle }];
737
+ }
738
+
671
739
  function useOutsideClick(onClick) {
672
740
  const targetRef = useRef(null);
673
741
  useEffect(() => {
@@ -707,194 +775,109 @@
707
775
  const getSvgSize = (width) => (width ? '' : 'w-full h-full');
708
776
  const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
709
777
 
710
- const Select = JSX(({ className = '', isBorder = true, label, options = [], value, onChange, placeholder = '', valid = true, onValidate, }) => {
711
- const [selectedItem, setSelectedItem] = useState(options[0] || { key: '', text: '' });
712
- const [isOpen, setIsOpen] = useState(false);
713
- const handleClickOutside = useCallback(() => setIsOpen(false), []);
714
- const wrapperRef = useOutsideClick(handleClickOutside);
715
- const choiceOption = (option) => {
716
- setSelectedItem(option);
717
- setIsOpen(false);
718
- onChange(option);
719
- onValidate && onValidate(option.text);
720
- };
721
- const isSelected = (option) => Boolean(option.key === selectedItem.key);
722
- useEffect(() => {
723
- setSelectedItem(value || { key: '', text: '' });
724
- }, [value]);
725
- return (jsxs("div", { className: `${className}`, ref: wrapperRef, children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null, jsxs("div", { className: `relative ${isOpen ? 'z-20' : 'z-10'}`, children: [jsxs("div", { className: `text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
726
- ${getBorderStyle(isBorder, valid)}`, onClick: () => setIsOpen(!isOpen), children: [jsx("p", { className: "p-4 pr-8 h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: selectedItem?.text || placeholder }), jsx(Icon, { name: "ArrowUpIcon", width: "16", height: "16", className: `absolute right-3 ${isOpen ? '' : 'rotate-180'}` })] }), options?.length ? (jsx("div", { className: `h-0 ${renderOptionsStyle(isOpen)}`, children: jsx("div", { className: `bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]`, children: options.map(renderOption(choiceOption, isOpen, isSelected)) }) })) : null] })] }));
778
+ const Select = JSX(({ className = '', label, options = [], value, valid = true, isBorder = true, placeholder = '', onChange, }) => {
779
+ const [isOpen, { setFalse: close, toggle }] = useBool();
780
+ const wrapperRef = useOutsideClick(close);
781
+ const handleChange = useCallback((option) => {
782
+ close();
783
+ onChange && onChange(option);
784
+ }, [onChange]);
785
+ const isSelected = (option) => option.key === value?.key;
786
+ return (jsxs("div", { className: className, ref: wrapperRef, children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null, jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), children: [jsxs("div", { className: style('text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer', getBorderStyle(isBorder, valid)), onClick: toggle, children: [jsx("p", { className: "p-4 pr-8 h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), name: "ArrowUpIcon", width: "16", height: "16" })] }), options?.length ? (jsx("div", { className: style('h-0', isOpen ? '' : 'overflow-hidden'), children: jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: options.map(renderOption(handleChange, isOpen, isSelected)) }) })) : null] })] }));
727
787
  });
728
- const renderOptionsStyle = (isOpen) => (isOpen ? '' : 'overflow-hidden');
729
- const renderOption = (choiceOption, isOpen, isSelected) => (option, i) => {
730
- return (jsxs("div", { onClick: () => {
731
- choiceOption(option);
732
- }, className: "flex px-4 py-3 cursor-pointer hover:bg-main-divider pr-11 relative", children: [jsx("span", { className: "min-h-6", children: option.text }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: ['absolute right-4 pt-0.5', isSelected(option) && isOpen ? '' : 'hidden'].join(' ') })] }, String(i)));
733
- };
734
- const getBorderStyle = (isBorder, valid) => `
735
- ${isBorder ? 'border rounded-md hover:border-primary-hover' : ''} ${valid ? ' border-gray' : 'border-error'} `;
788
+ const renderOption = (handleChange, isOpen, isSelected) => (option, i) => (jsxs("div", { onClick: () => {
789
+ handleChange(option);
790
+ }, className: "flex px-4 py-3 cursor-pointer hover:bg-main-divider pr-11 relative", children: [jsx("span", { className: "min-h-6", children: formatOption(option) }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: style('absolute right-4 pt-0.5', isSelected(option) && isOpen ? '' : 'hidden') })] }, String(i)));
791
+ const formatOption = (_) => _?.text || _?.key || '';
792
+ const getBorderStyle = (isBorder, valid) => style(isBorder ? 'border rounded-md hover:border-primary-hover' : '', valid ? ' border-gray' : 'border-error');
736
793
 
737
- const SelectControl = JSX(({ data, fieldLabel, fieldValue, selected, placeholder = '', setSelected, label, error, onValidate, }) => {
738
- const dataFormat = data
739
- .filter(Boolean)
740
- .map((_) => ({ key: _?.[fieldValue || fieldLabel], text: _?.[fieldLabel] }));
741
- const selectedObj = dataFormat.find((_) => _.key === selected);
742
- return (jsxs("div", { children: [jsx(Select, { options: dataFormat, label: label, valid: Boolean(!error), placeholder: placeholder || selected, onChange: (_) => setSelected(_.key), value: selectedObj, onValidate: onValidate }), jsx("div", { className: "h-2", children: jsx(Text, { size: "text-xs-light", color: "text-error", children: error ? error : null }) })] }));
743
- });
794
+ const SelectControl = JSX((props) => (jsxs("div", { children: [jsx(Select, { ...props, valid: !props.error }), jsx("div", { className: "h-2", children: props.error ? (jsx(Text, { size: "text-xs-light", color: "text-error", children: props.error })) : null })] })));
744
795
 
745
- const renderAcquiringRegion = ({ acquiringType, regions, region, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(SelectControl, { data: ACQUIRING_TYPES, fieldValue: "name", fieldLabel: "name", error: errors['acquiringType'], selected: acquiringType, setSelected: (value) => handleChange({ acquiringType: value }), onValidate: (value) => handleChangeErrors({ acquiringType: validate('acquiringType', value) }), label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433" }) }), jsx("div", { className: "w-1/2", children: jsx(SelectControl, { data: regions, fieldValue: "code", fieldLabel: "name", error: errors['region'], selected: region, setSelected: (value) => handleChange({ region: value }), onValidate: (value) => handleChangeErrors({ region: validate('region', value) }), label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441" }) })] }));
796
+ const renderAcquiringRegion = ({ regions, field }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES.map(({ name: key = '' }) => ({ key, text: key })), ...withValidator(field('acquiringType'), 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: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) })] }));
746
797
 
747
- const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-4", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: `relative flex-shrink-0 duration-300 w-9 h-5 mr-3 rounded-2xl ${value ? 'bg-primary-main' : 'bg-main-divider'}`, children: jsx("div", { className: `absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full ${value ? 'left-[50%]' : 'left-[5%]'}` }) }), jsx("div", { children: jsx(Text, { size: "text-m", font: "font-light", color: "text-primary-text", children: text }) })] })));
798
+ const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-3", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-3 rounded-2xl', value ? 'bg-primary-main' : 'bg-main-divider'), children: jsx("div", { className: style('absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full', value ? 'left-[50%]' : 'left-[5%]') }) }), jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })] })));
748
799
 
749
- const renderSlideCheckboxes = ({ onlineСheckout, posTerminal, handleChange, }) => (jsxs("div", { className: "mb-5", children: [jsx(SlideCheckbox, { value: onlineСheckout, text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", onChange: () => handleChange({ onlineСheckout: !onlineСheckout }) }), jsx(SlideCheckbox, { value: posTerminal, text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", onChange: () => handleChange({ posTerminal: !posTerminal }) })] }));
800
+ const renderSlideCheckboxes = (field) => (jsxs("div", { className: "mb-5", children: [jsx(SlideCheckbox, { text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') }), jsx(SlideCheckbox, { text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })] }));
750
801
 
751
802
  const renderSubmitButton = (button, className) => {
752
803
  const buttonStyle = getRegularButtonClasses({
753
804
  className: 'text-white',
754
805
  version: button?.version,
755
806
  });
756
- return (jsx("button", { type: "submit", className: `p-4 ${buttonStyle} ${className}`, children: button?.text ? button.text : 'Отправить заявку' }));
757
- };
758
-
759
- const useForm$1 = ({ initialFormState, errorsInitialState, handleSubmit, }) => {
760
- const [formState, setFormState] = useState(initialFormState);
761
- const [errors, setErrors] = useState(errorsInitialState || {});
762
- const handleChange = useCallback((state) => setFormState((oldState) => ({ ...oldState, ...state })), []);
763
- const handleChangeErrors = useCallback((state) => setErrors((oldState) => ({ ...oldState, ...state })), []);
764
- const sendForm = useCallback(async (sendData) => {
765
- const errorsTemp = [];
766
- const validateData = Object.keys(formState)
767
- .filter((_) => Object.keys(errors).includes(_))
768
- .reduce((obj, key) => {
769
- obj[key] = formState[key];
770
- return obj;
771
- }, {});
772
- for (const [key, value] of Object.entries(validateData)) {
773
- const error = validate(key, value);
774
- errorsTemp.push(error);
775
- handleChangeErrors({ [key]: error });
776
- }
777
- if (errorsTemp.some((_) => _.length !== 0)) {
778
- return;
779
- }
780
- handleSubmit && (await handleSubmit(sendData));
781
- }, [formState]);
782
- return {
783
- formState,
784
- handleChange,
785
- errors,
786
- handleChangeErrors,
787
- sendForm,
788
- };
807
+ return (jsx("button", { type: "submit", className: style('p-4', buttonStyle, className), children: button?.text ? button.text : 'Отправить заявку' }));
789
808
  };
790
809
 
791
810
  const initialFormState$4 = {
792
- acquiringType: 'Торговый эквайринг',
793
- region: '',
811
+ acquiringType: { key: 'Торговый эквайринг' },
794
812
  fullName: '',
795
813
  inn: '',
796
814
  name: '',
797
815
  phone: '',
798
- onlineСheckout: false,
816
+ onlineCheckout: false,
799
817
  posTerminal: false,
800
818
  };
801
- const errorsInitialState$2 = {
802
- acquiringType: '',
803
- region: '',
804
- fullName: '',
805
- inn: '',
806
- name: '',
807
- phone: '',
808
- };
819
+ const acquiringValidator = objectValidator({
820
+ acquiringType: defaultValidator,
821
+ region: defaultValidator,
822
+ fullName: defaultValidator,
823
+ inn: innValidator,
824
+ name: nameValidator,
825
+ phone: phoneValidator,
826
+ });
809
827
  const ApplicationFormAcquiring = JSX((props) => {
810
- const { button, link, handleSubmit } = props;
811
- const { formState, errors, handleChange, handleChangeErrors, sendForm } = useForm$1({
812
- initialFormState: initialFormState$4,
813
- errorsInitialState: errorsInitialState$2,
814
- handleSubmit,
815
- });
816
- const { acquiringType, region, fullName, inn, name, phone, onlineСheckout, posTerminal } = formState;
817
- const regions = useGetRegions();
818
- const onSubmit = (e) => {
819
- e.preventDefault();
820
- sendForm({
821
- typeForm: 'acqr',
822
- region: regions.find((_) => _.code === region)?.name || '',
823
- partnerComments: `Вид эквайринга=${acquiringType}/Онлайн касса=${onlineСheckout}/POS-терминал=${posTerminal}`,
824
- fullName,
825
- inn,
826
- name,
827
- phone,
828
- });
829
- };
830
- return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430 \u0438 \u0440\u0435\u0433\u0438\u043E\u043D", className: "text-center mb-4" }), renderAcquiringRegion({
831
- acquiringType,
832
- regions,
833
- region,
834
- handleChange,
835
- errors,
836
- handleChangeErrors,
837
- }), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderAcquiringDataOrganization({
828
+ const { button, link, onSubmit } = props;
829
+ const handleSubmit = useCallback((formState) => {
830
+ const { acquiringType, region, fullName, inn, name, phone, onlineCheckout, posTerminal } = formState;
831
+ isValidationSuccess(acquiringValidator(formState)) &&
832
+ onSubmit({
833
+ typeForm: 'acqr',
834
+ region: region?.text || '',
835
+ partnerComments: `Вид эквайринга=${acquiringType?.key || ''}/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`,
838
836
  fullName,
839
837
  inn,
840
838
  name,
841
839
  phone,
842
- handleChange,
843
- errors,
844
- handleChangeErrors,
845
- }), renderSlideCheckboxes({
846
- onlineСheckout,
847
- posTerminal,
848
- handleChange,
849
- }), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
840
+ });
841
+ }, [onSubmit]);
842
+ const [, { field, ...formProps }] = useForm(initialFormState$4, handleSubmit);
843
+ const regions = useGetRegions();
844
+ return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430 \u0438 \u0440\u0435\u0433\u0438\u043E\u043D", className: "text-center mb-4" }), renderAcquiringRegion({ regions, field }), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderAcquiringDataOrganization(field), renderSlideCheckboxes(field), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
850
845
  });
851
846
 
852
- const renderBusinessCardDataOrganization = ({ name, phone, mail, inn, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "flex justify-between gap-5", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", error: errors['name'], value: name, onChange: (value) => handleChange({ name: value }), onBlur: (value) => handleChangeErrors({ name: validate('name', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", error: errors['inn'], value: inn, onChange: (value) => handleChange({ inn: value }), onBlur: (value) => handleChangeErrors({ inn: validate('inn', value) }) })] }), jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", error: errors['phone'], value: phone, onChange: (value) => handleChange({ phone: value }), onBlur: (value) => handleChangeErrors({ phone: validate('phone', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", error: errors['mail'], value: mail, onChange: (value) => handleChange({ mail: value }), onBlur: (value) => handleChangeErrors({ mail: validate('mail', value) }) })] })] }));
847
+ const renderBusinessCardDataOrganization = (field) => (jsxs("div", { className: "flex justify-between gap-5", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: "w-1/2", children: [jsx(PhoneInputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] })] }));
853
848
 
854
- const renderRegion$1 = ({ regions, region, handleChange, errors, handleChangeErrors, }) => (jsx("div", { className: "flex justify-between gap-5 mb-5", children: jsx("div", { className: "w-full", children: jsx(SelectControl, { data: regions, fieldValue: "code", fieldLabel: "name", error: errors['region'], selected: region, setSelected: (value) => handleChange({ region: value }), onValidate: (value) => handleChangeErrors({ region: validate('region', value) }), label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D" }) }) }));
849
+ const renderRegion$1 = ({ regions, field }) => (jsx("div", { className: "flex justify-between gap-5 mb-5", children: jsx("div", { className: "w-full", 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) }) }) }));
855
850
 
856
851
  const initialFormState$3 = {
857
- region: '',
858
852
  name: '',
859
853
  phone: '',
860
854
  inn: '',
861
855
  mail: '',
862
856
  };
857
+ const businessCardValidator = objectValidator({
858
+ region: defaultValidator,
859
+ name: nameValidator,
860
+ phone: phoneValidator,
861
+ inn: innValidator,
862
+ mail: defaultValidator,
863
+ });
863
864
  const ApplicationFormBusinessCard = JSX((props) => {
864
- const { button, link, handleSubmit } = props;
865
- const { formState, errors, handleChange, handleChangeErrors, sendForm } = useForm$1({
866
- initialFormState: initialFormState$3,
867
- errorsInitialState: initialFormState$3,
868
- handleSubmit,
869
- });
870
- const { region, name, phone, inn, mail } = formState;
871
- const regions = useGetRegions();
872
- const onSubmit = (e) => {
873
- e.preventDefault();
874
- sendForm({
875
- typeForm: 'bcrd',
876
- region: regions.find((_) => _.code === region)?.name || '',
877
- name,
878
- phone,
879
- inn,
880
- mail,
881
- });
882
- };
883
- return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [renderRegion$1({
884
- regions,
885
- region,
886
- handleChange,
887
- errors,
888
- handleChangeErrors,
889
- }), renderBusinessCardDataOrganization({
865
+ const { button, link, onSubmit } = props;
866
+ const handleSubmit = useCallback((formState) => {
867
+ const { region, name, phone, inn, mail } = formState;
868
+ isValidationSuccess(businessCardValidator(formState)) &&
869
+ onSubmit({
870
+ typeForm: 'bcrd',
871
+ region: region?.text || '',
890
872
  name,
891
873
  phone,
892
874
  inn,
893
875
  mail,
894
- handleChange,
895
- errors,
896
- handleChangeErrors,
897
- }), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
876
+ });
877
+ }, [onSubmit]);
878
+ const [, { field, ...formProps }] = useForm(initialFormState$3, handleSubmit);
879
+ const regions = useGetRegions();
880
+ return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [renderRegion$1({ regions, field }), renderBusinessCardDataOrganization(field), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
898
881
  });
899
882
 
900
883
  const BRANCHES_URL = '/api/v1/branches';
@@ -908,58 +891,63 @@
908
891
  return result || EMPTY_VALUE$1;
909
892
  };
910
893
 
911
- const MIN_CREDIT_AMOUNT = 50000;
912
- const MAX_CREDIT_AMOUNT = 3000000;
913
- const ITEMS_CREDIT_AMOUNT = ['От 50 000 ₽', 'До 3 000 000 ₽'];
894
+ const MIN_CREDIT_AMOUNT = 1000;
895
+ const MAX_CREDIT_AMOUNT = 1000000000;
896
+ const ITEMS_CREDIT_AMOUNT = ['От 1 000 ₽', 'До 1 000 000 000 ₽'];
914
897
  const MIN_CREDIT_TERM = 1;
915
- const MAX_CREDIT_TERM = 60;
916
- const ITEMS_CREDIT_TERM = ['От 1 года', 'До 5 лет'];
898
+ const MAX_CREDIT_TERM = 180;
899
+ const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
917
900
 
918
- const renderCreditDataOrganization = ({ fullName, inn, name, phone, mail, annualRevenue, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", value: fullName, onChange: (value) => handleChange({ fullName: value }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", error: errors['inn'], value: inn, onChange: (value) => handleChange({ inn: value }), onBlur: (value) => handleChangeErrors({ inn: validate('inn', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", error: errors['phone'], value: phone, onChange: (value) => handleChange({ phone: value }), onBlur: (value) => handleChangeErrors({ phone: validate('phone', value) }) })] }), jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", error: errors['annualRevenue'], value: annualRevenue, onChange: (value) => handleChange({ annualRevenue: value }), onBlur: (value) => handleChangeErrors({ annualRevenue: validate('annualRevenue', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", error: errors['name'], value: name, onChange: (value) => handleChange({ name: value }), onBlur: (value) => handleChangeErrors({ name: validate('name', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", value: mail, onChange: (value) => handleChange({ mail: value }) })] })] }));
901
+ const renderCreditDataOrganization = (field) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "w-1/2", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...withValidator(field('annualRevenue'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('mail') })] })] }));
919
902
 
920
903
  const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', {}).format(number);
921
904
 
922
905
  const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
923
906
 
924
- 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
+ }
925
912
 
926
- const DISABLED_INPUT_CLASSES$1 = 'disabled:border-gray disabled:bg-main-divider';
927
- const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, disabled = false, onChange, }) => {
928
- const handleChange = (e) => {
929
- if (!onChange) {
930
- return;
931
- }
932
- onChange(clamp(Number(getSanitizedValue(e.target.value)), min, max));
933
- };
913
+ function renderRangeWithTicks({ list = [], min, max, step, value = list[0] || min, disabled, onChange, }) {
914
+ const rangeValue = list.length ? list.indexOf(value) : value;
934
915
  const inputStyle = {
935
- backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
916
+ backgroundSize: `${(((rangeValue - min) * 100) / (max - min)).toFixed(2)}% 100%`,
936
917
  };
937
- 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
938
- 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)] }));
939
- });
940
- function renderRangeCaption$1(items) {
941
- 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
+ }) }) })] }));
942
923
  }
943
924
 
944
- const renderInputRange = (props) => (jsxs("div", { className: "w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m-light", children: props.label }) }), jsx(InputRange, { ...props })] }));
945
-
946
- const renderCreditParameters = ({ amount, term, handleChange, }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [renderInputRange({
947
- label: 'Сумма кредита, ₽',
948
- value: amount,
949
- onChange: (value) => handleChange({ amount: value }),
950
- min: MIN_CREDIT_AMOUNT,
951
- max: MAX_CREDIT_AMOUNT,
952
- items: ITEMS_CREDIT_AMOUNT,
953
- }), renderInputRange({
954
- label: 'Срок кредита, месяцев',
955
- value: term,
956
- onChange: (value) => handleChange({ term: value }),
957
- min: MIN_CREDIT_TERM,
958
- max: MAX_CREDIT_TERM,
959
- items: ITEMS_CREDIT_TERM,
960
- })] }));
961
-
962
- const renderRegionDepartment = ({ regions, region, branches, department, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(SelectControl, { data: regions, fieldValue: "code", fieldLabel: "name", error: errors['region'], selected: region, setSelected: (value) => handleChange({ region: value, department: '' }), onValidate: (value) => handleChangeErrors({ region: validate('region', value) }), label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D" }) }), jsx("div", { className: "w-1/2", children: jsx(SelectControl, { data: branches, fieldValue: "branchCode", fieldLabel: "address", error: errors['department'], selected: department, setSelected: (value) => handleChange({ department: value }), onValidate: (value) => handleChangeErrors({ department: validate('department', value) }), label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441" }) })] }));
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
+
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') })] })] }));
946
+
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 = '' }) => ({
948
+ key: branchCode,
949
+ text: address,
950
+ })), ...withValidator(field('department'), defaultValidator) }) })] }));
963
951
 
964
952
  const initialFormState$2 = {
965
953
  amount: MIN_CREDIT_AMOUNT,
@@ -969,91 +957,60 @@
969
957
  name: '',
970
958
  phone: '',
971
959
  mail: '',
972
- region: '',
973
- department: '',
974
960
  annualRevenue: '',
975
961
  };
976
- const errorsInitialState$1 = {
977
- annualRevenue: '',
978
- inn: '',
979
- name: '',
980
- phone: '',
981
- region: '',
982
- department: '',
983
- };
984
- const ApplicationFormCredit = JSX(({ button, link, handleSubmit }) => {
985
- const regions = useGetRegions();
986
- const { formState, errors, handleChange, handleChangeErrors, sendForm } = useForm$1({
987
- initialFormState: initialFormState$2,
988
- errorsInitialState: errorsInitialState$1,
989
- handleSubmit,
990
- });
991
- const { amount, term, fullName, inn, name, phone, mail, region, department, annualRevenue } = formState;
992
- const branches = useBranches(region).filter((branch) => branch.address);
993
- const onSubmit = (e) => {
994
- e.preventDefault();
995
- sendForm({
996
- typeForm: 'cred',
997
- fullName,
998
- inn,
999
- name,
1000
- phone,
1001
- mail,
1002
- region: regions.find((_) => _.code === region)?.name || '',
1003
- department: branches.find((_) => _.branchCode === department)?.address || '',
1004
- partnerComments: `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`,
1005
- });
1006
- };
1007
- return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u0440\u0435\u0434\u0438\u0442\u0430", className: "text-center mb-4" }), renderCreditParameters({ amount, term, handleChange }), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderCreditDataOrganization({
962
+ const creditValidator = objectValidator({
963
+ annualRevenue: defaultValidator,
964
+ inn: innValidator,
965
+ name: nameValidator,
966
+ phone: phoneValidator,
967
+ region: defaultValidator,
968
+ department: defaultValidator,
969
+ });
970
+ const ApplicationFormCredit = JSX(({ button, link, onSubmit }) => {
971
+ const handleSubmit = useCallback((formState) => {
972
+ const { amount, term, fullName, inn, name, phone, mail, region, department, annualRevenue } = formState;
973
+ isValidationSuccess(creditValidator(formState)) &&
974
+ onSubmit({
975
+ typeForm: 'cred',
1008
976
  fullName,
1009
977
  inn,
1010
978
  name,
1011
979
  phone,
1012
980
  mail,
1013
- annualRevenue,
1014
- handleChange,
1015
- errors,
1016
- handleChangeErrors,
1017
- }), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", className: "text-center mb-4" }), renderRegionDepartment({
1018
- regions,
1019
- region,
1020
- branches,
1021
- department,
1022
- handleChange,
1023
- errors,
1024
- handleChangeErrors,
1025
- }), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
981
+ region: region?.text || '',
982
+ department: department?.text || '',
983
+ partnerComments: `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`,
984
+ });
985
+ }, [onSubmit]);
986
+ const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
987
+ const regions = useGetRegions();
988
+ const branches = useBranches(formState.region?.key).filter((branch) => branch?.address);
989
+ return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u0440\u0435\u0434\u0438\u0442\u0430", className: "text-center mb-4" }), renderCreditParameters(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderCreditDataOrganization(field), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", className: "text-center mb-4" }), renderRegionDepartment({ regions, branches, field }), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
1026
990
  });
1027
991
 
1028
992
  const initialFormState$1 = {
1029
993
  name: '',
1030
994
  phone: '',
1031
995
  };
996
+ const depositValidator = objectValidator({
997
+ name: nameValidator,
998
+ phone: phoneValidator,
999
+ });
1032
1000
  const ApplicationFormDeposit = JSX((props) => {
1033
- const { button, link, handleSubmit } = props;
1034
- const { formState, errors, handleChange, handleChangeErrors, sendForm } = useForm$1({
1035
- initialFormState: initialFormState$1,
1036
- errorsInitialState: initialFormState$1,
1037
- handleSubmit,
1038
- });
1039
- const { name, phone } = formState;
1040
- const onSubmit = (e) => {
1041
- e.preventDefault();
1042
- sendForm({
1043
- typeForm: 'dpst',
1044
- name,
1045
- phone,
1046
- });
1047
- };
1048
- return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", className: "text-center mb-4" }), renderDataOrganization({
1001
+ const { button, link, onSubmit } = props;
1002
+ const handleSubmit = useCallback((formState) => {
1003
+ const { name, phone } = formState;
1004
+ isValidationSuccess(depositValidator(formState)) &&
1005
+ onSubmit({
1006
+ typeForm: 'dpst',
1049
1007
  name,
1050
1008
  phone,
1051
- handleChange,
1052
- errors,
1053
- handleChangeErrors,
1054
- }), jsxs("div", { className: "flex justify-between items-center max-w-[560px] m-auto", children: [jsx("div", { className: "flex-1", children: jsx(Footnote, { link: link }) }), renderSubmitButton(button)] })] }));
1009
+ });
1010
+ }, [onSubmit]);
1011
+ const [, { field, ...formProps }] = useForm(initialFormState$1, handleSubmit);
1012
+ return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", className: "text-center mb-4" }), jsxs("div", { className: "max-w-[560px] m-auto", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "flex justify-between items-center max-w-[560px] m-auto", children: [jsx("div", { className: "flex-1", children: jsx(Footnote, { link: link }) }), renderSubmitButton(button)] })] }));
1055
1013
  });
1056
- const renderDataOrganization = ({ name, phone, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { className: "max-w-[560px] m-auto", children: [jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0418\u043C\u044F", error: errors['name'], value: name, onChange: (value) => handleChange({ name: value }), onBlur: (value) => handleChangeErrors({ name: validate('name', value) }) }), jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", error: errors['phone'], value: phone, onChange: (value) => handleChange({ phone: value }), onBlur: (value) => handleChangeErrors({ phone: validate('phone', value) }) })] }));
1057
1014
 
1058
1015
  const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
1059
1016
  const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', isMobile = false, pathPrefix }) => {
@@ -1102,15 +1059,25 @@
1102
1059
  fill: 'white',
1103
1060
  },
1104
1061
  ];
1105
- const Checkbox = JSX(({ className, text, checked, disabled, isRadio, onChange }) => {
1106
- return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", children: [jsx("input", { className: style('peer appearance-none w-5 h-5 border-solid cursor-pointer checked:border-primary-main m-0', isRadio
1107
- ? 'rounded-full border-2'
1108
- : 'rounded checked:bg-primary-main disabled:bg-main-disabled border', checked ? 'border-black' : 'border-gray', disabled ? '' : 'group-hover/box:border-primary-hover'), type: "checkbox", onChange: (e) => onChange && onChange(e.target.checked), checked: checked, disabled: disabled }), isRadio ? (jsx("div", { className: "left-1 w-3 h-3 rounded-full bg-primary-main hidden absolute peer-checked:block" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" })), text ? jsx("span", { className: "font-sans ml-3 text-l-light", children: text }) : null] }) }));
1062
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1063
+ const handleChange = useCallback((e) => {
1064
+ if (disabled) {
1065
+ return;
1066
+ }
1067
+ e.preventDefault();
1068
+ onChange && onChange(!value);
1069
+ }, [onChange, disabled, value]);
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" }));
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] }) }));
1109
1072
  });
1073
+ const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1110
1074
 
1111
- const renderQuestionsInterested = ({ currencyControl, documentaryOperations, conversionOperations, text, handleChange, }) => (jsxs("div", { className: "mb-6", children: [jsxs("div", { className: "flex items-center mb-4 gap-6", children: [jsx(Checkbox, { text: "\u0412\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C", checked: currencyControl, onChange: (value) => handleChange({ currencyControl: value }) }), jsx(Checkbox, { text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0440\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", checked: documentaryOperations, onChange: (value) => handleChange({ documentaryOperations: value }) }), jsx(Checkbox, { text: "\u041A\u043E\u043D\u0432\u0435\u0440\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", checked: conversionOperations, onChange: (value) => handleChange({ conversionOperations: value }) })] }), jsx("textarea", { placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441, \u043C\u0435\u0441\u0442\u043E \u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0431\u0438\u0437\u043D\u0435\u0441\u0430 \u0438 \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u043D\u043E\u0433\u043E \u0437\u0432\u043E\u043D\u043A\u0430", className: "block w-full resize-y min-h-24 p-4 outline-none border rounded-md border-main-stroke hover:border-primary-hover active:focus:border-primary-text", value: text, onChange: (e) => handleChange({ text: e.target.value }) })] }));
1075
+ const renderQuestionsInterested = (field) => {
1076
+ const textField = field('text');
1077
+ return (jsxs("div", { className: "mb-6", children: [jsxs("div", { className: "flex items-center mb-4 gap-6", children: [jsx(Checkbox, { text: "\u0412\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C", ...field('currencyControl') }), jsx(Checkbox, { text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0440\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", ...field('documentaryOperations') }), jsx(Checkbox, { text: "\u041A\u043E\u043D\u0432\u0435\u0440\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", ...field('conversionOperations') })] }), jsx("textarea", { placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441, \u043C\u0435\u0441\u0442\u043E \u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0431\u0438\u0437\u043D\u0435\u0441\u0430 \u0438 \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u043D\u043E\u0433\u043E \u0437\u0432\u043E\u043D\u043A\u0430", className: "block w-full resize-y min-h-24 p-4 outline-none border rounded-md border-main-stroke hover:border-primary-hover active:focus:border-primary-text", value: textField.value, onInput: ((e) => textField.onChange && textField.onChange(e.target?.value || '')) })] }));
1078
+ };
1112
1079
 
1113
- const renderWedDataOrganization = ({ fullName, name, phone, mail, handleChange, errors, handleChangeErrors, }) => (jsxs("div", { children: [jsxs("div", { className: "flex justify-between gap-5", children: [jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", error: errors['fullName'], value: fullName, onChange: (value) => handleChange({ fullName: value }), onBlur: (value) => handleChangeErrors({ fullName: validate('fullName', value) }) }) }), jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0424\u0418\u041E", error: errors['name'], value: name, onChange: (value) => handleChange({ name: value }), onBlur: (value) => handleChangeErrors({ name: validate('name', value) }) }) })] }), jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", error: errors['phone'], value: phone, onChange: (value) => handleChange({ phone: value }), onBlur: (value) => handleChangeErrors({ phone: validate('phone', value) }) }) }), jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", error: errors['mail'], value: mail, onChange: (value) => handleChange({ mail: value }), onBlur: (value) => handleChangeErrors({ mail: validate('mail', value) }) }) })] })] }));
1080
+ const renderWedDataOrganization = (field) => (jsxs("div", { children: [jsxs("div", { className: "flex justify-between gap-5", children: [jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }) }), jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0424\u0418\u041E", ...withValidator(field('name'), nameValidator) }) })] }), jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(PhoneInputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }) }), jsx("div", { className: "w-1/2", children: jsx(InputControl, { className: "shrink-0 text-l w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) }) })] })] }));
1114
1081
 
1115
1082
  const initialFormState = {
1116
1083
  fullName: '',
@@ -1122,53 +1089,34 @@
1122
1089
  conversionOperations: false,
1123
1090
  text: '',
1124
1091
  };
1125
- const errorsInitialState = {
1126
- fullName: '',
1127
- name: '',
1128
- phone: '',
1129
- mail: '',
1130
- text: '',
1131
- };
1092
+ const webValidator = objectValidator({
1093
+ fullName: defaultValidator,
1094
+ name: nameValidator,
1095
+ phone: phoneValidator,
1096
+ mail: defaultValidator,
1097
+ });
1132
1098
  const ApplicationFormWed = JSX((props) => {
1133
- const { button, link, handleSubmit } = props;
1134
- const { formState, errors, handleChange, handleChangeErrors, sendForm } = useForm$1({
1135
- initialFormState,
1136
- errorsInitialState,
1137
- handleSubmit,
1138
- });
1139
- const { fullName, name, phone, mail, currencyControl, documentaryOperations, conversionOperations, text, } = formState;
1140
- const onSubmit = (e) => {
1141
- e.preventDefault();
1142
- sendForm({
1143
- typeForm: 'kved',
1144
- fullName,
1145
- name,
1146
- phone,
1147
- mail,
1148
- partnerComments: `Валютный контроль=${currencyControl}/Документарные операции=${documentaryOperations}/Конверсионные операции=${conversionOperations}/Доп инф=${text}`,
1149
- });
1150
- };
1151
- return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderWedDataOrganization({
1099
+ const { button, link, onSubmit } = props;
1100
+ const handleSubmit = useCallback((formState) => {
1101
+ const { fullName, name, phone, mail, currencyControl, documentaryOperations, conversionOperations, text, } = formState;
1102
+ isValidationSuccess(webValidator(formState)) &&
1103
+ onSubmit({
1104
+ typeForm: 'kved',
1152
1105
  fullName,
1153
1106
  name,
1154
1107
  phone,
1155
1108
  mail,
1156
- handleChange,
1157
- errors,
1158
- handleChangeErrors,
1159
- }), jsx(Heading, { headingType: "h6", title: "\u0418\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u043E\u043F\u0440\u043E\u0441", className: "text-center mb-4" }), renderQuestionsInterested({
1160
- currencyControl,
1161
- documentaryOperations,
1162
- conversionOperations,
1163
- text,
1164
- handleChange,
1165
- }), jsxs("div", { className: "flex items-center pb-9 mb-9 border-b border-main-divider", children: [renderSubmitButton(button, 'mr-5'), jsx(Footnote, { link: link })] }), jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "text-center mb-4" }), renderContacts()] }));
1109
+ partnerComments: `Валютный контроль=${currencyControl}/Документарные операции=${documentaryOperations}/Конверсионные операции=${conversionOperations}/Доп инф=${text}`,
1110
+ });
1111
+ }, [onSubmit]);
1112
+ const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
1113
+ return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderWedDataOrganization(field), jsx(Heading, { headingType: "h6", title: "\u0418\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u043E\u043F\u0440\u043E\u0441", className: "text-center mb-4" }), renderQuestionsInterested(field), jsxs("div", { className: "flex items-center pb-9 mb-9 border-b border-main-divider", children: [renderSubmitButton(button, 'mr-5'), jsx(Footnote, { link: link })] }), jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "text-center mb-4" }), renderContacts()] }));
1166
1114
  });
1167
1115
 
1168
- const ResponseNotification = JSX(({ responceType }) => {
1169
- const responceOK = responceType === 'OK';
1170
- const backgroundColor = responceOK ? 'bg-responce-ok' : 'bg-responce-fail';
1171
- return (jsxs("div", { className: `flex items-center mt-5 p-5 rounded-md ${backgroundColor}`, children: [responceOK ? (jsx(ImgInner, { image: { icon: 'ResponceOKIcon' }, width: "42", height: "42", className: "mr-4" })) : (jsx(ImgInner, { image: { icon: 'ResponceFailIcon' }, width: "37", height: "34", className: "mr-4" })), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responceOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-1" }), jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: responceOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
1116
+ const ResponseNotification = JSX(({ responseType }) => {
1117
+ const responseOK = responseType === 'OK';
1118
+ const backgroundColor = responseOK ? 'bg-responce-ok' : 'bg-responce-fail';
1119
+ return (jsxs("div", { className: `flex items-center mt-5 p-5 rounded-md ${backgroundColor}`, children: [responseOK ? (jsx(ImgInner, { image: { icon: 'ResponceOKIcon' }, width: "42", height: "42", className: "mr-4" })) : (jsx(ImgInner, { image: { icon: 'ResponceFailIcon' }, width: "37", height: "34", className: "mr-4" })), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responseOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-1" }), jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: responseOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
1172
1120
  });
1173
1121
 
1174
1122
  const COMPONENTS_MAP = {
@@ -1180,17 +1128,17 @@
1180
1128
  };
1181
1129
  const API = CorporateLeadAPI();
1182
1130
  const ApplicationForm = JSX((props) => {
1183
- const { className = '', title, typeForm = 'credit', button, link, ...rest } = props;
1184
- const [responceType, setResponseType] = useState('');
1131
+ const { className, title, typeForm = 'credit', button, link, ...rest } = props;
1132
+ const [responseType, setResponseType] = useState('');
1185
1133
  const handleSubmit = useCallback(async (data) => {
1186
1134
  const status = (await API.send(data)) ? 'OK' : 'Fail';
1187
1135
  setResponseType(status);
1188
1136
  return status;
1189
1137
  }, []);
1190
- return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] 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, handleSubmit }), responceType ? jsx(ResponseNotification, { responceType: responceType }) : 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] }) }));
1191
1139
  });
1192
1140
 
1193
- const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 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] })));
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] })));
1194
1142
  const renderStep$1 = (benefit, i) => {
1195
1143
  const description = benefit.description;
1196
1144
  return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: "w-12 h-12 min-w-12 p-3 rounded-full bg-main-divider text-primary-main group-data-secondary:bg-white/30 group-data-secondary:text-black", image: benefit.icon })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5 h-full", children: [benefit?.label ? jsx(Heading, { headingType: "h6", children: benefit.label }) : null, renderDescription$4(description)] })] }, String(i)));
@@ -1219,34 +1167,34 @@
1219
1167
 
1220
1168
  const headlineVersionStyles = {
1221
1169
  XXL: {
1222
- wrapper: 'gap-[18px]',
1223
1170
  title: { headingType: 'h0', as: 'h1' },
1224
1171
  descriptionSize: 'text-h5',
1172
+ descriptionStyle: 'mt-5',
1225
1173
  },
1226
1174
  XL: {
1227
- wrapper: 'gap-4',
1228
1175
  title: { headingType: 'h1', as: 'h1' },
1229
1176
  descriptionSize: 'text-xl-light',
1177
+ descriptionStyle: 'mt-4',
1230
1178
  },
1231
1179
  L: {
1232
- wrapper: 'gap-4',
1233
1180
  title: { headingType: 'h2', as: 'h2' },
1234
1181
  descriptionSize: 'text-xl-light',
1182
+ descriptionStyle: 'mt-4',
1235
1183
  },
1236
1184
  M: {
1237
- wrapper: 'gap-3',
1238
1185
  title: { headingType: 'h3', as: 'h3' },
1239
1186
  descriptionSize: 'text-xl-light',
1187
+ descriptionStyle: 'mt-3',
1240
1188
  },
1241
1189
  S: {
1242
- wrapper: 'gap-2',
1243
1190
  title: { headingType: 'h4', as: 'h4' },
1244
1191
  descriptionSize: 'text-xl-light',
1192
+ descriptionStyle: 'mt-2',
1245
1193
  },
1246
1194
  XS: {
1247
- wrapper: 'gap-2',
1248
1195
  title: { headingType: 'h5', as: 'h5' },
1249
1196
  descriptionSize: 'text-l-light',
1197
+ descriptionStyle: 'mt-2',
1250
1198
  },
1251
1199
  };
1252
1200
  // TODO Move to Gallery and rename
@@ -1263,13 +1211,14 @@
1263
1211
 
1264
1212
  const Headline = JSX(({ className, title, description, headlineVersion = 'XL', align = 'text-center', as, isPadding = true, isTheme = false, version = '', ...rest }) => {
1265
1213
  const versionStyle = headlineVersionStyles[headlineVersion];
1266
- const paddingStyle = isPadding ? 'p-12' : '';
1267
- 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] }));
1214
+ const paddingStyle = isPadding ? 'p-default' : '';
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] }));
1268
1217
  });
1269
1218
 
1270
1219
  const Bonus = JSX((props) => {
1271
1220
  const { className = '', title, description, bonusItems, ...rest } = props;
1272
- return (jsx(BlockWrapper, { className: `p-12 pb-9 ${className}`, ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" }), jsx("div", { className: "flex flex-wrap w-full mt-9", children: bonusItems?.length
1221
+ return (jsx(BlockWrapper, { className: `p-default pb-9 ${className}`, ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" }), jsx("div", { className: "flex flex-wrap w-full mt-9", children: bonusItems?.length
1273
1222
  ? bonusItems.map((_, i) => (jsxs("div", { className: "flex-grow w-[49%] border border-gray p-9 mb-3 mx-2 even:mr-0 odd:ml-0 last:odd:mx-0", children: [_?.title ? jsx(Text, { size: "text-h4", children: _.title }) : null, _?.description ? (jsx("div", { className: "mt-2", children: jsx(Paragraph, { size: "text-xl", font: "font-light", children: _.description }) })) : null, jsxs("div", { className: "flex justify-between items-end mt-3", children: [renderButtonsSection(_?.buttons), _.bonusItemContent?.bonusType
1274
1223
  ? renderBonusItemContent(_.bonusItemContent)
1275
1224
  : null] })] }, String(i))))
@@ -1287,7 +1236,7 @@
1287
1236
  right: 'text-right',
1288
1237
  };
1289
1238
 
1290
- const BonusBenefitsBlock = JSX(({ bonusBenefits, cardTextAlign = 'center', className = '', columnsCount = '4', subtitle, title, ...rest }) => (jsxs(BlockWrapper, { className: `font-sans text-primary-text bg-white p-12 flex flex-col text-center ${className}`, ...rest, children: [jsx(Headline, { className: "!p-0 mb-8", title: title, description: subtitle, headlineVersion: "M" }), bonusBenefits?.length ? (jsx("div", { className: `grid gap-1 ${AlignText[cardTextAlign]} ${getElementsColsValue(columnsCount)}`, children: bonusBenefits.map(renderBonusBenefit) })) : null] })));
1239
+ const BonusBenefitsBlock = JSX(({ bonusBenefits, cardTextAlign = 'center', className = '', columnsCount = '4', subtitle, title, ...rest }) => (jsxs(BlockWrapper, { className: `font-sans text-primary-text bg-white p-default flex flex-col text-center ${className}`, ...rest, children: [jsx(Headline, { className: "!p-0 mb-8", title: title, description: subtitle, headlineVersion: "M" }), bonusBenefits?.length ? (jsx("div", { className: `grid gap-1 ${AlignText[cardTextAlign]} ${getElementsColsValue(columnsCount)}`, children: bonusBenefits.map(renderBonusBenefit) })) : null] })));
1291
1240
  const renderBonusBenefit = ({ icon, title, description }, i) => {
1292
1241
  return (jsxs("div", { className: style('flex flex-col items-center text-h6', !description && !title ? 'justify-center' : ''), children: [title ? jsx("span", { children: title }) : null, icon ? jsx(ImgInner, { image: icon, height: "180", className: "w-auto" }) : null, description ? jsx("span", { children: description }) : null] }, String(i)));
1293
1242
  };
@@ -1313,7 +1262,7 @@
1313
1262
  return (jsxs("li", { className: "flex items-center gap-3.5 mb-3 last:mb-0", children: [icon?.icon ? (jsx(ImgInner, { image: icon, className: "w-12 h-12 min-w-12 p-3 rounded-full bg-main-divider" })) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null, jsx("span", { className: "text-xl-light", children: text })] }, key));
1314
1263
  };
1315
1264
 
1316
- const BusinessBlock = JSX(({ className = '', title, cards, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 pb-9 ${className}`, ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }), jsx("div", { className: "flex gap-5", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
1265
+ const BusinessBlock = JSX(({ className = '', title, cards, ...rest }) => (jsxs(BlockWrapper, { className: `p-default pb-9 ${className}`, ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }), jsx("div", { className: "flex gap-5", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
1317
1266
 
1318
1267
  const ButtonBlock = JSX(({ button, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection([button]) })));
1319
1268
 
@@ -1420,18 +1369,17 @@
1420
1369
  const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
1421
1370
  const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
1422
1371
 
1423
- 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] })] })));
1424
1373
 
1425
1374
  const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
1426
1375
 
1427
1376
  const DEFAULT_MONEY_STEP = 1000;
1428
- function renderWantedSumInput(title, params, callback) {
1429
- const { moneyValue, minSum, maxSum, step = DEFAULT_MONEY_STEP, isShowItems = true } = params;
1377
+ function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
1430
1378
  const items = [
1431
- `От ${addSpacesBetweenNumbers(minSum)} ₽`,
1432
- `До ${addSpacesBetweenNumbers(maxSum)} ₽`,
1379
+ `От ${addSpacesBetweenNumbers(rest.min || 0)} ₽`,
1380
+ `До ${addSpacesBetweenNumbers(rest.max || 0)} ₽`,
1433
1381
  ];
1434
- 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 });
1435
1383
  }
1436
1384
 
1437
1385
  const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
@@ -1465,62 +1413,48 @@
1465
1413
  };
1466
1414
 
1467
1415
  const BonusCalculatorForm = JSX(({ className = '', sourceBookDir = '', buttons, footnote }) => {
1468
- const [travelExpenseValue, setTravelExpenseValue] = useState(DEFAULT_TRAVEL_MIN_SUM);
1469
- const handleTravelExpenseValue = useCallback((_) => setTravelExpenseValue(_), []);
1470
- const [restExpenseValue, setRestExpenseValue] = useState(DEFAULT_REST_MIN_SUM);
1471
- const handleRestExpenseValue = useCallback((_) => setRestExpenseValue(_), []);
1472
- const userInputParams = {
1473
- travelExpenseValue,
1474
- restExpenseValue,
1475
- };
1416
+ const [userInputParams, { field }] = useForm({
1417
+ travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
1418
+ restExpenseValue: DEFAULT_REST_MIN_SUM,
1419
+ });
1476
1420
  const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } = useBonusCalculatorParams(userInputParams, sourceBookDir);
1477
- return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма покупок в категории путешествия, ₽', {
1478
- minSum: minSumTravel,
1479
- maxSum: maxSumTravel,
1480
- 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,
1481
1425
  step: 500,
1482
1426
  isShowItems: false,
1483
- }, handleTravelExpenseValue), renderWantedSumInput('Сумма покупок в остальных категориях, ₽', {
1427
+ ...field('travelExpenseValue'),
1428
+ }), renderWantedSumInput({
1429
+ title: 'Сумма покупок в остальных категориях, ₽',
1484
1430
  className: 'mt-7',
1485
- minSum: minSumOther,
1486
- maxSum: maxSumOther,
1487
- moneyValue: restExpenseValue,
1431
+ min: minSumOther,
1432
+ max: maxSumOther,
1488
1433
  step: 500,
1489
1434
  isShowItems: false,
1490
- }, 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)] })] }));
1491
1437
  });
1492
1438
 
1493
1439
  const STEP_DAYS = 1;
1494
- function renderDaysInput(title, params, callback) {
1495
- const { minDays, maxDays, daysValue } = params;
1496
- const daysText = (days) => {
1497
- const text = Number(days) % 10 === 1 ? 'дня' : 'дней';
1498
- return `${days} ${text}`;
1499
- };
1500
- 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 }));
1501
- }
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 ? 'дня' : 'дней'}`;
1502
1442
 
1503
1443
  const orientationStyleMap = {
1504
1444
  horizontal: 'gap-10',
1505
1445
  vertical: 'flex-col gap-3',
1506
1446
  };
1507
- 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, checked: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
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)))) })));
1508
1448
 
1509
- const EVERY_MONTH = 'everyMonth';
1510
- const AT_END_TERM = 'atEndTerm';
1511
- const depositTypeItems = [
1512
- {
1513
- id: EVERY_MONTH,
1514
- text: 'Ежемесячно',
1515
- },
1516
- {
1517
- id: AT_END_TERM,
1518
- text: 'В конце срока',
1519
- },
1520
- ];
1521
- function renderInterestPayment({ isMonthlyInterestPayment, callback, title, orientation = 'horizontal', }) {
1522
- 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) }) })] }));
1523
- }
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
+ });
1524
1458
 
1525
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"] }) })] })));
1526
1460
 
@@ -1610,101 +1544,47 @@
1610
1544
  };
1611
1545
 
1612
1546
  const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
1613
- const [moneyValue, setMoneyValue] = useState(BUSINESS_DEFAULT_SUM);
1614
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1615
- const [daysValue, setDaysValue] = useState(BUSINESS_DEFAULT_DAYS);
1616
- const handleDaysValue = useCallback((_) => setDaysValue(_), []);
1617
- const [isReplenished, toggleIsReplenished] = useState(false);
1618
- const handleIsReplenished = useCallback((_) => toggleIsReplenished(_), []);
1619
- const [isPartialWithdrawal, toggleIsPartialWithdrawal] = useState(false);
1620
- const handleIsPartialWithdrawal = useCallback((_) => toggleIsPartialWithdrawal(_), []);
1621
- const [isSmallBusiness, toggleIsSmallBusiness] = useState(false);
1622
- const handleIsSmallBusiness = useCallback((_) => toggleIsSmallBusiness(_), []);
1623
- const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1624
- const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1625
- const userInputParams = {
1626
- moneyValue,
1627
- daysValue,
1628
- isReplenished,
1629
- isPartialWithdrawal,
1630
- isSmallBusiness,
1631
- isMonthlyInterestPayment,
1632
- };
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
+ });
1633
1555
  const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
1634
1556
  const { income, finalSum, rate, depositeName, isShowUnknownRate } = calculatorParams;
1635
- 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({
1636
- ...calculatorParams,
1637
- handleIsReplenished,
1638
- handleIsPartialWithdrawal,
1639
- handleIsSmallBusiness,
1640
- }), renderInterestPayment({
1641
- isMonthlyInterestPayment,
1642
- 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({
1643
1570
  title: 'Выплата процентов',
1644
1571
  orientation: 'vertical',
1572
+ ...field('isMonthlyInterestPayment'),
1645
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) })] }));
1646
1574
  });
1647
- 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, checked: 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", checked: 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", checked: isSmallBusiness, onChange: handleIsSmallBusiness })] }));
1648
-
1649
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
1650
- const InputListRange = JSX(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
1651
- const min = 0;
1652
- const max = list.length - 1;
1653
- const step = 1;
1654
- const handleTextChange = (e) => {
1655
- if (!onChange) {
1656
- return;
1657
- }
1658
- const newValue = parseInt(e.target.value);
1659
- const closetValue = list.reduce(function (prev, curr) {
1660
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
1661
- });
1662
- onChange(Number(getSanitizedValue(closetValue.toString())));
1663
- };
1664
- const handleRangeChange = (e) => {
1665
- if (!onChange) {
1666
- return;
1667
- }
1668
- const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
1669
- onChange(Number(getSanitizedValue(val.toString())));
1670
- };
1671
- const valueIndex = list.findIndex((item) => item === value) || 0;
1672
- const inputStyle = {
1673
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
1674
- };
1675
- 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
1676
- 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)] }));
1677
- });
1678
- 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)));
1679
- function renderRangeCaption(items) {
1680
- 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)))) }));
1681
- }
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 })] }));
1682
1576
 
1683
1577
  const STEP_MONTHS = 1;
1684
- function renderMonthsInput(title, params, callback) {
1685
- const { minMonths, maxMonths, monthsValue, availableMonths } = params;
1686
- const monthText = (month) => {
1687
- const text = Number(month) % 10 === 1 ? 'месяца' : 'месяцев';
1688
- return `${month} ${text}`;
1689
- };
1690
- 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 }));
1691
- }
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 ? 'месяца' : 'месяцев'}`;
1692
1580
 
1693
- const ANNUITY = 'annuity';
1694
- const DIFFERENTIAL = 'differential';
1695
- const paymentTypeItems = [
1696
- {
1697
- id: ANNUITY,
1698
- text: 'Аннуитетный',
1699
- },
1700
- {
1701
- id: DIFFERENTIAL,
1702
- text: 'Дифференцированный',
1703
- },
1704
- ];
1705
- function renderPaymentType({ isAnnuity, callback, title, orientation = 'horizontal', }) {
1706
- 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) })] }));
1707
- }
1581
+ const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
1582
+ ...props,
1583
+ items: [
1584
+ { id: 'annuity', text: 'Аннуитетный' },
1585
+ { id: 'differential', text: 'Дифференцированный' },
1586
+ ],
1587
+ });
1708
1588
 
1709
1589
  /**
1710
1590
  * Формулы расчёта аннуитетных и дифференцированных платежей:
@@ -1775,72 +1655,48 @@
1775
1655
  return isExclude || userInputParams[fieldKey] === row[fieldKey];
1776
1656
  };
1777
1657
 
1778
- const CreditCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1779
- const [isAnnuity, toggleIsAnnuity] = useState(false);
1780
- const [isSalaryClient, toggleIsSalaryClient] = useState(false);
1781
- const handleIsSalaryClient = useCallback((_) => toggleIsSalaryClient(_), []);
1782
- const [isStateEmployee, toggleIsStateEmployee] = useState(false);
1783
- const handleIsStateEmployee = useCallback((_) => toggleIsStateEmployee(_), []);
1784
- const [isPensionClient, toggleIsPensionClient] = useState(false);
1785
- const handleIsPensionClient = useCallback((_) => toggleIsPensionClient(_), []);
1786
- const [isInsurance, toggleIsInsurance] = useState(true);
1787
- const handleIsInsurance = useCallback((_) => toggleIsInsurance(_), []);
1788
- const [moneyValue, setMoneyValue] = useState(CREDIT_DEFAULT_SUM);
1789
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1790
- const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
1791
- const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
1792
- const userInputParams = {
1793
- isAnnuity,
1794
- isInsurance,
1795
- isSalaryClient,
1796
- isPensionClient,
1797
- isStateEmployee,
1798
- moneyValue,
1799
- monthsValue,
1800
- };
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
+ });
1801
1668
  const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
1802
- useEffect(() => {
1803
- setMoneyValue(clamp(moneyValue, calculatorParams.minSum, calculatorParams.maxSum));
1804
- setMonthsValue(clamp(monthsValue, calculatorParams.minMonths, calculatorParams.maxMonths));
1805
- }, [calculatorParams]);
1806
- 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({
1807
- ...calculatorParams,
1808
- ...paramsViewSettings,
1809
- handleIsSalaryClient,
1810
- handleIsStateEmployee,
1811
- handleIsPensionClient,
1812
- handleIsInsurance,
1813
- }) })] }), renderRate(calculatorParams.rate), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), renderPaymentType({
1814
- isAnnuity,
1815
- orientation: 'vertical',
1816
- callback: toggleIsAnnuity,
1817
- }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1818
- });
1819
- const renderRate = (rate) => (jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }));
1820
- 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", checked: 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", checked: 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", checked: 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", checked: isInsurance, onChange: handleIsInsurance })) : null] }));
1821
-
1822
- const REMOTE_REGISTRATION = 'remote';
1823
- const OFFICE_REGISTRATION = 'office';
1824
- const registrationTypeItems = [
1825
- {
1826
- id: OFFICE_REGISTRATION,
1827
- text: 'Офис Банка',
1828
- },
1829
- {
1830
- id: REMOTE_REGISTRATION,
1831
- text: 'Дистанционно',
1832
- },
1833
- ];
1834
- function renderRegistrationType({ isRemoteRegistration, callback, title, orientation = 'horizontal', }) {
1835
- 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) }) })] }));
1836
- }
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
+ });
1837
1693
 
1838
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);
1839
1695
 
1840
1696
  const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
1841
1697
  const { moneyValue, monthsValue } = userInputParams;
1842
1698
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
1843
- const defaultMonth = data?.rateRows[0]
1699
+ const defaultMonth = data?.rateRows?.[0]
1844
1700
  ? getMiddleMonth(data.rateRows[0].minMonths, data.rateRows[0].maxMonths)
1845
1701
  : 1;
1846
1702
  const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
@@ -1889,48 +1745,45 @@
1889
1745
  const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
1890
1746
  const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
1891
1747
 
1892
- const DepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
1893
- const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
1894
- const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1895
- const [monthsValue, setMonthsValue] = useState(0);
1896
- const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1897
- const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1898
- const [isRemoteRegistration, toggleIsRemoteRegistration] = useState(false);
1899
- const handleIsRemoteRegistration = useCallback((_) => toggleIsRemoteRegistration(_), []);
1900
- const userInputParams = {
1901
- moneyValue,
1902
- monthsValue,
1903
- isMonthlyInterestPayment,
1904
- isRemoteRegistration,
1905
- };
1906
- 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
+ });
1907
1755
  const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
1908
1756
  const { defaultMonth, income, finalSum, rate } = calculatorParams;
1757
+ const { onChange: setMonthsValue } = field('monthsValue');
1909
1758
  useEffect(() => {
1910
- setMonthsValue(defaultMonth);
1759
+ setMonthsValue && setMonthsValue(defaultMonth);
1911
1760
  }, [defaultMonth]);
1912
- return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма вклада, ₽', {
1913
- ...calculatorParams,
1914
- }, handleMoneyValue), renderMonthsInput('Срок вклада, месяцев', {
1915
- ...calculatorParams,
1916
- }, handleMonthsValue), jsx("div", { className: "mt-7", children: renderDepositParamsForm({
1917
- ...calculatorParams,
1918
- ...paramsViewSettings,
1919
- handleIsMonthlyInterestPayment,
1920
- handleIsRemoteRegistration,
1921
- }) })] }), 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)] })] }));
1922
- });
1923
- 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
1924
1777
  ? renderInterestPayment({
1925
- isMonthlyInterestPayment,
1926
- callback: handleIsMonthlyInterestPayment,
1927
1778
  title: 'Выплата процентов',
1779
+ ...field('isMonthlyInterestPayment'),
1780
+ value: params.isMonthlyInterestPayment,
1928
1781
  })
1929
- : null, isShowRemoteRegistration
1782
+ : null, params.isShowRemoteRegistration
1930
1783
  ? renderRegistrationType({
1931
- isRemoteRegistration,
1932
- callback: handleIsRemoteRegistration,
1933
1784
  title: 'Оформление',
1785
+ ...field('isRemoteRegistration'),
1786
+ value: params.isRemoteRegistration,
1934
1787
  })
1935
1788
  : null] }));
1936
1789
 
@@ -1960,7 +1813,7 @@
1960
1813
  itemCount: calculatorTabs?.length,
1961
1814
  visibleItemCount: COLUMNS_FOR_SCROLL,
1962
1815
  });
1963
- 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
1964
1817
  ? renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
1965
1818
  : null, renderArrows({
1966
1819
  ...controls,
@@ -1979,11 +1832,10 @@
1979
1832
  const iconClassName = isActive ? '' : `text-primary-main`;
1980
1833
  const iconVersion = tab?.icon?.iconVersion;
1981
1834
  const activeIconStyle = isActive ? 'white' : 'normal';
1982
- 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]
1983
- ${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: {
1984
1836
  ...tab?.icon,
1985
1837
  iconVersion: iconVersion ?? activeIconStyle,
1986
- }, 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)));
1987
1839
  }
1988
1840
  function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }) {
1989
1841
  const CARD_SHIFT = 388;
@@ -1995,6 +1847,8 @@
1995
1847
  })) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
1996
1848
  }
1997
1849
 
1850
+ const getSanitizedValue = (_) => _.replace(/\s/g, '');
1851
+
1998
1852
  const adjustValue = (val) => onlyOneDot(setZeroStart(replaceCommaToDot(getSanitizedValue(val))));
1999
1853
  const localNumberFormat = (val) => new Intl.NumberFormat('ru-RU', {
2000
1854
  minimumFractionDigits: 0,
@@ -2013,22 +1867,16 @@
2013
1867
  };
2014
1868
  const replaceCommaToDot = (val) => String(val.replace(',', '.').replace(/[^.\d]/g, ''));
2015
1869
 
2016
- const CurrencyInput = JSX(({ className = '', onChange, minValue = 0, maxValue = 300000, ...inputProps }) => {
1870
+ const CurrencyInput = JSX(({ className = '', value = '', onChange, minValue = 0, maxValue = 300000, ...inputProps }) => {
2017
1871
  const handleChange = useCallback((inputValue) => {
2018
- if (!onChange) {
2019
- return;
2020
- }
2021
1872
  const adjustedVal = adjustValue(inputValue);
2022
1873
  const clampVal = getClampValue(adjustedVal, clamp(Number(adjustedVal), minValue, maxValue));
2023
- onChange(String(clampVal));
2024
- }, [onChange]);
2025
- const handleBlur = useCallback((inputValue) => {
2026
- if (!onChange) {
2027
- return;
2028
- }
2029
- onChange(localNumberFormat(inputValue));
1874
+ onChange && onChange(clampVal);
2030
1875
  }, [onChange]);
2031
- return (jsx(Input, { className: className, inputClassName: "w-full", onChange: handleChange, onBlur: handleBlur, ...inputProps, children: jsx("span", { className: "text-xl-light absolute right-4 bottom-4", children: "\u20BD" }) }));
1876
+ const handleBlur = useCallback(() => {
1877
+ onChange && onChange(localNumberFormat(value));
1878
+ }, [onChange, value]);
1879
+ return (jsx(Input, { className: className, inputClassName: "w-full", value: value, onChange: handleChange, onBlur: handleBlur, ...inputProps, children: jsx("span", { className: "text-xl-light absolute right-4 bottom-4", children: "\u20BD" }) }));
2032
1880
  });
2033
1881
  const getClampValue = (val, clampVal) => Number(val) === clampVal ? val : String(clampVal);
2034
1882
 
@@ -2045,7 +1893,7 @@
2045
1893
  ? getDisabledButtonClasses({ version: button?.version })
2046
1894
  : getRegularButtonClasses({ className: 'text-white', version: button?.version });
2047
1895
  const link = useLink();
2048
- return (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? jsx(Heading, { className: "max-w-[684px] pb-9", headingType: "h2", title: title }) : null, jsxs("form", { className: "w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, value: value, onChange: handleChange, valid: value === '' || !isDisabled, placeholder: placeholder, label: label }), button?.text ? (jsx("button", { type: "submit", className: `w-full p-4 mt-6 ${buttonStyle} `, disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
1896
+ return (jsxs(BlockWrapper, { className: `p-default flex flex-col items-center ${className}`, ...rest, children: [title ? jsx(Heading, { className: "max-w-[684px] pb-9", headingType: "h2", title: title }) : null, jsxs("form", { className: "w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, value: value, onChange: handleChange, valid: value === '' || !isDisabled, placeholder: placeholder, label: label }), button?.text ? (jsx("button", { type: "submit", className: `w-full p-4 mt-6 ${buttonStyle} `, disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
2049
1897
  });
2050
1898
 
2051
1899
  const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
@@ -2265,9 +2113,10 @@
2265
2113
  }, [scrollRight, onScrollRight, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
2266
2114
  return (jsxs("div", { children: [renderBlur(isBlur, scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
2267
2115
  });
2268
- const renderBlur = (isBlur, scroll) => (scroll.canScrollLeft || scroll.canScrollRight) && isBlur ? (jsxs("div", { children: [jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white') }), jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white') })] })) : null;
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;
2269
2117
 
2270
2118
  const ITEMS_GAP = 4;
2119
+
2271
2120
  const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, arrowsPadded = true, isPadding = true, showDots = false, isAlignCenter = false, ...rest }) => {
2272
2121
  const { blocks: childBlocks = [] } = rest.block || {};
2273
2122
  const count = itemCount || childBlocks?.length;
@@ -2280,7 +2129,7 @@
2280
2129
  });
2281
2130
  const [dotsActiveIndex] = scroll.visibleIndicesRange;
2282
2131
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
2283
- 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({
2284
2133
  ...rest,
2285
2134
  renderProps: isBankHistoryCarousel
2286
2135
  ? (block, options) => renderBlock$1(block, options, {
@@ -2288,7 +2137,7 @@
2288
2137
  activeIndex: activeIndex,
2289
2138
  })
2290
2139
  : renderBlock$1,
2291
- }) }), 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] }) }));
2292
2141
  });
2293
2142
  Carousel.childrenTypes = [
2294
2143
  'CarouselCard',
@@ -2303,7 +2152,7 @@
2303
2152
  'CarouselInvestmentCard',
2304
2153
  'CarouselEventCard',
2305
2154
  ];
2306
- const getPaddingStyle = (isPadding) => (isPadding ? 'p-12' : '');
2155
+ const getPaddingStyle$1 = (isPadding) => (isPadding ? 'p-default' : '');
2307
2156
  const getAlignStyle = (isAlignCenter) => isAlignCenter ? 'flex justify-center' : '';
2308
2157
  const renderDots = (containerRef, dotsActiveIndex, itemCount) => (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: itemCount, listType: 'horizontal-list' }));
2309
2158
 
@@ -2437,8 +2286,8 @@
2437
2286
 
2438
2287
  const CarouselProductCard = JSX(({ additionalDescription, align = 'text-center', button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, isFullWidth = true, items = [], target, title, version = 'primary', ...rest }) => {
2439
2288
  return (jsxs(BlockWrapper, { className: style('h-full flex flex-col justify-between min-w-[260px]', 'box-border border-solid border border-gray', align, className), version: version, ...rest, children: [jsxs(LinkWrapper, { className: "p-6", href: href, target: target, children: [renderImage$3(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), renderItems(items, isDotted, version), renderAdditionalDescription$1(additionalDescription)] }), renderButtonsSection([button], {
2440
- className: style('p-6 pt-0', isFullWidth ? '' : 'justify-center'),
2441
- isVertical: isFullWidth ? true : false,
2289
+ className: style('p-6 pt-0', isFullWidth ? '' : 'self-center min-w-[158px]'),
2290
+ isVertical: isFullWidth,
2442
2291
  })] }));
2443
2292
  });
2444
2293
  const renderImage$3 = (image) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`, image: image })) : null] }));
@@ -2448,9 +2297,9 @@
2448
2297
  const renderItems = (items, isDotted, version = 'primary') => items?.length ? (jsx(List, { className: `max-w-[308px] mt-2 text-s ${version === 'primary' ? '!text-secondary-text' : ''}`, itemClassName: "text-left", items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted })) : null;
2449
2298
 
2450
2299
  const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], href, target, ...rest }) => {
2451
- return (jsx(BlockWrapper, { className: style('border border-gray', className), ...rest, children: jsxs(LinkWrapper, { className: "flex", href: href, target: target, children: [jsxs("div", { className: "w-[200px] min-w-[200px] self-center", children: [icon?.icon ? jsx(ImgInner, { image: icon }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null] }), jsxs("div", { className: "p-8 pl-3 w-full", children: [title ? jsx(Heading, { className: "mb-3.5", headingType: "h5", title: title }) : null, list.length ? (jsx("div", { className: "flex flex-col gap-3", children: list?.map(renderList$1) })) : null] })] }) }));
2300
+ return (jsx(BlockWrapper, { className: style('border border-gray', className), ...rest, children: jsxs(LinkWrapper, { className: "flex", href: href, target: target, children: [jsxs("div", { className: "w-[200px] min-w-[200px] self-center", children: [icon?.icon ? jsx(ImgInner, { image: icon }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null] }), jsxs("div", { className: "p-8 pl-3 w-full", children: [title ? jsx(Heading, { className: "mb-3.5", headingType: "h5", title: title }) : null, list.length ? (jsx("div", { className: "flex flex-col gap-3", children: list?.map(renderList$2) })) : null] })] }) }));
2452
2301
  });
2453
- const renderList$1 = (_, i) => (jsxs("div", { className: "break-words", children: [_.title ? jsx("div", { className: "text-h6", children: _.title }) : null, _.description ? jsx("span", { className: "text-l-light mt-1", children: _.description }) : null] }, String(i)));
2302
+ const renderList$2 = (_, i) => (jsxs("div", { className: "break-words", children: [_.title ? jsx("div", { className: "text-h6", children: _.title }) : null, _.description ? jsx("span", { className: "text-l-light mt-1", children: _.description }) : null] }, String(i)));
2454
2303
 
2455
2304
  const ICONS_MAP = [
2456
2305
  {
@@ -2512,7 +2361,7 @@
2512
2361
  return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
2513
2362
  });
2514
2363
 
2515
- const CarouselRichTextCard = JSX(({ className = '', __html, richVersion = 'striped', ...rest }) => (jsx(BlockWrapper, { className: style('p-9 border border-gray min-w-96', className), ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) })));
2364
+ const CarouselRichTextCard = JSX(({ className = '', __html, richVersion = 'striped', ...rest }) => (jsx(BlockWrapper, { className: style('p-9 border border-gray h-full min-w-96', className), ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) })));
2516
2365
 
2517
2366
  const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
2518
2367
  const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
@@ -2536,20 +2385,24 @@
2536
2385
  return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
2537
2386
  });
2538
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
+
2539
2397
  const VISIBLE_CELLS_COUNT = 1;
2540
- const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
2398
+ const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting = false, button, cardCells = [], ...rest }) => {
2541
2399
  const cellsNode = cardCells.map(renderCardInfo);
2542
2400
  const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
2543
2401
  const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
2544
- 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] }));
2545
2403
  });
2546
- 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] }));
2547
- 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 }));
2548
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" })] }));
2549
- const renderCardInfo = (cell, i) => {
2550
- const { title, description, buttons } = cell;
2551
- 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)));
2552
- };
2553
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" })] }));
2554
2407
 
2555
2408
  const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
@@ -2621,7 +2474,7 @@
2621
2474
  });
2622
2475
  const renderShowMoreToggleButton = ({ isShowAllRow, onClick, }) => (jsx("div", { className: "pr-12", children: jsxs("div", { className: "flex w-full", children: [jsx("div", { className: FIRST_CELL_CLASSES$1 }), jsx("button", { onClick: onClick, className: "mt-5 flex-1 border-gray border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main", children: jsx("div", { className: "font-sans text-xs-light font-medium py-3", children: !isShowAllRow ? 'Показать все параметры' : 'Скрыть' }) })] }) }));
2623
2476
 
2624
- const ContactsBlock = JSX(({ className = '', contacts, info, version = 'secondary', ...rest }) => (jsxs(BlockWrapper, { className: `flex p-12 ${className}`, version: version, ...rest, children: [info?.length ? renderBlocks(info) : null, contacts?.length ? renderBlocks(contacts) : null] })));
2477
+ const ContactsBlock = JSX(({ className = '', contacts, info, version = 'secondary', ...rest }) => (jsxs(BlockWrapper, { className: `flex p-default ${className}`, version: version, ...rest, children: [info?.length ? renderBlocks(info) : null, contacts?.length ? renderBlocks(contacts) : null] })));
2625
2478
  const renderBlocks = (info) => (jsx("div", { className: "flex grow basis-0", children: info.map((column, index) => renderBlocksColumn({ column, index })) }));
2626
2479
  const renderBlocksColumn = ({ column, index }) => column ? (jsx("div", { className: "flex flex-col grow basis-0 pr-11 last:pr-0", children: column.map(({ title = '', description, additionalDescription, button }, key) => (jsxs("div", { className: "mt-6 first:mt-0", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "XS", align: "text-left" }), additionalDescription ? (jsx("div", { className: "mt-1.5 opacity-80", children: jsx(Paragraph, { size: "text-m", font: "font-light", children: additionalDescription }) })) : null, button ? jsx(Button, { className: "mt-6", ...button }) : null] }, String(key)))) }, `col-${String(index)}`)) : null;
2627
2480
 
@@ -2854,23 +2707,6 @@
2854
2707
  return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
2855
2708
  };
2856
2709
 
2857
- const useForm = (initialState = {}) => {
2858
- const [formState, setFormState] = useState(initialState);
2859
- const handlersMap = useRef({});
2860
- const register = (fieldName) => {
2861
- if (!handlersMap.current) {
2862
- return {};
2863
- }
2864
- const handler = (value) => {
2865
- setFormState((prev) => ({ ...prev, [fieldName]: value }));
2866
- };
2867
- handlersMap.current[fieldName] ||= handler;
2868
- return { value: formState?.[fieldName], onChange: handlersMap.current[fieldName] };
2869
- };
2870
- const resetForm = useCallback(() => setFormState({}), []);
2871
- return { formState, register, resetForm };
2872
- };
2873
-
2874
2710
  const DefaultFoldButton = JSX(({ className = '', label, icon, dataTheme = '', disabled = false, onClick }) => {
2875
2711
  return (jsxs("button", { className: style('flex justify-center w-full px-0 py-5 border border-transparent outline-none focus:border-primary-text', disabled
2876
2712
  ? 'bg-main-divider text-main-disabled hover:bg-main-divider'
@@ -2922,25 +2758,26 @@
2922
2758
  return items.map((item) => (jsx(SlideCheckbox, { text: item.title, value: [value].flatMap((_) => _).includes(item.value), onChange: () => handleChange(item.value), type: multiple ? 'checkbox' : 'radio' }, item.value)));
2923
2759
  });
2924
2760
 
2925
- const renderFormItem = (filtrationSchema, register) => (key) => {
2761
+ const renderFormItem = (filtrationSchema, field) => (key) => {
2926
2762
  const item = filtrationSchema[key];
2927
2763
  const type = item?.type;
2928
2764
  switch (type) {
2929
2765
  case 'array':
2930
- return renderCheckboxes(key, register)(item);
2766
+ return renderCheckboxes(key, field)(item);
2931
2767
  default:
2932
2768
  return null;
2933
2769
  }
2934
2770
  };
2935
- const renderCheckboxes = (key, register) => (item) => {
2771
+ const renderCheckboxes = (key, field) => (item) => {
2936
2772
  const options = item?.items?.enum?.map((e, i) => ({ value: e, title: item?.items?.enumNames?.[i] || '' })) ||
2937
2773
  [];
2938
- return (jsxs("div", { children: [item?.title ? (jsx("div", { className: "mb-4", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, jsx(SlideCheckboxGroup, { items: options, multiple: true, ...register(key) })] }, key));
2774
+ return (jsxs("div", { children: [item?.title ? (jsx("div", { className: "mb-4", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, jsx(SlideCheckboxGroup, { items: options, multiple: true, ...field(key) })] }, key));
2939
2775
  };
2940
2776
 
2777
+ const initialFiltrationState = {};
2941
2778
  const Filtration = JSX(({ className, filtrationSchema = {}, resetButton, ...rest }) => {
2942
- const { formState, register, resetForm } = useForm();
2943
- return (jsxs(BlockWrapper, { className: style(className), version: "transparent", ...rest, children: [jsxs("form", { className: "flex justify-between bg-white p-9 mb-1", children: [jsx("div", { className: "flex gap-11", children: Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register)) }), resetButton ? (jsx("div", { children: jsx(Button, { className: "w-72", onClick: resetForm, ...resetButton }) })) : null] }), jsx(FiltrationInner, { filtrationState: formState, ...rest })] }));
2779
+ const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
2780
+ return (jsxs(BlockWrapper, { className: style(className), version: "transparent", ...rest, children: [jsxs("form", { className: "flex justify-between bg-white p-9 mb-1", children: [jsx("div", { className: "flex gap-11", children: Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, field)) }), resetButton ? (jsx("div", { children: jsx(Button, { className: "w-72", onClick: reset, ...resetButton }) })) : null] }), jsx(FiltrationInner, { filtrationState: filtrationState, ...rest })] }));
2944
2781
  });
2945
2782
  Filtration.childrenTypes = ['ProductTile'];
2946
2783
  Filtration.childSchema = (content) => content?.filtrationSchema || {};
@@ -2971,12 +2808,12 @@
2971
2808
  'bg-white': 'text-primary-text',
2972
2809
  transparent: 'text-white',
2973
2810
  };
2974
- const renderTitle$3 = (title, bgColor, className) => {
2811
+ const renderTitle$2 = (title, bgColor, className) => {
2975
2812
  return (jsx("span", { className: `${TEXT_COLOR[bgColor]} ml-2.5 font-medium ${className || ''}`, children: title || 'Россельхозбанк' }));
2976
2813
  };
2977
2814
 
2978
2815
  const Logo = JSX(({ className = '', href, logo, children = logo?.title, targetBlank, bgColor = 'bg-white', showTitle = true, }) => {
2979
- return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || '/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [renderImage$2(bgColor, logo?.image, { width: '40', height: '45' }), showTitle ? renderTitle$3(children || logo?.title, bgColor) : null] }));
2816
+ return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || '/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [renderImage$2(bgColor, logo?.image, { width: '40', height: '45' }), showTitle ? renderTitle$2(children || logo?.title, bgColor) : null] }));
2980
2817
  });
2981
2818
 
2982
2819
  const CloseButton = JSX(({ className, onClick }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-1 bg-transparent border-none', className), onClick: onClick, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(ImgInner, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
@@ -3166,14 +3003,6 @@
3166
3003
  return isOpened ? (jsx("div", { className: style('fixed inset-0 bg-white text-l-light z-50 overflow-x-hidden overflow-y-scroll no-scrollbar', className), role: "dialog", children: jsxs("div", { className: "relative container pb-12 min-h-full", children: [jsxs("div", { className: "sticky bg-white pt-6 top-0", children: [jsx(CloseButton, { className: "absolute top-10 -right-12", onClick: onClose }), head] }), children] }) })) : null;
3167
3004
  });
3168
3005
 
3169
- function useBool(defaultValue = false) {
3170
- const [value, setValue] = useState(defaultValue);
3171
- const setTrue = useCallback(() => setValue(true), []);
3172
- const setFalse = useCallback(() => setValue(false), []);
3173
- const toggle = useCallback(() => setValue((_) => !_), []);
3174
- return [value, { setValue, setTrue, setFalse, toggle }];
3175
- }
3176
-
3177
3006
  function useDialogProps(id, initOpen = false) {
3178
3007
  const [isOpened, { setTrue: open, setFalse: close }] = useBool(initOpen);
3179
3008
  const [params, setParams] = useState({ id });
@@ -3315,7 +3144,7 @@
3315
3144
  return (jsxs(BlockWrapper, { tag: "footer", className: `p-9 ${className}`, ...rest, children: [jsxs("div", { className: "flex items-stretch gap-[54px] pb-[30px] xl:gap-8", children: [jsx(Logo, { className: LEFT_COL_WIDTH_FULL_HD, logo: logo }), jsx(SearchBar$1, { className: "grow" })] }), jsxs("div", { className: "flex items-stretch gap-[54px] xl:gap-8", children: [jsxs("div", { className: `${LEFT_COL_WIDTH_FULL_HD} flex flex-col shrink-0 overflow-hidden`, children: [jsx(Contacts, { items: contacts, hasButton: true }), jsx(SocialMedia, { media: socialMedia, children: "\u0421\u043E\u0446\u0441\u0435\u0442\u0438" }), jsx(SocialMedia, { className: "mt-6", media: mobileApps, children: "\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" })] }), jsx(Sitemap, { className: "flex-grow", topItems: sitemap?.topItems })] }), jsx(HorizontalNavigation, { className: "mt-[98px]", links: relatedEnterprises }), jsx(TextInformation, { links: documents })] }));
3316
3145
  });
3317
3146
 
3318
- const GracePeriod = JSX(({ className = '', title, description, calendar, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 ${className}`, ...rest, children: [jsx(Headline, { className: "!p-0 mb-4", title: title, description: description, headlineVersion: "M" }), calendar ? renderCalendar(calendar) : null] })));
3147
+ const GracePeriod = JSX(({ className = '', title, description, calendar, ...rest }) => (jsxs(BlockWrapper, { className: `p-default ${className}`, ...rest, children: [jsx(Headline, { className: "!p-0 mb-4", title: title, description: description, headlineVersion: "M" }), calendar ? renderCalendar(calendar) : null] })));
3319
3148
  const renderCalendar = (calendar) => {
3320
3149
  const colCount = calendar.reduce((accumulator, currentValue) => currentValue?.month?.length ? accumulator + currentValue.month.length : accumulator, 0) || 1;
3321
3150
  const colSize = 100 / colCount;
@@ -3607,7 +3436,7 @@
3607
3436
  '': '',
3608
3437
  };
3609
3438
 
3610
- const HorizontalLayout = JSX(({ className = '', gap = 'XS', isPadding = false, version = 'transparent', isTheme = false, ...rest }) => (jsx(BlockWrapper, { className: style('relative', 'grid grid-cols-12', isPadding ? 'p-12' : '', gapStyles[gap], className), version: version, isTheme: isTheme, ...rest, children: renderChildren(rest) })));
3439
+ const HorizontalLayout = JSX(({ className = '', gap = 'XS', isPadding = false, version = 'transparent', isTheme = false, ...rest }) => (jsx(BlockWrapper, { className: style('relative', 'grid grid-cols-12', isPadding ? 'p-default' : '', gapStyles[gap], className), version: version, isTheme: isTheme, ...rest, children: renderChildren(rest) })));
3611
3440
  HorizontalLayout.childrenTypes = {
3612
3441
  exclude: ['HorizontalLayout'],
3613
3442
  };
@@ -3756,7 +3585,7 @@
3756
3585
  double: 'flex-wrap',
3757
3586
  single: 'flex-col',
3758
3587
  };
3759
- const LinkDocs = JSX(({ className = '', title, description, align = 'text-center', documents, icon = { icon: 'DocIcon' }, columnsMode = 'double', ...rest }) => (jsxs(BlockWrapper, { className: style('p-12', className), ...rest, children: [jsx(Headline, { className: "!p-0", title: title, description: description, align: align, headlineVersion: "M", as: "h2" }), documents?.length ? (jsx("div", { className: style('mt-8 flex gap-6', linkColumnsModeStyleMap[columnsMode]), role: "list", children: documents.map((doc, i) => (jsx("div", { className: columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : '', role: "listitem", children: jsx(LinkDocsListItem, { doc: doc, icon: icon ? (jsx(ImgInner, { className: "min-w-6 min-h-6", image: icon, width: "24", height: "24" })) : null }) }, String(i)))) })) : null] })));
3588
+ const LinkDocs = JSX(({ className = '', title, description, align = 'text-center', documents, icon = { icon: 'DocIcon' }, columnsMode = 'double', ...rest }) => (jsxs(BlockWrapper, { className: style('p-default', className), ...rest, children: [jsx(Headline, { className: "!p-0", title: title, description: description, align: align, headlineVersion: "M", as: "h2" }), documents?.length ? (jsx("div", { className: style('mt-8 flex gap-6', linkColumnsModeStyleMap[columnsMode]), role: "list", children: documents.map((doc, i) => (jsx("div", { className: columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : '', role: "listitem", children: jsx(LinkDocsListItem, { doc: doc, icon: icon ? (jsx(ImgInner, { className: "min-w-6 min-h-6", image: icon, width: "24", height: "24" })) : null }) }, String(i)))) })) : null] })));
3760
3589
 
3761
3590
  const getColSpan = (className) => {
3762
3591
  const colSpanPrefix = 'col-span-';
@@ -3779,12 +3608,12 @@
3779
3608
 
3780
3609
  const MobileAppTile = JSX(({ className = '', title = 'Мобильное приложение', qr, buttons, version = 'primary', items, image, headingType = 'h4', alignTitle = 'left', description, ...rest }) => {
3781
3610
  const containerStyle = version === 'secondary' ? 'p-3.5 min-w-[120px]' : 'min-w-[92px]';
3782
- return (jsxs(BlockWrapper, { className: `flex justify-between p-12 box-border relative min-h-80 ${getTileMinHeight(className)} ${className}`, version: version, ...rest, children: [jsxs(BaseTile, { className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap mb-7 w-full ${AlignText[alignTitle]}` })) : null, buttons: renderButtonsSection(buttons, {
3611
+ return (jsxs(BlockWrapper, { className: `flex justify-between p-default box-border relative min-h-80 ${getTileMinHeight(className)} ${className}`, version: version, ...rest, children: [jsxs(BaseTile, { className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap mb-7 w-full ${AlignText[alignTitle]}` })) : null, buttons: renderButtonsSection(buttons, {
3783
3612
  className: 'mt-8',
3784
3613
  buttonClassName: 'min-w-[168px]',
3785
- }), children: [renderDescription$2(description), jsxs("div", { className: "flex flex-1 items-center mb-3", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(ImgInner, { className: "w-fit", image: qr }) })) : null, renderList(items)] })] }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(ImgInner, { image: image }) })) : null] }));
3614
+ }), children: [renderDescription$2(description), jsxs("div", { className: "flex flex-1 items-center mb-3", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(ImgInner, { className: "w-fit", image: qr }) })) : null, renderList$1(items)] })] }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(ImgInner, { image: image }) })) : null] }));
3786
3615
  });
3787
- const renderList = (items) => {
3616
+ const renderList$1 = (items) => {
3788
3617
  return items?.length ? (jsx(List, { items: items, itemClassName: "text-l-light mb-2 last:mb-0" })) : (jsx("span", { className: "text-m-light text-secondary-text", children: "\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u043D\u0430 QR-\u043A\u043E\u0434 \u0438 \u0441\u043A\u0430\u0447\u0430\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }));
3789
3618
  };
3790
3619
  const renderDescription$2 = (description) => description ? jsx("p", { className: "text-xl-light mb-5 pt-0.5", children: description }) : null;
@@ -4272,7 +4101,7 @@
4272
4101
  const ProductBlock = JSX((props) => {
4273
4102
  const { className = '', breadcrumbs, backwardButton, version = 'primary', ...rest } = props;
4274
4103
  const buttonVersion = version === 'primary' ? version : 'white';
4275
- return (jsxs(BlockWrapper, { className: style('overflow-hidden p-12 flex flex-col box-border min-h-[454px]', className), version: version, ...rest, children: [backwardButton?.text ? renderBackwardButton(backwardButton, buttonVersion) : null, breadcrumbs?.length ? (jsx("div", { className: "text-xs-light mb-6", children: joinList(jsx("span", { className: style('mx-2', breadcrumbStyle), children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { className: breadcrumbStyle, ...breadcrumb }, String(i))))) })) : null, jsx(ProductBlockInner, { className: "mt-10", version: version, ...rest })] }));
4104
+ return (jsxs(BlockWrapper, { className: style('overflow-hidden p-default flex flex-col box-border min-h-[454px]', className), version: version, ...rest, children: [backwardButton?.text ? renderBackwardButton(backwardButton, buttonVersion) : null, breadcrumbs?.length ? (jsx("div", { className: "text-xs-light mb-6", children: joinList(jsx("span", { className: style('mx-2', breadcrumbStyle), children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { className: breadcrumbStyle, ...breadcrumb }, String(i))))) })) : null, jsx(ProductBlockInner, { className: "mt-10", version: version, ...rest })] }));
4276
4105
  });
4277
4106
 
4278
4107
  const ProductGallery = JSX(({ className = '', slides = [], ...rest }) => {
@@ -4664,9 +4493,9 @@
4664
4493
  const count = tab.ref && page?.blocks
4665
4494
  ? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
4666
4495
  : 0;
4667
- return (jsx("div", { className: getGroupTabClassName('div', active, isScrollable), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: `flex flex-1 items-center justify-center ${getGroupTabClassName('text', active, isScrollable)}`, children: [renderTitle$2(tab.title, active, isScrollable), renderCount(showCounter, count, active)] }) }, `group-${String(i)}`));
4496
+ return (jsx("div", { className: getGroupTabClassName('div', active, isScrollable), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: `flex flex-1 items-center justify-center ${getGroupTabClassName('text', active, isScrollable)}`, children: [renderTitle$1(tab.title, active, isScrollable), renderCount(showCounter, count, active)] }) }, `group-${String(i)}`));
4668
4497
  };
4669
- const renderTitle$2 = (title, active, isScrollable) => {
4498
+ const renderTitle$1 = (title, active, isScrollable) => {
4670
4499
  const activeClassName = active ? WHITE_ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES;
4671
4500
  const titleClassName = isScrollable
4672
4501
  ? `${TEXT_CLASSES} ${activeClassName}`
@@ -4906,9 +4735,9 @@
4906
4735
  });
4907
4736
  const rows = (rowData || []).map((row, i) => (jsx(TariffsTableRow, { row: row, activeIndex: activeIndex, rowIdx: i, ...rest }, String(i))));
4908
4737
  const [visibleRows, hiddenRows] = hiddenRowsNum > 0 ? [rows.slice(0, -hiddenRowsNum), rows.slice(-hiddenRowsNum)] : [rows, []];
4909
- return (jsxs(BlockWrapper, { className: `p-12 overflow-hidden relative ${itemCount > 1 ? 'pr-0' : ''} ${className}`, ...rest, children: [renderTitle$1({ title, description }), renderDescription$1(description), hiddenRowsNum > 0 ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs(Wrapper, { controls: controls, children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] })), renderFoldButton: renderDefaultFoldButton })) : (jsx(Wrapper, { controls: controls, children: rows }))] }));
4738
+ return (jsxs(BlockWrapper, { className: `p-default overflow-hidden relative ${itemCount > 1 ? 'pr-0' : ''} ${className}`, ...rest, children: [renderTitle({ title, description }), renderDescription$1(description), hiddenRowsNum > 0 ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs(Wrapper, { controls: controls, children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] })), renderFoldButton: renderDefaultFoldButton })) : (jsx(Wrapper, { controls: controls, children: rows }))] }));
4910
4739
  });
4911
- function renderTitle$1({ title, description }) {
4740
+ function renderTitle({ title, description }) {
4912
4741
  return title ? (jsx(Heading, { headingType: "h3", className: `text-center ${description ? 'mb-2.5' : 'mb-8'}`, title: title })) : null;
4913
4742
  }
4914
4743
  function renderDescription$1(description) {
@@ -4923,13 +4752,16 @@
4923
4752
  })] }), isScrollAvailable ? (jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })) : null] }));
4924
4753
  });
4925
4754
 
4926
- const TextBlock = JSX(({ className = '', title, description, iconVersion, image, __html, ...rest }) => {
4927
- return (jsxs(BlockWrapper, { className: `px-9 py-4 flex gap-3 bg-white group-data-secondary:bg-primary-main/10' ${className}`, ...rest, children: [iconVersion === 'small' ? jsx("div", { className: "mt-1", children: renderIcon() }) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { children: [title ? renderTitle(title) : null, description ? jsx("div", { className: "mt-1", children: renderDescription(description) }) : null, __html ? jsx(RichText, { __html: __html }) : null] })] }));
4755
+ const TextBlock = JSX(({ className = '', title, description, iconVersion, image, __html, items = [], ...rest }) => {
4756
+ return (jsxs(BlockWrapper, { className: style('px-9 py-4 flex gap-3 bg-white group-data-secondary:bg-primary-main/10', className), ...rest, children: [iconVersion === 'small' ? jsx("div", { className: "mt-1", children: renderIcon() }) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "flex flex-col w-fit gap-3", children: [title ? (jsx(Text, { size: "text-l", font: "font-medium", color: "text-primary-text group-data-secondary:text-white", children: title })) : null, description ? renderDescription(description) : null, items?.length ? renderList(items, true) : null, __html ? jsx(RichText, { __html: __html }) : null] })] }));
4928
4757
  });
4929
4758
  const renderIcon = () => (jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main`, children: "i" }));
4930
- const renderImage = (image) => (image?.src ? jsx(ImgInner, { image: image }) : null);
4931
- const renderTitle = (title) => (jsx(Text, { size: "text-l", font: "font-medium", color: "text-primary-text group-data-secondary:text-white", children: title }));
4759
+ const renderImage = (image) => image?.src ? jsx(ImgInner, { className: "h-fit", image: image }) : null;
4932
4760
  const renderDescription = (description) => (jsx(Paragraph, { size: "text-s", color: "text-secondary-text group-data-secondary:text-white", children: description }));
4761
+ const renderList = (items, bullets) => {
4762
+ const listStyle = bullets ? 'list-disc pl-6' : '';
4763
+ return (jsx("ul", { className: style('text-secondary-text group-data-secondary:text-white/80', listStyle), children: items.map((_, i) => (jsx("li", { children: jsx(Text, { size: "text-s", font: "font-light", children: _ }) }, `listItem-${i}`))) }));
4764
+ };
4933
4765
 
4934
4766
  const Tags = JSX((props) => {
4935
4767
  const { tags, className = '' } = props;
@@ -4950,7 +4782,7 @@
4950
4782
  };
4951
4783
  const VerticalLayout = JSX(({ className = '', gap = '', align = 'stretch', isPadding = false, isInnerPadding = true, version = 'transparent', isTheme = false, ...rest }) => {
4952
4784
  const innerPaddingStyle = isInnerPadding ? '' : '!p-0';
4953
- return (jsx(BlockWrapper, { className: style('relative', 'flex flex-col [&>*]:max-w-full', isPadding ? 'p-12' : '', gapStyles[gap], align && alignStyle[align], className), version: version, isTheme: isTheme, ...rest, children: renderChildren({
4785
+ return (jsx(BlockWrapper, { className: style('relative', 'flex flex-col [&>*]:max-w-full', isPadding ? 'p-default' : '', gapStyles[gap], align && alignStyle[align], className), version: version, isTheme: isTheme, ...rest, children: renderChildren({
4954
4786
  ...rest,
4955
4787
  renderProps: (block, options) => renderBlock$1(block, options, { className: innerPaddingStyle }),
4956
4788
  }) }));
@@ -5174,7 +5006,7 @@
5174
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" }) }));
5175
5007
  }
5176
5008
 
5177
- const packageVersion = "0.10.5";
5009
+ const packageVersion = "0.10.7";
5178
5010
 
5179
5011
  exports.Blocks = Blocks;
5180
5012
  exports.ContentPage = ContentPage;