@redneckz/wildless-cms-uni-blocks 0.14.823 → 0.14.824

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 (377) hide show
  1. package/bundle/bundle.umd.js +229 -198
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  4. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  5. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  6. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  7. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  8. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  9. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  10. package/bundle/retail/api/checkCode.d.ts +1 -0
  11. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  12. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  13. package/bundle/retail/api/uploadFile.d.ts +1 -1
  14. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  15. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  16. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  20. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  21. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  22. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  23. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  24. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  26. package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  27. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  29. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  30. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  32. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  35. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  36. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  37. package/dist/retail/api/checkCode.d.ts +1 -0
  38. package/dist/retail/api/checkCode.js +3 -2
  39. package/dist/retail/api/checkCode.js.map +1 -1
  40. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  41. package/dist/retail/api/esiaRequestProfile.js +10 -0
  42. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  43. package/dist/retail/api/updateUserTask.d.ts +1 -0
  44. package/dist/retail/api/updateUserTask.js.map +1 -1
  45. package/dist/retail/api/uploadFile.d.ts +1 -1
  46. package/dist/retail/api/uploadFile.js +2 -3
  47. package/dist/retail/api/uploadFile.js.map +1 -1
  48. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  49. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  50. package/dist/retail/components/Fields/BeginDateField.js +2 -1
  51. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  52. package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  53. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  54. package/dist/retail/components/Fields/DaDataInnField.js +2 -1
  55. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  56. package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  57. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  58. package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  59. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  60. package/dist/retail/components/Fields/JobsNumberField.js +2 -1
  61. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  62. package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  63. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  64. package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  65. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  66. package/dist/retail/components/Fields/WagesField.js +2 -1
  67. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  68. package/dist/retail/content.js +11 -5
  69. package/dist/retail/content.js.map +1 -1
  70. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  71. package/dist/retail/utils/mainFormStateMap.js +1 -0
  72. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  73. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  74. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  75. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  76. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  77. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  78. package/lib/common.css +1 -1
  79. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  80. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  81. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  82. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  83. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  84. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  85. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  91. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  94. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  97. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  100. package/lib/retail/api/checkCode.d.ts +1 -0
  101. package/lib/retail/api/checkCode.js +1 -1
  102. package/lib/retail/api/checkCode.js.map +1 -1
  103. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  104. package/lib/retail/api/esiaRequestProfile.js +7 -0
  105. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  106. package/lib/retail/api/updateUserTask.d.ts +1 -0
  107. package/lib/retail/api/updateUserTask.js.map +1 -1
  108. package/lib/retail/api/uploadFile.d.ts +1 -1
  109. package/lib/retail/api/uploadFile.js +2 -3
  110. package/lib/retail/api/uploadFile.js.map +1 -1
  111. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  113. package/lib/retail/components/Fields/BeginDateField.js +2 -1
  114. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  115. package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  116. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  117. package/lib/retail/components/Fields/DaDataInnField.js +2 -1
  118. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  119. package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  120. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  121. package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  122. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  123. package/lib/retail/components/Fields/JobsNumberField.js +2 -1
  124. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  125. package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  126. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  127. package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  128. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  129. package/lib/retail/components/Fields/WagesField.js +2 -1
  130. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  131. package/lib/retail/content.js +11 -5
  132. package/lib/retail/content.js.map +1 -1
  133. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  134. package/lib/retail/utils/mainFormStateMap.js +1 -0
  135. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  136. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  137. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  138. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  139. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  140. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  141. package/mobile/bundle/bundle.umd.js +229 -198
  142. package/mobile/bundle/bundle.umd.min.js +1 -1
  143. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  144. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  145. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  146. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  147. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  148. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  149. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  150. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  151. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  152. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  153. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  154. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  155. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  156. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  157. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  158. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  159. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  160. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  161. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  162. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  163. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  164. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  166. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  167. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  169. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  170. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  172. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  173. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  175. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  176. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  177. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  178. package/mobile/dist/retail/api/checkCode.js +3 -2
  179. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  180. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  181. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  182. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  183. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  184. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  185. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  186. package/mobile/dist/retail/api/uploadFile.js +2 -3
  187. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  188. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  189. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  190. package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
  191. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  192. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  193. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  194. package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
  195. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  196. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  197. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  198. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  199. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  200. package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
  201. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  202. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  203. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  205. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
  207. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  208. package/mobile/dist/retail/content.js +11 -5
  209. package/mobile/dist/retail/content.js.map +1 -1
  210. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  211. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  212. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  213. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  214. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  215. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  216. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  217. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  218. package/mobile/lib/common.css +1 -1
  219. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  220. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  221. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  222. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  223. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  224. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  225. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  226. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  227. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  228. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  229. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  230. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  232. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  233. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  235. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  236. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  238. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  239. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  240. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  241. package/mobile/lib/retail/api/checkCode.js +1 -1
  242. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  243. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  244. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  245. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  246. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  247. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  248. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  249. package/mobile/lib/retail/api/uploadFile.js +2 -3
  250. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  251. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  252. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  253. package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
  254. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  255. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  256. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  257. package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
  258. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  259. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  260. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  261. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  262. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  263. package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
  264. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  265. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  266. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  267. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  268. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  269. package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
  270. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  271. package/mobile/lib/retail/content.js +11 -5
  272. package/mobile/lib/retail/content.js.map +1 -1
  273. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  274. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  275. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  276. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  277. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  278. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  279. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  280. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  281. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  282. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  283. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  284. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  285. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  286. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  287. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  288. package/mobile/src/retail/api/checkCode.ts +1 -1
  289. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  290. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  291. package/mobile/src/retail/api/uploadFile.ts +2 -3
  292. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  293. package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
  294. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  295. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  296. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  297. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  298. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  299. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  300. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  301. package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
  302. package/mobile/src/retail/content.tsx +11 -5
  303. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  304. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  305. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  306. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  307. package/package.json +1 -1
  308. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  309. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  310. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  311. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  312. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  313. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  314. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  315. package/src/retail/api/checkCode.ts +1 -1
  316. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  317. package/src/retail/api/updateUserTask.ts +1 -0
  318. package/src/retail/api/uploadFile.ts +2 -3
  319. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  320. package/src/retail/components/Fields/BeginDateField.tsx +2 -0
  321. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  322. package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  323. package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  324. package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  325. package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  326. package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  327. package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  328. package/src/retail/components/Fields/WagesField.tsx +2 -0
  329. package/src/retail/content.tsx +11 -5
  330. package/src/retail/model/NameFieldDef.ts +1 -0
  331. package/src/retail/utils/mainFormStateMap.ts +1 -0
  332. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  333. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  334. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  335. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  336. package/dist/retail/api/updateProfileEsia.js +0 -6
  337. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  338. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  339. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  340. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  341. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  342. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  343. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  344. package/lib/retail/api/updateProfileEsia.js +0 -3
  345. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  346. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  347. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
  348. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  349. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  350. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  351. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  352. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  353. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  354. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  355. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  356. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  357. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  358. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  359. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  360. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  361. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  362. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  363. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  364. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  365. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  366. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  367. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  368. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  369. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  370. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  371. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  372. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  373. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  374. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  375. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  376. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  377. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -1,11 +1,9 @@
1
1
  import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
- import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
- import { locationNavigator } from '../../external/locationNavigator';
4
2
  import { useSetter } from '../../hooks/useSetter';
5
- import { updateProfileEsia } from '../../retail/api/updateProfileEsia';
3
+ import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
6
4
  import { type LeadFormState } from '../../retail/model/LeadFormState';
7
5
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
8
- import { safeJsonParse } from '../../utils/safeJsonParse';
6
+ import { EsiaStatuses } from './ApplicationLeadForm';
9
7
  import { type ProductType } from './ApplicationLeadFormContent';
10
8
  import { getInitialFormState } from './getInitialFormState';
11
9
  import { parseEsiaProfile } from './parseEsiaProfile';
@@ -15,76 +13,62 @@ type InitApplicationLeadProps = {
15
13
  inputs: FieldRetailDef[];
16
14
  nextStepLink: string;
17
15
  productType: ProductType;
18
- setEsiaError: () => void;
16
+ setEsiaStatus: (status: EsiaStatuses) => void;
17
+ esiaAuthSuccess: boolean;
19
18
  };
20
19
 
21
20
  export const useInitApplicationLead = ({
22
21
  inputs,
23
- nextStepLink,
24
22
  productType,
25
- setEsiaError,
26
- }: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
27
- const navigator = locationNavigator();
28
- const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
29
-
23
+ setEsiaStatus,
24
+ esiaAuthSuccess,
25
+ }: InitApplicationLeadProps): LeadFormState => {
30
26
  const leadFormStore = useLeadFormStore();
31
27
  const saveForm = useSetter(leadFormStore, 'leadForm');
32
28
 
33
29
  const initialFormState = useMemo(
34
- () => getInitialFormState(inputs, leadFormStore.leadForm),
30
+ () => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
35
31
  [inputs, leadFormStore.leadForm],
36
32
  );
37
33
 
38
- const updateEsiaProfile = useCallback(
39
- async (profileId: string, code: string, state: string) => {
40
- startLoading();
41
- try {
42
- const data = await updateProfileEsia({
43
- profileId,
44
- code,
45
- state,
46
- redirectUri: globalThis.location?.href,
47
- });
48
-
49
- if (data && leadFormStore?.taskId) {
50
- const parsedData = await parseEsiaProfile(
51
- data,
52
- leadFormStore.taskId.toString(),
53
- productType === 'debitCard',
54
- );
34
+ const requestEsiaProfile = useCallback(async (code: string, state: string) => {
35
+ setEsiaStatus(EsiaStatuses.Pending);
36
+ try {
37
+ const data = await esiaRequestProfile({
38
+ code,
39
+ state,
40
+ redirectUri: globalThis.location?.href,
41
+ authorize: true,
42
+ });
55
43
 
56
- saveForm((_) => ({
57
- ..._,
58
- ...parsedData,
59
- }));
60
- }
44
+ if (data) {
45
+ const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
61
46
 
62
- navigator.assign(nextStepLink);
63
- } catch {
64
- setEsiaError();
65
- } finally {
66
- endLoading();
47
+ saveForm((_) => ({
48
+ ..._,
49
+ ...parsedData,
50
+ }));
51
+ setEsiaStatus(EsiaStatuses.Success);
67
52
  }
68
- },
69
- [nextStepLink],
70
- );
53
+ } catch {
54
+ setEsiaStatus(EsiaStatuses.Error);
55
+ }
56
+ }, []);
71
57
 
72
58
  useEffect(() => {
73
59
  leadFormStore.productType = productType;
74
- const profileId: string = <string>(
75
- safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? '')
76
- );
60
+
77
61
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
78
62
  const code = params.get('code');
79
63
  const state = params.get('state');
80
64
 
81
- if (profileId && code && state) {
82
- updateEsiaProfile(profileId, code, state);
65
+ if (code && state) {
66
+ requestEsiaProfile(code, state);
83
67
  } else {
84
68
  sessionStorage.removeItem('accessToken');
85
69
  sessionStorage.removeItem('refreshToken');
86
70
  }
87
71
  }, []);
88
72
 
89
- return [initialFormState, { isLoading }];
73
+ return initialFormState;
90
74
  };
@@ -16,7 +16,7 @@ export type CheckCodeResponse = {
16
16
  export const checkCode = async (body: CheckCodeBody) =>
17
17
  fetchRetailJSON<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
18
18
 
19
- const saveToken = (data: CheckCodeResponse | null) => {
19
+ export const saveToken = (data: CheckCodeResponse | null) => {
20
20
  if (data) {
21
21
  globalThis.sessionStorage.setItem('accessToken', data.access_token);
22
22
  globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
@@ -1,13 +1,14 @@
1
+ import { saveToken, type CheckCodeResponse } from './checkCode';
1
2
  import { fetchRetailJSON } from './doRequest';
2
3
 
3
- export type UpdateProfileEsiaBody = {
4
+ export type EsiaRequestProfileBody = {
4
5
  code: string;
5
- profileId: string;
6
+ authorize: boolean;
6
7
  state: string;
7
8
  redirectUri: string;
8
9
  };
9
10
 
10
- export type UpdateProfileEsiaResponse = {
11
+ export type EsiaRequestProfileResponse = CheckCodeResponse & {
11
12
  profile: {
12
13
  id: number;
13
14
  esiaId: string;
@@ -75,8 +76,18 @@ export type UpdateProfileEsiaResponse = {
75
76
  workLengthLastJob: number;
76
77
  pdfFileWorkbook: string;
77
78
  pdfFilePayout: string;
79
+ pdfFileSigPayout: string;
80
+ pdfFileSigWorkbook: string;
81
+ xmlFilePayout: string;
82
+ xmlFileSigPayout: string;
83
+ xmlFileSigWorkbook: string;
84
+ xmlFileWorkbook: string;
78
85
  };
79
86
  };
80
87
 
81
- export const updateProfileEsia = (body: UpdateProfileEsiaBody) =>
82
- fetchRetailJSON<UpdateProfileEsiaResponse>('/esia/updateProfileEsia', 'POST', body);
88
+ export const esiaRequestProfile = (body: EsiaRequestProfileBody) =>
89
+ fetchRetailJSON<EsiaRequestProfileResponse>('/esia/requestProfile', 'POST', body).then((res) => {
90
+ saveToken(res);
91
+
92
+ return res;
93
+ });
@@ -52,6 +52,7 @@ export type Participant = {
52
52
  surname?: string;
53
53
  profile?: {
54
54
  id: number;
55
+ esiaAccountTypeCd?: Option;
55
56
  };
56
57
  armyIdFlg?: boolean;
57
58
  birthPlace?: string;
@@ -5,13 +5,12 @@ export type DocumentCategory = 'CONFIRMING_EMPLOYMENT_DOC' | 'CONFIRMING_INCOME_
5
5
 
6
6
  export const uploadFile = async (
7
7
  file: Blob,
8
- taskId: string,
9
8
  documentCategory: DocumentCategory,
9
+ isPDF = false,
10
10
  ): Promise<File> => {
11
11
  const fd = new FormData();
12
- fd.append('taskId', taskId);
13
12
  fd.append('documentCategory', documentCategory);
14
- fd.append('file', file, 'file.pdf');
13
+ fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
15
14
 
16
15
  const res = await globalThis
17
16
  ?.fetch?.(`/light-api-cash/v1/file`, {
@@ -68,6 +68,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
68
68
  payrollCardRshbFlg: isInsurance,
69
69
  consentInsuranceFlg: isSalaryClient,
70
70
  incomeCertificateCd,
71
+ profile,
71
72
  } = participant;
72
73
 
73
74
  return {
@@ -121,6 +122,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
121
122
  monthsValue,
122
123
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
123
124
  },
125
+ esiaAccountTypeCd: profile?.esiaAccountTypeCd,
124
126
  ...getParticipantIncomes(participantIncomes),
125
127
  ...getParticipantAddresses(participantAddresses),
126
128
  ...getParticipantContacts(participantContacts),
@@ -1,11 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { DatePickerControl } from '../../../ui-kit/DatePicker/DatePickerControl';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
4
5
 
5
6
  export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
6
7
  <DatePickerControl
7
8
  label="Дата начала работы на текущем месте"
8
9
  {...field(input?.name ?? '')}
9
10
  {...input}
11
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
10
12
  />
11
13
  ));
@@ -1,18 +1,29 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { InfoCard } from '../../../ui-kit/InfoCard/InfoCard';
3
4
  import { useLeadFormData } from '../../hooks/useLeadFormData';
5
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
4
6
  import { SelectField } from './SelectField';
5
7
 
6
8
  export const ConfirmationIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
7
9
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
10
+ const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
8
11
 
9
12
  return (
10
- <SelectField
11
- field={field}
12
- source={confirmationIncome}
13
- label="Способ подтверждения дохода"
14
- fieldName="confirmationIncome"
15
- input={input}
16
- />
13
+ <div>
14
+ {filledByEsia ? (
15
+ <div className="mb-6">
16
+ <InfoCard __html="Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги" />
17
+ </div>
18
+ ) : null}
19
+ <SelectField
20
+ field={field}
21
+ source={confirmationIncome}
22
+ label="Способ подтверждения дохода"
23
+ fieldName="confirmationIncome"
24
+ input={input}
25
+ disabled={filledByEsia}
26
+ />
27
+ </div>
17
28
  );
18
29
  });
@@ -4,6 +4,7 @@ import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProp
4
4
  import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
5
5
  import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
6
6
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
7
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
7
8
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
8
9
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
9
10
 
@@ -41,6 +42,7 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
41
42
  {...input}
42
43
  {...field(input?.name ?? '')}
43
44
  onDaDataChange={onDaDataChange}
45
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
44
46
  />
45
47
  );
46
48
  });
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
4
  import { clamp } from '../../../utils/clamp';
5
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
5
6
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
6
7
 
7
8
  const MAX_YEARS = 5;
@@ -22,6 +23,7 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
22
23
  {...field(input?.name ?? '')}
23
24
  {...input}
24
25
  onChange={onChange}
26
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
25
27
  />
26
28
  );
27
29
  });
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
10
11
  placeholder="Количество лет"
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
10
11
  maxLength={2}
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
10
11
  maxLength={2}
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -3,6 +3,7 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
4
  import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
5
5
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
6
7
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
7
8
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
8
9
 
@@ -19,6 +20,7 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
19
20
  label="Наименование организации"
20
21
  {...input}
21
22
  {...field(input?.name ?? '')}
23
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
22
24
  onDaDataChange={onDaDataChange}
23
25
  />
24
26
  );
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -9,5 +10,6 @@ export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
9
10
  isInteger={true}
10
11
  {...field(input?.name ?? '')}
11
12
  {...input}
13
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
12
14
  />
13
15
  ));
@@ -139,7 +139,7 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
139
139
  label: 'Телефон работодателя',
140
140
  required: true,
141
141
  },
142
- { name: 'beginDate', required: true },
142
+ { name: 'beginDate', required: true, filledByEsia: true },
143
143
  ],
144
144
  },
145
145
  {
@@ -181,16 +181,22 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: CreditCardSectionsProps[] = [
181
181
  title: 'Совокупный доход',
182
182
  },
183
183
  {
184
+ columns: 1,
184
185
  inputs: [
185
186
  {
186
- name: 'infoCard',
187
- label: 'Сумма основного и дополнительных доходов после вычета налога',
187
+ name: 'confirmationIncome',
188
+ required: true,
189
+ filledByEsia: true,
188
190
  },
189
191
  ],
190
192
  },
191
193
  {
192
- columns: 1,
193
- inputs: [{ name: 'confirmationIncome', required: true }],
194
+ inputs: [
195
+ {
196
+ name: 'infoCard',
197
+ label: 'Сумма основного и дополнительных доходов после вычета налога',
198
+ },
199
+ ],
194
200
  },
195
201
  {
196
202
  columns: 1,
@@ -86,6 +86,7 @@ type NameFieldRetailDef =
86
86
  | 'calculator'
87
87
  | 'infoCard'
88
88
  | 'deliveryTime'
89
+ | 'esiaAccountTypeCd'
89
90
  | 'comment';
90
91
 
91
92
  export type NameFieldDef =
@@ -56,6 +56,7 @@ export const mainFormStateMap: Partial<LeadFormState>[] = [
56
56
  mandatoryPayments: undefined,
57
57
  snils: '',
58
58
  armyIdFlg: false,
59
+ esiaAccountTypeCd: { key: '', text: '' },
59
60
  },
60
61
  {
61
62
  bankruptcyFlg: false,
@@ -1,9 +1,17 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { isEsiaAuthorize } from '../../../retail/utils/isEsiaAuthorize';
2
3
  import { InputPhoneControl } from '../../Input/InputPhoneControl';
3
4
  import { type CustomFieldProps } from '../CustomFieldProps';
4
5
 
5
6
  export const PhoneField = JSX<CustomFieldProps>(({ field, input }) => {
6
7
  const fieldName = input?.name || 'phone';
7
8
 
8
- return <InputPhoneControl label="Телефон" {...field(fieldName)} {...input} />;
9
+ return (
10
+ <InputPhoneControl
11
+ label="Телефон"
12
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input.name ?? '')}
13
+ {...field(fieldName)}
14
+ {...input}
15
+ />
16
+ );
9
17
  });
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
2
  import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
2
3
  import { type BaseFieldDef } from './BaseFieldDef';
3
4
 
@@ -11,5 +12,5 @@ export function shouldRenderField<F extends BaseFieldDef>({
11
12
  const { condition } = input;
12
13
  const { value } = field(condition?.name || '');
13
14
 
14
- return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
15
+ return !condition || condition?.values?.includes(value?.key ?? value);
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.823",
3
+ "version": "0.14.824",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,6 +1,6 @@
1
+ /* eslint-disable max-lines-per-function */
1
2
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
- import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
+ import { useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { useForm } from '../../hooks/useForm/useForm';
5
5
  import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
6
6
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
@@ -18,6 +18,7 @@ import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
18
18
  import { style } from '../../utils/style';
19
19
  import { getApplicationFormData } from './applicationFormData';
20
20
  import { type ApplicationLeadFormContent, type ProductType } from './ApplicationLeadFormContent';
21
+ import { EsiaLoginBanner } from './EsiaLoginBanner';
21
22
  import { renderInputs } from './renderInputs';
22
23
  import { renderSubmitButton } from './renderSubmitButton';
23
24
  import { useApplicationLeadApi } from './useApplicationLeadApi';
@@ -25,6 +26,12 @@ import { useInitApplicationLead } from './useInitApplicationLead';
25
26
 
26
27
  interface ApplicationLeadFormProps extends ApplicationLeadFormContent, UniBlockProps {}
27
28
 
29
+ export enum EsiaStatuses {
30
+ Success = 'SUCCESS',
31
+ Error = 'ERROR',
32
+ Pending = 'PENDING',
33
+ }
34
+
28
35
  export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
29
36
  ({
30
37
  className,
@@ -36,7 +43,8 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
36
43
  data,
37
44
  ...rest
38
45
  }) => {
39
- const [esiaError, { setTrue: setEsiaError }] = useBool(false);
46
+ const [esiaStatus, setEsiaStatus] = useState<EsiaStatuses>();
47
+ const leadForm = useRef<HTMLFormElement | null>(null);
40
48
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
41
49
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
42
50
 
@@ -46,21 +54,21 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
46
54
  [inputs, extendedValidatorObj],
47
55
  );
48
56
 
49
- const [initialFormState, { isLoading }] = useInitApplicationLead({
57
+ const initialFormState = useInitApplicationLead({
50
58
  inputs,
51
59
  nextStepLink,
52
60
  productType,
53
- setEsiaError,
61
+ setEsiaStatus,
62
+ esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
54
63
  });
55
64
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
56
65
  programId,
57
66
  nextStepLink,
58
67
  productType,
59
- esiaError,
60
68
  data,
61
69
  });
62
70
 
63
- const [, { field, onSubmit }] = useForm(initialFormState, {
71
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, {
64
72
  formValidator,
65
73
  onSubmit: handleSubmit,
66
74
  });
@@ -72,14 +80,27 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
72
80
  }
73
81
  }, [ok]);
74
82
 
83
+ useEffect(() => {
84
+ if (esiaStatus && leadForm?.current) {
85
+ leadForm.current.scrollIntoView({
86
+ block: 'start',
87
+ });
88
+ }
89
+
90
+ if (esiaStatus === EsiaStatuses.Success) {
91
+ reset();
92
+ }
93
+ }, [leadForm?.current, esiaStatus]);
94
+
75
95
  return (
76
96
  <ApplicationFormLayout
77
97
  className={style('container space-y-m', className)}
78
98
  title={title}
79
99
  {...rest}
80
100
  >
81
- <form onSubmit={onSubmit} className="space-y-m relative">
82
- {isLoading ? <Loader blur={false} /> : null}
101
+ {!esiaStatus ? <EsiaLoginBanner /> : null}
102
+ <form onSubmit={onSubmit} className="space-y-m relative" ref={leadForm}>
103
+ {esiaStatus === EsiaStatuses.Pending ? <Loader blur={false} /> : null}
83
104
  {applicationFormData.map((_, i) => (
84
105
  <div
85
106
  key={`section-${i}`}
@@ -90,7 +111,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
90
111
  </div>
91
112
  ))}
92
113
  {renderSubmitButton(button, isSending)}
93
- {esiaError ? (
114
+ {esiaStatus === EsiaStatuses.Error ? (
94
115
  <Text size="text-m" font="font-medium" color="text-error">
95
116
  Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля
96
117
  вручную.
@@ -0,0 +1,51 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { locationNavigator } from '../../external/locationNavigator';
4
+ import { getLink } from '../../retail/api/getLink';
5
+ import { Button } from '../../ui-kit/Button/Button';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+
8
+ export interface EsiaLoginBannerProps {
9
+ onClose?: () => void;
10
+ }
11
+
12
+ export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(() => {
13
+ const navigator = locationNavigator();
14
+
15
+ const handleAuth = useCallback(async () => {
16
+ const resp = await getLink({
17
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
18
+ });
19
+
20
+ if (resp?.link) {
21
+ navigator.assign(resp.link);
22
+ }
23
+ }, []);
24
+
25
+ return (
26
+ <div className="flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9">
27
+ <div className="flex flex-col justify-around w-full">
28
+ <p className="mb-4 text-xl @md:text-2xl @md:mb-6">Заполните данные через Госуслуги</p>
29
+ <ul className="list-disc list-inside mb-9">
30
+ <li>Вероятность одобрения выше</li>
31
+ <li>Без справок о доходах и трудоустройстве</li>
32
+ <li>С защитой Ваших данных</li>
33
+ </ul>
34
+ <Img
35
+ className="block mb-6 self-center @md:hidden"
36
+ image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
37
+ height="80"
38
+ width="80"
39
+ />
40
+ <Button type="button" onClick={handleAuth} className="w-full @md:w-fit">
41
+ Заполнить
42
+ </Button>
43
+ </div>
44
+ <Img
45
+ className="hidden @md:block"
46
+ image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
47
+ height="164"
48
+ />
49
+ </div>
50
+ );
51
+ });