@redneckz/wildless-cms-uni-blocks 0.14.917 → 0.14.919

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 (379) hide show
  1. package/bundle/bundle.umd.js +440 -367
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/api/getDictionaries.d.ts +2 -0
  4. package/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  5. package/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
  6. package/bundle/retail/model/LeadFormState.d.ts +1 -1
  7. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  8. package/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
  9. package/bundle/retail/validator/validators.d.ts +2 -0
  10. package/bundle/ui-kit/FormField/validators.d.ts +1 -0
  11. package/bundle/utils/isIFrame.d.ts +1 -0
  12. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  13. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  15. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  16. package/dist/components/ContentPage/ContentPage.js +5 -2
  17. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  18. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
  19. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  20. package/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  21. package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  22. package/dist/components/CreditCardForm/formStateMap.js +6 -0
  23. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  24. package/dist/components/CreditForm/CreditFormStep.js +2 -0
  25. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  26. package/dist/components/CreditForm/creditFormStepsData.js +14 -17
  27. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  28. package/dist/components/DebitForm/DebitFormStep.js +2 -0
  29. package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  30. package/dist/retail/adaptors/getPersonalInfoData.js +1 -9
  31. package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  32. package/dist/retail/api/getDictionaries.d.ts +2 -0
  33. package/dist/retail/api/getDictionaries.js +13 -0
  34. package/dist/retail/api/getDictionaries.js.map +1 -0
  35. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
  36. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  37. package/dist/retail/components/Fields/AmountWorkersField.js +0 -8
  38. package/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
  39. package/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  40. package/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  41. package/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  42. package/dist/retail/components/Fields/DaDataInnField.js +21 -8
  43. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  44. package/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
  45. package/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  46. package/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
  47. package/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  48. package/dist/retail/components/Fields/OrganizationField.js +0 -8
  49. package/dist/retail/components/Fields/OrganizationField.js.map +1 -1
  50. package/dist/retail/components/Fields/OrganizationNameField.js +12 -2
  51. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  52. package/dist/retail/content.js +4 -11
  53. package/dist/retail/content.js.map +1 -1
  54. package/dist/retail/hooks/useIFrameMode.d.ts +4 -0
  55. package/dist/retail/hooks/useIFrameMode.js +39 -0
  56. package/dist/retail/hooks/useIFrameMode.js.map +1 -0
  57. package/dist/retail/inputs.js +1 -1
  58. package/dist/retail/inputs.js.map +1 -1
  59. package/dist/retail/model/LeadFormState.d.ts +1 -1
  60. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  61. package/dist/retail/utils/getMainFormStateMap.js +1 -6
  62. package/dist/retail/utils/getMainFormStateMap.js.map +1 -1
  63. package/dist/retail/utils/getOrganizationParams.d.ts +6 -0
  64. package/dist/retail/utils/getOrganizationParams.js +7 -1
  65. package/dist/retail/utils/getOrganizationParams.js.map +1 -1
  66. package/dist/retail/utils/updateOrganizationFields.js +2 -0
  67. package/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  68. package/dist/retail/validator/getRetailFormValidator.js +2 -0
  69. package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  70. package/dist/retail/validator/validators.d.ts +2 -0
  71. package/dist/retail/validator/validators.js +6 -1
  72. package/dist/retail/validator/validators.js.map +1 -1
  73. package/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
  74. package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  75. package/dist/ui-kit/FormField/validators.d.ts +1 -0
  76. package/dist/ui-kit/FormField/validators.js +4 -3
  77. package/dist/ui-kit/FormField/validators.js.map +1 -1
  78. package/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
  79. package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  80. package/dist/utils/isIFrame.d.ts +1 -0
  81. package/dist/utils/isIFrame.js +5 -0
  82. package/dist/utils/isIFrame.js.map +1 -0
  83. package/lib/common.css +1 -1
  84. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  87. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  88. package/lib/components/ContentPage/ContentPage.js +5 -2
  89. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  90. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
  91. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  92. package/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  93. package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  94. package/lib/components/CreditCardForm/formStateMap.js +6 -0
  95. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  96. package/lib/components/CreditForm/CreditFormStep.js +2 -0
  97. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  98. package/lib/components/CreditForm/creditFormStepsData.js +14 -17
  99. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  100. package/lib/components/DebitForm/DebitFormStep.js +2 -0
  101. package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  102. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  103. package/lib/retail/adaptors/getPersonalInfoData.js +2 -10
  104. package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  105. package/lib/retail/api/getDictionaries.d.ts +2 -0
  106. package/lib/retail/api/getDictionaries.js +10 -0
  107. package/lib/retail/api/getDictionaries.js.map +1 -0
  108. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
  109. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  110. package/lib/retail/components/Fields/AmountWorkersField.js +0 -8
  111. package/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
  112. package/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  113. package/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  114. package/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  115. package/lib/retail/components/Fields/DaDataInnField.js +22 -9
  116. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  117. package/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
  118. package/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  119. package/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
  120. package/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  121. package/lib/retail/components/Fields/OrganizationField.js +0 -8
  122. package/lib/retail/components/Fields/OrganizationField.js.map +1 -1
  123. package/lib/retail/components/Fields/OrganizationNameField.js +13 -3
  124. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  125. package/lib/retail/content.js +4 -11
  126. package/lib/retail/content.js.map +1 -1
  127. package/lib/retail/hooks/useIFrameMode.d.ts +4 -0
  128. package/lib/retail/hooks/useIFrameMode.js +36 -0
  129. package/lib/retail/hooks/useIFrameMode.js.map +1 -0
  130. package/lib/retail/inputs.js +2 -2
  131. package/lib/retail/inputs.js.map +1 -1
  132. package/lib/retail/model/LeadFormState.d.ts +1 -1
  133. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  134. package/lib/retail/utils/getMainFormStateMap.js +1 -6
  135. package/lib/retail/utils/getMainFormStateMap.js.map +1 -1
  136. package/lib/retail/utils/getOrganizationParams.d.ts +6 -0
  137. package/lib/retail/utils/getOrganizationParams.js +6 -0
  138. package/lib/retail/utils/getOrganizationParams.js.map +1 -1
  139. package/lib/retail/utils/updateOrganizationFields.js +2 -0
  140. package/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  141. package/lib/retail/validator/getRetailFormValidator.js +3 -1
  142. package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  143. package/lib/retail/validator/validators.d.ts +2 -0
  144. package/lib/retail/validator/validators.js +3 -0
  145. package/lib/retail/validator/validators.js.map +1 -1
  146. package/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
  147. package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  148. package/lib/ui-kit/FormField/validators.d.ts +1 -0
  149. package/lib/ui-kit/FormField/validators.js +1 -1
  150. package/lib/ui-kit/FormField/validators.js.map +1 -1
  151. package/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
  152. package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  153. package/lib/utils/isIFrame.d.ts +1 -0
  154. package/lib/utils/isIFrame.js +2 -0
  155. package/lib/utils/isIFrame.js.map +1 -0
  156. package/mobile/bundle/bundle.umd.js +444 -371
  157. package/mobile/bundle/bundle.umd.min.js +1 -1
  158. package/mobile/bundle/retail/api/getDictionaries.d.ts +2 -0
  159. package/mobile/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  160. package/mobile/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
  161. package/mobile/bundle/retail/model/LeadFormState.d.ts +1 -1
  162. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  163. package/mobile/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
  164. package/mobile/bundle/retail/validator/validators.d.ts +2 -0
  165. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
  166. package/mobile/bundle/utils/isIFrame.d.ts +1 -0
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  168. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  169. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  170. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  171. package/mobile/dist/components/ContentPage/ContentPage.js +5 -2
  172. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  173. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
  174. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  175. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  176. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  177. package/mobile/dist/components/CreditCardForm/formStateMap.js +6 -0
  178. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  179. package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -0
  180. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  181. package/mobile/dist/components/CreditForm/creditFormStepsData.js +14 -17
  182. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  183. package/mobile/dist/components/DebitForm/DebitFormStep.js +2 -0
  184. package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  185. package/mobile/dist/retail/adaptors/getPersonalInfoData.js +1 -9
  186. package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  187. package/mobile/dist/retail/api/getDictionaries.d.ts +2 -0
  188. package/mobile/dist/retail/api/getDictionaries.js +13 -0
  189. package/mobile/dist/retail/api/getDictionaries.js.map +1 -0
  190. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
  191. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  192. package/mobile/dist/retail/components/Fields/AmountWorkersField.js +0 -8
  193. package/mobile/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
  194. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  195. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  196. package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  197. package/mobile/dist/retail/components/Fields/DaDataInnField.js +21 -8
  198. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  199. package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
  200. package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  201. package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
  202. package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  203. package/mobile/dist/retail/components/Fields/OrganizationField.js +0 -8
  204. package/mobile/dist/retail/components/Fields/OrganizationField.js.map +1 -1
  205. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +12 -2
  206. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  207. package/mobile/dist/retail/content.js +4 -11
  208. package/mobile/dist/retail/content.js.map +1 -1
  209. package/mobile/dist/retail/hooks/useIFrameMode.d.ts +4 -0
  210. package/mobile/dist/retail/hooks/useIFrameMode.js +39 -0
  211. package/mobile/dist/retail/hooks/useIFrameMode.js.map +1 -0
  212. package/mobile/dist/retail/inputs.js +1 -1
  213. package/mobile/dist/retail/inputs.js.map +1 -1
  214. package/mobile/dist/retail/model/LeadFormState.d.ts +1 -1
  215. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  216. package/mobile/dist/retail/utils/getMainFormStateMap.js +1 -6
  217. package/mobile/dist/retail/utils/getMainFormStateMap.js.map +1 -1
  218. package/mobile/dist/retail/utils/getOrganizationParams.d.ts +6 -0
  219. package/mobile/dist/retail/utils/getOrganizationParams.js +7 -1
  220. package/mobile/dist/retail/utils/getOrganizationParams.js.map +1 -1
  221. package/mobile/dist/retail/utils/updateOrganizationFields.js +2 -0
  222. package/mobile/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  223. package/mobile/dist/retail/validator/getRetailFormValidator.js +2 -0
  224. package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  225. package/mobile/dist/retail/validator/validators.d.ts +2 -0
  226. package/mobile/dist/retail/validator/validators.js +6 -1
  227. package/mobile/dist/retail/validator/validators.js.map +1 -1
  228. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
  229. package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  230. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
  231. package/mobile/dist/ui-kit/FormField/validators.js +4 -3
  232. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  233. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
  234. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  235. package/mobile/dist/utils/isIFrame.d.ts +1 -0
  236. package/mobile/dist/utils/isIFrame.js +5 -0
  237. package/mobile/dist/utils/isIFrame.js.map +1 -0
  238. package/mobile/lib/common.css +1 -1
  239. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
  240. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  241. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
  242. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  243. package/mobile/lib/components/ContentPage/ContentPage.js +5 -2
  244. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  245. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
  246. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  247. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
  248. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  249. package/mobile/lib/components/CreditCardForm/formStateMap.js +6 -0
  250. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  251. package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -0
  252. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  253. package/mobile/lib/components/CreditForm/creditFormStepsData.js +14 -17
  254. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  255. package/mobile/lib/components/DebitForm/DebitFormStep.js +2 -0
  256. package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  257. package/mobile/lib/retail/adaptors/getPersonalInfoData.js +2 -10
  258. package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  259. package/mobile/lib/retail/api/getDictionaries.d.ts +2 -0
  260. package/mobile/lib/retail/api/getDictionaries.js +10 -0
  261. package/mobile/lib/retail/api/getDictionaries.js.map +1 -0
  262. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
  263. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  264. package/mobile/lib/retail/components/Fields/AmountWorkersField.js +0 -8
  265. package/mobile/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
  266. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
  267. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
  268. package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
  269. package/mobile/lib/retail/components/Fields/DaDataInnField.js +22 -9
  270. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  271. package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
  272. package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
  273. package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
  274. package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
  275. package/mobile/lib/retail/components/Fields/OrganizationField.js +0 -8
  276. package/mobile/lib/retail/components/Fields/OrganizationField.js.map +1 -1
  277. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +13 -3
  278. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  279. package/mobile/lib/retail/content.js +4 -11
  280. package/mobile/lib/retail/content.js.map +1 -1
  281. package/mobile/lib/retail/hooks/useIFrameMode.d.ts +4 -0
  282. package/mobile/lib/retail/hooks/useIFrameMode.js +36 -0
  283. package/mobile/lib/retail/hooks/useIFrameMode.js.map +1 -0
  284. package/mobile/lib/retail/inputs.js +2 -2
  285. package/mobile/lib/retail/inputs.js.map +1 -1
  286. package/mobile/lib/retail/model/LeadFormState.d.ts +1 -1
  287. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  288. package/mobile/lib/retail/utils/getMainFormStateMap.js +1 -6
  289. package/mobile/lib/retail/utils/getMainFormStateMap.js.map +1 -1
  290. package/mobile/lib/retail/utils/getOrganizationParams.d.ts +6 -0
  291. package/mobile/lib/retail/utils/getOrganizationParams.js +6 -0
  292. package/mobile/lib/retail/utils/getOrganizationParams.js.map +1 -1
  293. package/mobile/lib/retail/utils/updateOrganizationFields.js +2 -0
  294. package/mobile/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  295. package/mobile/lib/retail/validator/getRetailFormValidator.js +3 -1
  296. package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  297. package/mobile/lib/retail/validator/validators.d.ts +2 -0
  298. package/mobile/lib/retail/validator/validators.js +3 -0
  299. package/mobile/lib/retail/validator/validators.js.map +1 -1
  300. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
  301. package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
  302. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
  303. package/mobile/lib/ui-kit/FormField/validators.js +1 -1
  304. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  305. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
  306. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  307. package/mobile/lib/utils/isIFrame.d.ts +1 -0
  308. package/mobile/lib/utils/isIFrame.js +2 -0
  309. package/mobile/lib/utils/isIFrame.js.map +1 -0
  310. package/mobile/src/common.css +3 -0
  311. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
  312. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
  313. package/mobile/src/components/ContentPage/ContentPage.tsx +6 -4
  314. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
  315. package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
  316. package/mobile/src/components/CreditCardForm/formStateMap.tsx +6 -0
  317. package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -0
  318. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +14 -17
  319. package/mobile/src/components/DebitForm/DebitFormStep.tsx +2 -0
  320. package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
  321. package/mobile/src/retail/api/getDictionaries.ts +21 -0
  322. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
  323. package/mobile/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
  324. package/mobile/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
  325. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +28 -10
  326. package/mobile/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
  327. package/mobile/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
  328. package/mobile/src/retail/components/Fields/OrganizationField.tsx +0 -10
  329. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
  330. package/mobile/src/retail/content.tsx +4 -11
  331. package/mobile/src/retail/hooks/useIFrameMode.ts +45 -0
  332. package/mobile/src/retail/inputs.tsx +2 -2
  333. package/mobile/src/retail/model/LeadFormState.ts +1 -1
  334. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  335. package/mobile/src/retail/utils/getMainFormStateMap.ts +1 -6
  336. package/mobile/src/retail/utils/getOrganizationParams.ts +7 -0
  337. package/mobile/src/retail/utils/updateOrganizationFields.ts +2 -0
  338. package/mobile/src/retail/validator/getRetailFormValidator.ts +4 -0
  339. package/mobile/src/retail/validator/validators.ts +9 -0
  340. package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
  341. package/mobile/src/ui-kit/FormField/validators.ts +1 -1
  342. package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
  343. package/mobile/src/utils/isIFrame.ts +1 -0
  344. package/package.json +1 -1
  345. package/src/common.css +3 -0
  346. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
  347. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
  348. package/src/components/ContentPage/ContentPage.tsx +6 -4
  349. package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
  350. package/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
  351. package/src/components/CreditCardForm/formStateMap.tsx +6 -0
  352. package/src/components/CreditForm/CreditFormStep.tsx +2 -0
  353. package/src/components/CreditForm/creditFormStepsData.tsx +14 -17
  354. package/src/components/DebitForm/DebitFormStep.tsx +2 -0
  355. package/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
  356. package/src/retail/api/getDictionaries.ts +21 -0
  357. package/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
  358. package/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
  359. package/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
  360. package/src/retail/components/Fields/DaDataInnField.tsx +28 -10
  361. package/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
  362. package/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
  363. package/src/retail/components/Fields/OrganizationField.tsx +0 -10
  364. package/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
  365. package/src/retail/content.tsx +4 -11
  366. package/src/retail/hooks/useIFrameMode.ts +45 -0
  367. package/src/retail/inputs.tsx +2 -2
  368. package/src/retail/model/LeadFormState.ts +1 -1
  369. package/src/retail/model/NameFieldDef.ts +1 -0
  370. package/src/retail/utils/getMainFormStateMap.ts +1 -6
  371. package/src/retail/utils/getOrganizationParams.ts +7 -0
  372. package/src/retail/utils/updateOrganizationFields.ts +2 -0
  373. package/src/retail/validator/getRetailFormValidator.ts +4 -0
  374. package/src/retail/validator/validators.ts +9 -0
  375. package/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
  376. package/src/ui-kit/FormField/validators.ts +1 -1
  377. package/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
  378. package/src/utils/isIFrame.ts +1 -0
  379. package/tailwind.config.cjs +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.917",
3
+ "version": "0.14.919",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
package/src/common.css CHANGED
@@ -19,6 +19,9 @@ html {
19
19
  --color-gradient-from: 141, 189, 76;
20
20
  --color-gradient-to: 69, 172, 69;
21
21
  --color-primary-divider: 235, 237, 240;
22
+ --border-radius-md: 0.375rem;
23
+ --border-radius-lg: 0.5rem;
24
+ --border-radius-none: 0rem;
22
25
  }
23
26
 
24
27
  /* Private clients | Green */
@@ -3,6 +3,7 @@ import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { useForm } from '../../hooks/useForm/useForm';
5
5
  import { NoConsentDialog } from '../../retail/components/NoConsentDialog/NoConsentDialog';
6
+ import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
6
7
  import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
7
8
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
8
9
  import { getLimitedBirthdayValidation } from '../../retail/validator/getLimitedBirthdayValidation';
@@ -49,7 +50,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
49
50
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
50
51
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
51
52
  const noConsentDialog = useDialog(NoConsentDialog);
52
-
53
+ useIFrameMode();
53
54
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
54
55
  const formValidator = useMemo(
55
56
  () => getFormValidator(inputs, extendedValidatorObj),
@@ -1,7 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
3
4
  import { locationNavigator } from '../../external/locationNavigator';
4
5
  import { getLink } from '../../retail/api/getLink';
6
+ import { type IFrameStore } from '../../retail/hooks/useIFrameMode';
5
7
  import { Button } from '../../ui-kit/Button/Button';
6
8
  import { Img } from '../../ui-kit/Img/Img';
7
9
  import { EsiaStatuses, type ProductType } from './ApplicationLeadFormContent';
@@ -13,20 +15,23 @@ export interface EsiaLoginBannerProps {
13
15
 
14
16
  export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(({ onChangeEsiaStatus, productType }) => {
15
17
  const navigator = locationNavigator();
18
+ const sessionStore = useSessionStore<IFrameStore>();
19
+ const frameLocation = sessionStore.frameLocation;
16
20
 
17
21
  const handleAuth = useCallback(async () => {
18
22
  try {
19
23
  const resp = await getLink({
20
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
24
+ redirectUri: frameLocation || globalThis.location.origin + globalThis.location.pathname,
21
25
  });
22
-
23
26
  if (resp?.link) {
24
- navigator.assign(resp.link);
27
+ frameLocation
28
+ ? window.parent.postMessage({ redirectUri: resp?.link }, '*')
29
+ : navigator.assign(resp.link);
25
30
  }
26
31
  } catch {
27
32
  onChangeEsiaStatus(EsiaStatuses.Error);
28
33
  }
29
- }, []);
34
+ }, [frameLocation]);
30
35
 
31
36
  return (
32
37
  <div className="flex items-center rounded-md bg-main-gray p-4xl">
@@ -13,6 +13,7 @@ import { CookiePopup } from '../../ui-kit/CookiePopup/CookiePopup';
13
13
  import { DialogManager } from '../../ui-kit/DialogManager/DialogManager';
14
14
  import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
15
15
  import { type UniBlockMeta } from '../../UniBlock/UniBlock';
16
+ import { isIFrame } from '../../utils/isIFrame';
16
17
  import { style } from '../../utils/style';
17
18
 
18
19
  interface ContentPageProps extends ComponentType {
@@ -30,7 +31,7 @@ export const ContentPage = JSX<ContentPageProps>(
30
31
  ({ className, data = EMPTY_DATA, blocksRegistry, blockDecorator }) => {
31
32
  const { slots, blocks, fallback, ...pageContent } = data;
32
33
  const resolvedPageContent = useJSONRef(pageContent, fallback);
33
-
34
+ const isFrame = isIFrame();
34
35
  useClickHandler();
35
36
  useDefaultLocation();
36
37
 
@@ -45,7 +46,7 @@ export const ContentPage = JSX<ContentPageProps>(
45
46
  return (
46
47
  <div data-theme={data.colorPalette || 'pc'}>
47
48
  <section className={style('@container relative', data.style, className)}>
48
- {slots?.[HEADER_SLOT]?.length ? (
49
+ {!isFrame && slots?.[HEADER_SLOT]?.length ? (
49
50
  <div className="relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]">
50
51
  {renderBlocksList(slots?.[HEADER_SLOT], { ...options, slotName: HEADER_SLOT })}
51
52
  </div>
@@ -56,10 +57,11 @@ export const ContentPage = JSX<ContentPageProps>(
56
57
  options,
57
58
  extraProps: { className: 'scroll-mt-12' },
58
59
  })}
59
- {renderBlocksList(slots?.[FOOTER_SLOT], { ...options, slotName: FOOTER_SLOT })}
60
+ {!isFrame &&
61
+ renderBlocksList(slots?.[FOOTER_SLOT], { ...options, slotName: FOOTER_SLOT })}
60
62
  </div>
61
63
  </section>
62
- {slots?.[STICKY_FOOTER_SLOT]?.length ? (
64
+ {!isFrame && slots?.[STICKY_FOOTER_SLOT]?.length ? (
63
65
  <div className="fixed w-full bottom-0 left-0 z-[100]">
64
66
  {renderBlocksList(slots?.[STICKY_FOOTER_SLOT], {
65
67
  ...options,
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm/useForm';
4
+ import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
4
5
  import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
5
6
  import { type LeadFormState } from '../../retail/model/LeadFormState';
6
7
  import { renderStep } from '../../retail/utils/renderStep';
@@ -20,6 +21,7 @@ const PRODUCT_TYPE = 'creditCard';
20
21
 
21
22
  export const CreditCardFormStep = JSX<CreditCardFormStepProps>(
22
23
  ({ step, sections, onPrevStep, onNextStep, onFinish }) => {
24
+ useIFrameMode();
23
25
  const inputs = useMemo(
24
26
  () => sections?.flatMap((_: SectionsRetailProps) => _?.inputs || []),
25
27
  [sections],
@@ -60,29 +60,32 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
60
60
  ],
61
61
  },
62
62
  {
63
- inputs: [
64
- { name: 'employment', required: true },
65
- { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
66
- ],
63
+ inputs: [{ name: 'employment', required: true }],
67
64
  },
68
65
  {
69
66
  columns: 2,
70
67
  inputs: [
68
+ { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
71
69
  { name: 'inn', required: true, dadata: true, filledByEsia: true },
72
- { name: 'legalForm', required: true },
73
70
  ],
74
71
  },
75
72
  {
73
+ inputs: [{ name: 'amountWorkers', required: true }],
74
+ },
75
+ {
76
+ columns: 2,
76
77
  inputs: [
77
- { name: 'organization', required: true },
78
- { name: 'amountWorkers', required: true },
78
+ { name: 'employerActivities', required: true },
79
+ {
80
+ name: 'organizationPhone',
81
+ label: 'Телефон работодателя',
82
+ required: true,
83
+ },
79
84
  ],
80
85
  },
81
86
  {
82
87
  columns: 2,
83
88
  inputs: [
84
- { name: 'employerActivities', required: true },
85
- { name: 'employerOrganization', required: true },
86
89
  { name: 'generalSeniority', required: true, filledByEsia: true },
87
90
  { name: 'lastJobExperience', required: true, filledByEsia: true },
88
91
  { name: 'experience5Years', required: true, filledByEsia: true },
@@ -90,14 +93,7 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
90
93
  ],
91
94
  },
92
95
  {
93
- inputs: [
94
- {
95
- name: 'organizationPhone',
96
- label: 'Телефон работодателя',
97
- required: true,
98
- },
99
- { name: 'beginDate', required: true, filledByEsia: true },
100
- ],
96
+ inputs: [{ name: 'beginDate', required: true, filledByEsia: true }],
101
97
  },
102
98
  {
103
99
  columns: 2,
@@ -231,13 +227,20 @@ const DELIVERY_CREDIT_CARD_CONTENT: CreditCardSectionsProps[] = [
231
227
  values: ['office'],
232
228
  },
233
229
  },
230
+ ],
231
+ },
232
+ {
233
+ columns: 2,
234
+ inputs: [
234
235
  {
235
- name: 'bankEmployeeCode',
236
236
  condition: {
237
237
  name: 'methodObtain',
238
238
  values: ['office'],
239
239
  },
240
240
  },
241
+ {
242
+ name: 'bankEmployeeCode',
243
+ },
241
244
  ],
242
245
  },
243
246
  ];
@@ -8,6 +8,12 @@ export const formStateMap: Partial<LeadFormState>[] = [
8
8
  codeWord: '',
9
9
  },
10
10
  ...getMainFormStateMap(),
11
+ {
12
+ bankruptcyFlg: false,
13
+ shareholderFlg: false,
14
+ legalEntityName: '',
15
+ creditInRshbCd: undefined,
16
+ },
11
17
  {
12
18
  regionRetail: { key: '', text: '' },
13
19
  addressRetail: { key: '', text: '' },
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm/useForm';
4
+ import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
4
5
  import { useRetailFormStore } from '../../retail/hooks/useRetailFormStore';
5
6
  import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
6
7
  import { type LeadFormState } from '../../retail/model/LeadFormState';
@@ -24,6 +25,7 @@ const PRODUCT_TYPE = 'credit';
24
25
  export const CreditFormStep = JSX<CreditFormStepProps>(
25
26
  ({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
26
27
  const { programId } = useRetailFormStore();
28
+ useIFrameMode();
27
29
  const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
28
30
 
29
31
  const inputs = useMemo(
@@ -44,38 +44,30 @@ const EMPLOYMENT_CONTENT: SectionsRetailProps[] = [
44
44
  ],
45
45
  },
46
46
  {
47
- inputs: [
48
- { name: 'employment', required: true },
49
- { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
50
- ],
47
+ inputs: [{ name: 'employment', required: true }],
51
48
  },
52
49
  {
53
50
  columns: 2,
54
51
  inputs: [
52
+ { name: 'organizationName', required: true, dadata: true, filledByEsia: true },
55
53
  { name: 'inn', required: true, dadata: true, filledByEsia: true },
56
- { name: 'legalForm', required: true },
57
54
  ],
58
55
  },
59
56
  {
57
+ columns: 2,
60
58
  inputs: [
61
- { name: 'organization', required: true },
62
59
  { name: 'amountWorkers', required: true },
60
+ {
61
+ name: 'organizationPhone',
62
+ label: 'Телефон работодателя',
63
+ required: true,
64
+ },
63
65
  ],
64
66
  },
65
67
  {
66
68
  columns: 2,
67
69
  inputs: [
68
- { name: 'employerOrganization', required: true },
69
70
  { name: 'jobsNumber', required: true, filledByEsia: true },
70
- ],
71
- },
72
- {
73
- inputs: [
74
- {
75
- name: 'organizationPhone',
76
- label: 'Телефон работодателя',
77
- required: true,
78
- },
79
71
  { name: 'beginDate', required: true, filledByEsia: true },
80
72
  ],
81
73
  },
@@ -177,7 +169,12 @@ const DELIVERY_CREDIT_CONTENT: SectionsRetailProps[] = [
177
169
  ],
178
170
  },
179
171
  {
180
- inputs: [{ name: 'bankEmployeeCode' }],
172
+ columns: 2,
173
+ inputs: [
174
+ {
175
+ name: 'bankEmployeeCode',
176
+ },
177
+ ],
181
178
  },
182
179
  ];
183
180
  const CALCULATOR_CONTENT: SectionsRetailProps[] = [
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm/useForm';
4
+ import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
4
5
  import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
5
6
  import type { LeadFormState } from '../../retail/model/LeadFormState';
6
7
  import { renderStep } from '../../retail/utils/renderStep';
@@ -20,6 +21,7 @@ const PRODUCT_TYPE = 'debitCard';
20
21
 
21
22
  export const DebitFormStep = JSX<DebitFormStepProps>(
22
23
  ({ step, sections, onPrevStep, onNextStep, onFinish }) => {
24
+ useIFrameMode();
23
25
  const inputs = useMemo(
24
26
  () => sections?.flatMap((_: SectionsRetailProps) => _?.inputs ?? []),
25
27
  [sections],
@@ -1,17 +1,11 @@
1
1
  import { formatDate } from '../../utils/formatDate';
2
- import { formatPhone } from '../../utils/formatPhone';
3
2
  import { type Participant } from '../api/updateUserTask';
4
3
  import { type LeadFormState } from '../model/LeadFormState';
5
- import { getParticipantAddresses, getParticipantContacts } from './utils';
4
+ import { getParticipantAddresses } from './utils';
6
5
 
7
6
  export const getPersonalInfoData = (formData: LeadFormState): Partial<Participant> => {
8
7
  const {
9
- name,
10
- surname,
11
- middleName,
12
8
  limitedBirthday = '',
13
- phone = '',
14
- email,
15
9
  sex,
16
10
  birthPlace,
17
11
  dulIssueDate = '',
@@ -29,9 +23,6 @@ export const getPersonalInfoData = (formData: LeadFormState): Partial<Participan
29
23
 
30
24
  return {
31
25
  birthDate: formatDate(limitedBirthday, true),
32
- midname: middleName,
33
- name,
34
- surname,
35
26
  birthPlace,
36
27
  dulIssueDate: formatDate(dulIssueDate, true),
37
28
  dulIssuedBy,
@@ -44,10 +35,6 @@ export const getPersonalInfoData = (formData: LeadFormState): Partial<Participan
44
35
  : undefined,
45
36
  homeMatchFlg: addressMatch,
46
37
  houseTypeCd: housing,
47
- participantContacts: getParticipantContacts({
48
- phone: formatPhone(phone),
49
- email,
50
- }),
51
38
  participantAddresses: getParticipantAddresses({
52
39
  addressRegistration,
53
40
  addressFact: addressMatch ? addressRegistration : addressFact,
@@ -0,0 +1,21 @@
1
+ import { type CreditFormDictionarySlice } from '../hooks/useRetailFormStore';
2
+ import { type DictionaryItem } from '../model/LeadFormData';
3
+ import { fetchRetailJSON } from './doRequest';
4
+
5
+ export const getDictionaries = (
6
+ dictionaries: Record<string, string>,
7
+ store: CreditFormDictionarySlice,
8
+ ) => {
9
+ Promise.all(
10
+ Object.entries(dictionaries).map((dictionary) => {
11
+ const [fieldName, dictionaryName] = dictionary;
12
+
13
+ fetchRetailJSON<DictionaryItem[]>(
14
+ `/dictionary?dictionaryType=${encodeURIComponent(dictionaryName)}`,
15
+ 'POST',
16
+ ).then((res) => {
17
+ store[fieldName] = res;
18
+ });
19
+ }),
20
+ );
21
+ };
@@ -90,6 +90,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
90
90
  employment: getSelectValue(employment, EMPLOYMENT_TYPE),
91
91
  organizationName,
92
92
  inn,
93
+ isDadataOrganization: Boolean(inn),
93
94
  employerActivities: getSelectValue(employerActivities),
94
95
  organization: getSelectValue(organization),
95
96
  employerOrganization: getSelectValue(employerOrganization),
@@ -1,21 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
- import { useLeadFormData } from '../../hooks/useLeadFormData';
5
3
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
4
  import { SelectField } from './SelectField';
7
5
 
8
6
  export const AmountWorkersField = JSX<CustomFieldProps>(({ field, input }) => {
9
- const { data } = useLeadFormData('EMPLOYEES_NUMBER');
10
-
11
7
  const store = useRetailFormStore();
12
8
 
13
- useEffect(() => {
14
- if (data) {
15
- store.amountWorkers = data;
16
- }
17
- }, [data]);
18
-
19
9
  return (
20
10
  <SelectField
21
11
  field={field}
@@ -1,13 +1,45 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
+ import { type RadioButtonItem } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroup';
5
+ import { RadioButtonGroupControl } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroupControl';
3
6
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
7
 
5
- export const BankEmpoleeCodeField = JSX<CustomFieldProps>(({ field, input }) => (
6
- <DaDataInputControl
7
- label="Код представителя Банка"
8
- placeholder="Введите код"
9
- isInteger={true}
10
- {...field(input?.name ?? '')}
11
- {...input}
12
- />
13
- ));
8
+ export const BUTTON_TYPES: RadioButtonItem[] = [
9
+ { id: 'true', text: 'Да' },
10
+ { id: 'false', text: 'Нет' },
11
+ ];
12
+
13
+ export const BankEmployeeCodeField = JSX<CustomFieldProps>(({ field, input }) => {
14
+ const [bankEmployeeFlg, setBankEmployeeFlg] = useState('');
15
+
16
+ const handleBankEmployeeFlgChange = useCallback((value: string) => {
17
+ setBankEmployeeFlg(value);
18
+
19
+ if (value === 'false') {
20
+ field('bankEmployeeCode')?.onChange?.(null);
21
+ }
22
+ }, []);
23
+
24
+ return (
25
+ <div className="flex flex-col md:flex-row">
26
+ <RadioButtonGroupControl
27
+ label="Мне помог сотрудник Банка"
28
+ orientation="horizontal"
29
+ items={BUTTON_TYPES}
30
+ value={bankEmployeeFlg}
31
+ onChange={handleBankEmployeeFlgChange}
32
+ />
33
+ {bankEmployeeFlg === 'true' ? (
34
+ <DaDataInputControl
35
+ label="Код представителя Банка"
36
+ placeholder="Введите код"
37
+ isInteger={true}
38
+ maxLength={8}
39
+ {...field(input?.name ?? '')}
40
+ {...input}
41
+ />
42
+ ) : null}
43
+ </div>
44
+ );
45
+ });
@@ -1,23 +1,40 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useCallback, useEffect, useState } 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
+ import { getDictionaries } from '../../api/getDictionaries';
5
6
  import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
6
7
  import { useRetailFormStore, type CreditFormStoreSlice } from '../../hooks/useRetailFormStore';
8
+ import { organizationDictionaries } from '../../utils/getOrganizationParams';
7
9
  import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
8
10
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
9
11
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
10
12
 
13
+ const NO_DADATA_ERROR_TEXT = 'Необходимо выбрать ИНН из выпадающего списка';
14
+
11
15
  export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
12
16
  const store = useRetailFormStore();
17
+ const [errorText, setErrorText] = useState('');
13
18
  const { employerActivities, employerOrganization, organization, amountWorkers } = store;
14
19
  const esiaAccountTypeCd = field?.('esiaAccountTypeCd')?.value;
15
20
  const inn = field?.('inn')?.value;
21
+ const fieldError = field?.('organizationName')?.error;
22
+ const isDadataOrganization = field('isDadataOrganization')?.value;
23
+
24
+ useEffect(() => {
25
+ setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT : '');
26
+ }, [isDadataOrganization, fieldError]);
16
27
 
17
28
  const onDaDataChange = useCallback((item: DaDataSuggestion) => {
18
29
  updateOrganizationFields(store, field, item);
19
30
  }, []);
20
31
 
32
+ useEffect(() => {
33
+ (async () => {
34
+ await getDictionaries(organizationDictionaries, store);
35
+ })();
36
+ }, []);
37
+
21
38
  useEffect(() => {
22
39
  if (!esiaAccountTypeCd || !inn || !isDictionariesAlreadyLoad(store as CreditFormStoreSlice)) {
23
40
  return;
@@ -30,6 +47,11 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
30
47
  })();
31
48
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
32
49
 
50
+ const onChange = useCallback((value: string) => {
51
+ field?.('inn')?.onChange?.(value);
52
+ field?.('isDadataOrganization')?.onChange?.(false);
53
+ }, []);
54
+
33
55
  return (
34
56
  <DaDataInputControl
35
57
  label="ИНН"
@@ -39,18 +61,14 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
39
61
  {...field(input?.name ?? '')}
40
62
  onDaDataChange={onDaDataChange}
41
63
  disabled={isEsiaAuthorize(field, input)}
64
+ onChange={onChange}
65
+ error={errorText || field('inn')?.error}
42
66
  />
43
67
  );
44
68
  });
45
69
 
46
70
  const isDictionariesAlreadyLoad = (store: CreditFormStoreSlice) => {
47
- const { employerActivities, employerOrganization, organization, amountWorkers, productType } =
48
- store;
49
-
50
- return [
51
- employerOrganization,
52
- organization,
53
- amountWorkers,
54
- productType === 'creditCard' ? employerActivities : true,
55
- ].every(Boolean);
71
+ const { employerActivities, employerOrganization, organization, amountWorkers } = store;
72
+
73
+ return [employerOrganization, organization, amountWorkers, employerActivities].every(Boolean);
56
74
  };
@@ -1,21 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
- import { useLeadFormData } from '../../hooks/useLeadFormData';
5
3
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
4
  import { SelectField } from './SelectField';
7
5
 
8
6
  export const EmployerActivitiesField = JSX<CustomFieldProps>(({ field, input }) => {
9
- const { data } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
10
-
11
7
  const store = useRetailFormStore();
12
8
 
13
- useEffect(() => {
14
- if (data) {
15
- store.employerActivities = data;
16
- }
17
- }, [data]);
18
-
19
9
  return (
20
10
  <SelectField
21
11
  field={field}
@@ -1,21 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
- import { useLeadFormData } from '../../hooks/useLeadFormData';
5
3
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
4
  import { SelectField } from './SelectField';
7
5
 
8
6
  export const EmployerOrganizationField = JSX<CustomFieldProps>(({ field, input }) => {
9
- const { data } = useLeadFormData('ORGANIZATION_KIND');
10
-
11
7
  const store = useRetailFormStore();
12
8
 
13
- useEffect(() => {
14
- if (data) {
15
- store.employerOrganization = data;
16
- }
17
- }, [data]);
18
-
19
9
  return (
20
10
  <SelectField
21
11
  field={field}
@@ -1,21 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
- import { useLeadFormData } from '../../hooks/useLeadFormData';
5
3
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
4
  import { SelectField } from './SelectField';
7
5
 
8
6
  export const OrganizationField = JSX<CustomFieldProps>(({ field, input }) => {
9
- const { data } = useLeadFormData('ORGANIZATION_TYPE');
10
-
11
7
  const store = useRetailFormStore();
12
8
 
13
- useEffect(() => {
14
- if (data) {
15
- store.organization = data;
16
- }
17
- }, [data]);
18
-
19
9
  return (
20
10
  <SelectField
21
11
  field={field}
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useCallback, useEffect, useState } 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';
@@ -7,14 +7,27 @@ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
7
7
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
8
8
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
9
9
 
10
+ const NO_DADATA_ERROR_TEXT = 'Необходимо выбрать организацию из выпадающего списка';
11
+
10
12
  export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) => {
11
13
  const store = useRetailFormStore();
14
+ const [errorText, setErrorText] = useState('');
15
+ const fieldError = field?.('organizationName')?.error;
16
+ const isDadataOrganization = field('isDadataOrganization')?.value;
17
+
18
+ useEffect(() => {
19
+ setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT : '');
20
+ }, [isDadataOrganization, fieldError]);
12
21
 
13
22
  const onDaDataChange = useCallback((item: DaDataSuggestion) => {
14
- field?.('inn')?.onChange?.(item.data?.inn);
15
23
  updateOrganizationFields(store, field, item);
16
24
  }, []);
17
25
 
26
+ const onChange = useCallback((value: string) => {
27
+ field?.('organizationName')?.onChange?.(value);
28
+ field?.('isDadataOrganization')?.onChange?.(false);
29
+ }, []);
30
+
18
31
  return (
19
32
  <DaDataInputControl
20
33
  label="Наименование организации"
@@ -22,6 +35,8 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
22
35
  {...field(input?.name ?? '')}
23
36
  disabled={isEsiaAuthorize(field, input)}
24
37
  onDaDataChange={onDaDataChange}
38
+ onChange={onChange}
39
+ error={errorText || field('organizationName')?.error}
25
40
  />
26
41
  );
27
42
  });