@redneckz/wildless-cms-uni-blocks 0.14.548 → 0.14.549

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 (381) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +147 -94
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  5. package/bundle/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  6. package/bundle/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  7. package/bundle/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  8. package/bundle/components/ApplicationForm/ProductField.d.ts +2 -0
  9. package/bundle/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  10. package/bundle/components/ApplicationForm/{contants.d.ts → constants.d.ts} +2 -0
  11. package/bundle/components/ApplicationForm/getField.d.ts +0 -4
  12. package/bundle/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  13. package/bundle/components/ApplicationForm/isRenderField.d.ts +6 -0
  14. package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  15. package/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  16. package/bundle/components/CalculatorDeposit/isRubles.d.ts +1 -0
  17. package/bundle/components/CalculatorDeposit/utils.d.ts +17 -0
  18. package/bundle/hooks/useForm.d.ts +2 -1
  19. package/bundle/hooks/useRegions.d.ts +2 -1
  20. package/bundle/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  21. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  22. package/dist/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  23. package/dist/components/ApplicationForm/FeedbackMethodField.js +2 -2
  24. package/dist/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
  25. package/dist/components/ApplicationForm/FeedbackTypeField.js +3 -3
  26. package/dist/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
  27. package/dist/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  28. package/dist/components/ApplicationForm/LocalitiesField.js +24 -0
  29. package/dist/components/ApplicationForm/LocalitiesField.js.map +1 -0
  30. package/dist/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  31. package/dist/components/ApplicationForm/PartnerCommentsField.js +6 -8
  32. package/dist/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
  33. package/dist/components/ApplicationForm/ProductField.d.ts +2 -0
  34. package/dist/components/ApplicationForm/ProductField.js +10 -0
  35. package/dist/components/ApplicationForm/ProductField.js.map +1 -0
  36. package/dist/components/ApplicationForm/RegionField.js +2 -2
  37. package/dist/components/ApplicationForm/RegionField.js.map +1 -1
  38. package/dist/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  39. package/dist/components/ApplicationForm/SecondaryPhoneField.js +14 -0
  40. package/dist/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
  41. package/dist/components/ApplicationForm/ServiceDirectionField.js +2 -2
  42. package/dist/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
  43. package/dist/components/ApplicationForm/UltraPremiumField.js +2 -2
  44. package/dist/components/ApplicationForm/UltraPremiumField.js.map +1 -1
  45. package/{lib/components/ApplicationForm/contants.d.ts → dist/components/ApplicationForm/constants.d.ts} +2 -0
  46. package/dist/components/ApplicationForm/constants.js +34 -0
  47. package/dist/components/ApplicationForm/constants.js.map +1 -0
  48. package/dist/components/ApplicationForm/getField.d.ts +0 -4
  49. package/dist/components/ApplicationForm/getField.js +13 -11
  50. package/dist/components/ApplicationForm/getField.js.map +1 -1
  51. package/dist/components/ApplicationForm/getInitialFormState.js +6 -6
  52. package/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  53. package/dist/components/ApplicationForm/getObjectValidator.js +3 -0
  54. package/dist/components/ApplicationForm/getObjectValidator.js.map +1 -1
  55. package/dist/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  56. package/dist/components/ApplicationForm/getRegionUrl.js +6 -0
  57. package/dist/components/ApplicationForm/getRegionUrl.js.map +1 -0
  58. package/dist/components/ApplicationForm/isRenderField.d.ts +6 -0
  59. package/dist/components/ApplicationForm/isRenderField.js +9 -0
  60. package/dist/components/ApplicationForm/isRenderField.js.map +1 -0
  61. package/dist/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
  62. package/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  63. package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  64. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  65. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
  66. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  67. package/dist/components/CalculatorDeposit/isRubles.d.ts +1 -0
  68. package/dist/components/CalculatorDeposit/isRubles.js +5 -0
  69. package/dist/components/CalculatorDeposit/isRubles.js.map +1 -0
  70. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
  71. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  72. package/dist/components/CalculatorDeposit/utils.d.ts +17 -0
  73. package/dist/components/CalculatorDeposit/utils.js +32 -0
  74. package/dist/components/CalculatorDeposit/utils.js.map +1 -0
  75. package/dist/hooks/useForm.d.ts +2 -1
  76. package/dist/hooks/useForm.js +22 -12
  77. package/dist/hooks/useForm.js.map +1 -1
  78. package/dist/hooks/useRegions.d.ts +2 -1
  79. package/dist/hooks/useRegions.js +2 -2
  80. package/dist/hooks/useRegions.js.map +1 -1
  81. package/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
  82. package/dist/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  83. package/dist/ui-kit/Calculator/getDefaultParams.js +1 -1
  84. package/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  85. package/lib/common.css +1 -1
  86. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  87. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  88. package/lib/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  89. package/lib/components/ApplicationForm/FeedbackMethodField.js +1 -1
  90. package/lib/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
  91. package/lib/components/ApplicationForm/FeedbackTypeField.js +1 -1
  92. package/lib/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
  93. package/lib/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  94. package/lib/components/ApplicationForm/LocalitiesField.js +22 -0
  95. package/lib/components/ApplicationForm/LocalitiesField.js.map +1 -0
  96. package/lib/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  97. package/lib/components/ApplicationForm/PartnerCommentsField.js +5 -7
  98. package/lib/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
  99. package/lib/components/ApplicationForm/ProductField.d.ts +2 -0
  100. package/lib/components/ApplicationForm/ProductField.js +8 -0
  101. package/lib/components/ApplicationForm/ProductField.js.map +1 -0
  102. package/lib/components/ApplicationForm/RegionField.js +2 -2
  103. package/lib/components/ApplicationForm/RegionField.js.map +1 -1
  104. package/lib/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  105. package/lib/components/ApplicationForm/SecondaryPhoneField.js +12 -0
  106. package/lib/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
  107. package/lib/components/ApplicationForm/ServiceDirectionField.js +1 -1
  108. package/lib/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
  109. package/lib/components/ApplicationForm/UltraPremiumField.js +1 -1
  110. package/lib/components/ApplicationForm/UltraPremiumField.js.map +1 -1
  111. package/{dist/components/ApplicationForm/contants.d.ts → lib/components/ApplicationForm/constants.d.ts} +2 -0
  112. package/lib/components/ApplicationForm/{contants.js → constants.js} +10 -1
  113. package/lib/components/ApplicationForm/constants.js.map +1 -0
  114. package/lib/components/ApplicationForm/getField.d.ts +0 -4
  115. package/lib/components/ApplicationForm/getField.js +11 -8
  116. package/lib/components/ApplicationForm/getField.js.map +1 -1
  117. package/lib/components/ApplicationForm/getInitialFormState.js +1 -1
  118. package/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  119. package/lib/components/ApplicationForm/getObjectValidator.js +3 -0
  120. package/lib/components/ApplicationForm/getObjectValidator.js.map +1 -1
  121. package/lib/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  122. package/lib/components/ApplicationForm/getRegionUrl.js +3 -0
  123. package/lib/components/ApplicationForm/getRegionUrl.js.map +1 -0
  124. package/lib/components/ApplicationForm/isRenderField.d.ts +6 -0
  125. package/lib/components/ApplicationForm/isRenderField.js +6 -0
  126. package/lib/components/ApplicationForm/isRenderField.js.map +1 -0
  127. package/lib/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
  128. package/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  129. package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  130. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  131. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
  132. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  133. package/lib/components/CalculatorDeposit/isRubles.d.ts +1 -0
  134. package/lib/components/CalculatorDeposit/isRubles.js +2 -0
  135. package/lib/components/CalculatorDeposit/isRubles.js.map +1 -0
  136. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
  137. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  138. package/lib/components/CalculatorDeposit/utils.d.ts +17 -0
  139. package/lib/components/CalculatorDeposit/utils.js +25 -0
  140. package/lib/components/CalculatorDeposit/utils.js.map +1 -0
  141. package/lib/hooks/useForm.d.ts +2 -1
  142. package/lib/hooks/useForm.js +23 -13
  143. package/lib/hooks/useForm.js.map +1 -1
  144. package/lib/hooks/useRegions.d.ts +2 -1
  145. package/lib/hooks/useRegions.js +2 -2
  146. package/lib/hooks/useRegions.js.map +1 -1
  147. package/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
  148. package/lib/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  149. package/lib/ui-kit/Calculator/getDefaultParams.js +1 -1
  150. package/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  151. package/mobile/bundle/bundle.umd.js +147 -94
  152. package/mobile/bundle/bundle.umd.min.js +1 -1
  153. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  154. package/mobile/bundle/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  155. package/mobile/bundle/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  156. package/mobile/bundle/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  157. package/mobile/bundle/components/ApplicationForm/ProductField.d.ts +2 -0
  158. package/mobile/bundle/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  159. package/mobile/bundle/components/ApplicationForm/{contants.d.ts → constants.d.ts} +2 -0
  160. package/mobile/bundle/components/ApplicationForm/getField.d.ts +0 -4
  161. package/mobile/bundle/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  162. package/mobile/bundle/components/ApplicationForm/isRenderField.d.ts +6 -0
  163. package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  164. package/mobile/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  165. package/mobile/bundle/components/CalculatorDeposit/isRubles.d.ts +1 -0
  166. package/mobile/bundle/components/CalculatorDeposit/utils.d.ts +17 -0
  167. package/mobile/bundle/hooks/useForm.d.ts +2 -1
  168. package/mobile/bundle/hooks/useRegions.d.ts +2 -1
  169. package/mobile/bundle/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  170. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  171. package/mobile/dist/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  172. package/mobile/dist/components/ApplicationForm/FeedbackMethodField.js +2 -2
  173. package/mobile/dist/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
  174. package/mobile/dist/components/ApplicationForm/FeedbackTypeField.js +3 -3
  175. package/mobile/dist/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
  176. package/mobile/dist/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  177. package/mobile/dist/components/ApplicationForm/LocalitiesField.js +24 -0
  178. package/mobile/dist/components/ApplicationForm/LocalitiesField.js.map +1 -0
  179. package/mobile/dist/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  180. package/mobile/dist/components/ApplicationForm/PartnerCommentsField.js +6 -8
  181. package/mobile/dist/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
  182. package/mobile/dist/components/ApplicationForm/ProductField.d.ts +2 -0
  183. package/mobile/dist/components/ApplicationForm/ProductField.js +10 -0
  184. package/mobile/dist/components/ApplicationForm/ProductField.js.map +1 -0
  185. package/mobile/dist/components/ApplicationForm/RegionField.js +2 -2
  186. package/mobile/dist/components/ApplicationForm/RegionField.js.map +1 -1
  187. package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  188. package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.js +14 -0
  189. package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
  190. package/mobile/dist/components/ApplicationForm/ServiceDirectionField.js +2 -2
  191. package/mobile/dist/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
  192. package/mobile/dist/components/ApplicationForm/UltraPremiumField.js +2 -2
  193. package/mobile/dist/components/ApplicationForm/UltraPremiumField.js.map +1 -1
  194. package/mobile/dist/components/ApplicationForm/constants.d.ts +7 -0
  195. package/mobile/dist/components/ApplicationForm/constants.js +34 -0
  196. package/mobile/dist/components/ApplicationForm/constants.js.map +1 -0
  197. package/mobile/dist/components/ApplicationForm/getField.d.ts +0 -4
  198. package/mobile/dist/components/ApplicationForm/getField.js +13 -11
  199. package/mobile/dist/components/ApplicationForm/getField.js.map +1 -1
  200. package/mobile/dist/components/ApplicationForm/getInitialFormState.js +6 -6
  201. package/mobile/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  202. package/mobile/dist/components/ApplicationForm/getObjectValidator.js +3 -0
  203. package/mobile/dist/components/ApplicationForm/getObjectValidator.js.map +1 -1
  204. package/mobile/dist/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  205. package/mobile/dist/components/ApplicationForm/getRegionUrl.js +6 -0
  206. package/mobile/dist/components/ApplicationForm/getRegionUrl.js.map +1 -0
  207. package/mobile/dist/components/ApplicationForm/isRenderField.d.ts +6 -0
  208. package/mobile/dist/components/ApplicationForm/isRenderField.js +9 -0
  209. package/mobile/dist/components/ApplicationForm/isRenderField.js.map +1 -0
  210. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
  211. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  212. package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  213. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  214. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
  215. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  216. package/mobile/dist/components/CalculatorDeposit/isRubles.d.ts +1 -0
  217. package/mobile/dist/components/CalculatorDeposit/isRubles.js +5 -0
  218. package/mobile/dist/components/CalculatorDeposit/isRubles.js.map +1 -0
  219. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
  220. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  221. package/mobile/dist/components/CalculatorDeposit/utils.d.ts +17 -0
  222. package/mobile/dist/components/CalculatorDeposit/utils.js +32 -0
  223. package/mobile/dist/components/CalculatorDeposit/utils.js.map +1 -0
  224. package/mobile/dist/hooks/useForm.d.ts +2 -1
  225. package/mobile/dist/hooks/useForm.js +22 -12
  226. package/mobile/dist/hooks/useForm.js.map +1 -1
  227. package/mobile/dist/hooks/useRegions.d.ts +2 -1
  228. package/mobile/dist/hooks/useRegions.js +2 -2
  229. package/mobile/dist/hooks/useRegions.js.map +1 -1
  230. package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
  231. package/mobile/dist/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  232. package/mobile/dist/ui-kit/Calculator/getDefaultParams.js +1 -1
  233. package/mobile/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  234. package/mobile/lib/common.css +1 -1
  235. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
  236. package/mobile/lib/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
  237. package/mobile/lib/components/ApplicationForm/FeedbackMethodField.js +1 -1
  238. package/mobile/lib/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
  239. package/mobile/lib/components/ApplicationForm/FeedbackTypeField.js +1 -1
  240. package/mobile/lib/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
  241. package/mobile/lib/components/ApplicationForm/LocalitiesField.d.ts +2 -0
  242. package/mobile/lib/components/ApplicationForm/LocalitiesField.js +22 -0
  243. package/mobile/lib/components/ApplicationForm/LocalitiesField.js.map +1 -0
  244. package/mobile/lib/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
  245. package/mobile/lib/components/ApplicationForm/PartnerCommentsField.js +5 -7
  246. package/mobile/lib/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
  247. package/mobile/lib/components/ApplicationForm/ProductField.d.ts +2 -0
  248. package/mobile/lib/components/ApplicationForm/ProductField.js +8 -0
  249. package/mobile/lib/components/ApplicationForm/ProductField.js.map +1 -0
  250. package/mobile/lib/components/ApplicationForm/RegionField.js +2 -2
  251. package/mobile/lib/components/ApplicationForm/RegionField.js.map +1 -1
  252. package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
  253. package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.js +12 -0
  254. package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
  255. package/mobile/lib/components/ApplicationForm/ServiceDirectionField.js +1 -1
  256. package/mobile/lib/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
  257. package/mobile/lib/components/ApplicationForm/UltraPremiumField.js +1 -1
  258. package/mobile/lib/components/ApplicationForm/UltraPremiumField.js.map +1 -1
  259. package/mobile/lib/components/ApplicationForm/constants.d.ts +7 -0
  260. package/mobile/lib/components/ApplicationForm/{contants.js → constants.js} +10 -1
  261. package/mobile/lib/components/ApplicationForm/constants.js.map +1 -0
  262. package/mobile/lib/components/ApplicationForm/getField.d.ts +0 -4
  263. package/mobile/lib/components/ApplicationForm/getField.js +11 -8
  264. package/mobile/lib/components/ApplicationForm/getField.js.map +1 -1
  265. package/mobile/lib/components/ApplicationForm/getInitialFormState.js +1 -1
  266. package/mobile/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  267. package/mobile/lib/components/ApplicationForm/getObjectValidator.js +3 -0
  268. package/mobile/lib/components/ApplicationForm/getObjectValidator.js.map +1 -1
  269. package/mobile/lib/components/ApplicationForm/getRegionUrl.d.ts +1 -0
  270. package/mobile/lib/components/ApplicationForm/getRegionUrl.js +3 -0
  271. package/mobile/lib/components/ApplicationForm/getRegionUrl.js.map +1 -0
  272. package/mobile/lib/components/ApplicationForm/isRenderField.d.ts +6 -0
  273. package/mobile/lib/components/ApplicationForm/isRenderField.js +6 -0
  274. package/mobile/lib/components/ApplicationForm/isRenderField.js.map +1 -0
  275. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
  276. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  277. package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
  278. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
  279. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
  280. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  281. package/mobile/lib/components/CalculatorDeposit/isRubles.d.ts +1 -0
  282. package/mobile/lib/components/CalculatorDeposit/isRubles.js +2 -0
  283. package/mobile/lib/components/CalculatorDeposit/isRubles.js.map +1 -0
  284. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
  285. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  286. package/mobile/lib/components/CalculatorDeposit/utils.d.ts +17 -0
  287. package/mobile/lib/components/CalculatorDeposit/utils.js +25 -0
  288. package/mobile/lib/components/CalculatorDeposit/utils.js.map +1 -0
  289. package/mobile/lib/hooks/useForm.d.ts +2 -1
  290. package/mobile/lib/hooks/useForm.js +23 -13
  291. package/mobile/lib/hooks/useForm.js.map +1 -1
  292. package/mobile/lib/hooks/useRegions.d.ts +2 -1
  293. package/mobile/lib/hooks/useRegions.js +2 -2
  294. package/mobile/lib/hooks/useRegions.js.map +1 -1
  295. package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
  296. package/mobile/lib/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
  297. package/mobile/lib/ui-kit/Calculator/getDefaultParams.js +1 -1
  298. package/mobile/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  299. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +79 -0
  300. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +6 -2
  301. package/mobile/src/components/ApplicationForm/CustomFieldProps.ts +1 -0
  302. package/mobile/src/components/ApplicationForm/FeedbackMethodField.tsx +1 -1
  303. package/mobile/src/components/ApplicationForm/FeedbackTypeField.tsx +1 -1
  304. package/mobile/src/components/ApplicationForm/LocalitiesField.tsx +34 -0
  305. package/mobile/src/components/ApplicationForm/PartnerCommentsField.tsx +10 -9
  306. package/mobile/src/components/ApplicationForm/ProductField.tsx +15 -0
  307. package/mobile/src/components/ApplicationForm/RegionField.tsx +2 -2
  308. package/mobile/src/components/ApplicationForm/SecondaryPhoneField.tsx +18 -0
  309. package/mobile/src/components/ApplicationForm/ServiceDirectionField.tsx +1 -1
  310. package/mobile/src/components/ApplicationForm/UltraPremiumField.tsx +1 -1
  311. package/mobile/src/components/ApplicationForm/{contants.tsx → constants.tsx} +11 -0
  312. package/mobile/src/components/ApplicationForm/getField.tsx +16 -23
  313. package/mobile/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
  314. package/mobile/src/components/ApplicationForm/getObjectValidator.tsx +3 -0
  315. package/mobile/src/components/ApplicationForm/getRegionUrl.tsx +4 -0
  316. package/mobile/src/components/ApplicationForm/isRenderField.tsx +15 -0
  317. package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.tsx +47 -71
  318. package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -1
  319. package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +14 -9
  320. package/mobile/src/components/CalculatorDeposit/isRubles.tsx +1 -0
  321. package/mobile/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +5 -2
  322. package/mobile/src/components/CalculatorDeposit/utils.tsx +37 -0
  323. package/mobile/src/hooks/useForm.ts +33 -16
  324. package/mobile/src/hooks/useRegions.ts +3 -2
  325. package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
  326. package/mobile/src/ui-kit/Calculator/getDefaultParams.tsx +3 -3
  327. package/package.json +1 -1
  328. package/src/components/ApplicationForm/ApplicationForm.example.json +79 -0
  329. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +34 -0
  330. package/src/components/ApplicationForm/ApplicationFormContent.ts +6 -2
  331. package/src/components/ApplicationForm/CustomFieldProps.ts +1 -0
  332. package/src/components/ApplicationForm/FeedbackMethodField.tsx +1 -1
  333. package/src/components/ApplicationForm/FeedbackTypeField.tsx +1 -1
  334. package/src/components/ApplicationForm/LocalitiesField.tsx +34 -0
  335. package/src/components/ApplicationForm/PartnerCommentsField.tsx +10 -9
  336. package/src/components/ApplicationForm/ProductField.tsx +15 -0
  337. package/src/components/ApplicationForm/RegionField.tsx +2 -2
  338. package/src/components/ApplicationForm/SecondaryPhoneField.tsx +18 -0
  339. package/src/components/ApplicationForm/ServiceDirectionField.tsx +1 -1
  340. package/src/components/ApplicationForm/UltraPremiumField.tsx +1 -1
  341. package/src/components/ApplicationForm/{contants.tsx → constants.tsx} +11 -0
  342. package/src/components/ApplicationForm/getField.tsx +16 -23
  343. package/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
  344. package/src/components/ApplicationForm/getObjectValidator.tsx +3 -0
  345. package/src/components/ApplicationForm/getRegionUrl.tsx +4 -0
  346. package/src/components/ApplicationForm/isRenderField.tsx +15 -0
  347. package/src/components/CalculatorDeposit/CalculatorDeposit.fixture.tsx +2 -0
  348. package/src/components/CalculatorDeposit/CalculatorDeposit.tsx +47 -71
  349. package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -1
  350. package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +14 -9
  351. package/src/components/CalculatorDeposit/isRubles.tsx +1 -0
  352. package/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +5 -2
  353. package/src/components/CalculatorDeposit/utils.tsx +37 -0
  354. package/src/hooks/useForm.ts +33 -16
  355. package/src/hooks/useRegions.ts +3 -2
  356. package/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
  357. package/src/ui-kit/Calculator/getDefaultParams.tsx +3 -3
  358. package/bundle/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  359. package/dist/components/ApplicationForm/contants.js +0 -25
  360. package/dist/components/ApplicationForm/contants.js.map +0 -1
  361. package/dist/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  362. package/dist/components/CalculatorDeposit/isNotRubles.js +0 -5
  363. package/dist/components/CalculatorDeposit/isNotRubles.js.map +0 -1
  364. package/lib/components/ApplicationForm/contants.js.map +0 -1
  365. package/lib/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  366. package/lib/components/CalculatorDeposit/isNotRubles.js +0 -2
  367. package/lib/components/CalculatorDeposit/isNotRubles.js.map +0 -1
  368. package/mobile/bundle/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  369. package/mobile/dist/components/ApplicationForm/contants.d.ts +0 -5
  370. package/mobile/dist/components/ApplicationForm/contants.js +0 -25
  371. package/mobile/dist/components/ApplicationForm/contants.js.map +0 -1
  372. package/mobile/dist/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  373. package/mobile/dist/components/CalculatorDeposit/isNotRubles.js +0 -5
  374. package/mobile/dist/components/CalculatorDeposit/isNotRubles.js.map +0 -1
  375. package/mobile/lib/components/ApplicationForm/contants.d.ts +0 -5
  376. package/mobile/lib/components/ApplicationForm/contants.js.map +0 -1
  377. package/mobile/lib/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
  378. package/mobile/lib/components/CalculatorDeposit/isNotRubles.js +0 -2
  379. package/mobile/lib/components/CalculatorDeposit/isNotRubles.js.map +0 -1
  380. package/mobile/src/components/CalculatorDeposit/isNotRubles.tsx +0 -1
  381. package/src/components/CalculatorDeposit/isNotRubles.tsx +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../src/hooks/useForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwBhD,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,YAAuB,EACvB,EACE,aAAa,EACb,QAAQ,MAIN,EAAE,EACqC,EAAE;IAC7C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAY,YAAY,CAAC,CAAC;IAEpE,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAClD,EAAE,CACH,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,CA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-3,5 +3,6 @@ export interface Region {
3
3
  code?: string;
4
4
  name?: string;
5
5
  slug?: string;
6
+ localities?: string[];
6
7
  }
7
- export declare function useRegions(): Region[];
8
+ export declare function useRegions(url?: string): Region[];
@@ -1,8 +1,8 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import { fetchJSONUnsafe } from '../utils/fetchJSON.js';
3
3
  const REGIONS_URL = '/api/v1/regions';
4
- export function useRegions() {
5
- const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
4
+ export function useRegions(url = REGIONS_URL) {
5
+ const { data } = useAsyncData(url, fetchJSONUnsafe);
6
6
  return Array.isArray(data) ? data : [];
7
7
  }
8
8
  //# sourceMappingURL=useRegions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRegions.js","sourceRoot":"","sources":["../../src/hooks/useRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAE/E,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAStC,MAAM,UAAU,UAAU;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE,eAAgD,CAAC,CAAC;IAE7F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"useRegions.js","sourceRoot":"","sources":["../../src/hooks/useRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAE/E,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAUtC,MAAM,UAAU,UAAU,CAAC,MAAc,WAAW;IAClD,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,eAAgD,CAAC,CAAC;IAErF,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const CalculatorStyle = {
2
2
  wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-4xl gap-y-7 @xl:gap-y-4xl',
3
3
  input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
4
- result: 'flex flex-col gap-y-xl min-w-60',
4
+ result: 'flex flex-col gap-y-xl min-w-52',
5
5
  };
6
6
  //# sourceMappingURL=CalculatorStyle.js.map
@@ -1,5 +1,4 @@
1
- import { type CreditCalculatorSourceBookParams } from '../../components/CalculatorCredit/CalculatorCreditContent';
2
1
  import { type DepositCalculatorSourceBookParams } from '../../components/CalculatorDeposit/getDepositCalculatorParams';
3
2
  import { type CalcDefaultParamsProps } from './CalculatorProps';
4
3
  export declare const getDefaultParamsMin: (rateRows?: CalcDefaultParamsProps[]) => CalcDefaultParamsProps | undefined;
5
- export declare const getDefaultParamsMax: (rateRows?: CreditCalculatorSourceBookParams[] | DepositCalculatorSourceBookParams[]) => CalcDefaultParamsProps | undefined;
4
+ export declare const getDefaultParamsMax: (rateRows?: DepositCalculatorSourceBookParams[], isNewClient?: boolean) => CalcDefaultParamsProps | undefined;
@@ -1,5 +1,5 @@
1
1
  export const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
2
- export const getDefaultParamsMax = (rateRows) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows);
2
+ export const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
3
3
  const getDefaultParams = (comparators, rateRows) => {
4
4
  if (!rateRows?.length) {
5
5
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultParams.js","sourceRoot":"","sources":["../../../src/ui-kit/Calculator/getDefaultParams.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAmC,EAAE,EAAE,CACzE,gBAAgB,CACd,CAAC,CAAC,CAAS,EAAE,GAAW,EAAW,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EACrF,QAAQ,CACT,CAAC;AACJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAmF,EACnF,EAAE,CACF,gBAAgB,CACd,CAAC,CAAC,CAAS,EAAE,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAC5E,QAAQ,CACT,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CACvB,WAGC,EACD,QAAmC,EACC,EAAE;IACtC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,CAC5B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACT,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YACvC,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACjC,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,CAAC,QAAQ,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AQ,EAAE,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,CAC5B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACT,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YACvC,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACjC,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACd,CAAC;IACF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAClF;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC"}
@@ -1053,26 +1053,35 @@
1053
1053
 
1054
1054
  const identity = (_) => _;
1055
1055
 
1056
- const useForm = (initialState, { resetOnSubmit, onSubmit, } = {}) => {
1057
- const [formState, setFormState] = useState(initialState);
1056
+ // eslint-disable-next-line max-lines-per-function
1057
+ const useForm = (initialState, { resetOnSubmit, onSubmit, normalize, } = {}) => {
1058
+ const [formState, setFormStateUnsafe] = useState(initialState);
1059
+ const setFormState = useCallback(normalize
1060
+ ? (_) => setFormStateUnsafe(_ instanceof Function
1061
+ ? (prev) => {
1062
+ const _normalize = normalize(_(prev));
1063
+ return shellowCompare(prev, _normalize) ? prev : _normalize;
1064
+ }
1065
+ : normalize(_))
1066
+ : setFormStateUnsafe, [normalize]);
1067
+ useEffect(() => {
1068
+ if (normalize) {
1069
+ setFormStateUnsafe(normalize);
1070
+ }
1071
+ }, [normalize]);
1058
1072
  const [isDirtyForm, setDirtyForm] = useState(false);
1059
1073
  const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
1060
- const handlersMap = useRef({});
1061
1074
  const field = useCallback((fieldName, options) => {
1062
1075
  const { parse = identity, format = identity } = options || {};
1063
- if (!handlersMap.current) {
1064
- handlersMap.current = {};
1065
- }
1066
- handlersMap.current[fieldName] ||= (value) => {
1067
- setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
1068
- setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
1069
- };
1070
1076
  return {
1071
1077
  value: format(formState[fieldName]),
1072
1078
  isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
1073
- onChange: handlersMap.current[fieldName],
1079
+ onChange: (value) => {
1080
+ setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
1081
+ setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
1082
+ },
1074
1083
  };
1075
- }, [formState, isDirtyForm, dirtyFieldsMap]);
1084
+ }, [setFormState, isDirtyForm, dirtyFieldsMap]);
1076
1085
  const update = useCallback((_) => {
1077
1086
  setFormState(_);
1078
1087
  setDirtyFieldsMap(_);
@@ -1098,6 +1107,7 @@
1098
1107
  },
1099
1108
  ];
1100
1109
  };
1110
+ const shellowCompare = (a, b) => Object.keys({ ...a, ...b }).every((key) => a[key] === b[key]);
1101
1111
 
1102
1112
  const ApplicationFormLayout = JSX((props) => {
1103
1113
  const { className, title, children, ...rest } = props;
@@ -1549,6 +1559,9 @@
1549
1559
  feedbackMethod: defaultSelectValidator,
1550
1560
  serviceType: defaultSelectValidator,
1551
1561
  serviceDirection: defaultSelectValidator,
1562
+ meetingDay: defaultValidator,
1563
+ product: defaultValidator,
1564
+ localities: defaultValidator,
1552
1565
  consentDataProcessing: agreementValidator,
1553
1566
  annualRevenue: defaultValidator,
1554
1567
  };
@@ -1778,6 +1791,15 @@
1778
1791
  { key: 'phone', text: 'Телефонный звонок' },
1779
1792
  { key: 'email', text: 'Электронное сообщение' },
1780
1793
  ];
1794
+ const PRODUCT_TYPE = [
1795
+ { key: 'Карта дебетовая', text: 'Карта дебетовая' },
1796
+ { key: 'Карта кредитная', text: 'Карта кредитная' },
1797
+ { key: 'Потребительский кредит', text: 'Потребительский кредит' },
1798
+ { key: 'Ипотечный кредит', text: 'Ипотечный кредит' },
1799
+ { key: 'Вклад', text: 'Вклад' },
1800
+ { key: 'Накопительный счет', text: 'Накопительный счет' },
1801
+ ];
1802
+ const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
1781
1803
 
1782
1804
  const FeedbackMethodField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), validatorObj.feedbackMethod) })));
1783
1805
 
@@ -1791,29 +1813,51 @@
1791
1813
  return (jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(feedbackType, validatorObj.feedbackType) }));
1792
1814
  });
1793
1815
 
1816
+ const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
1817
+
1794
1818
  const IsClientField = JSX(({ field }) => (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
1795
1819
 
1820
+ function isRenderField({ input, field, }) {
1821
+ const { condition } = input;
1822
+ const { value } = field(condition?.name || '');
1823
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
1824
+ }
1825
+
1826
+ const REGIONS_URL = '/api/v1/regions';
1827
+ function useRegions(url = REGIONS_URL) {
1828
+ const { data } = useAsyncData(url, fetchJSONUnsafe);
1829
+ return Array.isArray(data) ? data : [];
1830
+ }
1831
+
1832
+ const LocalitiesField = JSX(({ field, input }) => {
1833
+ const fieldRegion = field('region');
1834
+ const regionKey = fieldRegion?.value?.key;
1835
+ const localities = useRegions(OUT_SERVICE_URL)
1836
+ ?.find((_) => _.code === regionKey)
1837
+ ?.localities?.map((_) => ({ key: _, text: _ }));
1838
+ useEffect(() => {
1839
+ if (regionKey !== '') {
1840
+ field?.('localities')?.onChange?.('');
1841
+ }
1842
+ }, [regionKey]);
1843
+ return (jsx(SelectControl, { label: "\u041D\u0430\u0441\u0435\u043B\u0435\u043D\u043D\u044B\u0439 \u043F\u0443\u043D\u043A\u0442", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: localities, ...getValidation(field('localities'), validatorObj.localities, input?.required), isSearch: true }));
1844
+ });
1845
+
1796
1846
  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-s", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-s 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-1/2' : 'left-[5%]') }) }), text ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })) : null] })));
1797
1847
 
1798
1848
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
1799
1849
 
1800
- const SecondaryPhoneField = JSX(({ field }) => {
1801
- const fieldPhone = field('secondaryPhone');
1802
- return (jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!fieldPhone.value || fieldPhone.value === '+7 ('
1803
- ? fieldPhone
1804
- : withValidator(fieldPhone, validatorObj.secondaryPhone)) }));
1850
+ const PartnerCommentsField = JSX(({ field, input }) => {
1851
+ const { required, ...rest } = input;
1852
+ return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), 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", isTextarea: true, ...rest }));
1805
1853
  });
1806
1854
 
1807
1855
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1808
1856
 
1809
- const REGIONS_URL = '/api/v1/regions';
1810
- function useRegions() {
1811
- const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
1812
- return Array.isArray(data) ? data : [];
1813
- }
1857
+ const ProductField = JSX(({ field }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: PRODUCT_TYPE, ...withValidator(field('product'), validatorObj.product) })));
1814
1858
 
1815
- const RegionField = JSX(({ field, input }) => {
1816
- const regions = useRegions();
1859
+ const RegionField = JSX(({ field, input, url }) => {
1860
+ const regions = useRegions(url);
1817
1861
  return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
1818
1862
  });
1819
1863
 
@@ -1826,6 +1870,13 @@
1826
1870
  return (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, ...getValidation(field('region'), validatorObj.region, input?.required) }));
1827
1871
  });
1828
1872
 
1873
+ const SecondaryPhoneField = JSX(({ field }) => {
1874
+ const fieldPhone = field('secondaryPhone');
1875
+ return (jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!fieldPhone.value || fieldPhone.value === '+7 ('
1876
+ ? fieldPhone
1877
+ : withValidator(fieldPhone, validatorObj.secondaryPhone)) }));
1878
+ });
1879
+
1829
1880
  const ServiceDirectionField = JSX(({ field }) => (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), validatorObj.serviceDirection) })));
1830
1881
 
1831
1882
  const MIN_CREDIT_TERM = 1;
@@ -1868,12 +1919,15 @@
1868
1919
  fullName: (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, required), ...rest })),
1869
1920
  inn: (jsx(InputControl, { label: "\u0418\u041D\u041D", type: "number", ...getValidation(field('inn'), validatorObj.inn, required) })),
1870
1921
  comment: jsx(CommentField, { field: field, input: input }),
1871
- region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input })),
1922
+ region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, url: getRegionUrl(typeForm) })),
1872
1923
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
1873
1924
  birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
1925
+ desiredMeetingDate: (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, required) })),
1926
+ product: jsx(ProductField, { field: field }),
1927
+ localities: jsx(LocalitiesField, { field: field, input: input }),
1874
1928
  isClient: jsx(IsClientField, { field: field }),
1875
1929
  consentToReceiveMaterials: (jsx(CheckboxWithError, { ...field('consentToReceiveMaterials'), text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435" })),
1876
- partnerComments: (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), 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", isTextarea: true, ...rest })),
1930
+ partnerComments: jsx(PartnerCommentsField, { field: field, input: input }),
1877
1931
  collectionCount: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", type: "number", ...getValidation(field('collectionCount'), validatorObj.collectionCount, required) })),
1878
1932
  acquiringType: jsx(AcquiringField, { field: field, input: input }),
1879
1933
  onlineCheckout: jsx(OnlineCheckoutField, { field: field }),
@@ -1892,11 +1946,6 @@
1892
1946
  };
1893
1947
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(i))) : null;
1894
1948
  };
1895
- function isRenderField({ input, field, }) {
1896
- const { condition } = input;
1897
- const { value } = field(condition?.name || '');
1898
- return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
1899
- }
1900
1949
 
1901
1950
  const getPartnerComments = (data) => {
1902
1951
  const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
@@ -2540,7 +2589,7 @@
2540
2589
  const CalculatorStyle = {
2541
2590
  wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-4xl gap-y-7 @xl:gap-y-4xl',
2542
2591
  input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
2543
- result: 'flex flex-col gap-y-xl min-w-60',
2592
+ result: 'flex flex-col gap-y-xl min-w-52',
2544
2593
  };
2545
2594
 
2546
2595
  const FormatValue = JSX(({ value, fractionDigits, fixed, prefix, postfix }) => (jsx(Text, { size: "text-h3", children: typeof value === 'number'
@@ -2818,7 +2867,7 @@
2818
2867
  const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { color: "text-secondary-text", font: "font-light", children: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }), jsxs("div", { className: "flex flex-col gap-y-lg sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal })] })] }));
2819
2868
 
2820
2869
  const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
2821
- const getDefaultParamsMax = (rateRows) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows);
2870
+ const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
2822
2871
  const getDefaultParams = (comparators, rateRows) => {
2823
2872
  if (!rateRows?.length) {
2824
2873
  return undefined;
@@ -3032,8 +3081,6 @@
3032
3081
  });
3033
3082
  const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { 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, { 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, { 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] }));
3034
3083
 
3035
- const isNotRubles = (currency = 'rub') => currency !== 'rub';
3036
-
3037
3084
  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);
3038
3085
 
3039
3086
  const mergeIntervals = (intervals) => {
@@ -3072,32 +3119,36 @@
3072
3119
  const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
3073
3120
  const isExcludeReplenish = !paramsViewSettings?.isShowReplenish;
3074
3121
  const isExcludeWithdrawn = !paramsViewSettings?.isShowWithdrawn;
3075
- const depositCalculatorSourceBookParams = rows?.find((row) => checkRowByParam({
3076
- row,
3077
- userInputParams,
3078
- paramKey: 'isReplenish',
3079
- isExclude: isExcludeReplenish,
3080
- }) &&
3122
+ const isExcludeNewClient = !paramsViewSettings?.isShowNewClient;
3123
+ const depositCalculatorSourceBookParams = rows?.find((row) => [
3124
+ checkRowByParam({
3125
+ row,
3126
+ userInputParams,
3127
+ paramKey: 'isReplenish',
3128
+ isExclude: isExcludeReplenish,
3129
+ }),
3081
3130
  checkRowByParam({
3082
3131
  row,
3083
3132
  userInputParams,
3084
3133
  paramKey: 'isWithdrawn',
3085
3134
  isExclude: isExcludeWithdrawn,
3086
- }) &&
3135
+ }),
3087
3136
  checkRowByParam({
3088
3137
  row,
3089
3138
  userInputParams,
3090
3139
  paramKey: 'isMonthlyInterestPayment',
3091
3140
  isExclude: isExcludeMonthlyInterestPayment,
3092
- }) &&
3141
+ }),
3093
3142
  checkRowByParam({
3094
3143
  row,
3095
3144
  userInputParams,
3096
3145
  paramKey: 'isRemoteRegistration',
3097
3146
  isExclude: isExcludeRemoteRegistration,
3098
- }) &&
3099
- checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
3100
- checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
3147
+ }),
3148
+ isExcludeNewClient || userInputParams?.['isNewClient'] === row?.['isNewClient'],
3149
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row),
3150
+ checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row),
3151
+ ].every(Boolean)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
3101
3152
  const { rate } = depositCalculatorSourceBookParams;
3102
3153
  const income = getDepositIncome(rate, userInputParams);
3103
3154
  const finalSum = moneyValue + income;
@@ -3128,6 +3179,8 @@
3128
3179
  const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
3129
3180
  const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
3130
3181
 
3182
+ const isRubles = (currency = 'rub') => currency === 'rub';
3183
+
3131
3184
  const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
3132
3185
  ...props,
3133
3186
  items: [
@@ -3162,7 +3215,7 @@
3162
3215
  ],
3163
3216
  disabled: isCurrency,
3164
3217
  })
3165
- : null] }), separatorStyles(params.isShowReplenish || params.isShowWithdrawn), jsxs("div", { className: "flex gap-lg", children: [params.isShowMonthlyInterestPayment
3218
+ : null] }), renderSeparator(params.isShowReplenish || params.isShowWithdrawn), jsxs("div", { className: "flex gap-lg", children: [params.isShowMonthlyInterestPayment
3166
3219
  ? renderPayout({
3167
3220
  title: 'Выплата процентов',
3168
3221
  ...field('isMonthlyInterestPayment'),
@@ -3176,9 +3229,31 @@
3176
3229
  value: params.isRemoteRegistration,
3177
3230
  orientation: 'vertical',
3178
3231
  })
3179
- : null] })] }));
3232
+ : null] }), renderSeparator(params.isShowNewClient), params.isShowNewClient ? jsx(Checkbox, { text: "\u041D\u043E\u0432\u044B\u0439 \u0432\u043A\u043B\u0430\u0434\u0447\u0438\u043A", ...field('isNewClient') }) : null] }));
3233
+ };
3234
+ const renderSeparator = (isShow = false) => isShow ? jsx("div", { className: "border-b border-main-divider w-full" }) : null;
3235
+
3236
+ const normalizeMonthValue = (_, rows) => {
3237
+ const { minMonths, maxMonths } = getRangeByKeys(['minMonths', 'maxMonths'], getRows(rows, _?.currency));
3238
+ const monthsValue = _.monthsValue || Math.round((minMonths + maxMonths) / 2);
3239
+ return { monthsValue: clamp(monthsValue, minMonths, maxMonths) };
3240
+ };
3241
+ const normalizeMoneyValue = (_, rows) => {
3242
+ const { minSum, maxSum } = getRangeByKeys(['minSum', 'maxSum'], getRows(rows, _?.currency));
3243
+ const moneyValue = _.moneyValue || minSum;
3244
+ return { moneyValue: clamp(moneyValue, minSum, maxSum) };
3245
+ };
3246
+ const normalizeCurrency = (_, rows) => ({
3247
+ currency: _?.currency ?? rows?.map((row) => row.currency)?.[0],
3248
+ });
3249
+ const normalizeReplenishWithdrawn = (_) => {
3250
+ const _isRubles = isRubles(_?.currency?.key);
3251
+ return { isReplenish: _isRubles && _?.isReplenish, isWithdrawn: _isRubles && _?.isWithdrawn };
3252
+ };
3253
+ const getRows = (rows, currencyValue) => {
3254
+ const { rates } = rows?.find((_) => _?.currency.key === currencyValue?.key) ?? {};
3255
+ return rates ?? rows?.[0]?.rates;
3180
3256
  };
3181
- const separatorStyles = (isShow = false) => isShow ? jsx("div", { className: "border-b border-main-divider w-full" }) : null;
3182
3257
 
3183
3258
  const MAP = {
3184
3259
  isMonthlyInterestPayment: 'isMonthlyInterestPayment',
@@ -3192,67 +3267,49 @@
3192
3267
  key: 'rub',
3193
3268
  };
3194
3269
  const DEPOSIT_DEFAULT_SUM = 20000;
3270
+ const DEPOSIT_DEFAULT_MONTHS = 1;
3195
3271
  const CalculatorDeposit = UniBlock(({ className, title, calcSource, buttons = [], footnote = '', paramsViewSettings, defaultParams, ...rest }) => {
3196
3272
  const { rows } = calcSource ?? {};
3197
3273
  const currencyOptions = rows?.map((_) => _.currency) ?? [DEFAULT_CURRENCY];
3274
+ const normalize = useCallback((_) => !rows
3275
+ ? _
3276
+ : {
3277
+ ..._,
3278
+ ...normalizeReplenishWithdrawn(_),
3279
+ ...normalizeMoneyValue(_, rows),
3280
+ ...normalizeMonthValue(_, rows),
3281
+ ...normalizeCurrency(_, rows),
3282
+ }, [rows]);
3198
3283
  const [userInputParams, { field }] = useForm({
3199
3284
  moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
3200
- monthsValue: getMonthsDefaultValue(defaultParams),
3285
+ monthsValue: getMonthsDefaultValue(defaultParams, DEPOSIT_DEFAULT_MONTHS),
3201
3286
  isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
3202
3287
  isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
3203
3288
  isReplenish: Boolean(defaultParams?.isReplenish),
3204
3289
  isWithdrawn: Boolean(defaultParams?.isWithdrawn),
3290
+ isNewClient: Boolean(defaultParams?.isNewClient),
3205
3291
  currency: DEFAULT_CURRENCY,
3206
- });
3207
- const currencyValue = field?.('currency')?.value;
3208
- const { onChange: setMonthsValue } = field('monthsValue');
3209
- const { onChange: setMoneyValue } = field('moneyValue');
3292
+ }, { normalize });
3293
+ const currencyValue = field?.('currency')?.value ?? DEFAULT_CURRENCY;
3294
+ const isNewClient = field?.('isNewClient')?.value;
3210
3295
  const row = getRows(rows, currencyValue);
3211
- const [defParams, setDefParams] = useState(getDefaultParamsMax(rows?.[0]?.rates));
3212
- const calcParams = getDepositCalculatorParams(userInputParams, getRows(rows, currencyValue), paramsViewSettings);
3213
- useEffect(() => {
3214
- if (currencyOptions?.[0]) {
3215
- field?.('currency')?.onChange?.(currencyOptions?.[0]);
3216
- }
3217
- }, [calcSource]);
3296
+ const calcParams = getDepositCalculatorParams(userInputParams, row, paramsViewSettings);
3297
+ const { rate, income, finalSum, type = '' } = calcParams;
3218
3298
  const handleDefaultParamsCals = () => {
3219
3299
  setDefaultParamsCalc({
3220
3300
  field,
3221
- defParams: defParams,
3301
+ defParams: getDefaultParamsMax(row, isNewClient),
3222
3302
  calcParams,
3223
3303
  monthsValue: 'minMonths',
3224
3304
  map: MAP,
3225
3305
  });
3226
3306
  };
3227
- const { defaultMonth, rate, income, finalSum, type = '' } = calcParams;
3228
- useEffect(() => {
3229
- setDefParams(getDefaultParamsMax(row));
3230
- }, [currencyValue, rows]);
3231
- useEffect(() => {
3232
- !userInputParams.monthsValue && setMonthsValue && setMonthsValue(defaultMonth);
3233
- }, [defaultMonth]);
3234
- useEffect(() => {
3235
- setMoneyValue &&
3236
- setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
3237
- }, [calcParams.minSum, calcParams.maxSum, row]);
3238
3307
  useEffect(() => {
3239
- if (!isDefaultParams(defaultParams) && defParams) {
3308
+ if (!isDefaultParams(defaultParams) && row) {
3240
3309
  handleDefaultParamsCals();
3241
3310
  }
3242
- }, [defParams, defaultParams]);
3243
- useEffect(() => {
3244
- setMoneyValue?.(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
3245
- if (isNotRubles(currencyValue?.key)) {
3246
- field?.('isReplenish')?.onChange?.(false);
3247
- field?.('isWithdrawn')?.onChange?.(false);
3248
- }
3249
- }, [currencyValue]);
3250
- useEffect(() => {
3251
- if (!isDefaultParams(defaultParams) && defParams) {
3252
- handleDefaultParamsCals();
3253
- }
3254
- }, [defaultParams, row, defParams]);
3255
- const isMaxRate = rate === defParams?.rate;
3311
+ }, [defaultParams, rows]);
3312
+ const isMaxRate = rate === getDefaultParamsMax(row, isNewClient)?.rate;
3256
3313
  return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [jsxs("div", { className: "flex gap-m", children: [renderWantedSumInput({
3257
3314
  className: 'w-full',
3258
3315
  title: `Сумма, ${currencyValue?.text}`,
@@ -3281,17 +3338,13 @@
3281
3338
  isCapitalization: field('isMonthlyInterestPayment').value,
3282
3339
  })] }) }));
3283
3340
  });
3284
- const getStep = (key = '') => (isNotRubles(key) ? 100 : 1000);
3341
+ const getStep = (key = '') => (isRubles(key) ? 1000 : 100);
3285
3342
  const getTariffButton = (buttons = [], btnType = '') => {
3286
3343
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3287
3344
  const { type, ...button } = buttons.find((_) => _.type === btnType) ?? {};
3288
3345
  return button;
3289
3346
  };
3290
3347
  const renderMaxRateButton = (handleDefaultParamsCals, isMaxRate = false) => isMaxRate ? null : (jsx(Button, { type: "button", version: "secondary", onClick: handleDefaultParamsCals, children: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0442\u0430\u0432\u043A\u0443" }));
3291
- const getRows = (rows, currencyValue) => {
3292
- const { rates } = rows?.find((_) => _?.currency.key === currencyValue?.key) ?? {};
3293
- return rates ?? rows?.[0]?.rates;
3294
- };
3295
3348
 
3296
3349
  const checkRefinancingSourceBookRowCommonParams = (props) => checkRowParam({
3297
3350
  ...props,
@@ -6128,7 +6181,7 @@
6128
6181
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6129
6182
  });
6130
6183
 
6131
- const packageVersion = "0.14.547";
6184
+ const packageVersion = "0.14.548";
6132
6185
 
6133
6186
  exports.Blocks = Blocks;
6134
6187
  exports.ContentPage = ContentPage;