@redneckz/wildless-cms-uni-blocks 0.14.154 → 0.14.155

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 (437) hide show
  1. package/bundle/api/LeadServiceAPI.d.ts +10 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +131 -220
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  6. package/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  7. package/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  8. package/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  9. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  10. package/bundle/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  11. package/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  12. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  13. package/bundle/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  14. package/bundle/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  15. package/bundle/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  16. package/bundle/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  17. package/bundle/components/ApplicationForm/SelectControl.d.ts +2 -0
  18. package/bundle/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  19. package/bundle/hooks/useForm.d.ts +4 -1
  20. package/bundle/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  21. package/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  22. package/dist/api/LeadServiceAPI.d.ts +10 -1
  23. package/dist/api/LeadServiceAPI.js +23 -1
  24. package/dist/api/LeadServiceAPI.js.map +1 -1
  25. package/dist/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  26. package/dist/components/ApplicationForm/AddressBranchField.js +7 -4
  27. package/dist/components/ApplicationForm/AddressBranchField.js.map +1 -1
  28. package/dist/components/ApplicationForm/ApplicationForm.js +3 -1
  29. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  30. package/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  31. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +6 -11
  32. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  33. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  34. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -11
  35. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  36. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  37. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +10 -16
  38. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  39. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  40. package/dist/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  41. package/dist/components/ApplicationForm/ApplicationFormCorruption.js +4 -12
  42. package/dist/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -1
  43. package/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  44. package/dist/components/ApplicationForm/ApplicationFormCredit.js +10 -21
  45. package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  46. package/dist/components/ApplicationForm/ApplicationFormDeposit.js +6 -9
  47. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  48. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  49. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +7 -7
  50. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  51. package/dist/components/ApplicationForm/ApplicationFormIndividuals.js +6 -14
  52. package/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  53. package/dist/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  54. package/dist/components/ApplicationForm/ApplicationFormSelfCollection.js +5 -15
  55. package/dist/components/ApplicationForm/ApplicationFormSelfCollection.js.map +1 -1
  56. package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +6 -27
  57. package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
  58. package/dist/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  59. package/dist/components/ApplicationForm/ApplicationFormWed.js +12 -20
  60. package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  61. package/dist/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  62. package/dist/components/ApplicationForm/DatePickerControl.js +1 -1
  63. package/dist/components/ApplicationForm/DatePickerControl.js.map +1 -1
  64. package/dist/components/ApplicationForm/InputControl.js +1 -1
  65. package/dist/components/ApplicationForm/InputControl.js.map +1 -1
  66. package/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
  67. package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  68. package/dist/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  69. package/dist/components/ApplicationForm/RegionPremiumField.js +17 -0
  70. package/dist/components/ApplicationForm/RegionPremiumField.js.map +1 -0
  71. package/dist/components/ApplicationForm/SelectControl.d.ts +2 -0
  72. package/dist/components/ApplicationForm/SelectControl.js +1 -1
  73. package/dist/components/ApplicationForm/SelectControl.js.map +1 -1
  74. package/dist/components/ApplicationForm/handleSubmit.js +3 -51
  75. package/dist/components/ApplicationForm/handleSubmit.js.map +1 -1
  76. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  77. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  78. package/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  79. package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  80. package/dist/components/ApplicationForm/renderUserData.js +1 -1
  81. package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  82. package/dist/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  83. package/dist/components/ApplicationForm/renderWedDataOrganization.js +3 -3
  84. package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  85. package/dist/hooks/useForm.d.ts +4 -1
  86. package/dist/hooks/useForm.js +2 -2
  87. package/dist/hooks/useForm.js.map +1 -1
  88. package/dist/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  89. package/dist/hooks/usePremiumBranchesByRegions.js.map +1 -1
  90. package/dist/ui-kit/Input/InputProps.d.ts +1 -0
  91. package/dist/utils/formatPhone.js +1 -1
  92. package/dist/utils/formatPhone.js.map +1 -1
  93. package/lib/api/LeadServiceAPI.d.ts +10 -1
  94. package/lib/api/LeadServiceAPI.js +23 -1
  95. package/lib/api/LeadServiceAPI.js.map +1 -1
  96. package/lib/common.css +1 -1
  97. package/lib/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  98. package/lib/components/ApplicationForm/AddressBranchField.js +7 -4
  99. package/lib/components/ApplicationForm/AddressBranchField.js.map +1 -1
  100. package/lib/components/ApplicationForm/ApplicationForm.js +3 -1
  101. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  102. package/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  103. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +6 -11
  104. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  105. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  106. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -11
  107. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  108. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  109. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +10 -16
  110. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  111. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  112. package/lib/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  113. package/lib/components/ApplicationForm/ApplicationFormCorruption.js +4 -12
  114. package/lib/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -1
  115. package/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  116. package/lib/components/ApplicationForm/ApplicationFormCredit.js +10 -21
  117. package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  118. package/lib/components/ApplicationForm/ApplicationFormDeposit.js +6 -9
  119. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  120. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  121. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +7 -7
  122. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  123. package/lib/components/ApplicationForm/ApplicationFormIndividuals.js +7 -15
  124. package/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  125. package/lib/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  126. package/lib/components/ApplicationForm/ApplicationFormSelfCollection.js +5 -15
  127. package/lib/components/ApplicationForm/ApplicationFormSelfCollection.js.map +1 -1
  128. package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +6 -27
  129. package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
  130. package/lib/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  131. package/lib/components/ApplicationForm/ApplicationFormWed.js +12 -20
  132. package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  133. package/lib/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  134. package/lib/components/ApplicationForm/DatePickerControl.js +1 -1
  135. package/lib/components/ApplicationForm/DatePickerControl.js.map +1 -1
  136. package/lib/components/ApplicationForm/InputControl.js +1 -1
  137. package/lib/components/ApplicationForm/InputControl.js.map +1 -1
  138. package/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
  139. package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  140. package/lib/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  141. package/lib/components/ApplicationForm/RegionPremiumField.js +15 -0
  142. package/lib/components/ApplicationForm/RegionPremiumField.js.map +1 -0
  143. package/lib/components/ApplicationForm/SelectControl.d.ts +2 -0
  144. package/lib/components/ApplicationForm/SelectControl.js +1 -1
  145. package/lib/components/ApplicationForm/SelectControl.js.map +1 -1
  146. package/lib/components/ApplicationForm/handleSubmit.js +3 -51
  147. package/lib/components/ApplicationForm/handleSubmit.js.map +1 -1
  148. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  149. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  150. package/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  151. package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  152. package/lib/components/ApplicationForm/renderUserData.js +1 -1
  153. package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  154. package/lib/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  155. package/lib/components/ApplicationForm/renderWedDataOrganization.js +3 -3
  156. package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  157. package/lib/hooks/useForm.d.ts +4 -1
  158. package/lib/hooks/useForm.js +2 -2
  159. package/lib/hooks/useForm.js.map +1 -1
  160. package/lib/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  161. package/lib/hooks/usePremiumBranchesByRegions.js.map +1 -1
  162. package/lib/ui-kit/Input/InputProps.d.ts +1 -0
  163. package/lib/utils/formatPhone.js +1 -1
  164. package/lib/utils/formatPhone.js.map +1 -1
  165. package/mobile/bundle/api/LeadServiceAPI.d.ts +10 -1
  166. package/mobile/bundle/bundle.umd.js +131 -220
  167. package/mobile/bundle/bundle.umd.min.js +1 -1
  168. package/mobile/bundle/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  169. package/mobile/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  170. package/mobile/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  171. package/mobile/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  172. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  173. package/mobile/bundle/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  174. package/mobile/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  175. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  176. package/mobile/bundle/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  177. package/mobile/bundle/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  178. package/mobile/bundle/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  179. package/mobile/bundle/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  180. package/mobile/bundle/components/ApplicationForm/SelectControl.d.ts +2 -0
  181. package/mobile/bundle/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  182. package/mobile/bundle/hooks/useForm.d.ts +4 -1
  183. package/mobile/bundle/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  184. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  185. package/mobile/dist/api/LeadServiceAPI.d.ts +10 -1
  186. package/mobile/dist/api/LeadServiceAPI.js +23 -1
  187. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  188. package/mobile/dist/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  189. package/mobile/dist/components/ApplicationForm/AddressBranchField.js +7 -4
  190. package/mobile/dist/components/ApplicationForm/AddressBranchField.js.map +1 -1
  191. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +3 -1
  192. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  193. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  194. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +6 -11
  195. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  196. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  197. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -11
  198. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  199. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  200. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +10 -16
  201. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  202. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  203. package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  204. package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.js +4 -12
  205. package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -1
  206. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  207. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +10 -21
  208. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  209. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +6 -9
  210. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  211. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  212. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +7 -7
  213. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  214. package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js +6 -14
  215. package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  216. package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  217. package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.js +5 -15
  218. package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.js.map +1 -1
  219. package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +6 -27
  220. package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
  221. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  222. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js +12 -20
  223. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  224. package/mobile/dist/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  225. package/mobile/dist/components/ApplicationForm/DatePickerControl.js +1 -1
  226. package/mobile/dist/components/ApplicationForm/DatePickerControl.js.map +1 -1
  227. package/mobile/dist/components/ApplicationForm/InputControl.js +1 -1
  228. package/mobile/dist/components/ApplicationForm/InputControl.js.map +1 -1
  229. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
  230. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  231. package/mobile/dist/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  232. package/mobile/dist/components/ApplicationForm/RegionPremiumField.js +17 -0
  233. package/mobile/dist/components/ApplicationForm/RegionPremiumField.js.map +1 -0
  234. package/mobile/dist/components/ApplicationForm/SelectControl.d.ts +2 -0
  235. package/mobile/dist/components/ApplicationForm/SelectControl.js +1 -1
  236. package/mobile/dist/components/ApplicationForm/SelectControl.js.map +1 -1
  237. package/mobile/dist/components/ApplicationForm/handleSubmit.js +3 -51
  238. package/mobile/dist/components/ApplicationForm/handleSubmit.js.map +1 -1
  239. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  240. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  241. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  242. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  243. package/mobile/dist/components/ApplicationForm/renderUserData.js +1 -1
  244. package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  245. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  246. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +3 -3
  247. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  248. package/mobile/dist/hooks/useForm.d.ts +4 -1
  249. package/mobile/dist/hooks/useForm.js +2 -2
  250. package/mobile/dist/hooks/useForm.js.map +1 -1
  251. package/mobile/dist/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  252. package/mobile/dist/hooks/usePremiumBranchesByRegions.js.map +1 -1
  253. package/mobile/dist/ui-kit/Input/InputProps.d.ts +1 -0
  254. package/mobile/dist/utils/formatPhone.js +1 -1
  255. package/mobile/dist/utils/formatPhone.js.map +1 -1
  256. package/mobile/lib/api/LeadServiceAPI.d.ts +10 -1
  257. package/mobile/lib/api/LeadServiceAPI.js +23 -1
  258. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  259. package/mobile/lib/common.css +1 -1
  260. package/mobile/lib/components/ApplicationForm/AddressBranchField.d.ts +2 -1
  261. package/mobile/lib/components/ApplicationForm/AddressBranchField.js +7 -4
  262. package/mobile/lib/components/ApplicationForm/AddressBranchField.js.map +1 -1
  263. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +3 -1
  264. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  265. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +1 -0
  266. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +6 -11
  267. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  268. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +1 -1
  269. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -11
  270. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  271. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +2 -1
  272. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +10 -16
  273. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  274. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -1
  275. package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.d.ts +2 -2
  276. package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.js +4 -12
  277. package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -1
  278. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +3 -2
  279. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +10 -21
  280. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  281. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +6 -9
  282. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  283. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +1 -1
  284. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +7 -7
  285. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  286. package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js +7 -15
  287. package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  288. package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +2 -2
  289. package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.js +5 -15
  290. package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.js.map +1 -1
  291. package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +6 -27
  292. package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
  293. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.d.ts +6 -5
  294. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js +12 -20
  295. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  296. package/mobile/lib/components/ApplicationForm/DatePickerControl.d.ts +1 -0
  297. package/mobile/lib/components/ApplicationForm/DatePickerControl.js +1 -1
  298. package/mobile/lib/components/ApplicationForm/DatePickerControl.js.map +1 -1
  299. package/mobile/lib/components/ApplicationForm/InputControl.js +1 -1
  300. package/mobile/lib/components/ApplicationForm/InputControl.js.map +1 -1
  301. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
  302. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  303. package/mobile/lib/components/ApplicationForm/RegionPremiumField.d.ts +6 -0
  304. package/mobile/lib/components/ApplicationForm/RegionPremiumField.js +15 -0
  305. package/mobile/lib/components/ApplicationForm/RegionPremiumField.js.map +1 -0
  306. package/mobile/lib/components/ApplicationForm/SelectControl.d.ts +2 -0
  307. package/mobile/lib/components/ApplicationForm/SelectControl.js +1 -1
  308. package/mobile/lib/components/ApplicationForm/SelectControl.js.map +1 -1
  309. package/mobile/lib/components/ApplicationForm/handleSubmit.js +3 -51
  310. package/mobile/lib/components/ApplicationForm/handleSubmit.js.map +1 -1
  311. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  312. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  313. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  314. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  315. package/mobile/lib/components/ApplicationForm/renderUserData.js +1 -1
  316. package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  317. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.d.ts +1 -4
  318. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +3 -3
  319. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  320. package/mobile/lib/hooks/useForm.d.ts +4 -1
  321. package/mobile/lib/hooks/useForm.js +2 -2
  322. package/mobile/lib/hooks/useForm.js.map +1 -1
  323. package/mobile/lib/hooks/usePremiumBranchesByRegions.d.ts +1 -0
  324. package/mobile/lib/hooks/usePremiumBranchesByRegions.js.map +1 -1
  325. package/mobile/lib/ui-kit/Input/InputProps.d.ts +1 -0
  326. package/mobile/lib/utils/formatPhone.js +1 -1
  327. package/mobile/lib/utils/formatPhone.js.map +1 -1
  328. package/mobile/src/api/LeadServiceAPI.ts +50 -3
  329. package/mobile/src/components/ApplicationForm/AddressBranchField.tsx +21 -15
  330. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +7 -1
  331. package/mobile/src/components/ApplicationForm/ApplicationForm.ui.json +1 -1
  332. package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +12 -12
  333. package/mobile/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +6 -15
  334. package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +24 -18
  335. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +0 -1
  336. package/mobile/src/components/ApplicationForm/ApplicationFormCorruption.tsx +8 -20
  337. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +13 -29
  338. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +8 -10
  339. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +20 -22
  340. package/mobile/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +7 -17
  341. package/mobile/src/components/ApplicationForm/ApplicationFormSelfCollection.tsx +9 -23
  342. package/mobile/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +12 -49
  343. package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +25 -27
  344. package/mobile/src/components/ApplicationForm/DatePickerControl.tsx +3 -2
  345. package/mobile/src/components/ApplicationForm/InputControl.tsx +3 -3
  346. package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +2 -2
  347. package/mobile/src/components/ApplicationForm/RegionPremiumField.tsx +28 -0
  348. package/mobile/src/components/ApplicationForm/SelectControl.tsx +10 -6
  349. package/mobile/src/components/ApplicationForm/handleSubmit.tsx +3 -52
  350. package/mobile/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +4 -4
  351. package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +4 -2
  352. package/mobile/src/components/ApplicationForm/renderUserData.tsx +3 -3
  353. package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +4 -20
  354. package/mobile/src/hooks/useForm.ts +3 -2
  355. package/mobile/src/hooks/usePremiumBranchesByRegions.ts +1 -0
  356. package/mobile/src/ui-kit/Input/InputProps.ts +1 -0
  357. package/mobile/src/utils/formatPhone.ts +1 -1
  358. package/package.json +1 -1
  359. package/src/api/LeadServiceAPI.ts +50 -3
  360. package/src/components/ApplicationForm/AddressBranchField.tsx +21 -15
  361. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -1
  362. package/src/components/ApplicationForm/ApplicationForm.tsx +7 -1
  363. package/src/components/ApplicationForm/ApplicationForm.ui.json +1 -1
  364. package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +12 -12
  365. package/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +6 -15
  366. package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +24 -18
  367. package/src/components/ApplicationForm/ApplicationFormContent.ts +0 -1
  368. package/src/components/ApplicationForm/ApplicationFormCorruption.tsx +8 -20
  369. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +13 -29
  370. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +8 -10
  371. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +20 -22
  372. package/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +7 -17
  373. package/src/components/ApplicationForm/ApplicationFormSelfCollection.tsx +9 -23
  374. package/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +12 -49
  375. package/src/components/ApplicationForm/ApplicationFormWed.tsx +25 -27
  376. package/src/components/ApplicationForm/DatePickerControl.tsx +3 -2
  377. package/src/components/ApplicationForm/InputControl.tsx +3 -3
  378. package/src/components/ApplicationForm/PhoneInputControl.tsx +2 -2
  379. package/src/components/ApplicationForm/RegionPremiumField.tsx +28 -0
  380. package/src/components/ApplicationForm/SelectControl.tsx +10 -6
  381. package/src/components/ApplicationForm/handleSubmit.tsx +3 -52
  382. package/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +4 -4
  383. package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +4 -2
  384. package/src/components/ApplicationForm/renderUserData.tsx +3 -3
  385. package/src/components/ApplicationForm/renderWedDataOrganization.tsx +4 -20
  386. package/src/hooks/useForm.ts +3 -2
  387. package/src/hooks/usePremiumBranchesByRegions.ts +1 -0
  388. package/src/ui-kit/Input/InputProps.ts +1 -0
  389. package/src/utils/formatPhone.ts +1 -1
  390. package/bundle/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -4
  391. package/bundle/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -4
  392. package/bundle/components/ApplicationForm/renderTextarea.d.ts +0 -11
  393. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -4
  394. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +0 -11
  395. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +0 -1
  396. package/dist/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -4
  397. package/dist/components/ApplicationForm/renderSlideCheckboxes.js +0 -7
  398. package/dist/components/ApplicationForm/renderSlideCheckboxes.js.map +0 -1
  399. package/dist/components/ApplicationForm/renderTextarea.d.ts +0 -11
  400. package/dist/components/ApplicationForm/renderTextarea.js +0 -10
  401. package/dist/components/ApplicationForm/renderTextarea.js.map +0 -1
  402. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -3
  403. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +0 -8
  404. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +0 -1
  405. package/lib/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -3
  406. package/lib/components/ApplicationForm/renderSlideCheckboxes.js +0 -4
  407. package/lib/components/ApplicationForm/renderSlideCheckboxes.js.map +0 -1
  408. package/lib/components/ApplicationForm/renderTextarea.d.ts +0 -10
  409. package/lib/components/ApplicationForm/renderTextarea.js +0 -7
  410. package/lib/components/ApplicationForm/renderTextarea.js.map +0 -1
  411. package/mobile/bundle/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -4
  412. package/mobile/bundle/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -4
  413. package/mobile/bundle/components/ApplicationForm/renderTextarea.d.ts +0 -11
  414. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -4
  415. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +0 -11
  416. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +0 -1
  417. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -4
  418. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.js +0 -7
  419. package/mobile/dist/components/ApplicationForm/renderSlideCheckboxes.js.map +0 -1
  420. package/mobile/dist/components/ApplicationForm/renderTextarea.d.ts +0 -11
  421. package/mobile/dist/components/ApplicationForm/renderTextarea.js +0 -10
  422. package/mobile/dist/components/ApplicationForm/renderTextarea.js.map +0 -1
  423. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.d.ts +0 -4
  424. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +0 -8
  425. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +0 -1
  426. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.d.ts +0 -4
  427. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.js +0 -4
  428. package/mobile/lib/components/ApplicationForm/renderSlideCheckboxes.js.map +0 -1
  429. package/mobile/lib/components/ApplicationForm/renderTextarea.d.ts +0 -11
  430. package/mobile/lib/components/ApplicationForm/renderTextarea.js +0 -7
  431. package/mobile/lib/components/ApplicationForm/renderTextarea.js.map +0 -1
  432. package/mobile/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +0 -22
  433. package/mobile/src/components/ApplicationForm/renderSlideCheckboxes.tsx +0 -10
  434. package/mobile/src/components/ApplicationForm/renderTextarea.tsx +0 -42
  435. package/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +0 -22
  436. package/src/components/ApplicationForm/renderSlideCheckboxes.tsx +0 -10
  437. package/src/components/ApplicationForm/renderTextarea.tsx +0 -42
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { JSX } from '@redneckz/uni-jsx';
4
4
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
5
- import { useBranches } from '../../hooks/useBranches';
6
5
  import { useForm } from '../../hooks/useForm';
7
6
  import { type Option } from '../../ui-kit/Select/Option';
8
7
  import { withValidator } from '../../validation/withValidator';
8
+ import { AddressBranchField } from './AddressBranchField';
9
9
  import { ApplicationFieldsetLayout } from './ApplicationFieldsetLayout';
10
10
  import { type ApplicationFormsProps } from './ApplicationFormsProps';
11
11
  import { FEEDBACK_METHOD, FEEDBACK_TYPES, SERVICE_DIRECTIONS } from './feedbackTypes';
@@ -29,7 +29,7 @@ export type FeedbackFormState = UserDataState & {
29
29
  feedbackMethod: Option;
30
30
  phone: string;
31
31
  secondaryPhone?: string;
32
- email?: string;
32
+ email: string;
33
33
  bankEmpolee?: string;
34
34
  applicationDate?: string;
35
35
  comment: string;
@@ -67,28 +67,29 @@ export const ApplicationFormFeedback = JSX<ApplicationFormsProps>(({ button, lin
67
67
  [onSubmit],
68
68
  );
69
69
 
70
- const [formState, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
70
+ const [formState, { field, ...formProps }] = useForm(initialFormState, {
71
+ onSubmit: handleSubmit,
72
+ });
71
73
 
72
74
  const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
73
75
  const isLegalEntity = getLegalEntity(
74
76
  field('typeForm').value?.key,
75
77
  field('serviceDirection').value?.key,
76
78
  );
77
- const addressByBranch = useBranches(formState?.region?.key).filter((branch) => branch?.address);
78
79
 
79
80
  return (
80
81
  <form className={formStyle} onSubmit={formProps.onSubmit}>
81
82
  <ApplicationFieldsetLayout>
82
83
  <div className={oneColumnFormStyle}>
83
84
  <SelectControl
84
- label="Тема*"
85
+ label="Тема"
85
86
  placeholder="Выберите тему"
86
87
  options={FEEDBACK_TYPES}
87
88
  {...withValidator(field('typeForm'), defaultValidator)}
88
89
  />
89
90
  {isQualityService ? (
90
91
  <SelectControl
91
- label="Направление обслуживания*"
92
+ label="Направление обслуживания"
92
93
  placeholder="Выберите направление"
93
94
  options={SERVICE_DIRECTIONS}
94
95
  {...withValidator(field('serviceDirection'), defaultValidator)}
@@ -96,34 +97,31 @@ export const ApplicationFormFeedback = JSX<ApplicationFormsProps>(({ button, lin
96
97
  ) : null}
97
98
  <RegionField field={field} />
98
99
  {isQualityService ? (
99
- <SelectControl
100
- label="Адрес*"
101
- placeholder="Выберите адрес"
102
- options={addressByBranch.map(({ branchCode = '', address = '' }) => ({
103
- key: branchCode,
104
- text: address,
105
- }))}
106
- {...withValidator(field('addressBranch'), defaultValidator)}
107
- />
100
+ <AddressBranchField field={field} regionKey={formState?.region?.key} />
108
101
  ) : null}
109
102
  {renderUserData<FeedbackFormState>(field, true)}
110
103
  {isLegalEntity ? (
111
104
  <div>
112
- <InputControl label="ИНН*" {...withValidator(field('inn'), innValidator)} />
105
+ <InputControl label="ИНН" {...withValidator(field('inn'), innValidator)} />
113
106
  <InputControl label="Наименование организации" {...field('fullName')} />
114
107
  </div>
115
108
  ) : null}
116
109
  <SelectControl
117
- label="Способ получения ответа*"
110
+ label="Способ получения ответа"
118
111
  options={FEEDBACK_METHOD}
119
112
  {...withValidator(field('feedbackMethod'), defaultValidator)}
120
113
  />
121
- <PhoneInputControl label="Телефон*" {...withValidator(field('phone'), phoneValidator)} />
114
+ <PhoneInputControl label="Телефон" {...withValidator(field('phone'), phoneValidator)} />
122
115
  {isQualityService ? (
123
116
  <div>
124
- <PhoneInputControl label="Дополнительный телефон" {...field('secondaryPhone')} />
117
+ <PhoneInputControl
118
+ label="Дополнительный телефон"
119
+ {...(!field('secondaryPhone').value || field('secondaryPhone').value === '+7 ('
120
+ ? field('secondaryPhone')
121
+ : withValidator(field('secondaryPhone'), phoneValidator))}
122
+ />
125
123
  <InputControl
126
- label="Электронная почта*"
124
+ label="Электронная почта"
127
125
  {...withValidator(field('email'), defaultValidator)}
128
126
  />
129
127
  <InputControl
@@ -134,13 +132,13 @@ export const ApplicationFormFeedback = JSX<ApplicationFormsProps>(({ button, lin
134
132
  </div>
135
133
  ) : (
136
134
  <InputControl
137
- label="Электронная почта*"
135
+ label="Электронная почта"
138
136
  {...withValidator(field('email'), defaultValidator)}
139
137
  />
140
138
  )}
141
139
  <InputControl
142
140
  {...withValidator(field('comment'), defaultValidator)}
143
- placeholder="Ваше сообщение*"
141
+ placeholder="Ваше сообщение"
144
142
  isTextarea={true}
145
143
  />
146
144
  {renderAgreementWithSubmit(field('consentDataProcessing'), link, button)}
@@ -1,7 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm';
4
- import { formatPhone } from '../../utils/formatPhone';
5
4
  import { objectValidator } from '../../validation/objectValidator';
6
5
  import { isValidationSuccess } from '../../validation/validator';
7
6
  import { withValidator } from '../../validation/withValidator';
@@ -13,7 +12,7 @@ import { InputControl } from './InputControl';
13
12
  import { PhoneInputControl } from './PhoneInputControl';
14
13
  import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
15
14
  import { initialUserFormState, type UserDataState } from './renderUserData';
16
- import { defaultValidator, nameValidator, phoneValidator } from './validators';
15
+ import { checkboxValidator, defaultValidator, nameValidator, phoneValidator } from './validators';
17
16
 
18
17
  export type IndividualsFormState = UserDataState & {
19
18
  phone: string;
@@ -35,28 +34,19 @@ const individualsValidator = objectValidator({
35
34
  phone: phoneValidator,
36
35
  email: defaultValidator,
37
36
  birthday: defaultValidator,
37
+ consentDataProcessing: checkboxValidator,
38
38
  });
39
39
 
40
40
  export const ApplicationFormIndividuals = JSX<ApplicationFormsProps>((props) => {
41
- const { button, link, product, onSubmit } = props;
41
+ const { button, link, product = '', onSubmit } = props;
42
42
 
43
43
  const handleSubmit = useCallback(
44
44
  (formState: IndividualsFormState) => {
45
- const { surname, name, middleName, phone, email, birthday, consentDataProcessing } =
46
- formState;
47
-
48
45
  isValidationSuccess(individualsValidator(formState)) &&
49
46
  onSubmit(
50
47
  {
51
- typeForm: 'dpst',
52
- surname,
53
- name,
54
- middleName,
55
- email,
56
- consentDataProcessing,
57
- phoneNumber: formatPhone(phone),
58
- birthday: birthday?.toISOString().slice(0, 10) || '',
59
- product: product || '',
48
+ ...formState,
49
+ product,
60
50
  },
61
51
  true,
62
52
  );
@@ -64,7 +54,7 @@ export const ApplicationFormIndividuals = JSX<ApplicationFormsProps>((props) =>
64
54
  [onSubmit],
65
55
  );
66
56
 
67
- const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
57
+ const [, { field, ...formProps }] = useForm(initialFormState, { onSubmit: handleSubmit });
68
58
 
69
59
  return (
70
60
  <form className={formStyle} onSubmit={formProps.onSubmit}>
@@ -78,7 +68,7 @@ export const ApplicationFormIndividuals = JSX<ApplicationFormsProps>((props) =>
78
68
  <div className={formChildrenStyle}>
79
69
  <InputControl label="Имя" {...withValidator(field('name'), nameValidator)} />
80
70
  <DatePickerControl
81
- label="Дата рождения*"
71
+ label="Дата рождения"
82
72
  {...withValidator(field('birthday'), defaultValidator)}
83
73
  />
84
74
  <InputControl
@@ -2,33 +2,31 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm';
4
4
  import { type Option } from '../../ui-kit/Select/Option';
5
- import { formatPhone } from '../../utils/formatPhone';
6
5
  import { objectValidator } from '../../validation/objectValidator';
7
6
  import { isValidationSuccess } from '../../validation/validator';
8
7
  import { withValidator } from '../../validation/withValidator';
9
8
  import { ApplicationFieldsetLayout } from './ApplicationFieldsetLayout';
10
9
  import { type ApplicationFormsProps } from './ApplicationFormsProps';
11
- import { Footnote } from './Footnote';
12
10
  import { formStyle, oneColumnFormStyle } from './formStyle';
13
11
  import { InputControl } from './InputControl';
14
12
  import { PhoneInputControl } from './PhoneInputControl';
15
13
  import { RegionField } from './RegionField';
16
- import { renderSubmitButton } from './renderSubmitButton';
17
- import { initialUserFormState, type UserDataState } from './renderUserData';
14
+ import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
18
15
  import { defaultValidator, phoneValidator } from './validators';
19
16
 
20
- export type SelfCollectionFormState = UserDataState & {
17
+ export type SelfCollectionFormState = {
21
18
  typeForm: Option;
22
19
  fullName: string;
23
20
  region?: Option;
24
21
  phone: string;
22
+ consentDataProcessing: boolean;
25
23
  };
26
24
 
27
25
  const initialFormState: SelfCollectionFormState = {
28
- ...initialUserFormState,
29
26
  typeForm: { key: 'SELFCOLLECTION', text: 'Самоинкассация' }, // Уточнить key
30
27
  fullName: '',
31
28
  phone: '',
29
+ consentDataProcessing: false,
32
30
  };
33
31
 
34
32
  const feedbackValidator = objectValidator({
@@ -42,33 +40,21 @@ export const ApplicationFormSelfCollection = JSX<ApplicationFormsProps>(
42
40
  ({ button, link, onSubmit }) => {
43
41
  const handleSubmit = useCallback(
44
42
  (formState: SelfCollectionFormState) => {
45
- const { typeForm, region, fullName, phone } = formState;
46
-
47
- const submitData = {
48
- typeForm: typeForm.key,
49
- region: region?.text,
50
- name: fullName,
51
- phone: formatPhone(phone),
52
- };
53
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
43
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, false);
54
44
  },
55
45
  [onSubmit],
56
46
  );
57
47
 
58
- const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
48
+ const [, { field, ...formProps }] = useForm(initialFormState, { onSubmit: handleSubmit });
59
49
 
60
50
  return (
61
51
  <form className={formStyle} onSubmit={formProps.onSubmit}>
62
52
  <ApplicationFieldsetLayout>
63
53
  <div className={oneColumnFormStyle}>
64
- <InputControl label="ФИО*" {...withValidator(field('fullName'), defaultValidator)} />
54
+ <InputControl label="ФИО" {...withValidator(field('fullName'), defaultValidator)} />
65
55
  <RegionField field={field} />
66
- <PhoneInputControl
67
- label="Телефон*"
68
- {...withValidator(field('phone'), phoneValidator)}
69
- />
70
- {renderSubmitButton(button)}
71
- <Footnote link={link} />
56
+ <PhoneInputControl label="Телефон" {...withValidator(field('phone'), phoneValidator)} />
57
+ {renderAgreementWithSubmit(field('consentDataProcessing'), link, button)}
72
58
  </div>
73
59
  </ApplicationFieldsetLayout>
74
60
  </form>
@@ -3,17 +3,17 @@
3
3
  import { JSX } from '@redneckz/uni-jsx';
4
4
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
5
5
  import { useForm } from '../../hooks/useForm';
6
- import { usePremiumBranchesByRegions } from '../../hooks/usePremiumBranchesByRegions';
7
6
  import { type Option } from '../../ui-kit/Select/Option';
8
- import { formatPhone } from '../../utils/formatPhone';
9
7
  import { objectValidator } from '../../validation/objectValidator';
10
8
  import { isValidationSuccess } from '../../validation/validator';
11
9
  import { withValidator } from '../../validation/withValidator';
10
+ import { AddressBranchField } from './AddressBranchField';
12
11
  import { ApplicationFieldsetLayout, formChildrenStyle } from './ApplicationFieldsetLayout';
13
12
  import { type ApplicationFormsProps } from './ApplicationFormsProps';
14
13
  import { formStyle } from './formStyle';
15
14
  import { InputControl } from './InputControl';
16
15
  import { PhoneInputControl } from './PhoneInputControl';
16
+ import { RegionPremiumField } from './RegionPremiumField';
17
17
  import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
18
18
  import { initialUserFormState, type UserDataState } from './renderUserData';
19
19
  import { SelectControl } from './SelectControl';
@@ -57,58 +57,35 @@ export const ApplicationFormUltraPremium = JSX<ApplicationFormsProps>(
57
57
  ({ button, link, onSubmit, defaultType = 'PREMIUMSERVICE' }) => {
58
58
  const handleSubmit = useCallback(
59
59
  (formState: UltraPremiumFormState) => {
60
- const { surname, name, middleName, email, comment, consentDataProcessing } = formState;
61
-
62
- const submitData = {
63
- typeForm: formState.typeForm.key,
64
- surname,
65
- name,
66
- middleName,
67
- phoneNumber: formatPhone(formState.phone),
68
- email,
69
- addressBranch: formState.addressBranch?.key,
70
- comment,
71
- consentDataProcessing,
72
- };
73
- console.log(submitData);
74
-
75
- isValidationSuccess(creditValidator(formState)) && onSubmit(submitData, true);
60
+ const isValid = isValidationSuccess(creditValidator(formState));
61
+ isValid && onSubmit(formState, true);
76
62
  },
77
63
  [onSubmit],
78
64
  );
79
65
 
80
66
  const [formState, { field, ...formProps }] = useForm(
81
67
  { ...initialFormState, typeForm: getDefaultFormType(defaultType) as Option },
82
- handleSubmit,
68
+ { onSubmit: handleSubmit },
83
69
  );
84
- const branchByRegions = usePremiumBranchesByRegions();
85
- const regions = branchByRegions.map(({ region }) => ({
86
- key: region,
87
- text: region,
88
- }));
89
70
  const regionKey = formState?.region?.key;
90
- const addressBranches = branchByRegions.find((_) => _?.region === regionKey)?.branches;
91
71
 
92
72
  return (
93
73
  <form className={formStyle} onSubmit={formProps.onSubmit}>
94
74
  <ApplicationFieldsetLayout title="Ваши данные">
95
75
  <div className={formChildrenStyle}>
96
- <InputControl label="Фамилия*" {...withValidator(field('surname'), nameValidator)} />
76
+ <InputControl label="Фамилия" {...withValidator(field('surname'), nameValidator)} />
97
77
  <InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
98
78
  <InputControl
99
- label="Электронная почта*"
79
+ label="Электронная почта"
100
80
  {...withValidator(field('email'), defaultValidator)}
101
81
  />
102
82
  </div>
103
83
 
104
84
  <div className={formChildrenStyle}>
105
- <InputControl label="Имя*" {...withValidator(field('name'), nameValidator)} />
106
- <PhoneInputControl
107
- label="Телефон*"
108
- {...withValidator(field('phone'), phoneValidator)}
109
- />
85
+ <InputControl label="Имя" {...withValidator(field('name'), nameValidator)} />
86
+ <PhoneInputControl label="Телефон" {...withValidator(field('phone'), phoneValidator)} />
110
87
  <SelectControl
111
- label="Тип обслуживания*"
88
+ label="Тип обслуживания"
112
89
  options={SERVICE_TYPES}
113
90
  {...withValidator(field('typeForm'), defaultValidator)}
114
91
  />
@@ -116,24 +93,10 @@ export const ApplicationFormUltraPremium = JSX<ApplicationFormsProps>(
116
93
  </ApplicationFieldsetLayout>
117
94
  <ApplicationFieldsetLayout title="Офис банка">
118
95
  <div className={formChildrenStyle}>
119
- <SelectControl
120
- label="Регион*"
121
- placeholder="Выберите регион"
122
- options={regions as Option[]}
123
- {...withValidator(field('region'), defaultValidator)}
124
- />
96
+ <RegionPremiumField field={field} />
125
97
  </div>
126
98
  <div className={formChildrenStyle}>
127
- <SelectControl
128
- className="w-full"
129
- label="Адрес*"
130
- placeholder="Выберите отделение"
131
- options={(addressBranches || []).map(({ address = '' }) => ({
132
- key: address,
133
- text: address,
134
- }))}
135
- {...withValidator(field('addressBranch'), defaultValidator)}
136
- />
99
+ <AddressBranchField field={field} regionKey={regionKey} isPremium={true} />
137
100
  </div>
138
101
  </ApplicationFieldsetLayout>
139
102
  <InputControl
@@ -1,39 +1,40 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useForm } from '../../hooks/useForm';
4
- import { useRegions } from '../../hooks/useRegions';
5
4
  import { Heading } from '../../ui-kit/Heading/Heading';
6
5
  import { type Option } from '../../ui-kit/Select/Option';
7
- import { formatPhone } from '../../utils/formatPhone';
8
6
  import { objectValidator } from '../../validation/objectValidator';
9
7
  import { isValidationSuccess } from '../../validation/validator';
10
8
  import { type ApplicationFormsProps } from './ApplicationFormsProps';
11
9
  import { Footnote } from './Footnote';
10
+ import { InputControl } from './InputControl';
12
11
  import { renderContacts } from './renderContacts';
13
12
  import { renderQuestionsInterested } from './renderQuestionsInterested';
14
13
  import { renderSubmitButton } from './renderSubmitButton';
15
- import { renderTextarea } from './renderTextarea';
16
14
  import { renderWedDataOrganization } from './renderWedDataOrganization';
17
15
  import { defaultValidator, innValidator, nameValidator, phoneValidator } from './validators';
18
16
 
19
17
  export interface WedFormState {
20
- fullName: string;
21
- name: string;
22
- phone: string;
18
+ typeForm: Option;
23
19
  vedTypes: string;
24
- text: string;
25
20
  region?: Option;
26
- mail?: string;
21
+ name: string;
22
+ fullName: string;
23
+ phone: string;
27
24
  inn?: string;
25
+ email: string;
26
+ partnerComments: string;
28
27
  }
29
28
 
30
29
  const initialFormState: WedFormState = {
30
+ typeForm: { key: 'KVED', text: 'Заявка на консультацию ВЭД' },
31
+ vedTypes: 'currencyControl',
31
32
  fullName: '',
32
33
  name: '',
33
34
  phone: '',
34
35
  inn: '',
35
- vedTypes: 'currencyControl',
36
- text: '',
36
+ email: '',
37
+ partnerComments: '',
37
38
  };
38
39
 
39
40
  const defaultValidators = {
@@ -44,7 +45,6 @@ const defaultValidators = {
44
45
 
45
46
  const wedValidator = objectValidator({
46
47
  ...defaultValidators,
47
- mail: defaultValidator,
48
48
  });
49
49
 
50
50
  const wedValidatorCurrencyControl = objectValidator({
@@ -70,17 +70,17 @@ export const ApplicationFormWed = JSX<ApplicationFormsProps>((props) => {
70
70
 
71
71
  const handleSubmit = useCallback(
72
72
  (formState: WedFormState) => {
73
- const { fullName, name, phone, mail, inn, region, vedTypes, text } = formState;
73
+ const { typeForm, fullName, name, phone, email, inn, region, vedTypes, partnerComments } =
74
+ formState;
74
75
 
75
76
  const data = {
76
- typeForm: 'KVED',
77
+ typeForm,
77
78
  fullName,
78
79
  name,
79
- phone: formatPhone(phone),
80
- text,
80
+ phone,
81
81
  vedTypes: getVedTypes(vedTypes),
82
- PartnerComments: text,
83
- ...(!isCurrencyControl(vedTypes) ? { mail } : { inn, region: region?.text || '' }),
82
+ partnerComments,
83
+ ...(!isCurrencyControl(vedTypes) ? { email } : { inn, region }),
84
84
  };
85
85
 
86
86
  isValidationSuccess(getValidator(vedTypes)(formState)) && onSubmit(data);
@@ -88,21 +88,19 @@ export const ApplicationFormWed = JSX<ApplicationFormsProps>((props) => {
88
88
  [onSubmit],
89
89
  );
90
90
 
91
- const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
92
- const regions = useRegions();
93
- const textField = field('text');
91
+ const [, { field, ...formProps }] = useForm(initialFormState, { onSubmit: handleSubmit });
94
92
 
95
93
  return (
96
94
  <form className="container space-y-lg" onSubmit={formProps.onSubmit}>
97
95
  {renderQuestionsInterested(field)}
98
96
  <Heading headingType="h6" title="Данные организации" className="@xl:text-center" />
99
- {renderWedDataOrganization({ field, regions })}
100
- {renderTextarea({
101
- textField,
102
- text: 'Обращение',
103
- placeholder:
104
- 'Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка',
105
- })}
97
+ {renderWedDataOrganization({ field })}
98
+ <InputControl
99
+ label="Обращение"
100
+ placeholder="Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"
101
+ {...field('partnerComments')}
102
+ isTextarea={true}
103
+ />
106
104
  {renderSubmitButton(button)}
107
105
  <Footnote link={link} />
108
106
  <Heading
@@ -9,16 +9,17 @@ export interface DatePickerControlProps {
9
9
  label: string;
10
10
  value?: Date;
11
11
  error?: string;
12
+ errors?: string[];
12
13
  onChange?: (value: Date) => void;
13
14
  }
14
15
 
15
16
  export const DatePickerControl = JSX<DatePickerControlProps>(
16
- ({ className, label, value = undefined, error, onChange }) => (
17
+ ({ className, label, value = undefined, error, onChange, ...rest }) => (
17
18
  <div className={style('shrink-0 w-full', className)}>
18
19
  {label ? (
19
20
  <div className="mb-xs">
20
21
  <Text size="text-m" font="font-light">
21
- {label}
22
+ {rest?.errors ? `${label}*` : label}
22
23
  </Text>
23
24
  </div>
24
25
  ) : null}
@@ -5,18 +5,18 @@ import { style } from '../../utils/style';
5
5
  import { renderErrorText } from './renderErrorText';
6
6
 
7
7
  export const InputControl = JSX<InputProps>(
8
- ({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea }) => (
8
+ ({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea, ...rest }) => (
9
9
  <div className={style('shrink-0 w-full', className)}>
10
10
  <Input
11
11
  type="text"
12
12
  aria-label={label}
13
- label={label}
13
+ label={label && rest?.errors ? `${label}*` : label}
14
14
  valid={Boolean(!error)}
15
15
  value={value}
16
16
  onChange={onChange}
17
17
  onBlur={onBlur}
18
18
  isTextarea={isTextarea}
19
- placeholder={placeholder}
19
+ placeholder={rest?.errors && !label ? `${placeholder}*` : placeholder}
20
20
  />
21
21
  {renderErrorText(error)}
22
22
  </div>
@@ -5,11 +5,11 @@ import { style } from '../../utils/style';
5
5
  import { renderErrorText } from './renderErrorText';
6
6
 
7
7
  export const PhoneInputControl = JSX<InputProps>(
8
- ({ className, label, value, error, onChange, onBlur }) => (
8
+ ({ className, label, value, error, onChange, onBlur, ...rest }) => (
9
9
  <div className={style('shrink-0 w-full', className)}>
10
10
  <PhoneInput
11
11
  aria-label={label}
12
- label={label}
12
+ label={rest?.errors ? `${label}*` : label}
13
13
  valid={Boolean(!error)}
14
14
  value={value}
15
15
  onChange={onChange}
@@ -0,0 +1,28 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { type FormFieldRegisterer } from '../../hooks/useForm';
3
+ import { usePremiumBranchesByRegions } from '../../hooks/usePremiumBranchesByRegions';
4
+ import { type Option } from '../../ui-kit/Select/Option';
5
+ import { withValidator } from '../../validation/withValidator';
6
+ import { SelectControl } from './SelectControl';
7
+ import { defaultValidator } from './validators';
8
+
9
+ interface RegionFieldProps {
10
+ field: FormFieldRegisterer<any>;
11
+ }
12
+
13
+ export const RegionPremiumField = JSX<RegionFieldProps>(({ field }) => {
14
+ const branchByRegions = usePremiumBranchesByRegions();
15
+ const regions = branchByRegions.map(({ region }) => ({
16
+ key: region,
17
+ text: region,
18
+ }));
19
+
20
+ return (
21
+ <SelectControl
22
+ label="Регион"
23
+ placeholder="Выберите регион"
24
+ options={regions as Option[]}
25
+ {...withValidator(field('region'), defaultValidator)}
26
+ />
27
+ );
28
+ });
@@ -3,13 +3,17 @@ import { Select, type SelectProps } from '../../ui-kit/Select/Select';
3
3
  import { renderErrorText } from './renderErrorText';
4
4
 
5
5
  interface SelectControlProps extends SelectProps {
6
+ label?: string;
6
7
  error?: string;
8
+ errors?: string[];
7
9
  className?: string;
8
10
  }
9
11
 
10
- export const SelectControl = JSX<SelectControlProps>(({ className = '', error, ...rest }) => (
11
- <div className={className}>
12
- <Select {...rest} valid={!error} />
13
- {renderErrorText(error)}
14
- </div>
15
- ));
12
+ export const SelectControl = JSX<SelectControlProps>(
13
+ ({ className = '', label, error, ...rest }) => (
14
+ <div className={className}>
15
+ <Select {...rest} valid={!error} label={rest?.errors ? `${label}*` : label} />
16
+ {renderErrorText(error)}
17
+ </div>
18
+ ),
19
+ );