@redneckz/wildless-cms-uni-blocks 0.8.17 → 0.8.18

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 (274) hide show
  1. package/bundle/api/CorporateLeadAPI.d.ts +1 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +116 -51
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  6. package/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  7. package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  8. package/bundle/components/ApplicationForm/CreditParameters.d.ts +6 -0
  9. package/bundle/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  10. package/bundle/components/ApplicationForm/renderInputRange.d.ts +11 -0
  11. package/bundle/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  12. package/bundle/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  13. package/bundle/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  14. package/bundle/components/Video/VideoContent.d.ts +19 -4
  15. package/bundle/hooks/useLink.d.ts +1 -3
  16. package/bundle/model/PreventableEvent.d.ts +3 -0
  17. package/dist/api/CorporateLeadAPI.d.ts +1 -1
  18. package/dist/api/CorporateLeadAPI.js +1 -1
  19. package/dist/api/CorporateLeadAPI.js.map +1 -1
  20. package/dist/components/ApplicationForm/ApplicationForm.js +6 -3
  21. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  22. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +16 -5
  23. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  24. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +16 -7
  25. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  26. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  27. package/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  28. package/dist/components/ApplicationForm/ApplicationFormCredit.js +21 -13
  29. package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  30. package/dist/components/ApplicationForm/ApplicationFormDeposit.js +11 -4
  31. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  32. package/dist/components/ApplicationForm/ApplicationFormWed.js +14 -4
  33. package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  34. package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  35. package/dist/components/ApplicationForm/CreditParameters.d.ts +6 -0
  36. package/dist/components/ApplicationForm/CreditParameters.js +9 -0
  37. package/dist/components/ApplicationForm/CreditParameters.js.map +1 -0
  38. package/dist/components/ApplicationForm/acquiringTypes.js +0 -5
  39. package/dist/components/ApplicationForm/acquiringTypes.js.map +1 -1
  40. package/dist/components/ApplicationForm/renderBankOffices.js +1 -1
  41. package/dist/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  42. package/dist/components/ApplicationForm/renderCreditParameters.js +10 -12
  43. package/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  44. package/dist/components/ApplicationForm/renderInputRange.d.ts +11 -0
  45. package/dist/components/ApplicationForm/renderInputRange.js +8 -0
  46. package/dist/components/ApplicationForm/renderInputRange.js.map +1 -0
  47. package/dist/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  48. package/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  49. package/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  50. package/dist/components/ApplicationForm/renderSelects.js +1 -1
  51. package/dist/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  52. package/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  53. package/dist/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  54. package/dist/components/ApplicationForm/useFormHandlers.js +1 -6
  55. package/dist/components/ApplicationForm/useFormHandlers.js.map +1 -1
  56. package/dist/components/Video/Video.js +2 -2
  57. package/dist/components/Video/Video.js.map +1 -1
  58. package/dist/components/Video/VideoContent.d.ts +19 -4
  59. package/dist/hooks/useLink.d.ts +1 -3
  60. package/dist/hooks/useLink.js.map +1 -1
  61. package/dist/model/PreventableEvent.d.ts +3 -0
  62. package/dist/model/PreventableEvent.js +2 -0
  63. package/dist/model/PreventableEvent.js.map +1 -0
  64. package/lib/api/CorporateLeadAPI.d.ts +1 -1
  65. package/lib/api/CorporateLeadAPI.js +1 -1
  66. package/lib/api/CorporateLeadAPI.js.map +1 -1
  67. package/lib/common.css +1 -1
  68. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +0 -2
  69. package/lib/components/ApplicationForm/ApplicationForm.js +6 -3
  70. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  71. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +16 -5
  72. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  73. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +16 -7
  74. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  75. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  76. package/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  77. package/lib/components/ApplicationForm/ApplicationFormCredit.js +18 -10
  78. package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  79. package/lib/components/ApplicationForm/ApplicationFormDeposit.js +11 -4
  80. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  81. package/lib/components/ApplicationForm/ApplicationFormWed.js +14 -4
  82. package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  83. package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  84. package/lib/components/ApplicationForm/CreditParameters.d.ts +6 -0
  85. package/lib/components/ApplicationForm/CreditParameters.js +7 -0
  86. package/lib/components/ApplicationForm/CreditParameters.js.map +1 -0
  87. package/lib/components/ApplicationForm/acquiringTypes.js +0 -5
  88. package/lib/components/ApplicationForm/acquiringTypes.js.map +1 -1
  89. package/lib/components/ApplicationForm/renderBankOffices.js +1 -1
  90. package/lib/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  91. package/lib/components/ApplicationForm/renderCreditParameters.js +3 -5
  92. package/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  93. package/lib/components/ApplicationForm/renderInputRange.d.ts +11 -0
  94. package/lib/components/ApplicationForm/renderInputRange.js +5 -0
  95. package/lib/components/ApplicationForm/renderInputRange.js.map +1 -0
  96. package/lib/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  97. package/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  98. package/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  99. package/lib/components/ApplicationForm/renderSelects.js +1 -1
  100. package/lib/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  101. package/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  102. package/lib/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  103. package/lib/components/ApplicationForm/useFormHandlers.js +1 -6
  104. package/lib/components/ApplicationForm/useFormHandlers.js.map +1 -1
  105. package/lib/components/Video/Video.js +2 -2
  106. package/lib/components/Video/Video.js.map +1 -1
  107. package/lib/components/Video/VideoContent.d.ts +19 -4
  108. package/lib/hooks/useLink.d.ts +1 -3
  109. package/lib/hooks/useLink.js.map +1 -1
  110. package/lib/model/PreventableEvent.d.ts +3 -0
  111. package/lib/model/PreventableEvent.js +2 -0
  112. package/lib/model/PreventableEvent.js.map +1 -0
  113. package/mobile/bundle/api/CorporateLeadAPI.d.ts +1 -1
  114. package/mobile/bundle/bundle.umd.js +1 -1
  115. package/mobile/bundle/bundle.umd.min.js +1 -1
  116. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  117. package/mobile/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  118. package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  119. package/mobile/bundle/components/ApplicationForm/CreditParameters.d.ts +6 -0
  120. package/mobile/bundle/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  121. package/mobile/bundle/components/ApplicationForm/renderInputRange.d.ts +11 -0
  122. package/mobile/bundle/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  123. package/mobile/bundle/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  124. package/mobile/bundle/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  125. package/mobile/bundle/components/Video/VideoContent.d.ts +19 -4
  126. package/mobile/bundle/hooks/useLink.d.ts +1 -3
  127. package/mobile/bundle/model/PreventableEvent.d.ts +3 -0
  128. package/mobile/dist/api/CorporateLeadAPI.d.ts +1 -1
  129. package/mobile/dist/api/CorporateLeadAPI.js +1 -1
  130. package/mobile/dist/api/CorporateLeadAPI.js.map +1 -1
  131. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +6 -3
  132. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  133. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +16 -5
  134. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  135. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +16 -7
  136. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  137. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  138. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  139. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +21 -13
  140. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  141. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +11 -4
  142. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  143. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js +14 -4
  144. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  145. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  146. package/mobile/dist/components/ApplicationForm/CreditParameters.d.ts +6 -0
  147. package/mobile/dist/components/ApplicationForm/CreditParameters.js +9 -0
  148. package/mobile/dist/components/ApplicationForm/CreditParameters.js.map +1 -0
  149. package/mobile/dist/components/ApplicationForm/acquiringTypes.js +0 -5
  150. package/mobile/dist/components/ApplicationForm/acquiringTypes.js.map +1 -1
  151. package/mobile/dist/components/ApplicationForm/renderBankOffices.js +1 -1
  152. package/mobile/dist/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  153. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +10 -12
  154. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  155. package/mobile/dist/components/ApplicationForm/renderInputRange.d.ts +11 -0
  156. package/mobile/dist/components/ApplicationForm/renderInputRange.js +8 -0
  157. package/mobile/dist/components/ApplicationForm/renderInputRange.js.map +1 -0
  158. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  159. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  160. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  161. package/mobile/dist/components/ApplicationForm/renderSelects.js +1 -1
  162. package/mobile/dist/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  163. package/mobile/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  164. package/mobile/dist/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  165. package/mobile/dist/components/ApplicationForm/useFormHandlers.js +1 -6
  166. package/mobile/dist/components/ApplicationForm/useFormHandlers.js.map +1 -1
  167. package/mobile/dist/components/Video/Video.js +2 -2
  168. package/mobile/dist/components/Video/Video.js.map +1 -1
  169. package/mobile/dist/components/Video/VideoContent.d.ts +19 -4
  170. package/mobile/dist/hooks/useLink.d.ts +1 -3
  171. package/mobile/dist/hooks/useLink.js.map +1 -1
  172. package/mobile/dist/model/PreventableEvent.d.ts +3 -0
  173. package/mobile/dist/model/PreventableEvent.js +2 -0
  174. package/mobile/dist/model/PreventableEvent.js.map +1 -0
  175. package/mobile/lib/api/CorporateLeadAPI.d.ts +1 -1
  176. package/mobile/lib/api/CorporateLeadAPI.js +1 -1
  177. package/mobile/lib/api/CorporateLeadAPI.js.map +1 -1
  178. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +6 -3
  179. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  180. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +16 -5
  181. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  182. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +16 -7
  183. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  184. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +15 -4
  185. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -6
  186. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +18 -10
  187. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  188. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +11 -4
  189. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  190. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js +14 -4
  191. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  192. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  193. package/mobile/lib/components/ApplicationForm/CreditParameters.d.ts +6 -0
  194. package/mobile/lib/components/ApplicationForm/CreditParameters.js +7 -0
  195. package/mobile/lib/components/ApplicationForm/CreditParameters.js.map +1 -0
  196. package/mobile/lib/components/ApplicationForm/acquiringTypes.js +0 -5
  197. package/mobile/lib/components/ApplicationForm/acquiringTypes.js.map +1 -1
  198. package/mobile/lib/components/ApplicationForm/renderBankOffices.js +1 -1
  199. package/mobile/lib/components/ApplicationForm/renderCreditParameters.d.ts +1 -1
  200. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +3 -5
  201. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  202. package/mobile/lib/components/ApplicationForm/renderInputRange.d.ts +11 -0
  203. package/mobile/lib/components/ApplicationForm/renderInputRange.js +5 -0
  204. package/mobile/lib/components/ApplicationForm/renderInputRange.js.map +1 -0
  205. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.d.ts +2 -2
  206. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  207. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  208. package/mobile/lib/components/ApplicationForm/renderSelects.js +1 -1
  209. package/mobile/lib/components/ApplicationForm/renderSubmitButton.d.ts +1 -1
  210. package/mobile/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  211. package/mobile/lib/components/ApplicationForm/useFormHandlers.d.ts +1 -5
  212. package/mobile/lib/components/ApplicationForm/useFormHandlers.js +1 -6
  213. package/mobile/lib/components/ApplicationForm/useFormHandlers.js.map +1 -1
  214. package/mobile/lib/components/Video/Video.js +2 -2
  215. package/mobile/lib/components/Video/Video.js.map +1 -1
  216. package/mobile/lib/components/Video/VideoContent.d.ts +19 -4
  217. package/mobile/lib/hooks/useLink.d.ts +1 -3
  218. package/mobile/lib/hooks/useLink.js.map +1 -1
  219. package/mobile/lib/model/PreventableEvent.d.ts +3 -0
  220. package/mobile/lib/model/PreventableEvent.js +2 -0
  221. package/mobile/lib/model/PreventableEvent.js.map +1 -0
  222. package/mobile/src/api/CorporateLeadAPI.ts +2 -2
  223. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +8 -4
  224. package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +20 -5
  225. package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +20 -7
  226. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +16 -4
  227. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +23 -12
  228. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +15 -4
  229. package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +18 -4
  230. package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  231. package/mobile/src/components/ApplicationForm/CreditParameters.ts +7 -0
  232. package/mobile/src/components/ApplicationForm/WrapperSelect.tsx +1 -1
  233. package/mobile/src/components/ApplicationForm/acquiringTypes.ts +0 -5
  234. package/mobile/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
  235. package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +3 -22
  236. package/mobile/src/components/ApplicationForm/renderInputRange.tsx +20 -0
  237. package/mobile/src/components/ApplicationForm/renderQuestionsInterested.tsx +3 -3
  238. package/mobile/src/components/ApplicationForm/renderSelects.tsx +2 -2
  239. package/mobile/src/components/ApplicationForm/renderSubmitButton.tsx +1 -1
  240. package/mobile/src/components/ApplicationForm/useFormHandlers.ts +1 -15
  241. package/mobile/src/components/Video/Video.example.json +5 -0
  242. package/mobile/src/components/Video/Video.tsx +4 -4
  243. package/mobile/src/components/Video/Video.ui.json +1 -1
  244. package/mobile/src/components/Video/VideoContent.ts +19 -4
  245. package/mobile/src/hooks/useLink.ts +1 -4
  246. package/mobile/src/model/PreventableEvent.ts +3 -0
  247. package/package.json +1 -1
  248. package/src/api/CorporateLeadAPI.ts +2 -2
  249. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -1
  250. package/src/components/ApplicationForm/ApplicationForm.tsx +8 -4
  251. package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +20 -5
  252. package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +20 -7
  253. package/src/components/ApplicationForm/ApplicationFormContent.ts +16 -4
  254. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +23 -12
  255. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +15 -4
  256. package/src/components/ApplicationForm/ApplicationFormWed.tsx +18 -4
  257. package/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  258. package/src/components/ApplicationForm/CreditParameters.ts +7 -0
  259. package/src/components/ApplicationForm/WrapperSelect.tsx +1 -1
  260. package/src/components/ApplicationForm/acquiringTypes.ts +0 -5
  261. package/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
  262. package/src/components/ApplicationForm/renderCreditParameters.tsx +3 -22
  263. package/src/components/ApplicationForm/renderInputRange.tsx +20 -0
  264. package/src/components/ApplicationForm/renderQuestionsInterested.tsx +3 -3
  265. package/src/components/ApplicationForm/renderSelects.tsx +2 -2
  266. package/src/components/ApplicationForm/renderSubmitButton.tsx +1 -1
  267. package/src/components/ApplicationForm/useFormHandlers.ts +1 -15
  268. package/src/components/Video/Video.example.json +5 -0
  269. package/src/components/Video/Video.fixture.tsx +1 -1
  270. package/src/components/Video/Video.tsx +4 -4
  271. package/src/components/Video/Video.ui.json +1 -1
  272. package/src/components/Video/VideoContent.ts +19 -4
  273. package/src/hooks/useLink.ts +1 -4
  274. package/src/model/PreventableEvent.ts +3 -0
@@ -1,13 +1,9 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import type { HandleFormStateChange } from './models';
3
3
  interface UseFormHandlersProps<T> {
4
- formState: Partial<T>;
5
- handleSubmit: (data: Partial<T>) => void;
6
4
  setFormState: Dispatch<SetStateAction<T>>;
7
- typeForm: string;
8
5
  }
9
- export declare const useFormHandlers: <T>({ formState, handleSubmit, setFormState, typeForm, }: UseFormHandlersProps<T>) => {
6
+ export declare const useFormHandlers: <T>({ setFormState }: UseFormHandlersProps<T>) => {
10
7
  handleChange: HandleFormStateChange<T>;
11
- onSubmit: (e: React.FormEvent<HTMLFormElement>) => Promise<void>;
12
8
  };
13
9
  export {};
@@ -1,13 +1,8 @@
1
1
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
- export const useFormHandlers = ({ formState, handleSubmit, setFormState, typeForm, }) => {
2
+ export const useFormHandlers = ({ setFormState }) => {
3
3
  const handleChange = useCallback((state) => setFormState((oldState) => ({ ...oldState, ...state })), []);
4
- const onSubmit = useCallback(async (e) => {
5
- e.preventDefault();
6
- handleSubmit && (await handleSubmit({ ...formState, typeForm }));
7
- }, []);
8
4
  return {
9
5
  handleChange,
10
- onSubmit,
11
6
  };
12
7
  };
13
8
  //# sourceMappingURL=useFormHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormHandlers.js","sourceRoot":"","sources":["../../../src/components/ApplicationForm/useFormHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAW1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,EACjC,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,GACgB,EAAE,EAAE;IAC5B,MAAM,YAAY,GAA6B,WAAW,CACxD,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,EAClE,EAAE,CACH,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,CAAmC,EAAE,EAAE;QACzE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,YAAY,IAAI,CAAC,MAAM,YAAY,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,YAAY;QACZ,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"useFormHandlers.js","sourceRoot":"","sources":["../../../src/components/ApplicationForm/useFormHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAQ1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,EAAE,YAAY,EAA2B,EAAE,EAAE;IAC9E,MAAM,YAAY,GAA6B,WAAW,CACxD,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,EAClE,EAAE,CACH,CAAC;IAEF,OAAO;QACL,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
@@ -6,8 +6,8 @@ import { adjustHref } from '../../utils/adjustHref.js';
6
6
  import { style } from '../../utils/style.js';
7
7
  import { Headline } from '../Headline/Headline.js';
8
8
  import { getPaddings } from './getPaddings.js';
9
- export const Video = JSX(({ className, title, src, previewImg, ...rest }) => {
9
+ export const Video = JSX(({ className, title, url, previewImg, ...rest }) => {
10
10
  const router = useRouter();
11
- return (_jsxs(BlockWrapper, { className: style(getPaddings(className), className), ...rest, children: [_jsx(Headline, { title: title, headlineVersion: "M" }), src ? (_jsx("video", { className: "m-auto w-full object-fill", preload: "metadata", poster: adjustHref(router)(previewImg?.src), style: { maxHeight: 524 }, controls: true, children: _jsx("source", { src: adjustHref(router)(src) }) })) : null] }));
11
+ return (_jsxs(BlockWrapper, { className: style(getPaddings(className), className), ...rest, children: [_jsx(Headline, { title: title, headlineVersion: "M" }), url ? (_jsx("video", { className: "m-auto w-full object-fill", preload: "metadata", poster: adjustHref(router)(previewImg?.src), style: { maxHeight: 524 }, controls: true, children: _jsx("source", { src: adjustHref(router)(url) }) })) : null] }));
12
12
  });
13
13
  //# sourceMappingURL=Video.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Video.js","sourceRoot":"","sources":["../../../src/components/Video/Video.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACtF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CACL,MAAC,YAAY,IAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,KAAM,IAAI,aACzE,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,eAAe,EAAC,GAAG,GAAG,EAC7C,GAAG,CAAC,CAAC,CAAC,CACL,gBACE,SAAS,EAAC,2BAA2B,EACrC,OAAO,EAAC,UAAU,EAClB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,EAC3C,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EACzB,QAAQ,kBAER,iBAAQ,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAI,GAClC,CACT,CAAC,CAAC,CAAC,IAAI,IACK,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Video.js","sourceRoot":"","sources":["../../../src/components/Video/Video.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACtF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CACL,MAAC,YAAY,IAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,KAAM,IAAI,aACzE,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,eAAe,EAAC,GAAG,GAAG,EAC7C,GAAG,CAAC,CAAC,CAAC,CACL,gBACE,SAAS,EAAC,2BAA2B,EACrC,OAAO,EAAC,UAAU,EAClB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,EAC3C,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EACzB,QAAQ,kBAER,iBAAQ,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAI,GAClC,CACT,CAAC,CAAC,CAAC,IAAI,IACK,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,9 +1,24 @@
1
1
  import type { TitleProps } from '../../model/HeadlineType';
2
2
  import type { Picture } from '../../model/Picture';
3
- /** @title Блок Видео */
3
+ /**
4
+ * @title Блок Видео
5
+ * @default {
6
+ * "title": "Заголовок блока"
7
+ * }
8
+ */
4
9
  export interface VideoContent extends TitleProps {
5
- /** @title URL */
6
- src?: string;
7
- /** @title Заставка */
10
+ /**
11
+ * @title Ссылка на видео
12
+ */
13
+ url?: string;
14
+ /**
15
+ * @title Заставка в блоке
16
+ * @default {
17
+ * "format": "webp",
18
+ * "size": {
19
+ * "width": 1004
20
+ * },
21
+ * }
22
+ */
8
23
  previewImg?: Picture;
9
24
  }
@@ -1,7 +1,5 @@
1
1
  import type { LinkProps } from '../model/LinkProps';
2
- interface PreventableEvent {
3
- preventDefault: () => void;
4
- }
2
+ import type { PreventableEvent } from '../model/PreventableEvent';
5
3
  interface Clickable {
6
4
  onClick(ev?: PreventableEvent): void;
7
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,MAAM,UAAU,OAAO,CAAC,QAAQ,GAAG,KAAK;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBAClD,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,MAAM,UAAU,OAAO,CAAC,QAAQ,GAAG,KAAK;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBAClD,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ export interface PreventableEvent {
2
+ preventDefault: () => void;
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PreventableEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreventableEvent.js","sourceRoot":"","sources":["../../src/model/PreventableEvent.ts"],"names":[],"mappings":""}
@@ -13,7 +13,7 @@ export interface DaDataResult {
13
13
  }
14
14
 
15
15
  export function CorporateLeadAPI() {
16
- async function send(body: any) {
16
+ async function send(body: Record<string, string>) {
17
17
  try {
18
18
  const response = await fetch('/api/v1/sendCorporateLead', {
19
19
  method: 'POST',
@@ -22,7 +22,7 @@ export function CorporateLeadAPI() {
22
22
  body: JSON.stringify(body),
23
23
  });
24
24
 
25
- const data = (await response.json()) as any;
25
+ const data = await response.json();
26
26
 
27
27
  return data;
28
28
  } catch (e) {
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { CorporateLeadAPI } from '../../api/CorporateLeadAPI';
3
4
  import type { UniBlockProps } from '../../model/JSXBlock';
4
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
6
  import { Heading } from '../../ui-kit/Heading/Heading';
@@ -8,7 +9,7 @@ import { ApplicationFormBusinessCard } from './ApplicationFormBusinessCard';
8
9
  import type { ApplicationFormContent } from './ApplicationFormContent';
9
10
  import { ApplicationFormCredit } from './ApplicationFormCredit';
10
11
  import { ApplicationFormDeposit } from './ApplicationFormDeposit';
11
- import { ApplicationFormsProps } from './ApplicationFormsProps';
12
+ import type { ApplicationFormsProps } from './ApplicationFormsProps';
12
13
  import { ApplicationFormWed } from './ApplicationFormWed';
13
14
  import { ResponseNotification } from './ResponseNotification';
14
15
 
@@ -22,13 +23,16 @@ const COMPONENTS_MAP = {
22
23
  wed: (props: ApplicationFormsProps) => <ApplicationFormWed {...props} />,
23
24
  };
24
25
 
26
+ const API = CorporateLeadAPI();
27
+
25
28
  export const ApplicationForm = JSX<ApplicationFormProps>((props) => {
26
29
  const { className = '', title, typeForm = 'credit', button, link, ...rest } = props;
27
30
 
28
- const [responceType, setResponceType] = useState<'OK' | 'Fail' | ''>('');
31
+ const [responceType, setResponseType] = useState<'OK' | 'Fail' | ''>('');
29
32
 
30
- const handleSubmit = useCallback(() => {
31
- setResponceType('OK');
33
+ const handleSubmit = useCallback(async (data: Record<string, string>) => {
34
+ const status = await API.send(data);
35
+ setResponseType(status ? 'OK' : 'Fail');
32
36
 
33
37
  return 'OK';
34
38
  }, []);
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import type { PreventableEvent } from '../../model/PreventableEvent';
3
4
  import { Heading } from '../../ui-kit/Heading/Heading';
4
5
  import { Input } from '../../ui-kit/Input/Input';
5
6
  import { useGetRegions } from '../SafeDepositRental/useGetRegions';
@@ -43,11 +44,8 @@ export const ApplicationFormAcquiring = JSX<ApplicationFormsProps>((props) => {
43
44
 
44
45
  const regions = useGetRegions();
45
46
 
46
- const { handleChange, onSubmit } = useFormHandlers<AcquiringFormState>({
47
- formState,
48
- handleSubmit,
47
+ const { handleChange } = useFormHandlers<AcquiringFormState>({
49
48
  setFormState,
50
- typeForm: 'acqr',
51
49
  });
52
50
 
53
51
  const selectedRegion = normalizeSelectedRegion(region, regions);
@@ -56,10 +54,27 @@ export const ApplicationFormAcquiring = JSX<ApplicationFormsProps>((props) => {
56
54
  setFormState((oldState) => ({
57
55
  ...oldState,
58
56
  acquiringType:
59
- ACQUIRING_TYPES?.length && ACQUIRING_TYPES[0]?.code ? ACQUIRING_TYPES[0].code : '',
57
+ ACQUIRING_TYPES?.length && ACQUIRING_TYPES[0]?.name ? ACQUIRING_TYPES[0].name : '',
60
58
  }));
61
59
  }, []);
62
60
 
61
+ const onSubmit = async (e: PreventableEvent) => {
62
+ e.preventDefault();
63
+
64
+ const PartnerComments = `Вид эквайринга=${acquiringType}/Онлайн касса=${onlineСheckout}/POS-терминал=${posTerminal}`;
65
+
66
+ handleSubmit &&
67
+ (await handleSubmit({
68
+ typeForm: 'acqr',
69
+ region,
70
+ PartnerComments,
71
+ fullName,
72
+ inn,
73
+ name,
74
+ phone,
75
+ }));
76
+ };
77
+
63
78
  return (
64
79
  <form onSubmit={onSubmit} className="container">
65
80
  <Heading headingType="h6" title="Вид эквайринга и регион" className="text-center mb-4" />
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import type { Region } from '../../hooks/useRegions';
4
+ import type { PreventableEvent } from '../../model/PreventableEvent';
4
5
  import { Input } from '../../ui-kit/Input/Input';
5
6
  import { useGetRegions } from '../SafeDepositRental/useGetRegions';
6
7
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
@@ -21,6 +22,7 @@ export interface BusinessCardFormState {
21
22
 
22
23
  export const ApplicationFormBusinessCard = JSX<ApplicationFormsProps>((props) => {
23
24
  const { button, link, handleSubmit } = props;
25
+
24
26
  const [formState, setFormState] = useState<BusinessCardFormState>({
25
27
  region: '',
26
28
  name: '',
@@ -29,18 +31,29 @@ export const ApplicationFormBusinessCard = JSX<ApplicationFormsProps>((props) =>
29
31
  mail: '',
30
32
  });
31
33
 
32
- const { name, phone, inn, mail } = formState;
34
+ const { region, name, phone, inn, mail } = formState;
33
35
 
34
36
  const regions = useGetRegions();
35
37
 
36
- const { handleChange, onSubmit } = useFormHandlers<BusinessCardFormState>({
37
- formState,
38
- handleSubmit,
38
+ const { handleChange } = useFormHandlers<BusinessCardFormState>({
39
39
  setFormState,
40
- typeForm: 'bcrd',
41
40
  });
42
41
 
43
- const selectedRegion = normalizeSelectedRegion(formState.region, regions);
42
+ const selectedRegion = normalizeSelectedRegion(region, regions);
43
+
44
+ const onSubmit = async (e: PreventableEvent) => {
45
+ e.preventDefault();
46
+
47
+ handleSubmit &&
48
+ (await handleSubmit({
49
+ typeForm: 'bcrd',
50
+ region,
51
+ name,
52
+ phone,
53
+ inn,
54
+ mail,
55
+ }));
56
+ };
44
57
 
45
58
  return (
46
59
  <form onSubmit={onSubmit} className="container">
@@ -122,7 +135,7 @@ const renderRegion = ({ regions, region, handleChange }: RenderRegionProps) => (
122
135
  <div className="w-full">
123
136
  <WrapperSelect
124
137
  data={regions}
125
- fieldValue="code"
138
+ fieldValue="name"
126
139
  fieldLabel="name"
127
140
  selected={region}
128
141
  setSelected={(value) => handleChange({ region: value })}
@@ -1,18 +1,30 @@
1
- import type { HeadlineCommonProps } from '../../model/HeadlineType';
1
+ import type { ButtonVersion } from '../../model/ButtonVersion';
2
+ import type { TitleProps } from '../../model/HeadlineType';
2
3
  import type { LinkProps } from '../../model/LinkProps';
3
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
4
+ import type { ButtonAdditionalProps } from '../../ui-kit/Button/ButtonProps';
5
+
6
+ /**
7
+ * @title Кнопка
8
+ */
9
+ export interface ButtonProps extends ButtonAdditionalProps {
10
+ /**
11
+ * @title Текст
12
+ * @default "Отправить заявку"
13
+ */
14
+ text?: string;
15
+ version?: ButtonVersion;
16
+ }
4
17
 
5
18
  /**
6
19
  * @title Форма заявки
7
20
  */
8
- export type ApplicationFormContent = HeadlineCommonProps & {
21
+ export type ApplicationFormContent = TitleProps & {
9
22
  /**
10
23
  * @title Вид заявки
11
24
  * @default credit
12
25
  * @enumNames ["Бизнес-карта", "ВЭД", "Депозит", "Кредит", "Эквайринг"]
13
26
  */
14
27
  typeForm?: 'business-card' | 'wed' | 'deposit' | 'credit' | 'acquiring';
15
- /** @title Кнопка */
16
28
  button?: ButtonProps;
17
29
  /** @title Условия передачи данных */
18
30
  link?: LinkProps;
@@ -1,9 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useSafeBoxes } from '../../hooks/useSafeBoxes';
4
+ import type { PreventableEvent } from '../../model/PreventableEvent';
4
5
  import { Heading } from '../../ui-kit/Heading/Heading';
5
6
  import { useGetRegions } from '../SafeDepositRental/useGetRegions';
6
7
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
8
+ import { MIN_CREDIT_AMOUNT, MIN_CREDIT_TERM } from './CreditParameters';
7
9
  import { Footnote } from './Footnote';
8
10
  import { normalizeSelectedRegion } from './normalizeSelectedRegion';
9
11
  import { renderBankOffices } from './renderBankOffices';
@@ -25,16 +27,9 @@ export interface CreditFormState {
25
27
  annualRevenue: string;
26
28
  }
27
29
 
28
- export const MIN_CREDIT_AMOUNT = 50000;
29
- export const MAX_CREDIT_AMOUNT = 3000000;
30
- export const ITEMS_CREDIT_AMOUNT = ['От 50 000 ₽', 'До 3 000 000 ₽'];
31
-
32
- export const MIN_CREDIT_TERM = 1;
33
- export const MAX_CREDIT_TERM = 60;
34
- export const ITEMS_CREDIT_TERM = ['От 1 года', 'До 5 лет'];
35
-
36
30
  export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
37
31
  const { button, link, handleSubmit } = props;
32
+
38
33
  const [formState, setFormState] = useState<CreditFormState>({
39
34
  amount: MIN_CREDIT_AMOUNT,
40
35
  term: MIN_CREDIT_TERM,
@@ -53,11 +48,8 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
53
48
 
54
49
  const regions = useGetRegions();
55
50
 
56
- const { handleChange, onSubmit } = useFormHandlers<CreditFormState>({
57
- formState,
58
- handleSubmit,
51
+ const { handleChange } = useFormHandlers<CreditFormState>({
59
52
  setFormState,
60
- typeForm: 'cred',
61
53
  });
62
54
 
63
55
  const selectedRegion = normalizeSelectedRegion(formState.region, regions);
@@ -70,6 +62,25 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
70
62
  });
71
63
  }, [formState.region, handleChange]);
72
64
 
65
+ const onSubmit = async (e: PreventableEvent) => {
66
+ e.preventDefault();
67
+
68
+ const PartnerComments = `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
69
+
70
+ handleSubmit &&
71
+ (await handleSubmit({
72
+ typeForm: 'cred',
73
+ fullName,
74
+ inn,
75
+ name,
76
+ phone,
77
+ mail,
78
+ region,
79
+ department,
80
+ PartnerComments,
81
+ }));
82
+ };
83
+
73
84
  return (
74
85
  <form onSubmit={onSubmit} className="container">
75
86
  <Heading headingType="h6" title="Параметры кредита" className="text-center mb-4" />
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import type { PreventableEvent } from '../../model/PreventableEvent';
3
4
  import { Heading } from '../../ui-kit/Heading/Heading';
4
5
  import { Input } from '../../ui-kit/Input/Input';
5
6
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
@@ -21,13 +22,23 @@ export const ApplicationFormDeposit = JSX<ApplicationFormsProps>((props) => {
21
22
  phone: '',
22
23
  });
23
24
 
24
- const { handleChange, onSubmit } = useFormHandlers<DepositFormState>({
25
- formState,
26
- handleSubmit,
25
+ const { name, phone } = formState;
26
+
27
+ const { handleChange } = useFormHandlers<DepositFormState>({
27
28
  setFormState,
28
- typeForm: 'dpst',
29
29
  });
30
30
 
31
+ const onSubmit = async (e: PreventableEvent) => {
32
+ e.preventDefault();
33
+
34
+ handleSubmit &&
35
+ (await handleSubmit({
36
+ typeForm: 'dpst',
37
+ name,
38
+ phone,
39
+ }));
40
+ };
41
+
31
42
  return (
32
43
  <form onSubmit={onSubmit} className="container">
33
44
  <Heading
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import type { PreventableEvent } from '../../model/PreventableEvent';
3
4
  import { Heading } from '../../ui-kit/Heading/Heading';
4
5
  import { Input } from '../../ui-kit/Input/Input';
5
6
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
@@ -46,13 +47,26 @@ export const ApplicationFormWed = JSX<ApplicationFormsProps>((props) => {
46
47
  text,
47
48
  } = formState;
48
49
 
49
- const { handleChange, onSubmit } = useFormHandlers<WedFormState>({
50
- formState,
51
- handleSubmit,
50
+ const { handleChange } = useFormHandlers<WedFormState>({
52
51
  setFormState,
53
- typeForm: 'kved',
54
52
  });
55
53
 
54
+ const onSubmit = async (e: PreventableEvent) => {
55
+ e.preventDefault();
56
+
57
+ const PartnerComments = `Валютный контроль=${currencyControl}/Документарные операции=${documentaryOperations}/Конверсионные операции=${conversionOperations}/Доп инф=${text}`;
58
+
59
+ handleSubmit &&
60
+ (await handleSubmit({
61
+ typeForm: 'kved',
62
+ fullName,
63
+ name,
64
+ phone,
65
+ mail,
66
+ PartnerComments,
67
+ }));
68
+ };
69
+
56
70
  return (
57
71
  <form onSubmit={onSubmit} className="container">
58
72
  <Heading headingType="h6" title="Данные организации" className="text-center mb-4" />
@@ -1,8 +1,8 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
2
+ import type { ButtonProps } from './ApplicationFormContent';
3
3
 
4
4
  export interface ApplicationFormsProps {
5
5
  button?: ButtonProps;
6
6
  link?: LinkProps;
7
- handleSubmit: (data: any) => void;
7
+ handleSubmit: (data: Record<string, string>) => Promise<string>;
8
8
  }
@@ -0,0 +1,7 @@
1
+ export const MIN_CREDIT_AMOUNT = 50000;
2
+ export const MAX_CREDIT_AMOUNT = 3000000;
3
+ export const ITEMS_CREDIT_AMOUNT = ['От 50 000 ₽', 'До 3 000 000 ₽'];
4
+
5
+ export const MIN_CREDIT_TERM = 1;
6
+ export const MAX_CREDIT_TERM = 60;
7
+ export const ITEMS_CREDIT_TERM = ['От 1 года', 'До 5 лет'];
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { OptionProps, Select } from '../../ui-kit/Select/Select';
3
- import { Currency } from '../ExchangeRateTile/CurrencyProps';
3
+ import type { Currency } from '../ExchangeRateTile/CurrencyProps';
4
4
 
5
5
  interface WrapperSelectProps {
6
6
  data: Record<string, any>[];
@@ -2,23 +2,18 @@ import { Select } from './models';
2
2
 
3
3
  export const ACQUIRING_TYPES: Select[] = [
4
4
  {
5
- code: '1',
6
5
  name: 'Торговый эквайринг',
7
6
  },
8
7
  {
9
- code: '2',
10
8
  name: 'Мобильный эквайринг',
11
9
  },
12
10
  {
13
- code: '3',
14
11
  name: 'Интернет-эквайринг',
15
12
  },
16
13
  {
17
- code: '4',
18
14
  name: 'QR-эквайринг (СБП)',
19
15
  },
20
16
  {
21
- code: '5',
22
17
  name: 'Все виды эквайринга',
23
18
  },
24
19
  ];
@@ -22,7 +22,7 @@ export const renderBankOffices = ({
22
22
  <div className="w-1/2">
23
23
  <WrapperSelect
24
24
  data={regions}
25
- fieldValue="code"
25
+ fieldValue="name"
26
26
  fieldLabel="name"
27
27
  selected={region}
28
28
  setSelected={(value) => handleChange({ region: value })}
@@ -1,15 +1,14 @@
1
- import { InputRange } from '../../ui-kit/InputRange/InputRange';
2
- import { Text } from '../../ui-kit/Text/Text';
1
+ import type { CreditFormState } from './ApplicationFormCredit';
3
2
  import {
4
- CreditFormState,
5
3
  ITEMS_CREDIT_AMOUNT,
6
4
  ITEMS_CREDIT_TERM,
7
5
  MAX_CREDIT_AMOUNT,
8
6
  MAX_CREDIT_TERM,
9
7
  MIN_CREDIT_AMOUNT,
10
8
  MIN_CREDIT_TERM,
11
- } from './ApplicationFormCredit';
9
+ } from './CreditParameters';
12
10
  import type { HandleFormStateChange } from './models';
11
+ import { renderInputRange } from './renderInputRange';
13
12
 
14
13
  interface RenderCreditParametersProps {
15
14
  amount: number;
@@ -41,21 +40,3 @@ export const renderCreditParameters = ({
41
40
  })}
42
41
  </div>
43
42
  );
44
-
45
- interface RenderInputRangeProps {
46
- label: string;
47
- value: number;
48
- onChange: (value: number) => void;
49
- min: number;
50
- max: number;
51
- items: string[];
52
- }
53
-
54
- const renderInputRange = (props: RenderInputRangeProps) => (
55
- <div className="w-1/2">
56
- <label>
57
- <Text size="text-m-light">{props.label}</Text>
58
- </label>
59
- <InputRange {...props} />
60
- </div>
61
- );
@@ -0,0 +1,20 @@
1
+ import { InputRange } from '../../ui-kit/InputRange/InputRange';
2
+ import { Text } from '../../ui-kit/Text/Text';
3
+
4
+ interface RenderInputRangeProps {
5
+ label: string;
6
+ value: number;
7
+ onChange: (value: number) => void;
8
+ min: number;
9
+ max: number;
10
+ items: string[];
11
+ }
12
+
13
+ export const renderInputRange = (props: RenderInputRangeProps) => (
14
+ <div className="w-1/2">
15
+ <label>
16
+ <Text size="text-m-light">{props.label}</Text>
17
+ </label>
18
+ <InputRange {...props} />
19
+ </div>
20
+ );
@@ -1,6 +1,6 @@
1
1
  import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
2
- import { WedFormState } from './ApplicationFormWed';
3
- import { HandleFormStateChange } from './models';
2
+ import type { WedFormState } from './ApplicationFormWed';
3
+ import type { HandleFormStateChange } from './models';
4
4
 
5
5
  interface RenderQuestionsInterestedProps {
6
6
  currencyControl: boolean;
@@ -37,7 +37,7 @@ export const renderQuestionsInterested = ({
37
37
  </div>
38
38
  <textarea
39
39
  placeholder="Укажите интересующий Вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"
40
- className="block w-full resize-y min-h-24 p-4 outline-none border rounded-md border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text"
40
+ className="block w-full resize-y min-h-24 p-4 outline-none border rounded-md border-main-stroke hover:border-primary-hover active:focus:border-primary-text"
41
41
  value={text}
42
42
  onChange={(e) => handleChange({ text: e.target.value })}
43
43
  />
@@ -15,7 +15,7 @@ export const renderSelects = ({ acquiringType, regions, region, handleChange }:
15
15
  <div className="w-1/2">
16
16
  <WrapperSelect
17
17
  data={ACQUIRING_TYPES}
18
- fieldValue="code"
18
+ fieldValue="name"
19
19
  fieldLabel="name"
20
20
  selected={acquiringType}
21
21
  setSelected={(value) => handleChange({ acquiringType: value })}
@@ -26,7 +26,7 @@ export const renderSelects = ({ acquiringType, regions, region, handleChange }:
26
26
  <div className="w-1/2">
27
27
  <WrapperSelect
28
28
  data={regions}
29
- fieldValue="code"
29
+ fieldValue="name"
30
30
  fieldLabel="name"
31
31
  selected={region}
32
32
  setSelected={(value) => handleChange({ region: value })}
@@ -1,5 +1,5 @@
1
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
2
1
  import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonClasses';
2
+ import type { ButtonProps } from './ApplicationFormContent';
3
3
 
4
4
  export const renderSubmitButton = (button?: ButtonProps, className?: string) => {
5
5
  const buttonStyle = getRegularButtonClasses({