@redneckz/wildless-cms-uni-blocks 0.14.608 → 0.14.616

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 (676) hide show
  1. package/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
  2. package/bundle/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +483 -177
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  7. package/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  8. package/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  9. package/bundle/components/CreditForm/CreditForm.d.ts +2 -9
  10. package/bundle/components/CreditForm/CreditFormContent.d.ts +9 -1
  11. package/bundle/components/CreditForm/CreditFormStep.d.ts +17 -0
  12. package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  13. package/bundle/components/CreditForm/creditFormStepsData.d.ts +40 -2
  14. package/bundle/components/CreditForm/getInitialFormState.d.ts +62 -0
  15. package/bundle/components/CreditForm/renderInputs.d.ts +3 -0
  16. package/bundle/components/CreditForm/useCreditFormApi.d.ts +11 -0
  17. package/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  18. package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  19. package/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  20. package/bundle/ui-kit/DatePicker/getYears.d.ts +1 -0
  21. package/bundle/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  22. package/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
  23. package/bundle/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  24. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  25. package/bundle/ui-kit/FormField/validators.d.ts +1 -0
  26. package/bundle/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  27. package/bundle/ui-kit/Input/InputNumberControl.d.ts +2 -0
  28. package/bundle/ui-kit/Input/InputProps.d.ts +2 -1
  29. package/bundle/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  30. package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  31. package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  32. package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  33. package/bundle/utils/normalizeWithMask.d.ts +1 -0
  34. package/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
  35. package/dist/api/RetailAPI/updateUserProfile.js +1 -1
  36. package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  37. package/dist/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  38. package/dist/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
  39. package/dist/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
  40. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  41. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  42. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  43. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  44. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  45. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  46. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  47. package/dist/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  48. package/dist/components/ApplicationStatus/ApplicationStatus.js +25 -0
  49. package/dist/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
  50. package/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  51. package/dist/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
  52. package/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
  53. package/dist/components/Blocks.js +2 -0
  54. package/dist/components/Blocks.js.map +1 -1
  55. package/dist/components/CreditForm/CreditForm.d.ts +2 -9
  56. package/dist/components/CreditForm/CreditForm.js +11 -19
  57. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  58. package/dist/components/CreditForm/CreditFormContent.d.ts +9 -1
  59. package/dist/components/CreditForm/CreditFormStep.d.ts +17 -0
  60. package/dist/components/CreditForm/CreditFormStep.js +33 -0
  61. package/dist/components/CreditForm/CreditFormStep.js.map +1 -0
  62. package/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  63. package/dist/components/CreditForm/StepsNavigationButtons.js +2 -12
  64. package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  65. package/dist/components/CreditForm/creditFormStepsData.d.ts +40 -2
  66. package/dist/components/CreditForm/creditFormStepsData.js +31 -26
  67. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  68. package/dist/components/CreditForm/getInitialFormState.d.ts +62 -0
  69. package/dist/components/CreditForm/getInitialFormState.js +77 -0
  70. package/dist/components/CreditForm/getInitialFormState.js.map +1 -0
  71. package/dist/components/CreditForm/renderInputs.d.ts +3 -0
  72. package/dist/components/CreditForm/renderInputs.js +8 -0
  73. package/dist/components/CreditForm/renderInputs.js.map +1 -0
  74. package/dist/components/CreditForm/useCreditFormApi.d.ts +11 -0
  75. package/dist/components/CreditForm/useCreditFormApi.js +28 -0
  76. package/dist/components/CreditForm/useCreditFormApi.js.map +1 -0
  77. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  78. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  79. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  80. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
  81. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  82. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  83. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
  84. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  85. package/dist/ui-kit/DatePicker/DatePicker.js +16 -5
  86. package/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
  87. package/dist/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  88. package/dist/ui-kit/DatePicker/DatePickerInput.js +66 -0
  89. package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
  90. package/dist/ui-kit/DatePicker/getYears.d.ts +1 -0
  91. package/dist/ui-kit/DatePicker/getYears.js +3 -3
  92. package/dist/ui-kit/DatePicker/getYears.js.map +1 -1
  93. package/dist/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  94. package/dist/ui-kit/DatePicker/useDatePickerManager.js +29 -3
  95. package/dist/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
  96. package/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
  97. package/dist/ui-kit/DialogManager/openDocument.js +11 -0
  98. package/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
  99. package/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
  100. package/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  101. package/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  102. package/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  103. package/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  104. package/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  105. package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  106. package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  107. package/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  108. package/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  109. package/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  110. package/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  111. package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  112. package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  113. package/dist/ui-kit/FormField/Fields/InnField.js +2 -2
  114. package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  115. package/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  116. package/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  117. package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  118. package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  119. package/dist/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  120. package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -0
  121. package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
  122. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  123. package/dist/ui-kit/FormField/SelectField.js +1 -1
  124. package/dist/ui-kit/FormField/SelectField.js.map +1 -1
  125. package/dist/ui-kit/FormField/getField.js +2 -0
  126. package/dist/ui-kit/FormField/getField.js.map +1 -1
  127. package/dist/ui-kit/FormField/getObjectValidator.js +6 -5
  128. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  129. package/dist/ui-kit/FormField/validators.d.ts +1 -0
  130. package/dist/ui-kit/FormField/validators.js +3 -1
  131. package/dist/ui-kit/FormField/validators.js.map +1 -1
  132. package/dist/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  133. package/dist/ui-kit/InfoCard/InfoCard.js +2 -1
  134. package/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
  135. package/dist/ui-kit/Input/InputNumberControl.d.ts +2 -0
  136. package/dist/ui-kit/Input/InputNumberControl.js +10 -0
  137. package/dist/ui-kit/Input/InputNumberControl.js.map +1 -0
  138. package/dist/ui-kit/Input/InputProps.d.ts +2 -1
  139. package/dist/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  140. package/dist/ui-kit/InputNumber/InputNumber.js +12 -0
  141. package/dist/ui-kit/InputNumber/InputNumber.js.map +1 -0
  142. package/dist/ui-kit/SnilsInput/SnilsInput.js +2 -2
  143. package/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
  144. package/dist/ui-kit/TimerCircle/TimerCircle.js +3 -2
  145. package/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  146. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  147. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  148. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  149. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  150. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  151. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  152. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  153. package/dist/utils/normalizeWithMask.d.ts +1 -0
  154. package/dist/utils/normalizeWithMask.js +20 -0
  155. package/dist/utils/normalizeWithMask.js.map +1 -0
  156. package/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
  157. package/lib/api/RetailAPI/updateUserProfile.js +1 -1
  158. package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  159. package/lib/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  160. package/lib/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
  161. package/lib/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
  162. package/lib/common.css +1 -1
  163. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  164. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  165. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  166. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  167. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  168. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  169. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  170. package/lib/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  171. package/lib/components/ApplicationStatus/ApplicationStatus.fixture.d.ts +9 -0
  172. package/lib/components/ApplicationStatus/ApplicationStatus.js +23 -0
  173. package/lib/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
  174. package/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  175. package/lib/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
  176. package/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
  177. package/lib/components/Blocks.js +2 -0
  178. package/lib/components/Blocks.js.map +1 -1
  179. package/lib/components/CreditForm/CreditForm.d.ts +2 -9
  180. package/lib/components/CreditForm/CreditForm.js +12 -20
  181. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  182. package/lib/components/CreditForm/CreditFormContent.d.ts +9 -1
  183. package/lib/components/CreditForm/CreditFormStep.d.ts +17 -0
  184. package/lib/components/CreditForm/CreditFormStep.js +31 -0
  185. package/lib/components/CreditForm/CreditFormStep.js.map +1 -0
  186. package/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  187. package/lib/components/CreditForm/StepsNavigationButtons.js +2 -12
  188. package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  189. package/lib/components/CreditForm/creditFormStepsData.d.ts +40 -2
  190. package/lib/components/CreditForm/creditFormStepsData.js +31 -26
  191. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  192. package/lib/components/CreditForm/getInitialFormState.d.ts +62 -0
  193. package/lib/components/CreditForm/getInitialFormState.js +74 -0
  194. package/lib/components/CreditForm/getInitialFormState.js.map +1 -0
  195. package/lib/components/CreditForm/renderInputs.d.ts +2 -0
  196. package/lib/components/CreditForm/renderInputs.js +5 -0
  197. package/lib/components/CreditForm/renderInputs.js.map +1 -0
  198. package/lib/components/CreditForm/useCreditFormApi.d.ts +11 -0
  199. package/lib/components/CreditForm/useCreditFormApi.js +25 -0
  200. package/lib/components/CreditForm/useCreditFormApi.js.map +1 -0
  201. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  202. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  203. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  204. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.d.ts +6 -0
  205. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
  206. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  207. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  208. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
  209. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  210. package/lib/ui-kit/DatePicker/DatePicker.js +16 -5
  211. package/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
  212. package/lib/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  213. package/lib/ui-kit/DatePicker/DatePickerInput.js +64 -0
  214. package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
  215. package/lib/ui-kit/DatePicker/getYears.d.ts +1 -0
  216. package/lib/ui-kit/DatePicker/getYears.js +1 -1
  217. package/lib/ui-kit/DatePicker/getYears.js.map +1 -1
  218. package/lib/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  219. package/lib/ui-kit/DatePicker/useDatePickerManager.js +29 -3
  220. package/lib/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
  221. package/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
  222. package/lib/ui-kit/DialogManager/openDocument.js +8 -0
  223. package/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
  224. package/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
  225. package/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  226. package/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  227. package/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  228. package/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  229. package/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  230. package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  231. package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  232. package/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  233. package/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  234. package/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  235. package/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  236. package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  237. package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  238. package/lib/ui-kit/FormField/Fields/InnField.js +2 -2
  239. package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  240. package/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  241. package/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  242. package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  243. package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  244. package/lib/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  245. package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +7 -0
  246. package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
  247. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  248. package/lib/ui-kit/FormField/SelectField.js +1 -1
  249. package/lib/ui-kit/FormField/SelectField.js.map +1 -1
  250. package/lib/ui-kit/FormField/getField.js +2 -0
  251. package/lib/ui-kit/FormField/getField.js.map +1 -1
  252. package/lib/ui-kit/FormField/getObjectValidator.js +7 -6
  253. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  254. package/lib/ui-kit/FormField/validators.d.ts +1 -0
  255. package/lib/ui-kit/FormField/validators.js +1 -0
  256. package/lib/ui-kit/FormField/validators.js.map +1 -1
  257. package/lib/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  258. package/lib/ui-kit/InfoCard/InfoCard.js +2 -1
  259. package/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
  260. package/lib/ui-kit/Input/InputNumberControl.d.ts +2 -0
  261. package/lib/ui-kit/Input/InputNumberControl.js +8 -0
  262. package/lib/ui-kit/Input/InputNumberControl.js.map +1 -0
  263. package/lib/ui-kit/Input/InputProps.d.ts +2 -1
  264. package/lib/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  265. package/lib/ui-kit/InputNumber/InputNumber.js +10 -0
  266. package/lib/ui-kit/InputNumber/InputNumber.js.map +1 -0
  267. package/lib/ui-kit/SnilsInput/SnilsInput.js +2 -2
  268. package/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
  269. package/lib/ui-kit/TimerCircle/TimerCircle.js +3 -2
  270. package/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  271. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  272. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  273. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  274. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  275. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  276. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  277. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  278. package/lib/utils/normalizeWithMask.d.ts +1 -0
  279. package/lib/utils/normalizeWithMask.js +17 -0
  280. package/lib/utils/normalizeWithMask.js.map +1 -0
  281. package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
  282. package/mobile/bundle/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  283. package/mobile/bundle/bundle.umd.js +462 -177
  284. package/mobile/bundle/bundle.umd.min.js +1 -1
  285. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  286. package/mobile/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  287. package/mobile/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  288. package/mobile/bundle/components/CreditForm/CreditForm.d.ts +2 -9
  289. package/mobile/bundle/components/CreditForm/CreditFormContent.d.ts +9 -1
  290. package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +17 -0
  291. package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  292. package/mobile/bundle/components/CreditForm/creditFormStepsData.d.ts +40 -2
  293. package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +62 -0
  294. package/mobile/bundle/components/CreditForm/renderInputs.d.ts +3 -0
  295. package/mobile/bundle/components/CreditForm/useCreditFormApi.d.ts +11 -0
  296. package/mobile/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  297. package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  298. package/mobile/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  299. package/mobile/bundle/ui-kit/DatePicker/getYears.d.ts +1 -0
  300. package/mobile/bundle/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  301. package/mobile/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
  302. package/mobile/bundle/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  303. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  304. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
  305. package/mobile/bundle/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  306. package/mobile/bundle/ui-kit/Input/InputNumberControl.d.ts +2 -0
  307. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +2 -1
  308. package/mobile/bundle/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  309. package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  310. package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  311. package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  312. package/mobile/bundle/utils/normalizeWithMask.d.ts +1 -0
  313. package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
  314. package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
  315. package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  316. package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  317. package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
  318. package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
  319. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  320. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  321. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  322. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  323. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  324. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  325. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  326. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  327. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js +25 -0
  328. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
  329. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  330. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
  331. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
  332. package/mobile/dist/components/CreditForm/CreditForm.d.ts +2 -9
  333. package/mobile/dist/components/CreditForm/CreditForm.js +11 -19
  334. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  335. package/mobile/dist/components/CreditForm/CreditFormContent.d.ts +9 -1
  336. package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +17 -0
  337. package/mobile/dist/components/CreditForm/CreditFormStep.js +33 -0
  338. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -0
  339. package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  340. package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -12
  341. package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  342. package/mobile/dist/components/CreditForm/creditFormStepsData.d.ts +40 -2
  343. package/mobile/dist/components/CreditForm/creditFormStepsData.js +31 -26
  344. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  345. package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +62 -0
  346. package/mobile/dist/components/CreditForm/getInitialFormState.js +77 -0
  347. package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -0
  348. package/mobile/dist/components/CreditForm/renderInputs.d.ts +3 -0
  349. package/mobile/dist/components/CreditForm/renderInputs.js +8 -0
  350. package/mobile/dist/components/CreditForm/renderInputs.js.map +1 -0
  351. package/mobile/dist/components/CreditForm/useCreditFormApi.d.ts +11 -0
  352. package/mobile/dist/components/CreditForm/useCreditFormApi.js +28 -0
  353. package/mobile/dist/components/CreditForm/useCreditFormApi.js.map +1 -0
  354. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  355. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  356. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  357. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
  358. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  359. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  360. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
  361. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  362. package/mobile/dist/ui-kit/DatePicker/DatePicker.js +16 -5
  363. package/mobile/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
  364. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  365. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +66 -0
  366. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
  367. package/mobile/dist/ui-kit/DatePicker/getYears.d.ts +1 -0
  368. package/mobile/dist/ui-kit/DatePicker/getYears.js +3 -3
  369. package/mobile/dist/ui-kit/DatePicker/getYears.js.map +1 -1
  370. package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  371. package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.js +29 -3
  372. package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
  373. package/mobile/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
  374. package/mobile/dist/ui-kit/DialogManager/openDocument.js +11 -0
  375. package/mobile/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
  376. package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
  377. package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  378. package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  379. package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  380. package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  381. package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  382. package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  383. package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  384. package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  385. package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  386. package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  387. package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  388. package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  389. package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  390. package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -2
  391. package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  392. package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  393. package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  394. package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  395. package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  396. package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  397. package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -0
  398. package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
  399. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  400. package/mobile/dist/ui-kit/FormField/SelectField.js +1 -1
  401. package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
  402. package/mobile/dist/ui-kit/FormField/getField.js +2 -0
  403. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  404. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +6 -5
  405. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  406. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
  407. package/mobile/dist/ui-kit/FormField/validators.js +3 -1
  408. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  409. package/mobile/dist/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  410. package/mobile/dist/ui-kit/InfoCard/InfoCard.js +2 -1
  411. package/mobile/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
  412. package/mobile/dist/ui-kit/Input/InputNumberControl.d.ts +2 -0
  413. package/mobile/dist/ui-kit/Input/InputNumberControl.js +10 -0
  414. package/mobile/dist/ui-kit/Input/InputNumberControl.js.map +1 -0
  415. package/mobile/dist/ui-kit/Input/InputProps.d.ts +2 -1
  416. package/mobile/dist/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  417. package/mobile/dist/ui-kit/InputNumber/InputNumber.js +12 -0
  418. package/mobile/dist/ui-kit/InputNumber/InputNumber.js.map +1 -0
  419. package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js +2 -2
  420. package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
  421. package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js +3 -2
  422. package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  423. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  424. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  425. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  426. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  427. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  428. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  429. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  430. package/mobile/dist/utils/normalizeWithMask.d.ts +1 -0
  431. package/mobile/dist/utils/normalizeWithMask.js +20 -0
  432. package/mobile/dist/utils/normalizeWithMask.js.map +1 -0
  433. package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
  434. package/mobile/lib/api/RetailAPI/updateUserProfile.js +1 -1
  435. package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  436. package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
  437. package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
  438. package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
  439. package/mobile/lib/common.css +1 -1
  440. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  441. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  442. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  443. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  444. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  445. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  446. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  447. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
  448. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js +23 -0
  449. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
  450. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
  451. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
  452. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
  453. package/mobile/lib/components/CreditForm/CreditForm.d.ts +2 -9
  454. package/mobile/lib/components/CreditForm/CreditForm.js +12 -20
  455. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  456. package/mobile/lib/components/CreditForm/CreditFormContent.d.ts +9 -1
  457. package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +17 -0
  458. package/mobile/lib/components/CreditForm/CreditFormStep.js +31 -0
  459. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -0
  460. package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
  461. package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -12
  462. package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  463. package/mobile/lib/components/CreditForm/creditFormStepsData.d.ts +40 -2
  464. package/mobile/lib/components/CreditForm/creditFormStepsData.js +31 -26
  465. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  466. package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +62 -0
  467. package/mobile/lib/components/CreditForm/getInitialFormState.js +74 -0
  468. package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -0
  469. package/mobile/lib/components/CreditForm/renderInputs.d.ts +3 -0
  470. package/mobile/lib/components/CreditForm/renderInputs.js +5 -0
  471. package/mobile/lib/components/CreditForm/renderInputs.js.map +1 -0
  472. package/mobile/lib/components/CreditForm/useCreditFormApi.d.ts +11 -0
  473. package/mobile/lib/components/CreditForm/useCreditFormApi.js +25 -0
  474. package/mobile/lib/components/CreditForm/useCreditFormApi.js.map +1 -0
  475. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  476. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  477. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  478. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
  479. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  480. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  481. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
  482. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  483. package/mobile/lib/ui-kit/DatePicker/DatePicker.js +16 -5
  484. package/mobile/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
  485. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
  486. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +64 -0
  487. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
  488. package/mobile/lib/ui-kit/DatePicker/getYears.d.ts +1 -0
  489. package/mobile/lib/ui-kit/DatePicker/getYears.js +1 -1
  490. package/mobile/lib/ui-kit/DatePicker/getYears.js.map +1 -1
  491. package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
  492. package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.js +29 -3
  493. package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
  494. package/mobile/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
  495. package/mobile/lib/ui-kit/DialogManager/openDocument.js +8 -0
  496. package/mobile/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
  497. package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
  498. package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  499. package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  500. package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  501. package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  502. package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  503. package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  504. package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  505. package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  506. package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  507. package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  508. package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  509. package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  510. package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  511. package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -2
  512. package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  513. package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  514. package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  515. package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  516. package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  517. package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
  518. package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +7 -0
  519. package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
  520. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  521. package/mobile/lib/ui-kit/FormField/SelectField.js +1 -1
  522. package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
  523. package/mobile/lib/ui-kit/FormField/getField.js +2 -0
  524. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  525. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +7 -6
  526. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  527. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
  528. package/mobile/lib/ui-kit/FormField/validators.js +1 -0
  529. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  530. package/mobile/lib/ui-kit/InfoCard/InfoCard.d.ts +3 -2
  531. package/mobile/lib/ui-kit/InfoCard/InfoCard.js +2 -1
  532. package/mobile/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
  533. package/mobile/lib/ui-kit/Input/InputNumberControl.d.ts +2 -0
  534. package/mobile/lib/ui-kit/Input/InputNumberControl.js +8 -0
  535. package/mobile/lib/ui-kit/Input/InputNumberControl.js.map +1 -0
  536. package/mobile/lib/ui-kit/Input/InputProps.d.ts +2 -1
  537. package/mobile/lib/ui-kit/InputNumber/InputNumber.d.ts +2 -0
  538. package/mobile/lib/ui-kit/InputNumber/InputNumber.js +10 -0
  539. package/mobile/lib/ui-kit/InputNumber/InputNumber.js.map +1 -0
  540. package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js +2 -2
  541. package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
  542. package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js +3 -2
  543. package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  544. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  545. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  546. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  547. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  548. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  549. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  550. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  551. package/mobile/lib/utils/normalizeWithMask.d.ts +1 -0
  552. package/mobile/lib/utils/normalizeWithMask.js +17 -0
  553. package/mobile/lib/utils/normalizeWithMask.js.map +1 -0
  554. package/mobile/src/api/RetailAPI/updateUserProfile.ts +3 -1
  555. package/mobile/src/api/RetailAPI/utils/getUpdateUserTask.ts +49 -35
  556. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  557. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +4 -1
  558. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
  559. package/mobile/src/components/ApplicationStatus/ApplicationStatus.example.json +6 -0
  560. package/mobile/src/components/ApplicationStatus/ApplicationStatus.tsx +108 -0
  561. package/mobile/src/components/ApplicationStatus/ApplicationStatus.ui.json +1 -0
  562. package/mobile/src/components/ApplicationStatus/ApplicationStatusContent.ts +19 -0
  563. package/mobile/src/components/CreditForm/CreditForm.tsx +36 -56
  564. package/mobile/src/components/CreditForm/CreditFormContent.ts +13 -1
  565. package/mobile/src/components/CreditForm/CreditFormStep.tsx +65 -0
  566. package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +19 -38
  567. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +31 -26
  568. package/mobile/src/components/CreditForm/getInitialFormState.tsx +145 -0
  569. package/mobile/src/components/CreditForm/renderInputs.tsx +6 -0
  570. package/mobile/src/components/CreditForm/useCreditFormApi.tsx +36 -0
  571. package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
  572. package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
  573. package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
  574. package/mobile/src/ui-kit/DatePicker/DatePicker.tsx +34 -13
  575. package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +100 -0
  576. package/mobile/src/ui-kit/DatePicker/getYears.ts +1 -1
  577. package/mobile/src/ui-kit/DatePicker/useDatePickerManager.ts +51 -3
  578. package/mobile/src/ui-kit/DialogManager/openDocument.tsx +13 -0
  579. package/mobile/src/ui-kit/FormField/Fields/DependentsField.tsx +3 -3
  580. package/mobile/src/ui-kit/FormField/Fields/DulNumberField.tsx +3 -3
  581. package/mobile/src/ui-kit/FormField/Fields/DulSerieField.tsx +3 -3
  582. package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +3 -3
  583. package/mobile/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +3 -2
  584. package/mobile/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +3 -3
  585. package/mobile/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +3 -2
  586. package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +3 -3
  587. package/mobile/src/ui-kit/FormField/Fields/JobsNumberField.tsx +5 -5
  588. package/mobile/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +3 -2
  589. package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +15 -0
  590. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  591. package/mobile/src/ui-kit/FormField/SelectField.tsx +3 -1
  592. package/mobile/src/ui-kit/FormField/getField.tsx +2 -0
  593. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +7 -7
  594. package/mobile/src/ui-kit/FormField/validators.ts +5 -0
  595. package/mobile/src/ui-kit/InfoCard/InfoCard.tsx +9 -3
  596. package/mobile/src/ui-kit/Input/InputNumberControl.tsx +18 -0
  597. package/mobile/src/ui-kit/Input/InputProps.ts +2 -1
  598. package/mobile/src/ui-kit/InputNumber/InputNumber.tsx +24 -0
  599. package/mobile/src/ui-kit/SnilsInput/SnilsInput.tsx +2 -2
  600. package/mobile/src/ui-kit/TimerCircle/TimerCircle.tsx +9 -4
  601. package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
  602. package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
  603. package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
  604. package/mobile/src/utils/normalizeWithMask.ts +23 -0
  605. package/package.json +2 -2
  606. package/src/api/RetailAPI/updateUserProfile.ts +3 -1
  607. package/src/api/RetailAPI/utils/getUpdateUserTask.ts +49 -35
  608. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  609. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +4 -1
  610. package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
  611. package/src/components/ApplicationStatus/ApplicationStatus.example.json +6 -0
  612. package/src/components/ApplicationStatus/ApplicationStatus.fixture.tsx +129 -0
  613. package/src/components/ApplicationStatus/ApplicationStatus.tsx +108 -0
  614. package/src/components/ApplicationStatus/ApplicationStatus.ui.json +1 -0
  615. package/src/components/ApplicationStatus/ApplicationStatusContent.ts +19 -0
  616. package/src/components/Blocks.ts +2 -0
  617. package/src/components/CreditForm/CreditForm.fixture.tsx +27 -1
  618. package/src/components/CreditForm/CreditForm.tsx +36 -56
  619. package/src/components/CreditForm/CreditFormContent.ts +13 -1
  620. package/src/components/CreditForm/CreditFormStep.tsx +65 -0
  621. package/src/components/CreditForm/StepsNavigationButtons.tsx +19 -38
  622. package/src/components/CreditForm/creditFormStepsData.tsx +31 -26
  623. package/src/components/CreditForm/getInitialFormState.tsx +145 -0
  624. package/src/components/CreditForm/renderInputs.tsx +6 -0
  625. package/src/components/CreditForm/useCreditFormApi.tsx +36 -0
  626. package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
  627. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.tsx +7 -0
  628. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
  629. package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
  630. package/src/ui-kit/DatePicker/DatePicker.tsx +34 -13
  631. package/src/ui-kit/DatePicker/DatePickerInput.tsx +100 -0
  632. package/src/ui-kit/DatePicker/getYears.ts +1 -1
  633. package/src/ui-kit/DatePicker/useDatePickerManager.ts +51 -3
  634. package/src/ui-kit/DialogManager/openDocument.tsx +13 -0
  635. package/src/ui-kit/FormField/Fields/DependentsField.tsx +3 -3
  636. package/src/ui-kit/FormField/Fields/DulNumberField.tsx +3 -3
  637. package/src/ui-kit/FormField/Fields/DulSerieField.tsx +3 -3
  638. package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +3 -3
  639. package/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +3 -2
  640. package/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +3 -3
  641. package/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +3 -2
  642. package/src/ui-kit/FormField/Fields/InnField.tsx +3 -3
  643. package/src/ui-kit/FormField/Fields/JobsNumberField.tsx +5 -5
  644. package/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +3 -2
  645. package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +15 -0
  646. package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  647. package/src/ui-kit/FormField/SelectField.tsx +3 -1
  648. package/src/ui-kit/FormField/getField.tsx +2 -0
  649. package/src/ui-kit/FormField/getObjectValidator.tsx +7 -7
  650. package/src/ui-kit/FormField/validators.ts +5 -0
  651. package/src/ui-kit/InfoCard/InfoCard.tsx +9 -3
  652. package/src/ui-kit/Input/InputNumberControl.tsx +18 -0
  653. package/src/ui-kit/Input/InputProps.ts +2 -1
  654. package/src/ui-kit/InputNumber/InputNumber.tsx +24 -0
  655. package/src/ui-kit/SnilsInput/SnilsInput.tsx +2 -2
  656. package/src/ui-kit/TimerCircle/TimerCircle.tsx +9 -4
  657. package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
  658. package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
  659. package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
  660. package/src/utils/normalizeWithMask.ts +23 -0
  661. package/bundle/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  662. package/dist/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  663. package/dist/ui-kit/SnilsInput/normalizeSnils.js +0 -23
  664. package/dist/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
  665. package/lib/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  666. package/lib/ui-kit/SnilsInput/normalizeSnils.js +0 -20
  667. package/lib/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
  668. package/mobile/bundle/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  669. package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  670. package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.js +0 -23
  671. package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
  672. package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
  673. package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.js +0 -20
  674. package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
  675. package/mobile/src/ui-kit/SnilsInput/normalizeSnils.ts +0 -29
  676. package/src/ui-kit/SnilsInput/normalizeSnils.ts +0 -29
@@ -1418,6 +1418,7 @@
1418
1418
  const ERROR_MESSAGE = 'Некорректно заполненное поле';
1419
1419
  const defaultValidator = (errorMsg) => required(errorMsg ? errorMsg : ERROR_MESSAGE);
1420
1420
  const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
1421
+ const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ? errorMsg : ERROR_MESSAGE);
1421
1422
  const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1)(errorMsg ? errorMsg : ERROR_MESSAGE);
1422
1423
  const lengthStringValidator = (maxLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= maxLength)(errorMsg ? errorMsg : ERROR_MESSAGE);
1423
1424
  const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
@@ -1475,10 +1476,10 @@
1475
1476
  inn: innValidator('Укажите ИНН'),
1476
1477
  legalForm: defaultValidator('Укажите ОПФ'),
1477
1478
  organizationName: defaultValidator('Укажите наименование организации'),
1478
- generalSeniority: defaultValidator(),
1479
- lastJobExperience: defaultValidator('Укажите стаж на последнем месте работы'),
1480
- experience5Years: defaultValidator('Укажите общий стаж за последние 5 лет'),
1481
- jobsNumber: defaultValidator('Укажите количество лет стажа'),
1479
+ generalSeniority: jobNumberValidator('Укажите количество лет стажа'),
1480
+ lastJobExperience: jobNumberValidator('Укажите стаж на последнем месте работы'),
1481
+ experience5Years: jobNumberValidator('Укажите общий стаж за последние 5 лет'),
1482
+ jobsNumber: jobNumberValidator('Укажите количество мест работы за последние 5 лет'),
1482
1483
  beginDate: defaultValidator('Укажите дату заключения трудового договора'),
1483
1484
  fullAddress: defaultValidator(),
1484
1485
  partnerComments: defaultValidator(),
@@ -1520,9 +1521,10 @@
1520
1521
  shareholderFlg: defaultValidator(),
1521
1522
  legalEntityName: defaultValidator(),
1522
1523
  bankEmployeeCode: defaultValidator(),
1524
+ partInBusiness: defaultValidator(),
1523
1525
  };
1524
1526
  const getObjectValidator = (inputs) => {
1525
- const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
1527
+ const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
1526
1528
  return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
1527
1529
  };
1528
1530
 
@@ -1740,7 +1742,7 @@
1740
1742
  const leadDescription = (source && source?.map((_) => _.description)) || [];
1741
1743
  return (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430", label: label, options: arrayToOptions$1(leadDescription), ...getValidation(field(fieldName), validatorObj[fieldName], input?.required) }));
1742
1744
  });
1743
- const arrayToOptions$1 = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
1745
+ const arrayToOptions$1 = (array) => (array ?? []).map((_) => ({ key: _, text: _ }));
1744
1746
 
1745
1747
  const AmountWorkersField = JSX(({ field, input }) => {
1746
1748
  const { data: amountWorkers } = useLeadFormData('EMPLOYEES_NUMBER');
@@ -1863,6 +1865,83 @@
1863
1865
  }) })] }));
1864
1866
  });
1865
1867
 
1868
+ function normalizeWithMask(value, pattern) {
1869
+ const valueNumbers = value.replace(/\D/g, '');
1870
+ if (valueNumbers === '' || value?.length === pattern.length) {
1871
+ return value;
1872
+ }
1873
+ const patternInArr = [...pattern];
1874
+ const firstPlaceholderIndex = patternInArr.findIndex(isPlaceholder$1);
1875
+ const valueWildcardIndicies = patternInArr.map((_, i) => isWildcard$1(_) ? patternInArr.slice(0, i).filter(isWildcard$1).length : -1);
1876
+ const applyPlaceholder = (_, i) => isDigit$1(_) ? _ : valueNumbers.charAt(valueWildcardIndicies[i]) || _;
1877
+ const resultInArr = patternInArr.map(applyPlaceholder);
1878
+ const resultLength = valueWildcardIndicies.indexOf(valueNumbers.length - 1) + 1;
1879
+ return resultInArr.slice(0, Math.max(firstPlaceholderIndex, resultLength)).join('');
1880
+ }
1881
+ const isPlaceholder$1 = (_) => _ === '_';
1882
+ const isDigit$1 = (_) => /\d/.test(_);
1883
+ const isWildcard$1 = (_) => isPlaceholder$1(_) || isDigit$1(_);
1884
+
1885
+ const START_YEAR = 1940;
1886
+ const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
1887
+
1888
+ const ICON_PROPS$1 = {
1889
+ name: 'CalendarIcon',
1890
+ iconVersion: 'black',
1891
+ width: '24',
1892
+ height: '24',
1893
+ };
1894
+ const DatePickerInput = JSX(({ setSelectedMonth, setSelectedYear, className, value, onChange, onClick }) => {
1895
+ const ref = useRef(null);
1896
+ const [inputValue, setInputValue] = useState(value || '');
1897
+ const handleChange = (ev) => {
1898
+ const val = ev.target?.value;
1899
+ if (typeof val === 'string' && val?.length < 11) {
1900
+ setInputValue(normalizeWithMask(val, '__.__.____'));
1901
+ }
1902
+ };
1903
+ const onBlur = () => {
1904
+ if (checkIsValidDate(inputValue)) {
1905
+ const [day, month, year] = inputValue.split('.');
1906
+ onChange?.(new Date(Number(year), Number(month) - 1, Number(day)));
1907
+ setSelectedMonth(Number(month) - 1);
1908
+ setSelectedYear(Number(year));
1909
+ }
1910
+ else {
1911
+ setInputValue(value || '');
1912
+ }
1913
+ };
1914
+ const onInputClick = () => {
1915
+ if (ref.current !== null) {
1916
+ ref.current.focus();
1917
+ }
1918
+ onClick?.();
1919
+ };
1920
+ useEffect(() => {
1921
+ setInputValue(value || '');
1922
+ }, [value]);
1923
+ return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur }), jsx(Icon, { className: "mr-s", ...ICON_PROPS$1 })] }));
1924
+ });
1925
+ const isValidYear = (year) => Number(year) >= START_YEAR && Number(year) <= new Date().getFullYear();
1926
+ const isValidMonth = (month) => Number(month) > 0 && Number(month) < 13;
1927
+ const checkIsValidDate = (date) => {
1928
+ const [day, month, year] = date.split('.');
1929
+ if (isValidYear(year)) {
1930
+ if (isValidMonth(month)) {
1931
+ const currentDate = new Date(Number(year), Number(month) - 1, 1);
1932
+ let maxDateOfMonth = 0;
1933
+ while (currentDate.getMonth() === Number(month) - 1) {
1934
+ currentDate.setDate(currentDate.getDate() + 1);
1935
+ maxDateOfMonth++;
1936
+ }
1937
+ if (Number(day) > 0 && Number(day) <= maxDateOfMonth) {
1938
+ return true;
1939
+ }
1940
+ }
1941
+ }
1942
+ return false;
1943
+ };
1944
+
1866
1945
  const months = [
1867
1946
  'Январь',
1868
1947
  'Февраль',
@@ -1878,15 +1957,12 @@
1878
1957
  'Декабрь',
1879
1958
  ];
1880
1959
 
1881
- const START_YEAR = 1940;
1882
- const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
1883
-
1884
1960
  const MONTHS_COUNT = 11;
1885
1961
  const MONTHS_OPTIONS = months.map((key) => ({ key }));
1886
1962
  const YEARS_OPTIONS = getYears()
1887
1963
  .reverse()
1888
1964
  .map((key) => ({ key: String(key) }));
1889
- const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
1965
+ const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, onChange, value, }) => {
1890
1966
  const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
1891
1967
  const ref = useOutsideClick(close);
1892
1968
  const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
@@ -1908,8 +1984,21 @@
1908
1984
  onYearSelect(selectedYear - 1);
1909
1985
  }
1910
1986
  }, [selectedMonth]);
1911
- const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
1912
- const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
1987
+ const handleSelectMonth = useCallback(({ key }) => {
1988
+ onMonthSelect(months.indexOf(key));
1989
+ const maxDateOfMonth = calculateMaxDaysOfMonth(selectedYear, months.indexOf(key));
1990
+ handleChangeMonth({
1991
+ maxDateOfMonth,
1992
+ selectedYear,
1993
+ selectedMonth: months.indexOf(key),
1994
+ value,
1995
+ onChange,
1996
+ });
1997
+ }, [value]);
1998
+ const handleSelectYear = useCallback(({ key }) => {
1999
+ onYearSelect(Number(key));
2000
+ value && onChange?.(new Date(Number(key), selectedMonth, value?.getDate()));
2001
+ }, [value]);
1913
2002
  return {
1914
2003
  handleChangeVisibleCalendar,
1915
2004
  handleNextMonth,
@@ -1921,6 +2010,19 @@
1921
2010
  ref,
1922
2011
  };
1923
2012
  };
2013
+ const calculateMaxDaysOfMonth = (selectedYear, selectedMonth) => {
2014
+ const date = new Date(selectedYear, selectedMonth, 1);
2015
+ let maxDateOfMonth = 0;
2016
+ while (date.getMonth() === selectedMonth) {
2017
+ maxDateOfMonth++;
2018
+ date.setDate(date.getDate() + 1);
2019
+ }
2020
+ return maxDateOfMonth;
2021
+ };
2022
+ const handleChangeMonth = ({ maxDateOfMonth, selectedYear, selectedMonth, value, onChange, }) => {
2023
+ value &&
2024
+ onChange?.(new Date(selectedYear, selectedMonth, Math.min(maxDateOfMonth, value.getDate())));
2025
+ };
1924
2026
 
1925
2027
  const ICON_PROPS = {
1926
2028
  name: 'ArrowUpIcon',
@@ -1933,9 +2035,11 @@
1933
2035
  iconVersion: 'black',
1934
2036
  isBorder: false,
1935
2037
  };
1936
- const formStyle = 'flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer ' +
2038
+ const formStyle = 'flex justify-between items-center h-14 py-s border rounded-md cursor-pointer ' +
1937
2039
  'hover:border-black active:border-black focus:border-black';
1938
- const DatePicker = JSX(({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
2040
+ const DatePicker = JSX(
2041
+ // eslint-disable-next-line max-lines-per-function
2042
+ ({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
1939
2043
  const [showCalendar, { setValue }] = useBool(false);
1940
2044
  const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
1941
2045
  const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
@@ -1946,13 +2050,22 @@
1946
2050
  selectedYear,
1947
2051
  selectedMonth,
1948
2052
  showCalendar,
2053
+ onChange,
2054
+ value,
1949
2055
  });
1950
2056
  const spaceAbove = useElementSpace(ref, 370);
1951
- return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm(handleChangeVisibleCalendar, value, valid), showCalendar ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
2057
+ return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm({
2058
+ handleChangeVisibleCalendar,
2059
+ value,
2060
+ valid,
2061
+ onChange,
2062
+ setSelectedMonth,
2063
+ setSelectedYear,
2064
+ }), showCalendar ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
1952
2065
  'bottom-full': spaceAbove,
1953
2066
  }), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, onDateSelect: onChange, min: minDate, max: maxDate, setValue: setValue })] })) : null] })] }));
1954
2067
  });
1955
- const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
2068
+ const renderDatePickerForm = ({ handleChangeVisibleCalendar, value, valid, onChange, setSelectedMonth, setSelectedYear, }) => (jsx(DatePickerInput, { onChange: onChange, onClick: handleChangeVisibleCalendar, value: value && formatDate(value), setSelectedMonth: setSelectedMonth, setSelectedYear: setSelectedYear, className: style(formStyle, valid ? 'border-gray' : 'border-error') }));
1956
2069
 
1957
2070
  const DatePickerControl = JSX(({ className, label, error, errors, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
1958
2071
 
@@ -1999,17 +2112,6 @@
1999
2112
  },
2000
2113
  };
2001
2114
 
2002
- const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
2003
-
2004
- const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2005
- const { close } = useDialogManager();
2006
- const handleClose = useCallback(() => {
2007
- close();
2008
- onClose && onClose();
2009
- }, [onClose]);
2010
- return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2011
- });
2012
-
2013
2115
  async function doRequest(url, method, body) {
2014
2116
  const response = await fetch(`${API_BASE_URI}${url}`, {
2015
2117
  method,
@@ -2039,16 +2141,28 @@
2039
2141
  return URL.createObjectURL(response);
2040
2142
  };
2041
2143
 
2042
- const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2043
- const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2044
- const { open } = useDialogManager();
2045
- return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => handleOpenDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
2144
+ const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
2145
+
2146
+ const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2147
+ const { close } = useDialogManager();
2148
+ const handleClose = useCallback(() => {
2149
+ close();
2150
+ onClose && onClose();
2151
+ }, [onClose]);
2152
+ return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2046
2153
  });
2047
- const handleOpenDocument = async (id, open) => {
2154
+
2155
+ const openDocument = async (id, open) => {
2048
2156
  const document = await getDocument(id);
2049
2157
  open(jsx(Dialog, { className: "my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0", children: jsx("iframe", { src: `${document}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" }) }));
2050
2158
  };
2051
2159
 
2160
+ const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2161
+ const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2162
+ const { open } = useDialogManager();
2163
+ return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => openDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
2164
+ });
2165
+
2052
2166
  const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
2053
2167
 
2054
2168
  const LABEL_TEXT =
@@ -2059,7 +2173,15 @@
2059
2173
  return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
2060
2174
  });
2061
2175
 
2062
- const DependentsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", type: "number", ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
2176
+ const InputNumber = JSX(({ children, onChange, inputLength, ...inputProps }) => {
2177
+ const handleChange = useCallback((v) => onChange && inputLength && v.length <= inputLength && onChange(normalizeInput(v)), [onChange]);
2178
+ return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), children: children }));
2179
+ });
2180
+ const normalizeInput = (value) => value.replace(/\D/g, '');
2181
+
2182
+ const InputNumberControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(InputNumber, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
2183
+
2184
+ const DependentsField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
2063
2185
 
2064
2186
  const DesiredMeetingDateField = JSX(({ field, input }) => (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, input?.required) })));
2065
2187
 
@@ -2075,15 +2197,15 @@
2075
2197
  return (jsx(InputControl, { label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field('dulIssuedBy'), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
2076
2198
  });
2077
2199
 
2078
- const DulNumberField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", type: "number", ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
2200
+ const DulNumberField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", inputLength: 6, ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
2079
2201
 
2080
- const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", type: "number", ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
2202
+ const DulSerieField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", inputLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
2081
2203
 
2082
2204
  const DulSubdivisionCodeField = JSX(({ field, input }) => {
2083
2205
  const onDaDataChange = useCallback((item) => {
2084
2206
  field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
2085
2207
  }, []);
2086
- return (jsx(InputControl, { label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", type: "number", ...input, ...getValidation(field('dulSubdivisionCode'), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
2208
+ return (jsx(InputNumberControl, { label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", ...input, inputLength: 6, ...getValidation(field('dulSubdivisionCode'), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
2087
2209
  });
2088
2210
 
2089
2211
  const EducationField = JSX(({ field, input }) => {
@@ -2113,9 +2235,9 @@
2113
2235
 
2114
2236
  const ExpensesField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0440\u0430\u0441\u0445\u043E\u0434\u044B \u0432 \u043C\u0435\u0441\u044F\u0446", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", type: "number", ...getValidation(field('expenses'), validatorObj.expenses, input?.required), ...input })));
2115
2237
 
2116
- const Experience5YearsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", ...getValidation(field('experience5Years'), validatorObj.experience5Years, input?.required), ...input })));
2238
+ const Experience5YearsField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('experience5Years'), validatorObj.experience5Years, input?.required), ...input })));
2117
2239
 
2118
- const FamilyMembersField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0447\u043B\u0435\u043D\u043E\u0432 \u0441\u0435\u043C\u044C\u0438", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", type: "number", ...getValidation(field('familyMembers'), validatorObj.familyMembers, input?.required), ...input })));
2240
+ const FamilyMembersField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0447\u043B\u0435\u043D\u043E\u0432 \u0441\u0435\u043C\u044C\u0438", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", inputLength: 2, ...getValidation(field('familyMembers'), validatorObj.familyMembers, input?.required), ...input })));
2119
2241
 
2120
2242
  const FamilyStatusField = JSX(({ field, input }) => {
2121
2243
  const { data: familyStatus } = useLeadFormData('MARITAL_STATUS');
@@ -2141,7 +2263,7 @@
2141
2263
 
2142
2264
  const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, input?.required), ...input })));
2143
2265
 
2144
- const GeneralSeniorityField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...getValidation(field('generalSeniority'), validatorObj.generalSeniority, input?.required), ...input })));
2266
+ const GeneralSeniorityField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", inputLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...getValidation(field('generalSeniority'), validatorObj.generalSeniority, input?.required), ...input })));
2145
2267
 
2146
2268
  const HousingField = JSX(({ field, input }) => {
2147
2269
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -2153,14 +2275,14 @@
2153
2275
  field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
2154
2276
  field?.('legalForm')?.onChange?.(item.data?.opf?.short);
2155
2277
  }, []);
2156
- return (jsx(InputControl, { label: "\u0418\u041D\u041D", type: "number", ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
2278
+ return (jsx(InputNumberControl, { label: "\u0418\u041D\u041D", inputLength: 12, ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
2157
2279
  });
2158
2280
 
2159
2281
  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"' })));
2160
2282
 
2161
- const JobsNumberField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", ...getValidation(field('jobsNumber'), validatorObj.jobsNumber, input?.required), ...input })));
2283
+ const JobsNumberField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", inputLength: 2, ...getValidation(field('jobsNumber'), validatorObj.jobsNumber, input?.required), ...input })));
2162
2284
 
2163
- const LastJobExperienceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...getValidation(field('lastJobExperience'), validatorObj.lastJobExperience, input?.required), ...input })));
2285
+ const LastJobExperienceField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('lastJobExperience'), validatorObj.lastJobExperience, input?.required), ...input })));
2164
2286
 
2165
2287
  const LegalEntityNameField = JSX(({ field, input }) => {
2166
2288
  return (jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430", ...input, ...getValidation(field('legalEntityName'), validatorObj.legalEntityName, input?.required) }));
@@ -2221,23 +2343,25 @@
2221
2343
 
2222
2344
  const ParticipantDateRegistrationField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E \u043C\u0435\u0441\u0442\u0443 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430", ...getValidation(field('participantDateRegistration'), validatorObj.participantDateRegistration, input?.required) })));
2223
2345
 
2346
+ const PartInBusinessField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", inputLength: 2, ...getValidation(field('partInBusiness'), validatorObj.partInBusiness, input?.required), ...input })));
2347
+
2224
2348
  const PartnerCommentsField = JSX(({ field, input }) => {
2225
2349
  const { required, ...rest } = input;
2226
2350
  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 }));
2227
2351
  });
2228
2352
 
2229
- const isPlaceholder$1 = (_) => _ === '_';
2230
- const isDigit$1 = (_) => /\d/.test(_);
2231
- const isWildcard$1 = (_) => isPlaceholder$1(_) || isDigit$1(_);
2353
+ const isPlaceholder = (_) => _ === '_';
2354
+ const isDigit = (_) => /\d/.test(_);
2355
+ const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
2232
2356
  const phonePattern = [...'+7 (___) ___-__-__'];
2233
- const firstPlaceholderIndex$1 = phonePattern.findIndex(isPlaceholder$1);
2234
- const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard$1(_) ? phonePattern.slice(0, i).filter(isWildcard$1).length : -1);
2357
+ const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
2358
+ const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
2235
2359
  function normalizePhone(phone) {
2236
2360
  const phoneNumbers = phone.replace(/\D/g, '');
2237
- const applyPlaceholder = (_, i) => isDigit$1(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
2361
+ const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
2238
2362
  const result = phonePattern.map(applyPlaceholder);
2239
2363
  const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
2240
- return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex$1, resultLength)) : result).join('');
2364
+ return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
2241
2365
  }
2242
2366
 
2243
2367
  const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
@@ -2311,28 +2435,8 @@
2311
2435
 
2312
2436
  const ShareholderFlgField = JSX(({ field }) => (jsx(CheckboxWithError, { text: "\u042F \u044F\u0432\u043B\u044F\u044E\u0441\u044C \u0430\u043A\u0446\u0438\u043E\u043D\u0435\u0440\u043E\u043C / \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u043E\u043C / \u0447\u043B\u0435\u043D\u043E\u043C / \u043F\u0430\u0439\u0449\u0438\u043A\u043E\u043C / \u0432\u043A\u043B\u0430\u0434\u0447\u0438\u043A\u043E\u043C \u0441 \u0434\u043E\u043B\u0435\u0439 \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0431\u043E\u043B\u0435\u0435 20% \u0443\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E \u043A\u0430\u043F\u0438\u0442\u0430\u043B\u0430 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430", ...getValidation(field('shareholderFlg'), validatorObj.shareholderFlg) })));
2313
2437
 
2314
- const isPlaceholder = (_) => _ === '_';
2315
- const isDigit = (_) => /\d/.test(_);
2316
- const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
2317
- const snilsPattern = [...'___-___-___ __'];
2318
- const firstPlaceholderIndex = snilsPattern.findIndex(isPlaceholder);
2319
- const snilsWildcardIndicies = snilsPattern.map((_, i) => isWildcard(_) ? snilsPattern.slice(0, i).filter(isWildcard).length : -1);
2320
- function normalizeSnils(snils) {
2321
- const snilsNumbers = snils.replace(/\D/g, '');
2322
- const applyPlaceholder = (_, i) => isDigit(_) ? _ : snilsNumbers.charAt(snilsWildcardIndicies[i]) || _;
2323
- const result = snilsPattern.map(applyPlaceholder);
2324
- const resultLength = snilsWildcardIndicies.indexOf(snilsNumbers.length - 1) + 1;
2325
- const isCursorStart = snilsNumbers.length === 0;
2326
- if (!isCursorStart) {
2327
- return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
2328
- }
2329
- else {
2330
- return '';
2331
- }
2332
- }
2333
-
2334
2438
  const SnilsInput = JSX(({ children, onChange, ...inputProps }) => {
2335
- const handleChange = useCallback((v) => onChange && onChange(normalizeSnils(v)), [onChange]);
2439
+ const handleChange = useCallback((v) => onChange && onChange(normalizeWithMask(v, '___-___-___ __')), [onChange]);
2336
2440
  const handleBlur = useCallback((v) => {
2337
2441
  if (v === '___-___-___ __') {
2338
2442
  onChange && onChange('');
@@ -2468,6 +2572,7 @@
2468
2572
  legalEntityName: jsx(LegalEntityNameField, { field: field, input: input }),
2469
2573
  creditInRshbCd: jsx(CreditInRshbCdField, { field: field, input: input }),
2470
2574
  bankEmployeeCode: jsx(BankEmpoleeCodeField, { field: field, input: input }),
2575
+ partInBusiness: jsx(PartInBusinessField, { field: field, input: input }),
2471
2576
  };
2472
2577
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(i))) : null;
2473
2578
  };
@@ -2593,7 +2698,7 @@
2593
2698
  consentToReceiveMaterials: false,
2594
2699
  consentDataProcessing: false,
2595
2700
  };
2596
- const getInitialFormState$1 = (inputs, typeForm = '') => {
2701
+ const getInitialFormState$2 = (inputs, typeForm = '') => {
2597
2702
  const formState = Object.fromEntries(inputs.map((_) => [
2598
2703
  _.name,
2599
2704
  (_.fieldType === 'ved' && _?.defaultValue) || initialFormState$1[_.name],
@@ -2618,7 +2723,7 @@
2618
2723
  // eslint-disable-next-line max-lines-per-function
2619
2724
  ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, ...rest }) => {
2620
2725
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
2621
- const initialFormState = getInitialFormState$1(inputs, typeForm);
2726
+ const initialFormState = getInitialFormState$2(inputs, typeForm);
2622
2727
  const [responseType, setResponseType] = useState('');
2623
2728
  const handleSubmit = useCallback(async (formData, ev) => {
2624
2729
  const inputsFiltered = getFilteredInputs(inputs, formData);
@@ -2725,7 +2830,7 @@
2725
2830
  });
2726
2831
  const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
2727
2832
 
2728
- const renderInputs = ({ field, typeForm = '', inputs }) => {
2833
+ const renderInputs$1 = ({ field, typeForm = '', inputs }) => {
2729
2834
  const { consentInputs, restInputs } = splitInputs(inputs || []);
2730
2835
  return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
2731
2836
  };
@@ -2734,6 +2839,7 @@
2734
2839
  restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name)) || [],
2735
2840
  });
2736
2841
 
2842
+ /* eslint-disable max-lines */
2737
2843
  const initialFormState = {
2738
2844
  typeForm: '',
2739
2845
  region: { key: '', text: '' },
@@ -2766,9 +2872,9 @@
2766
2872
  participantAddress: '',
2767
2873
  participantDateRegistration: undefined,
2768
2874
  };
2769
- const getInitialFormState = (inputs, savedForm, typeForm = '') => {
2875
+ const getInitialFormState$1 = (inputs, savedForm, typeForm = '') => {
2770
2876
  if (savedForm) {
2771
- const formState = JSON.parse(savedForm);
2877
+ const formState = typeof savedForm === 'string' ? JSON.parse(savedForm) : savedForm;
2772
2878
  formState.birthday = new Date(formState?.birthday || 0);
2773
2879
  return formState;
2774
2880
  }
@@ -2785,7 +2891,7 @@
2785
2891
 
2786
2892
  const createUserProfile = (body) => doRequest('/public-data/createUserProfile', 'POST', body);
2787
2893
 
2788
- const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'POST', body);
2894
+ const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
2789
2895
 
2790
2896
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
2791
2897
 
@@ -2811,44 +2917,47 @@
2811
2917
  };
2812
2918
  };
2813
2919
 
2814
- const getUpdateUserTaskData = ({ participantId, taskId, profileId, formData, }) => ({
2815
- sendToBank: true,
2816
- taskKind: 'SHORT',
2817
- task: {
2818
- taskSource: globalThis.location.origin,
2819
- id: taskId,
2820
- participants: [
2821
- {
2822
- birthDate: formData?.birthDate,
2823
- id: participantId,
2824
- midname: formData?.midname,
2825
- name: formData?.name,
2826
- surname: formData?.surname,
2827
- profile: {
2828
- id: profileId,
2829
- },
2830
- participantContacts: [
2831
- {
2832
- contactTypeCd: {
2833
- key: 'EMAIL',
2834
- },
2835
- value: formData?.email,
2920
+ const getUpdateUserTaskData = ({ participantId, taskId, profileId, formData, }) => {
2921
+ const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', } = formData;
2922
+ return {
2923
+ sendToBank: true,
2924
+ taskKind: 'SHORT',
2925
+ task: {
2926
+ taskSource: globalThis.location.origin,
2927
+ id: taskId,
2928
+ participants: [
2929
+ {
2930
+ birthDate: formatDate(birthday, true),
2931
+ id: participantId,
2932
+ midname: middleName,
2933
+ name: name,
2934
+ surname: surname,
2935
+ profile: {
2936
+ id: profileId,
2836
2937
  },
2837
- {
2838
- contactTypeCd: {
2839
- key: 'MAIN_PHONE',
2938
+ participantContacts: [
2939
+ {
2940
+ contactTypeCd: {
2941
+ key: 'EMAIL',
2942
+ },
2943
+ value: email,
2944
+ },
2945
+ {
2946
+ contactTypeCd: {
2947
+ key: 'MAIN_PHONE',
2948
+ },
2949
+ value: formatPhone(phone),
2840
2950
  },
2841
- value: formData?.phone,
2951
+ ],
2952
+ roleCd: {
2953
+ key: 'BORROWER',
2954
+ value: 'Заемщик',
2842
2955
  },
2843
- ],
2844
- roleCd: {
2845
- key: 'BORROWER',
2846
- value: 'Заемщик',
2847
2956
  },
2848
- },
2849
- ],
2850
- },
2851
- });
2957
+ ],
2958
+ },
2959
+ };
2960
+ };
2852
2961
 
2853
2962
  const ICON_SIZE$1 = { width: '103', height: '21' };
2854
2963
 
@@ -3036,7 +3145,7 @@
3036
3145
  smsCodesSetName: { key: 'AUTHENTICATION' },
3037
3146
  });
3038
3147
  resetError();
3039
- close && close();
3148
+ close && close(values.join(''));
3040
3149
  }
3041
3150
  catch {
3042
3151
  setIsLoading(false);
@@ -3087,19 +3196,92 @@
3087
3196
  const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
3088
3197
  const renderText$2 = (timeNextReq, setTimeNextReq, sendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-primary-main", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "text-primary-main ml-1", time: timeNextReq, setTime: setTimeNextReq })] })) : (jsx(LinkButton, { onClick: sendCode, className: "text-primary-main", children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }));
3089
3198
 
3090
- const useVerifyPhoneDialog = (props) => {
3199
+ const useVerifyPhoneDialog = () => {
3091
3200
  const { open, close } = useDialogManager();
3092
3201
  return {
3093
- open: (options = {}) => open(jsx(VerifyPhoneDialog, { onClose: close, ...props }), options),
3202
+ open: (handleClose, props) => open(jsx(VerifyPhoneDialog, { onClose: close, close: handleClose, ...props })),
3094
3203
  close,
3095
3204
  };
3096
3205
  };
3097
3206
 
3207
+ const defaultConsentText = {
3208
+ title: 'Подпишите согласие на запрос в БКИ',
3209
+ description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
3210
+ };
3211
+ const refuseConsentText = {
3212
+ title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
3213
+ description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
3214
+ };
3215
+ const ConsentBkiDialog = JSX(function ({ handleSubmit = noop, onClose = noop, }) {
3216
+ const [confirmStatus, setConfirmStatus] = useState('');
3217
+ const [showRefuceContent, setShowRefuceContent] = useState(false);
3218
+ const { open, close } = useDialogManager();
3219
+ const handleClose = useCallback(() => {
3220
+ close();
3221
+ handleSubmit(confirmStatus);
3222
+ }, [confirmStatus]);
3223
+ const handleConfirmChange = useCallback((value) => {
3224
+ setConfirmStatus(value);
3225
+ if (value === 'REFUSE') {
3226
+ setShowRefuceContent(true);
3227
+ }
3228
+ }, []);
3229
+ const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
3230
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(CONSENT_BKI_ID, open), children: jsx(Heading, { className: "text-center text-balance", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
3231
+ });
3232
+ const ITEMS$1 = [
3233
+ { id: 'SIGNED', text: 'Подписать' },
3234
+ { id: 'REFUSE', text: 'Отказаться' },
3235
+ ];
3236
+ const CONSENT_BKI_ID = 2;
3237
+
3238
+ const useConsentBkiDialog = () => {
3239
+ const { open, closeAll } = useDialogManager();
3240
+ const verifyPhoneDialog = useVerifyPhoneDialog();
3241
+ const redirectToCreditForm = () => {
3242
+ globalThis.location.href = '/credit-lead';
3243
+ };
3244
+ const handleSuccessVerify = (profileId) => async (smsCode) => {
3245
+ if (profileId) {
3246
+ await updateUserProfile({
3247
+ profile: {
3248
+ id: profileId,
3249
+ consentBkiFlg: true,
3250
+ smsConsentBki: smsCode,
3251
+ },
3252
+ });
3253
+ }
3254
+ redirectToCreditForm();
3255
+ };
3256
+ const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
3257
+ await closeAll();
3258
+ if (confirmStatus === 'SIGNED' && phone) {
3259
+ verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent$1(phone));
3260
+ }
3261
+ else {
3262
+ redirectToCreditForm();
3263
+ }
3264
+ };
3265
+ return {
3266
+ open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose: redirectToCreditForm })),
3267
+ };
3268
+ };
3269
+ const verifyPhoneContent$1 = (phone) => ({
3270
+ title: 'Подтвердите номер телефона',
3271
+ description: `Мы отправили код на ${phone}`,
3272
+ phoneNumber: formatPhone(phone),
3273
+ textButton: 'Отправить',
3274
+ __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
3275
+ <ul><li>согласие на запрос информации в БКИ</li></ul>`,
3276
+ });
3277
+
3098
3278
  const useApplicationLeadApi = ({ inputs, programId, saveForm }) => {
3099
3279
  const [responseStatus, setResponseStatus] = useState('');
3100
3280
  const [, setTaskId] = useLocalStorage('taskId');
3101
3281
  const [, setProfileId] = useLocalStorage('profileId');
3102
3282
  const [, setParticipantId] = useLocalStorage('participantId');
3283
+ const consentBkiDialog = useConsentBkiDialog();
3284
+ const verifyPhoneDialog = useVerifyPhoneDialog();
3103
3285
  const saveUserData = useCallback((participantId, taskId, profileId) => {
3104
3286
  setParticipantId(participantId);
3105
3287
  setTaskId(taskId);
@@ -3133,21 +3315,19 @@
3133
3315
  }));
3134
3316
  saveUserData(participantId, taskId, profileId);
3135
3317
  saveForm(JSON.stringify(formData));
3136
- globalThis.location.href = '/credit-lead';
3137
3318
  }
3138
3319
  catch {
3139
3320
  setResponseStatus('Fail');
3140
3321
  }
3141
3322
  };
3323
+ const handleCloseVerify = async () => {
3324
+ await handleSuccessVerify();
3325
+ consentBkiDialog.open(formData.phone, profileId);
3326
+ };
3142
3327
  const acceptedConsents = Object.keys(CONSENTS)
3143
3328
  .filter((_) => formData[_])
3144
3329
  .map((_) => CONSENTS[_]?.text);
3145
- // eslint-disable-next-line react-hooks/rules-of-hooks
3146
- const verifyPhoneDialog = useVerifyPhoneDialog({
3147
- close: handleSuccessVerify,
3148
- ...verifyPhoneContent(formData?.phone, acceptedConsents),
3149
- });
3150
- verifyPhoneDialog.open();
3330
+ verifyPhoneDialog.open(handleCloseVerify, verifyPhoneContent(formData?.phone, acceptedConsents));
3151
3331
  }
3152
3332
  }
3153
3333
  catch {
@@ -3189,7 +3369,7 @@
3189
3369
  const [responseType, setResponseType] = useState('');
3190
3370
  useInitApplicationLead();
3191
3371
  const [leadForm, setLeadForm] = useLocalStorage('leadForm');
3192
- const initialFormState = getInitialFormState(inputs, leadForm, typeForm);
3372
+ const initialFormState = getInitialFormState$1(inputs, leadForm, typeForm);
3193
3373
  const { handleSubmit, responseStatus } = useApplicationLeadApi({
3194
3374
  inputs,
3195
3375
  programId,
@@ -3206,7 +3386,7 @@
3206
3386
  reset();
3207
3387
  }
3208
3388
  }, [responseType]);
3209
- return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs({ field, typeForm, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
3389
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
3210
3390
  });
3211
3391
 
3212
3392
  const NotFound = JSX(({ title, description }) => {
@@ -4829,8 +5009,6 @@
4829
5009
  }
4830
5010
  }, type: "button", ...(isUnfolded ? getAspectsAttributes(data) : {}), children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
4831
5011
 
4832
- const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black' }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsx(RichText, { __html: __html })] })));
4833
-
4834
5012
  const ProgressBar = JSX(({ step = 10, description, showPercentage = true }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? jsxs("div", { className: "absolute left-2/4 text-green", children: [step, "%"] }) : null, description ? jsx("div", { className: "text-right mr-4 text-gray", children: description }) : null] })] })));
4835
5013
 
4836
5014
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
@@ -4838,8 +5016,127 @@
4838
5016
  return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold", children: ["\u0428\u0430\u0433 ", step, " \u0438\u0437 ", totalSteps, "."] }), ' ', stepsTitles[step - 1] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
4839
5017
  });
4840
5018
 
5019
+ const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
5020
+
5021
+ const formStateMap = {
5022
+ 1: {
5023
+ surname: '',
5024
+ name: '',
5025
+ middleName: '',
5026
+ sex: '',
5027
+ birthday: undefined,
5028
+ birthPlace: '',
5029
+ phone: '',
5030
+ email: '',
5031
+ dulSerie: undefined,
5032
+ dulNumber: undefined,
5033
+ dulIssueDateField: undefined,
5034
+ dulSubdivisionCode: '',
5035
+ dulIssuedBy: '',
5036
+ participantAddress: '',
5037
+ participantDateRegistration: undefined,
5038
+ fullAddress: '',
5039
+ housing: '',
5040
+ },
5041
+ 2: {
5042
+ employment: { key: '', text: '' },
5043
+ organizationName: '',
5044
+ inn: undefined,
5045
+ legalForm: '',
5046
+ organization: { key: '', text: '' },
5047
+ amountWorkers: { key: '', text: '' },
5048
+ employerActivities: { key: '', text: '' },
5049
+ employerOrganization: { key: '', text: '' },
5050
+ lastJobExperience: '',
5051
+ experience5Years: '',
5052
+ jobsNumber: '',
5053
+ phone: '',
5054
+ beginDate: undefined,
5055
+ positionOrganization: { key: '', text: '' },
5056
+ partInBusiness: undefined,
5057
+ fullAddress: '',
5058
+ },
5059
+ 3: {
5060
+ familyStatus: { key: '', text: '' },
5061
+ dependents: undefined,
5062
+ familyMembers: undefined,
5063
+ mandatoryIncome: undefined,
5064
+ otherPayments: undefined,
5065
+ snils: '',
5066
+ armyIdFlg: false,
5067
+ },
5068
+ 4: {
5069
+ disablePeopleFlg: '',
5070
+ bankruptcyFlg: '',
5071
+ shareholderFlg: '',
5072
+ legalEntityName: '',
5073
+ creditInRshbCd: '',
5074
+ },
5075
+ 5: {
5076
+ region: '',
5077
+ addressBranch: '',
5078
+ bankEmployeeCode: '',
5079
+ },
5080
+ };
5081
+ const getInitialFormState = (step, localStorageData) => {
5082
+ if (localStorageData) {
5083
+ // TODO: Fill in for other fields with type Date
5084
+ // TODO: Take it out to the helper
5085
+ localStorageData.birthday = localStorageData.dulIssueDateField = new Date(localStorageData?.birthday || Date.now());
5086
+ localStorageData.participantDateRegistration = new Date(localStorageData?.participantDateRegistration || Date.now());
5087
+ localStorageData.beginDate = new Date(localStorageData?.beginDate || Date.now());
5088
+ }
5089
+ return {
5090
+ ...formStateMap[step],
5091
+ ...localStorageData,
5092
+ };
5093
+ };
5094
+
5095
+ const renderInputs = ({ field, inputs }) => {
5096
+ return (inputs || [])?.map(getField(field, ''));
5097
+ };
5098
+
5099
+ const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
5100
+ return (jsxs("div", { className: 'flex justify-between', children: [jsx(Button, { onClick: onPrevStep, className: style('w-full @xl:w-auto'), type: "button", version: "secondary", disabled: step === 1, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", children: "\u0414\u0430\u043B\u0435\u0435" })] }));
5101
+ });
5102
+
5103
+ const useCreditFormApi = ({ inputs, onNextStep, saveStep }) => {
5104
+ const handleSubmit = useCallback(async (formData) => {
5105
+ const feedbackValidator = objectValidator(getObjectValidator(inputs));
5106
+ if (!isValidationSuccess(feedbackValidator(formData))) {
5107
+ return 'Fail';
5108
+ }
5109
+ saveStep(formData);
5110
+ onNextStep();
5111
+ return 'OK';
5112
+ }, []);
5113
+ return {
5114
+ handleSubmit,
5115
+ };
5116
+ };
5117
+
5118
+ const CreditFormStep = JSX(({ totalSteps, step, sections, onPrevStep, onNextStep, inputs }) => {
5119
+ const [localStorageData, saveStep] = useLocalStorage('leadForm');
5120
+ const initialState = getInitialFormState(step, localStorageData);
5121
+ const { handleSubmit } = useCreditFormApi({
5122
+ inputs,
5123
+ onNextStep: onNextStep,
5124
+ saveStep,
5125
+ });
5126
+ const [, { field, onSubmit }] = useForm(initialState, { onSubmit: handleSubmit });
5127
+ return (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep({ sections, field }), jsx(StepsNavigationButtons, { step: step, totalSteps: totalSteps, onPrevStep: onPrevStep })] }));
5128
+ });
5129
+ const renderStep = ({ sections, field }) => {
5130
+ return sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderInfo$1(_?.inputs), renderTitle(_?.title), renderInputs({ field, inputs: _?.inputs })] }, `section-${i}`)));
5131
+ };
5132
+ const renderInfo$1 = (inputs = []) => {
5133
+ const infoInputs = inputs.filter((_) => _.fieldType === 'info');
5134
+ return infoInputs.length ? infoInputs.map(({ text }) => jsx(InfoCard, { __html: text })) : null;
5135
+ };
5136
+
4841
5137
  /* eslint-disable max-lines */
4842
5138
  /* eslint-disable max-len */
5139
+ //TODO: DO List
4843
5140
  const stepsSectionsMap = {
4844
5141
  1: [
4845
5142
  {
@@ -4872,24 +5169,27 @@
4872
5169
  {
4873
5170
  fieldType: 'common',
4874
5171
  name: 'education',
4875
- required: true,
4876
5172
  },
4877
5173
  ],
4878
5174
  },
4879
5175
  {
4880
5176
  title: 'Адрес регистрации по месту жительства',
5177
+ columns: 1,
5178
+ inputs: [],
5179
+ },
5180
+ {
5181
+ inputs: [{ fieldType: 'common', name: 'participantAddress', required: true, dadata: true }],
5182
+ },
5183
+ {
4881
5184
  columns: 2,
4882
- inputs: [
4883
- { fieldType: 'common', name: 'participantAddress', required: true },
4884
- { fieldType: 'common', name: 'participantAddress', required: true, dadata: true },
4885
- ],
5185
+ inputs: [{ fieldType: 'common', name: 'participantDateRegistration', required: true }],
4886
5186
  },
4887
5187
  {
4888
5188
  title: 'Адрес фактического проживания (место пребывания РФ)',
4889
5189
  columns: 2,
4890
5190
  inputs: [
4891
5191
  { fieldType: 'common', name: 'fullAddress', required: true, dadata: true },
4892
- { fieldType: 'common', name: 'housing', required: true },
5192
+ { fieldType: 'common', name: 'housing' },
4893
5193
  ],
4894
5194
  },
4895
5195
  ],
@@ -4908,7 +5208,7 @@
4908
5208
  },
4909
5209
  {
4910
5210
  inputs: [
4911
- { fieldType: 'common', name: 'employment', required: true },
5211
+ { fieldType: 'common', name: 'employment' },
4912
5212
  { fieldType: 'common', name: 'organizationName', required: true, dadata: true },
4913
5213
  ],
4914
5214
  },
@@ -4921,15 +5221,15 @@
4921
5221
  },
4922
5222
  {
4923
5223
  inputs: [
4924
- { fieldType: 'common', name: 'organization', required: true },
4925
- { fieldType: 'common', name: 'amountWorkers', required: true },
5224
+ { fieldType: 'common', name: 'organization', required: false },
5225
+ { fieldType: 'common', name: 'amountWorkers', required: false },
4926
5226
  ],
4927
5227
  },
4928
5228
  {
4929
5229
  columns: 2,
4930
5230
  inputs: [
4931
- { fieldType: 'common', name: 'employerActivities', required: true },
4932
- { fieldType: 'common', name: 'employerOrganization', required: true },
5231
+ { fieldType: 'common', name: 'employerActivities', required: false },
5232
+ { fieldType: 'common', name: 'employerOrganization', required: false },
4933
5233
  { fieldType: 'common', name: 'generalSeniority', required: true },
4934
5234
  { fieldType: 'common', name: 'lastJobExperience', required: true },
4935
5235
  { fieldType: 'common', name: 'experience5Years', required: true },
@@ -4940,7 +5240,13 @@
4940
5240
  inputs: [
4941
5241
  { fieldType: 'common', name: 'phone', label: 'Телефон работодателя', required: true },
4942
5242
  { fieldType: 'common', name: 'beginDate', required: true },
4943
- { fieldType: 'common', name: 'positionOrganization', required: true },
5243
+ ],
5244
+ },
5245
+ {
5246
+ columns: 2,
5247
+ inputs: [
5248
+ { fieldType: 'common', name: 'positionOrganization', required: false },
5249
+ { fieldType: 'common', name: 'partInBusiness', required: true },
4944
5250
  ],
4945
5251
  },
4946
5252
  {
@@ -4957,20 +5263,15 @@
4957
5263
  },
4958
5264
  {
4959
5265
  columns: 1,
4960
- inputs: [{ fieldType: 'common', name: 'familyStatus' }],
5266
+ inputs: [{ fieldType: 'common', name: 'familyStatus', required: true }],
4961
5267
  },
4962
5268
  {
4963
5269
  columns: 1,
4964
- inputs: [{ fieldType: 'common', name: 'dependents' }],
5270
+ inputs: [{ fieldType: 'common', name: 'dependents', required: true }],
4965
5271
  },
4966
5272
  {
4967
- columns: 2,
4968
- inputs: [
4969
- { fieldType: 'common', name: 'familyMembers' },
4970
- { fieldType: 'common', name: 'familyMembers' },
4971
- { fieldType: 'common', name: 'retirementIncome' },
4972
- { fieldType: 'common', name: 'otherIncome' },
4973
- ],
5273
+ columns: 1,
5274
+ inputs: [{ fieldType: 'common', name: 'familyMembers', required: true }],
4974
5275
  },
4975
5276
  {
4976
5277
  title: 'Совокупный доход',
@@ -4985,15 +5286,15 @@
4985
5286
  },
4986
5287
  {
4987
5288
  columns: 1,
4988
- inputs: [{ fieldType: 'common', name: 'mandatoryIncome' }],
5289
+ inputs: [{ fieldType: 'common', name: 'mandatoryIncome', required: true }],
4989
5290
  },
4990
5291
  {
4991
5292
  columns: 1,
4992
- inputs: [{ fieldType: 'common', name: 'otherPayments' }],
5293
+ inputs: [{ fieldType: 'common', name: 'otherPayments', required: true }],
4993
5294
  },
4994
5295
  {
4995
5296
  columns: 1,
4996
- inputs: [{ fieldType: 'common', name: 'snils' }],
5297
+ inputs: [{ fieldType: 'common', name: 'snils', required: true }],
4997
5298
  },
4998
5299
  {
4999
5300
  columns: 2,
@@ -5029,10 +5330,10 @@
5029
5330
  inputs: [],
5030
5331
  },
5031
5332
  {
5032
- inputs: [{ fieldType: 'common', name: 'region' }],
5333
+ inputs: [{ fieldType: 'common', name: 'region', required: true }],
5033
5334
  },
5034
5335
  {
5035
- inputs: [{ fieldType: 'common', name: 'addressBranch' }],
5336
+ inputs: [{ fieldType: 'common', name: 'addressBranch', required: true }],
5036
5337
  },
5037
5338
  {
5038
5339
  title: 'Код представителя Банка',
@@ -5053,20 +5354,6 @@
5053
5354
  ],
5054
5355
  };
5055
5356
 
5056
- const StepsNavigationButtons = JSX(({ step, setStep, totalSteps }) => {
5057
- const handleNext = () => {
5058
- if (step < totalSteps) {
5059
- setStep(step + 1);
5060
- }
5061
- };
5062
- const handlePrev = () => {
5063
- if (step > 1) {
5064
- setStep(step - 1);
5065
- }
5066
- };
5067
- return (jsxs("div", { className: 'flex justify-between', children: [jsx(Button, { onClick: handlePrev, className: style('w-full @xl:w-auto'), type: "button", version: "secondary", disabled: step === 1, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { onClick: handleNext, className: style('w-full @xl:w-auto'), type: "button", disabled: step === totalSteps, children: "\u0414\u0430\u043B\u0435\u0435" })] }));
5068
- });
5069
-
5070
5357
  const STEPS_COUNT = 5;
5071
5358
  const STEPS_TITLES = [
5072
5359
  'Персональные данные',
@@ -5075,21 +5362,19 @@
5075
5362
  'Дополнительные сведения',
5076
5363
  'Отделение Банка',
5077
5364
  ];
5078
- const CreditForm = JSX(({ className, typeForm = '', sections = [], ...rest }) => {
5365
+ const CreditForm = JSX(({ className, ...rest }) => {
5079
5366
  const [step, setStep] = useState(1);
5367
+ const sections = useMemo(() => stepsSectionsMap[step], [step]);
5080
5368
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
5081
- const initialFormState = getInitialFormState(inputs, typeForm);
5082
- const handleSubmit = () => false;
5083
- const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
5084
- return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [jsx(CreditFormProgress, { stepsTitles: STEPS_TITLES, step: step, totalSteps: STEPS_COUNT }), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep({ sections: stepsSectionsMap[step], typeForm, field }), jsx(StepsNavigationButtons, { step: step, setStep: setStep, totalSteps: STEPS_COUNT })] }) })] }) }));
5369
+ const handleNextStep = useCallback(() => {
5370
+ setStep((_) => Math.min(_ + 1, STEPS_COUNT));
5371
+ }, []);
5372
+ const handlePrevStep = useCallback(() => {
5373
+ //TODO search hook - 1,
5374
+ setStep((_) => Math.max(_ - 1, 0));
5375
+ }, []);
5376
+ return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [jsx(CreditFormProgress, { stepsTitles: STEPS_TITLES, step: step, totalSteps: STEPS_COUNT }), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { inputs: inputs, totalSteps: STEPS_COUNT, step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep }, String(step)) })] }) }));
5085
5377
  });
5086
- const renderStep = ({ sections, field, typeForm }) => {
5087
- return sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderInfo$1(_?.inputs), renderTitle(_?.title), renderInputs({ field, typeForm, inputs: _?.inputs })] }, `section-${i}`)));
5088
- };
5089
- const renderInfo$1 = (inputs = []) => {
5090
- const infoInputs = inputs.filter((_) => _.fieldType === 'info');
5091
- return infoInputs.length ? infoInputs.map(({ text }) => jsx(InfoCard, { __html: text })) : null;
5092
- };
5093
5378
 
5094
5379
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
5095
5380
 
@@ -7516,7 +7801,7 @@
7516
7801
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7517
7802
  });
7518
7803
 
7519
- const packageVersion = "0.14.607";
7804
+ const packageVersion = "0.14.615";
7520
7805
 
7521
7806
  exports.Blocks = Blocks;
7522
7807
  exports.ContentPage = ContentPage;