@redneckz/wildless-cms-uni-blocks 0.14.264 → 0.14.266

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 (430) hide show
  1. package/bin/migration-scripts/0.14.265.js +100 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +264 -291
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  6. package/bundle/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  7. package/bundle/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  8. package/bundle/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  9. package/bundle/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  10. package/bundle/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  11. package/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  12. package/bundle/components/ApplicationFormCustom/contants.d.ts +3 -0
  13. package/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  14. package/bundle/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  15. package/bundle/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  16. package/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  17. package/bundle/hooks/useNormalizedInput.d.ts +2 -1
  18. package/bundle/ui-kit/Input/InputProps.d.ts +3 -2
  19. package/bundle/ui-kit/PreventableEvent.d.ts +3 -0
  20. package/dist/api/LeadServiceAPI.js +18 -10
  21. package/dist/api/LeadServiceAPI.js.map +1 -1
  22. package/dist/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  23. package/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  24. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +12 -2
  25. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  26. package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  27. package/dist/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  28. package/dist/components/ApplicationFormCustom/FeedbackMethodField.js +10 -0
  29. package/dist/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  30. package/dist/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  31. package/dist/components/ApplicationFormCustom/FeedbackTypeField.js +19 -0
  32. package/dist/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  33. package/dist/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  34. package/dist/components/ApplicationFormCustom/IsClientField.js +7 -0
  35. package/dist/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  36. package/dist/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  37. package/dist/components/ApplicationFormCustom/PartnerCommentsField.js +14 -0
  38. package/dist/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  39. package/dist/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  40. package/dist/components/ApplicationFormCustom/ServiceDirectionField.js +10 -0
  41. package/dist/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  42. package/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  43. package/dist/components/ApplicationFormCustom/UltraPremiumField.js +4 -7
  44. package/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  45. package/dist/components/ApplicationFormCustom/contants.d.ts +3 -0
  46. package/dist/components/ApplicationFormCustom/contants.js +19 -1
  47. package/dist/components/ApplicationFormCustom/contants.js.map +1 -1
  48. package/dist/components/ApplicationFormCustom/getField.js +13 -2
  49. package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  50. package/dist/components/ApplicationFormCustom/getFormatData.js +2 -1
  51. package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  52. package/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  53. package/dist/components/ApplicationFormCustom/getInitialFormState.js +7 -4
  54. package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  55. package/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  56. package/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  57. package/dist/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  58. package/dist/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  59. package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  60. package/dist/components/Blocks.js +0 -2
  61. package/dist/components/Blocks.js.map +1 -1
  62. package/dist/components/Blocks.mobile.js +0 -2
  63. package/dist/components/Blocks.mobile.js.map +1 -1
  64. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +4 -1
  65. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  66. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  67. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  68. package/dist/hooks/useNormalizedInput.d.ts +2 -1
  69. package/dist/hooks/useNormalizedInput.js +2 -2
  70. package/dist/hooks/useNormalizedInput.js.map +1 -1
  71. package/dist/ui-kit/Input/InputProps.d.ts +3 -2
  72. package/dist/ui-kit/PhoneInput/PhoneInput.js +5 -2
  73. package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  74. package/dist/ui-kit/PreventableEvent.d.ts +3 -0
  75. package/lib/api/LeadServiceAPI.js +18 -10
  76. package/lib/api/LeadServiceAPI.js.map +1 -1
  77. package/lib/common.css +1 -1
  78. package/lib/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  79. package/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  80. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +1 -0
  81. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -3
  82. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  83. package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  84. package/lib/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  85. package/lib/components/ApplicationFormCustom/FeedbackMethodField.js +8 -0
  86. package/lib/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  87. package/lib/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  88. package/lib/components/ApplicationFormCustom/FeedbackTypeField.js +17 -0
  89. package/lib/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  90. package/lib/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  91. package/lib/components/ApplicationFormCustom/IsClientField.js +5 -0
  92. package/lib/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  93. package/lib/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  94. package/lib/components/ApplicationFormCustom/PartnerCommentsField.js +12 -0
  95. package/lib/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  96. package/lib/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  97. package/lib/components/ApplicationFormCustom/ServiceDirectionField.js +8 -0
  98. package/lib/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  99. package/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  100. package/lib/components/ApplicationFormCustom/UltraPremiumField.js +3 -6
  101. package/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  102. package/lib/components/ApplicationFormCustom/contants.d.ts +3 -0
  103. package/lib/components/ApplicationFormCustom/contants.js +18 -0
  104. package/lib/components/ApplicationFormCustom/contants.js.map +1 -1
  105. package/lib/components/ApplicationFormCustom/getField.js +13 -2
  106. package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  107. package/lib/components/ApplicationFormCustom/getFormatData.js +2 -1
  108. package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  109. package/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  110. package/lib/components/ApplicationFormCustom/getInitialFormState.js +5 -2
  111. package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  112. package/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  113. package/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  114. package/lib/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  115. package/lib/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  116. package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  117. package/lib/components/Blocks.js +0 -2
  118. package/lib/components/Blocks.js.map +1 -1
  119. package/lib/components/Blocks.mobile.js +0 -2
  120. package/lib/components/Blocks.mobile.js.map +1 -1
  121. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +4 -1
  122. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  123. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  124. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  125. package/lib/hooks/useNormalizedInput.d.ts +2 -1
  126. package/lib/hooks/useNormalizedInput.js +2 -2
  127. package/lib/hooks/useNormalizedInput.js.map +1 -1
  128. package/lib/ui-kit/Input/InputProps.d.ts +3 -2
  129. package/lib/ui-kit/PhoneInput/PhoneInput.js +5 -2
  130. package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  131. package/lib/ui-kit/PreventableEvent.d.ts +3 -0
  132. package/mobile/bundle/bundle.umd.js +273 -293
  133. package/mobile/bundle/bundle.umd.min.js +1 -1
  134. package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  135. package/mobile/bundle/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  136. package/mobile/bundle/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  137. package/mobile/bundle/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  138. package/mobile/bundle/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  139. package/mobile/bundle/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  140. package/mobile/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  141. package/mobile/bundle/components/ApplicationFormCustom/contants.d.ts +3 -0
  142. package/mobile/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  143. package/mobile/bundle/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  144. package/mobile/bundle/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  145. package/mobile/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  146. package/mobile/bundle/hooks/useNormalizedInput.d.ts +2 -1
  147. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +3 -2
  148. package/mobile/bundle/ui-kit/PreventableEvent.d.ts +3 -0
  149. package/mobile/dist/api/LeadServiceAPI.js +18 -10
  150. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  151. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  152. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  153. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +12 -2
  154. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  155. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  156. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  157. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.js +10 -0
  158. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  159. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  160. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.js +19 -0
  161. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  162. package/mobile/dist/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  163. package/mobile/dist/components/ApplicationFormCustom/IsClientField.js +7 -0
  164. package/mobile/dist/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  165. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  166. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.js +14 -0
  167. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  168. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  169. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.js +10 -0
  170. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  171. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  172. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js +4 -7
  173. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  174. package/mobile/dist/components/ApplicationFormCustom/contants.d.ts +3 -0
  175. package/mobile/dist/components/ApplicationFormCustom/contants.js +19 -1
  176. package/mobile/dist/components/ApplicationFormCustom/contants.js.map +1 -1
  177. package/mobile/dist/components/ApplicationFormCustom/getField.js +13 -2
  178. package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  179. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js +2 -1
  180. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  181. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  182. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +7 -4
  183. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  184. package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  185. package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  186. package/mobile/dist/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  187. package/mobile/dist/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  188. package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  189. package/mobile/dist/components/Blocks.js +0 -2
  190. package/mobile/dist/components/Blocks.js.map +1 -1
  191. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +4 -1
  192. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  193. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  194. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  195. package/mobile/dist/hooks/useNormalizedInput.d.ts +2 -1
  196. package/mobile/dist/hooks/useNormalizedInput.js +2 -2
  197. package/mobile/dist/hooks/useNormalizedInput.js.map +1 -1
  198. package/mobile/dist/ui-kit/Input/InputProps.d.ts +3 -2
  199. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +5 -2
  200. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  201. package/mobile/dist/ui-kit/PreventableEvent.d.ts +3 -0
  202. package/mobile/lib/api/LeadServiceAPI.js +18 -10
  203. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  204. package/mobile/lib/common.css +1 -1
  205. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  206. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  207. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -3
  208. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  209. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  210. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  211. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.js +8 -0
  212. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  213. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  214. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.js +17 -0
  215. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  216. package/mobile/lib/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  217. package/mobile/lib/components/ApplicationFormCustom/IsClientField.js +5 -0
  218. package/mobile/lib/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  219. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  220. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.js +12 -0
  221. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  222. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  223. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.js +8 -0
  224. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  225. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  226. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js +3 -6
  227. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  228. package/mobile/lib/components/ApplicationFormCustom/contants.d.ts +3 -0
  229. package/mobile/lib/components/ApplicationFormCustom/contants.js +18 -0
  230. package/mobile/lib/components/ApplicationFormCustom/contants.js.map +1 -1
  231. package/mobile/lib/components/ApplicationFormCustom/getField.js +13 -2
  232. package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  233. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js +2 -1
  234. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  235. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  236. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +5 -2
  237. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  238. package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  239. package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  240. package/mobile/lib/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  241. package/mobile/lib/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  242. package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  243. package/mobile/lib/components/Blocks.js +0 -2
  244. package/mobile/lib/components/Blocks.js.map +1 -1
  245. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +4 -1
  246. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  247. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  248. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  249. package/mobile/lib/hooks/useNormalizedInput.d.ts +2 -1
  250. package/mobile/lib/hooks/useNormalizedInput.js +2 -2
  251. package/mobile/lib/hooks/useNormalizedInput.js.map +1 -1
  252. package/mobile/lib/ui-kit/Input/InputProps.d.ts +3 -2
  253. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +5 -2
  254. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  255. package/mobile/lib/ui-kit/PreventableEvent.d.ts +3 -0
  256. package/mobile/src/api/LeadServiceAPI.ts +18 -9
  257. package/mobile/src/components/ApplicationFormCustom/AddressBranchField.tsx +5 -4
  258. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +90 -0
  259. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +18 -6
  260. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +13 -8
  261. package/mobile/src/components/ApplicationFormCustom/FeedbackMethodField.tsx +14 -0
  262. package/mobile/src/components/ApplicationFormCustom/FeedbackTypeField.tsx +25 -0
  263. package/mobile/src/components/ApplicationFormCustom/IsClientField.tsx +7 -0
  264. package/mobile/src/components/ApplicationFormCustom/PartnerCommentsField.tsx +18 -0
  265. package/mobile/src/components/ApplicationFormCustom/ServiceDirectionField.tsx +15 -0
  266. package/mobile/src/components/ApplicationFormCustom/UltraPremiumField.tsx +3 -9
  267. package/mobile/src/components/ApplicationFormCustom/contants.tsx +21 -0
  268. package/mobile/src/components/ApplicationFormCustom/getField.tsx +20 -7
  269. package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +2 -0
  270. package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +6 -2
  271. package/mobile/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
  272. package/mobile/src/components/ApplicationFormCustom/renderAgreementSubmit.tsx +1 -1
  273. package/mobile/src/components/ApplicationFormCustom/renderSubmitButton.tsx +1 -1
  274. package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +1 -1
  275. package/mobile/src/components/Blocks.ts +0 -2
  276. package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +8 -1
  277. package/mobile/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +8 -1
  278. package/mobile/src/hooks/useNormalizedInput.ts +3 -2
  279. package/mobile/src/ui-kit/Input/InputProps.ts +3 -2
  280. package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +7 -3
  281. package/mobile/src/ui-kit/PreventableEvent.ts +2 -0
  282. package/package.json +1 -1
  283. package/src/api/LeadServiceAPI.ts +18 -9
  284. package/src/components/ApplicationFormCustom/AddressBranchField.tsx +5 -4
  285. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +90 -0
  286. package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +86 -0
  287. package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +18 -6
  288. package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +13 -8
  289. package/src/components/ApplicationFormCustom/FeedbackMethodField.tsx +14 -0
  290. package/src/components/ApplicationFormCustom/FeedbackTypeField.tsx +25 -0
  291. package/src/components/ApplicationFormCustom/IsClientField.tsx +7 -0
  292. package/src/components/ApplicationFormCustom/PartnerCommentsField.tsx +18 -0
  293. package/src/components/ApplicationFormCustom/ServiceDirectionField.tsx +15 -0
  294. package/src/components/ApplicationFormCustom/UltraPremiumField.tsx +3 -9
  295. package/src/components/ApplicationFormCustom/contants.tsx +21 -0
  296. package/src/components/ApplicationFormCustom/getField.tsx +20 -7
  297. package/src/components/ApplicationFormCustom/getFormatData.tsx +2 -0
  298. package/src/components/ApplicationFormCustom/getInitialFormState.tsx +6 -2
  299. package/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
  300. package/src/components/ApplicationFormCustom/renderAgreementSubmit.tsx +1 -1
  301. package/src/components/ApplicationFormCustom/renderSubmitButton.tsx +1 -1
  302. package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +1 -1
  303. package/src/components/Blocks.mobile.ts +0 -2
  304. package/src/components/Blocks.ts +0 -2
  305. package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +8 -1
  306. package/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +8 -1
  307. package/src/hooks/useNormalizedInput.ts +3 -2
  308. package/src/ui-kit/Input/InputProps.ts +3 -2
  309. package/src/ui-kit/PhoneInput/PhoneInput.tsx +7 -3
  310. package/src/ui-kit/PreventableEvent.ts +2 -0
  311. package/bundle/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  312. package/bundle/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  313. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  314. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  315. package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  316. package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  317. package/bundle/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  318. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  319. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -8
  320. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  321. package/dist/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  322. package/dist/components/ApplicationForm/ApplicationForm.js +0 -31
  323. package/dist/components/ApplicationForm/ApplicationForm.js.map +0 -1
  324. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  325. package/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  326. package/dist/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  327. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  328. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +0 -80
  329. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  330. package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  331. package/dist/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  332. package/dist/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  333. package/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  334. package/dist/components/ApplicationForm/EmbeddableForms.js +0 -7
  335. package/dist/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  336. package/dist/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  337. package/dist/components/ApplicationForm/feedbackTypes.js +0 -21
  338. package/dist/components/ApplicationForm/feedbackTypes.js.map +0 -1
  339. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  340. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -6
  341. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  342. package/lib/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  343. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +0 -6
  344. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +0 -6
  345. package/lib/components/ApplicationForm/ApplicationForm.js +0 -29
  346. package/lib/components/ApplicationForm/ApplicationForm.js.map +0 -1
  347. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  348. package/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  349. package/lib/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  350. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  351. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +0 -76
  352. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  353. package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  354. package/lib/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  355. package/lib/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  356. package/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  357. package/lib/components/ApplicationForm/EmbeddableForms.js +0 -5
  358. package/lib/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  359. package/lib/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  360. package/lib/components/ApplicationForm/feedbackTypes.js +0 -19
  361. package/lib/components/ApplicationForm/feedbackTypes.js.map +0 -1
  362. package/mobile/bundle/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  363. package/mobile/bundle/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  364. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  365. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  366. package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  367. package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  368. package/mobile/bundle/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  369. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  370. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -8
  371. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  372. package/mobile/dist/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  373. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +0 -31
  374. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +0 -1
  375. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  376. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  377. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  378. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  379. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +0 -80
  380. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  381. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  382. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  383. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  384. package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  385. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +0 -7
  386. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  387. package/mobile/dist/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  388. package/mobile/dist/components/ApplicationForm/feedbackTypes.js +0 -21
  389. package/mobile/dist/components/ApplicationForm/feedbackTypes.js.map +0 -1
  390. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  391. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -6
  392. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  393. package/mobile/lib/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  394. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +0 -29
  395. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +0 -1
  396. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  397. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  398. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  399. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  400. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +0 -76
  401. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  402. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  403. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  404. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  405. package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  406. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +0 -5
  407. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  408. package/mobile/lib/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  409. package/mobile/lib/components/ApplicationForm/feedbackTypes.js +0 -19
  410. package/mobile/lib/components/ApplicationForm/feedbackTypes.js.map +0 -1
  411. package/mobile/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +0 -21
  412. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +0 -13
  413. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +0 -66
  414. package/mobile/src/components/ApplicationForm/ApplicationForm.ui.json +0 -9
  415. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +0 -41
  416. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +0 -205
  417. package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +0 -8
  418. package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +0 -5
  419. package/mobile/src/components/ApplicationForm/feedbackTypes.ts +0 -22
  420. package/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +0 -21
  421. package/src/components/ApplicationForm/ApplicationForm.example.json +0 -13
  422. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +0 -29
  423. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +0 -29
  424. package/src/components/ApplicationForm/ApplicationForm.tsx +0 -66
  425. package/src/components/ApplicationForm/ApplicationForm.ui.json +0 -9
  426. package/src/components/ApplicationForm/ApplicationFormContent.ts +0 -41
  427. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +0 -205
  428. package/src/components/ApplicationForm/ApplicationFormsProps.ts +0 -8
  429. package/src/components/ApplicationForm/EmbeddableForms.tsx +0 -5
  430. package/src/components/ApplicationForm/feedbackTypes.ts +0 -22
@@ -826,16 +826,16 @@
826
826
  const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
827
827
 
828
828
  function LeadServiceAPI() {
829
- // eslint-disable-next-line complexity
830
829
  async function send(body, isIndividualType = false) {
831
- const url = isIndividualType ? '/api/v1/lead' : '/api/v1/sendcorporatelead';
832
- const { typeForm, region, phone = '', email, birthday, inn, fullName, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, ...staticBody } = body;
830
+ const { typeForm, region, phone = '', email, birthday, inn, fullName, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, serviceDirection, ...staticBody } = body;
831
+ const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
832
+ const url = isNaturalPerson ? '/api/v1/lead' : '/api/v1/sendcorporatelead';
833
833
  const submitBody = {
834
834
  typeForm,
835
- [isIndividualType ? 'regionBranch' : 'region']: region,
836
- [isIndividualType ? 'email' : 'mail']: email,
835
+ ...getRegion$1(region, isNaturalPerson),
836
+ ...getEmail(email, isNaturalPerson),
837
837
  ...getPhone(phone),
838
- ...(isIndividualType ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
838
+ ...(isNaturalPerson ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
839
839
  ...(typeForm === 'FEEDBACK'
840
840
  ? {}
841
841
  : {
@@ -867,17 +867,18 @@
867
867
  send,
868
868
  };
869
869
  }
870
- const getPhone = (phone, isIndividual) => phone ? { [isIndividual ? 'phoneNumber' : 'phone']: formatPhone(phone) } : {};
871
- const getSecondaryPhone = (secondaryPhone) => !secondaryPhone || secondaryPhone === '+7 ('
872
- ? {}
873
- : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
874
-
875
- const ResponseNotification = JSX(({ responseType }) => {
876
- const responseOK = responseType === 'OK';
877
- const backgroundColor = responseOK ? 'bg-ok' : 'bg-fail';
878
- const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
879
- return (jsxs("div", { className: style('flex items-center p-lg rounded-md space-x-m', backgroundColor), children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "42", height: "42" }), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responseOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-2xs" }), jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: responseOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
870
+ const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
871
+ const getRegion$1 = (region, isNaturalPerson = true) => ({
872
+ [isNaturalPerson ? 'regionBranch' : 'region']: region,
873
+ });
874
+ const getEmail = (email, isNaturalPerson = true) => ({
875
+ [isNaturalPerson ? 'email' : 'mail']: email,
880
876
  });
877
+ const getSecondaryPhone = (secondaryPhone = '') => {
878
+ return !secondaryPhone || secondaryPhone === '+7 ('
879
+ ? {}
880
+ : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
881
+ };
881
882
 
882
883
  const identity = (_) => _;
883
884
 
@@ -927,8 +928,58 @@
927
928
  ];
928
929
  };
929
930
 
931
+ const ResponseNotification = JSX(({ responseType }) => {
932
+ const responseOK = responseType === 'OK';
933
+ const backgroundColor = responseOK ? 'bg-ok' : 'bg-fail';
934
+ const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
935
+ return (jsxs("div", { className: style('flex items-center p-lg rounded-md space-x-m', backgroundColor), children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "42", height: "42" }), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responseOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-2xs" }), jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: responseOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
936
+ });
937
+
938
+ const ApplicationFormLayout = JSX((props) => {
939
+ const { className, title, responseType, children, ...rest } = props;
940
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
941
+ });
942
+
943
+ const objectValidator = (validatorsMap) => (o) => (o &&
944
+ Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
945
+ [];
946
+
947
+ const isValidationSuccess = (info) => !info?.length;
948
+ const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
949
+
930
950
  const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
931
951
 
952
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
953
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
954
+ const resultOptions = { ...commonOptions, ...options };
955
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
956
+ }) }));
957
+ });
958
+
959
+ const CHECK_PATHS = [
960
+ {
961
+ d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
962
+ fillRule: 'evenodd',
963
+ clipRule: 'evenodd',
964
+ fill: 'white',
965
+ },
966
+ ];
967
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
968
+ const handleChange = useCallback((e) => {
969
+ if (disabled) {
970
+ return;
971
+ }
972
+ e.preventDefault();
973
+ onChange && onChange(!value);
974
+ }, [onChange, disabled, value]);
975
+ const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
976
+ return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
977
+ });
978
+ const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
979
+ const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
980
+
981
+ const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
982
+
932
983
  function useBool(defaultValue = false) {
933
984
  const [value, setValue] = useState(defaultValue);
934
985
  const setTrue = useCallback(() => setValue(true), []);
@@ -1227,20 +1278,58 @@
1227
1278
  }
1228
1279
 
1229
1280
  const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
1230
- const handleChange = useCallback((value) => onChange && onChange(normalizePhone(value)), [onChange]);
1231
- return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
1281
+ const handleChange = useCallback((v) => onChange && onChange(normalizePhone(v)), [onChange]);
1282
+ const handleBlur = useCallback((v) => {
1283
+ v === '+7 (' ? onChange && onChange('') : null;
1284
+ }, []);
1285
+ return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (e) => handleChange(e?.target?.value || ''), onBlur: (e) => handleBlur(e?.target?.value || ''), children: children }));
1232
1286
  });
1233
1287
 
1234
1288
  const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
1235
1289
 
1236
1290
  const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: rest?.errors ? `${label}*` : label }), renderErrorText(error)] })));
1237
1291
 
1238
- const objectValidator = (validatorsMap) => (o) => (o &&
1239
- Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
1240
- [];
1292
+ const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
1241
1293
 
1242
- const isValidationSuccess = (info) => !info?.length;
1243
- const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
1294
+ const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
1295
+
1296
+ const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
1297
+
1298
+ const ERROR_MESSAGE = 'Некорректно заполненное поле';
1299
+ const defaultValidator = required(ERROR_MESSAGE);
1300
+ const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
1301
+ const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
1302
+ const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
1303
+ const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
1304
+ const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
1305
+
1306
+ const validatorObj = {
1307
+ typeForm: defaultValidator,
1308
+ surname: nameValidator,
1309
+ name: nameValidator,
1310
+ region: defaultSelectValidator,
1311
+ addressBranch: defaultSelectValidator,
1312
+ phone: phoneValidator,
1313
+ secondaryPhone: phoneValidator,
1314
+ birthday: defaultValidator,
1315
+ email: defaultValidator,
1316
+ fullName: nameValidator,
1317
+ inn: innValidator,
1318
+ partnerComments: defaultValidator,
1319
+ collectionCount: defaultValidator,
1320
+ comment: defaultValidator,
1321
+ acquiringType: defaultSelectValidator,
1322
+ feedbackType: defaultSelectValidator,
1323
+ feedbackMethod: defaultSelectValidator,
1324
+ serviceType: defaultSelectValidator,
1325
+ serviceDirection: defaultSelectValidator,
1326
+ consentDataProcessing: agreementValidator,
1327
+ annualRevenue: defaultValidator,
1328
+ };
1329
+ const getObjectValidator = (inputs) => {
1330
+ const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
1331
+ return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
1332
+ };
1244
1333
 
1245
1334
  const withValidator = (props, validator) => {
1246
1335
  const { value, isDirty } = props;
@@ -1252,6 +1341,29 @@
1252
1341
  };
1253
1342
  };
1254
1343
 
1344
+ const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1345
+
1346
+ const ACQUIRING_TYPES = [
1347
+ {
1348
+ text: 'Торговый эквайринг',
1349
+ key: 'trade',
1350
+ },
1351
+ {
1352
+ text: 'СБП-эквайринг',
1353
+ key: 'sbp',
1354
+ },
1355
+ {
1356
+ text: 'Интернет-эквайринг',
1357
+ key: 'internet',
1358
+ },
1359
+ {
1360
+ text: 'Все виды эквайринга',
1361
+ key: 'all',
1362
+ },
1363
+ ];
1364
+ const AcquiringField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES, ...getValidation(field('acquiringType'), validatorObj.acquiringType, input?.required) })));
1365
+ const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
1366
+
1255
1367
  const isFilled = (_) => _ !== null && _ !== undefined;
1256
1368
 
1257
1369
  const defaultCache = new Map();
@@ -1335,278 +1447,30 @@
1335
1447
  return Array.isArray(data) ? data : [];
1336
1448
  }
1337
1449
 
1338
- const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
1339
-
1340
- const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
1341
-
1342
- const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
1343
-
1344
- const ERROR_MESSAGE = 'Некорректно заполненное поле';
1345
- const defaultValidator = required(ERROR_MESSAGE);
1346
- const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
1347
- const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
1348
- const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
1349
- const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
1350
- const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
1351
-
1352
- const validatorObj = {
1353
- typeForm: defaultValidator,
1354
- surname: nameValidator,
1355
- name: nameValidator,
1356
- region: defaultSelectValidator,
1357
- addressBranch: defaultSelectValidator,
1358
- phone: phoneValidator,
1359
- birthday: defaultValidator,
1360
- email: defaultValidator,
1361
- fullName: nameValidator,
1362
- inn: innValidator,
1363
- partnerComments: defaultValidator,
1364
- collectionCount: defaultValidator,
1365
- comment: defaultValidator,
1366
- acquiringType: defaultSelectValidator,
1367
- serviceType: defaultSelectValidator,
1368
- consentDataProcessing: agreementValidator,
1369
- annualRevenue: defaultValidator,
1370
- };
1371
- const getObjectValidator = (inputs) => {
1372
- const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
1373
- return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
1374
- };
1375
-
1376
- const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1377
-
1378
1450
  const AddressBranchField = JSX(({ field, input, isPremium = false }) => {
1379
- const regionKey = field('region')?.value?.key;
1380
- const regionText = field('region')?.value?.text;
1451
+ const fieldRegion = field('region');
1452
+ const regionKey = fieldRegion?.value?.key;
1453
+ const regionText = fieldRegion?.value?.text;
1381
1454
  const addressBranch = isPremium
1382
1455
  ? useBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
1383
1456
  : useBranches(regionKey)?.filter((branch) => branch?.address);
1384
1457
  useEffect(() => {
1385
- if (field('region')?.value?.key !== '') {
1458
+ if (fieldRegion?.value?.key !== '') {
1386
1459
  field?.('addressBranch')?.onChange?.('');
1387
1460
  }
1388
- }, [field('region')?.value]);
1461
+ }, [fieldRegion?.value]);
1389
1462
  return (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: (addressBranch || []).map(({ address = '' }) => ({
1390
1463
  key: address,
1391
1464
  text: address,
1392
1465
  })), ...getValidation(field('addressBranch'), validatorObj.addressBranch, input?.required) }));
1393
1466
  });
1394
1467
 
1395
- const REGIONS_URL = '/api/v1/regions';
1396
- function useRegions() {
1397
- const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
1398
- return Array.isArray(data) ? data : [];
1399
- }
1400
-
1401
- const RegionField = JSX(({ field, input }) => {
1402
- const regions = useRegions();
1403
- return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
1404
- });
1405
-
1406
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1407
- return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1408
- const resultOptions = { ...commonOptions, ...options };
1409
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1410
- }) }));
1411
- });
1412
-
1413
- const CHECK_PATHS = [
1414
- {
1415
- d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
1416
- fillRule: 'evenodd',
1417
- clipRule: 'evenodd',
1418
- fill: 'white',
1419
- },
1420
- ];
1421
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1422
- const handleChange = useCallback((e) => {
1423
- if (disabled) {
1424
- return;
1425
- }
1426
- e.preventDefault();
1427
- onChange && onChange(!value);
1428
- }, [onChange, disabled, value]);
1429
- const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1430
- return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
1431
- });
1432
- const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
1433
- const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1434
-
1435
- const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: text }), link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
1436
-
1437
- function useButton() {
1438
- return (props) => ({
1439
- ...props,
1440
- onClick: handlerDecorator(handleClick(props)),
1441
- });
1442
- }
1443
- function handleClick({ disabled, onClick }) {
1444
- return (ev) => {
1445
- !disabled && onClick && onClick(ev);
1446
- };
1447
- }
1448
-
1449
- const activeButtonStyleMap = 'text-white bg-primary-active';
1450
- const disabledButtonStyle = 'bg-main-gray text-main-disabled cursor-not-allowed';
1451
- const buttonStyleMap = {
1452
- primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
1453
- secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
1454
- };
1455
- const secondaryButtonStyleMap = {
1456
- primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1457
- secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1458
- };
1459
- const Button = JSX(({ children, ...props }) => {
1460
- const button = useButton();
1461
- const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
1462
- return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', active ? activeButtonStyleMap : '', disabled ? disabledButtonStyle : '', !active && !disabled
1463
- ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
1464
- : '', rounded ? 'rounded-md' : '', className), type: type, role: role, onClick: onClick, children: children }));
1465
- });
1466
-
1467
- const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
1468
-
1469
- const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
1470
- const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton(button)] }));
1471
-
1472
- const ApplicationFieldsetLayout = JSX(({ title, children }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none", children: [title ? (jsx("legend", { className: "w-full", children: jsx(Heading, { title: title, headingType: "h6", className: "@xl:text-center" }) })) : null, children] })));
1473
-
1474
- const FEEDBACK_TYPES = [
1475
- {
1476
- text: 'Задать вопрос по продуктам и услугам',
1477
- key: 'FEEDBACK',
1478
- },
1479
- {
1480
- text: 'Качество обслуживания',
1481
- key: 'FEEDBACK_QS',
1482
- },
1483
- ];
1484
- const FEEDBACK_METHOD = [
1485
- { key: 'phone', text: 'Телефонный звонок' },
1486
- { key: 'email', text: 'Электронное сообщение' },
1487
- ];
1488
- const SERVICE_DIRECTIONS = [
1489
- { key: 'Физическое лицо' },
1490
- { key: 'Юридическое лицо / ИП' },
1491
- ];
1492
-
1493
- const initialFormState$1 = {
1494
- surname: '',
1495
- name: '',
1496
- middleName: '',
1497
- typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
1498
- serviceDirection: { key: 'Физическое лицо' },
1499
- birthday: undefined,
1500
- feedbackMethod: { key: 'Телефонный звонок' },
1501
- phone: '',
1502
- email: '',
1503
- comment: '',
1504
- consentDataProcessing: false,
1505
- };
1506
- const feedbackValidatorDefaultObject = {
1507
- typeForm: defaultValidator,
1508
- region: defaultValidator,
1509
- surname: defaultValidator,
1510
- name: nameValidator,
1511
- feedbackMethod: defaultValidator,
1512
- phone: phoneValidator,
1513
- email: defaultValidator,
1514
- comment: defaultValidator,
1515
- consentDataProcessing: agreementValidator,
1516
- };
1517
- const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
1518
- const handleSubmit = useCallback((feedbackFormState) => {
1519
- handleSubmitFeedback(feedbackFormState, onSubmit);
1520
- }, [onSubmit]);
1521
- const [, { field, ...formProps }] = useForm(initialFormState$1, {
1522
- onSubmit: handleSubmit,
1523
- });
1524
- const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
1525
- const isLegalEntity = getLegalEntity(field('typeForm').value?.key, field('serviceDirection').value?.key);
1526
- return (jsx("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { children: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(field('typeForm'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), defaultValidator) })) : null, jsx(RegionField, { field: field }), isQualityService ? jsx(AddressBranchField, { field: field }) : null, jsxs("div", { className: "space-y-s", children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...withValidator(field('birthday'), defaultValidator) })] }), isLegalEntity ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') })] })) : null, jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), defaultValidator) }), jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!field('secondaryPhone').value || field('secondaryPhone').value === '+7 ('
1527
- ? field('secondaryPhone')
1528
- : withValidator(field('secondaryPhone'), phoneValidator)) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') }), jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1529
- });
1530
- const handleSubmitFeedback = (formState, onSubmit) => {
1531
- const isLegal = getLegalEntity(formState?.typeForm.key, formState?.serviceDirection?.key);
1532
- const feedbackValidator = objectValidator({
1533
- ...feedbackValidatorDefaultObject,
1534
- ...getFeedbackValidationObject(formState, isLegal),
1535
- });
1536
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, !isLegal);
1537
- };
1538
- const getFeedbackValidationObject = (formState, isLegal) => {
1539
- if (isLegal) {
1540
- return { addressBranch: defaultValidator, inn: innValidator };
1541
- }
1542
- else if (formState.typeForm.key === 'FEEDBACK') {
1543
- return { birthday: defaultValidator };
1544
- }
1545
- else {
1546
- return { addressBranch: defaultValidator };
1547
- }
1548
- };
1549
- const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1550
-
1551
- const EmbeddableForms = {
1552
- ApplicationFormFeedback,
1553
- };
1554
-
1555
- const API$1 = LeadServiceAPI();
1556
- const ApplicationForm = UniBlock(({ className, formBlock, ...rest }) => {
1557
- const [responseType, setResponseType] = useState('');
1558
- const handleSubmit = useCallback(async (data, isIndividualType = false) => {
1559
- const formatData = getFormatData$1(data);
1560
- const status = (await API$1.send(formatData, isIndividualType)) ? 'OK' : 'Fail';
1561
- setResponseType(status);
1562
- return status;
1563
- }, []);
1564
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-m", children: [formBlock?.title ? (jsx(Heading, { headingType: "h3", title: formBlock.title, className: "@xl:text-center" })) : null, formBlock ? renderEmbeddedForm(formBlock, handleSubmit) : null, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1565
- });
1566
- const renderEmbeddedForm = (formBlock, handleSubmit) => {
1567
- const type = formBlock?.formType;
1568
- if (!type || !(type in EmbeddableForms)) {
1569
- return null;
1570
- }
1571
- const EmbeddedForm = EmbeddableForms[type];
1572
- return jsx(EmbeddedForm, { ...formBlock, onSubmit: handleSubmit });
1573
- };
1574
- const getFormatData$1 = (data) => Object.fromEntries(Object.entries(data).map(([k, v]) => [k, (v?.region ? v?.text : v?.key) || v]));
1575
-
1576
- const ApplicationFormLayout = JSX((props) => {
1577
- const { className, title, responseType, children, ...rest } = props;
1578
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1579
- });
1580
-
1581
- const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
1582
-
1583
- const ACQUIRING_TYPES = [
1584
- {
1585
- text: 'Торговый эквайринг',
1586
- key: 'trade',
1587
- },
1588
- {
1589
- text: 'СБП-эквайринг',
1590
- key: 'sbp',
1591
- },
1592
- {
1593
- text: 'Интернет-эквайринг',
1594
- key: 'internet',
1595
- },
1596
- {
1597
- text: 'Все виды эквайринга',
1598
- key: 'all',
1599
- },
1600
- ];
1601
- const AcquiringField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES, ...getValidation(field('acquiringType'), validatorObj.acquiringType, input?.required) })));
1602
- const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
1603
-
1604
1468
  const useNormalizedInput = (props, { normalize, format }) => {
1605
1469
  const { value, onFocus, onBlur, onChange } = props;
1606
1470
  const [isFocused, setIsFocused] = useState(false);
1607
- const handleFocus = useCallback((e) => {
1471
+ const handleFocus = useCallback((ev) => {
1608
1472
  setIsFocused(true);
1609
- onFocus && onFocus(e);
1473
+ onFocus && onFocus(ev);
1610
1474
  }, []);
1611
1475
  const handleBlur = useCallback(() => {
1612
1476
  setIsFocused(false);
@@ -1666,12 +1530,67 @@
1666
1530
 
1667
1531
  const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...getValidation(field('comment'), validatorObj.comment, input?.required), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
1668
1532
 
1533
+ const SERVICE_TYPES = [
1534
+ { key: 'ULTRASERVICE', text: 'Ультра' },
1535
+ { key: 'PREMIUMSERVICE', text: 'Премиум' },
1536
+ ];
1537
+ const SERVICE_DIRECTIONS = [
1538
+ { key: 'Физическое лицо' },
1539
+ { key: 'Юридическое лицо / ИП' },
1540
+ ];
1541
+ const FEEDBACK_TYPES = [
1542
+ {
1543
+ text: 'Задать вопрос по продуктам и услугам',
1544
+ key: 'FEEDBACK',
1545
+ },
1546
+ {
1547
+ text: 'Качество обслуживания',
1548
+ key: 'FEEDBACK_QS',
1549
+ },
1550
+ ];
1551
+ const FEEDBACK_METHOD = [
1552
+ { key: 'phone', text: 'Телефонный звонок' },
1553
+ { key: 'email', text: 'Электронное сообщение' },
1554
+ ];
1555
+
1556
+ const FeedbackMethodField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), validatorObj.feedbackMethod) })));
1557
+
1558
+ const FeedbackTypeField = JSX(({ field }) => {
1559
+ const feedbackType = field('feedbackType');
1560
+ useEffect(() => {
1561
+ if (feedbackType?.value?.key === 'FEEDBACK') {
1562
+ field('serviceDirection')?.onChange?.(SERVICE_DIRECTIONS[0]);
1563
+ }
1564
+ }, [feedbackType?.value]);
1565
+ return (jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(feedbackType, validatorObj.feedbackType) }));
1566
+ });
1567
+
1568
+ const IsClientField = JSX(({ field }) => (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
1569
+
1669
1570
  const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-s", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl', value ? 'bg-primary-main' : 'bg-main-divider'), children: jsx("div", { className: style('absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full', value ? 'left-1/2' : 'left-[5%]') }) }), text ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })) : null] })));
1670
1571
 
1671
1572
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
1672
1573
 
1574
+ const SecondaryPhoneField = JSX(({ field }) => {
1575
+ const fieldPhone = field('secondaryPhone');
1576
+ return (jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!fieldPhone.value || fieldPhone.value === '+7 ('
1577
+ ? fieldPhone
1578
+ : withValidator(fieldPhone, validatorObj.secondaryPhone)) }));
1579
+ });
1580
+
1673
1581
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1674
1582
 
1583
+ const REGIONS_URL = '/api/v1/regions';
1584
+ function useRegions() {
1585
+ const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
1586
+ return Array.isArray(data) ? data : [];
1587
+ }
1588
+
1589
+ const RegionField = JSX(({ field, input }) => {
1590
+ const regions = useRegions();
1591
+ return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
1592
+ });
1593
+
1675
1594
  const RegionPremiumField = JSX(({ field, input }) => {
1676
1595
  const branchByRegions = useBranchesByRegions();
1677
1596
  const regions = useMemo(() => branchByRegions?.map(({ region }) => ({
@@ -1681,16 +1600,14 @@
1681
1600
  return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...getValidation(field('region'), validatorObj.region, input?.required) }));
1682
1601
  });
1683
1602
 
1603
+ const ServiceDirectionField = JSX(({ field }) => (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), validatorObj.serviceDirection) })));
1604
+
1684
1605
  const MIN_CREDIT_TERM = 1;
1685
1606
  const MAX_CREDIT_TERM = 180;
1686
1607
  const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
1687
1608
  const TermField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })));
1688
1609
 
1689
- const SERVICE_TYPES = [
1690
- { key: 'ULTRASERVICE', text: 'Ультра' },
1691
- { key: 'PREMIUMSERVICE', text: 'Премиум' },
1692
- ];
1693
- const UltraPremiumField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('serviceType'), defaultValidator) })));
1610
+ const UltraPremiumField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('serviceType'), validatorObj.serviceType) })));
1694
1611
 
1695
1612
  const Radio = JSX(({ name, text, value, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "font-sans flex gap-s items-center relative cursor-pointer", children: [jsx("input", { className: "appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer", type: "radio", value: value, name: name, checked: checked, onChange: (_) => onChange?.(_.target.value), role: "radio" }), text ? jsx(Text, { color: "text-primary-text", children: text }) : null] }) })));
1696
1613
 
@@ -1728,7 +1645,7 @@
1728
1645
  region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input })),
1729
1646
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
1730
1647
  birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
1731
- isClient: (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })),
1648
+ isClient: jsx(IsClientField, { field: field }),
1732
1649
  consentToReceiveMaterials: (jsx(CheckboxWithError, { ...field('consentToReceiveMaterials'), text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435" })),
1733
1650
  partnerComments: (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest })),
1734
1651
  collectionCount: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", type: "number", ...getValidation(field('collectionCount'), validatorObj.collectionCount, required) })),
@@ -1740,13 +1657,19 @@
1740
1657
  amount: jsx(AmountField, { field: field }),
1741
1658
  annualRevenue: (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, required) })),
1742
1659
  vedTypes: jsx(VedField, { field: field }),
1660
+ feedbackType: jsx(FeedbackTypeField, { field: field }),
1661
+ feedbackMethod: jsx(FeedbackMethodField, { field: field }),
1662
+ serviceDirection: jsx(ServiceDirectionField, { field: field }),
1663
+ bankEmpolee: (jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') })),
1664
+ applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
1665
+ secondaryPhone: jsx(SecondaryPhoneField, { field: field }),
1743
1666
  };
1744
1667
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(index))) : null;
1745
1668
  };
1746
1669
  function isRenderField({ input, field, }) {
1747
1670
  const { condition } = input;
1748
1671
  const { value } = field(condition?.name || '');
1749
- return !condition || condition?.values?.find((_) => _ === value);
1672
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
1750
1673
  }
1751
1674
 
1752
1675
  const getPartnerComments = (data) => {
@@ -1763,13 +1686,14 @@
1763
1686
 
1764
1687
  /* eslint-disable @typescript-eslint/no-unused-vars */
1765
1688
  const getFormatData = (data) => {
1766
- const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, ...usedData } = data;
1689
+ const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, feedbackType, vedTypes, region, ...usedData } = data;
1767
1690
  const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
1768
1691
  const formatData = {
1769
1692
  ...usedData,
1770
1693
  ...getVedTypes(vedTypes),
1771
1694
  ...getRegion(region),
1772
1695
  ...(partnerComments ? { partnerComments } : {}),
1696
+ ...(feedbackType ? { typeForm: feedbackType } : {}),
1773
1697
  };
1774
1698
  return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
1775
1699
  };
@@ -1786,8 +1710,8 @@
1786
1710
  addressBranch: { key: '', text: '' },
1787
1711
  surname: '',
1788
1712
  name: '',
1789
- middleName: '',
1790
1713
  phone: '',
1714
+ secondaryPhone: '',
1791
1715
  comment: '',
1792
1716
  product: '',
1793
1717
  partnerComments: '',
@@ -1796,6 +1720,9 @@
1796
1720
  amount: 1000,
1797
1721
  acquiringType: ACQUIRING_TYPES[0],
1798
1722
  serviceType: SERVICE_TYPES[0],
1723
+ feedbackType: FEEDBACK_TYPES[0],
1724
+ feedbackMethod: FEEDBACK_METHOD[0],
1725
+ serviceDirection: SERVICE_DIRECTIONS[0],
1799
1726
  vedTypes: VED_TYPES[0],
1800
1727
  birthday: undefined,
1801
1728
  isClient: false,
@@ -1812,6 +1739,43 @@
1812
1739
  return { ...formState, typeForm: { key: typeForm, text: '' } };
1813
1740
  };
1814
1741
 
1742
+ const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: text }), link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
1743
+
1744
+ function useButton() {
1745
+ return (props) => ({
1746
+ ...props,
1747
+ onClick: handlerDecorator(handleClick(props)),
1748
+ });
1749
+ }
1750
+ function handleClick({ disabled, onClick }) {
1751
+ return (ev) => {
1752
+ !disabled && onClick && onClick(ev);
1753
+ };
1754
+ }
1755
+
1756
+ const activeButtonStyleMap = 'text-white bg-primary-active';
1757
+ const disabledButtonStyle = 'bg-main-gray text-main-disabled cursor-not-allowed';
1758
+ const buttonStyleMap = {
1759
+ primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
1760
+ secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
1761
+ };
1762
+ const secondaryButtonStyleMap = {
1763
+ primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1764
+ secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1765
+ };
1766
+ const Button = JSX(({ children, ...props }) => {
1767
+ const button = useButton();
1768
+ const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
1769
+ return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', active ? activeButtonStyleMap : '', disabled ? disabledButtonStyle : '', !active && !disabled
1770
+ ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
1771
+ : '', rounded ? 'rounded-md' : '', className), type: type, role: role, onClick: onClick, children: children }));
1772
+ });
1773
+
1774
+ const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
1775
+
1776
+ const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
1777
+ const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton(button)] }));
1778
+
1815
1779
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
1816
1780
 
1817
1781
  const API = LeadServiceAPI();
@@ -1830,8 +1794,13 @@
1830
1794
  setResponseType(status);
1831
1795
  return status;
1832
1796
  }, []);
1833
- const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
1797
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, { onSubmit: handleSubmit });
1834
1798
  const fieldName = getConsentDataProcessing(inputs)?.name;
1799
+ useEffect(() => {
1800
+ if (responseType === 'OK') {
1801
+ reset();
1802
+ }
1803
+ }, [responseType]);
1835
1804
  return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? jsx("div", { className: "@xl:text-center @xl:col-span-2", children: _.title }) : null, (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1836
1805
  });
1837
1806
  const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
@@ -1839,7 +1808,12 @@
1839
1808
  const getFilteredInputs = (inputs, data) => inputs
1840
1809
  .filter((_) => _)
1841
1810
  .filter((input) => !input?.condition ||
1842
- input?.condition.values.find((_) => _ === data?.[input?.condition?.name]));
1811
+ input?.condition.values.find((_) => {
1812
+ const dataValue = data?.[input?.condition?.name ?? ''];
1813
+ return input.name === 'secondaryPhone'
1814
+ ? Boolean(data.secondaryPhone)
1815
+ : _ === (dataValue?.key ?? dataValue);
1816
+ }));
1843
1817
 
1844
1818
  const AlignStyles = 'text-left';
1845
1819
 
@@ -4762,7 +4736,11 @@
4762
4736
  const openBottomMenuItemDialog = (index, itemsPosition) => {
4763
4737
  const requiredArray = itemsPosition === 'left' ? leftItems : rightItems;
4764
4738
  const menuDimensions = menuRef?.current?.getBoundingClientRect();
4765
- openDialog(jsx(StickyBottomMenuDialog, { onClick: (e) => e.stopPropagation(), onClose: closeDialog, head: jsx("div", { className: "flex items-center px-xl", children: jsx(Heading, { as: "h4", title: requiredArray[index].title }) }), children: jsx("div", { className: "bg-white pb-20 pt-1 text-l", ref: dialogRef, children: jsx("iframe", { src: requiredArray[index]?.src, className: "min-h-[90vh]", width: menuDimensions?.width || 0 }) }) }), { id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title });
4739
+ const handleIframeLoad = () => {
4740
+ const ifDoc = document.getElementsByTagName('iframe')['iframe-dialog'];
4741
+ ifDoc.style.height = String(ifDoc?.contentWindow?.document.body.offsetHeight) + 'px';
4742
+ };
4743
+ openDialog(jsx(StickyBottomMenuDialog, { onClick: (e) => e.stopPropagation(), onClose: closeDialog, head: jsx("div", { className: "flex items-center px-xl", children: jsx(Heading, { as: "h4", title: requiredArray[index].title }) }), children: jsx("div", { className: "bg-white pb-20 pt-1 text-l", ref: dialogRef, children: jsx("iframe", { id: "iframe-dialog", onLoad: () => handleIframeLoad(), src: requiredArray[index]?.src, width: menuDimensions?.width || 0 }) }) }), { id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title });
4766
4744
  };
4767
4745
  return [{ openBottomMenuItemDialog }];
4768
4746
  };
@@ -5045,7 +5023,10 @@
5045
5023
  const renderMenuItem = (onClick, itemsPosition, currentActiveItem) => (_, i, arr) => {
5046
5024
  return (jsx(StickyBottomMenuItem, { item: _, isActive: arr[currentActiveItem.activeIndex]?.title === _?.title &&
5047
5025
  currentActiveItem.currentItemPosition === itemsPosition, onClick: (e) => {
5048
- e.stopPropagation();
5026
+ if (!(arr[currentActiveItem.activeIndex]?.title === _?.title &&
5027
+ currentActiveItem.currentItemPosition === itemsPosition)) {
5028
+ e.stopPropagation();
5029
+ }
5049
5030
  onClick(i, itemsPosition);
5050
5031
  } }, _.title || String(i)));
5051
5032
  };
@@ -5386,7 +5367,6 @@
5386
5367
 
5387
5368
  const Blocks = {
5388
5369
  AdTile,
5389
- ApplicationForm,
5390
5370
  ApplicationFormCustom,
5391
5371
  BenefitsBlock,
5392
5372
  BonusBenefitsBlock,
@@ -5640,7 +5620,7 @@
5640
5620
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
5641
5621
  });
5642
5622
 
5643
- const packageVersion = "0.14.263";
5623
+ const packageVersion = "0.14.265";
5644
5624
 
5645
5625
  exports.Blocks = Blocks;
5646
5626
  exports.ContentPage = ContentPage;