@redneckz/wildless-cms-uni-blocks 0.14.699 → 0.14.701

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 (283) hide show
  1. package/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  2. package/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  3. package/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  4. package/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  5. package/bundle/api/RetailAPI/updateUserTask.d.ts +13 -9
  6. package/bundle/bundle.umd.js +271 -50
  7. package/bundle/bundle.umd.min.js +1 -1
  8. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  9. package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  10. package/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  11. package/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  12. package/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  13. package/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  14. package/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  15. package/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  16. package/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  17. package/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  18. package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  19. package/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  20. package/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  21. package/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  22. package/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  23. package/dist/api/RetailAPI/getPaymentSystems.js +1 -4
  24. package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  25. package/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  26. package/dist/api/RetailAPI/getTaskById.js +9 -0
  27. package/dist/api/RetailAPI/getTaskById.js.map +1 -0
  28. package/dist/api/RetailAPI/updateUserTask.d.ts +13 -9
  29. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  30. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  31. package/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  32. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  34. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  35. package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  36. package/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  37. package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  38. package/dist/components/CreditCardForm/formStateMap.js +1 -1
  39. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  40. package/dist/components/GrantSupport/GrantSupport.js +1 -1
  41. package/dist/components/GrantSupport/GrantSupport.js.map +1 -1
  42. package/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  43. package/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  44. package/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  45. package/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  46. package/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  47. package/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  48. package/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  49. package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  50. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  51. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  52. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  53. package/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  54. package/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  55. package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  56. package/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  57. package/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  58. package/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  59. package/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  60. package/dist/ui-kit/DraftDialog/utils.js +85 -0
  61. package/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  62. package/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  63. package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  64. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -1
  65. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  66. package/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  67. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  68. package/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  69. package/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  70. package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  71. package/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  72. package/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  73. package/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  74. package/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  75. package/lib/api/RetailAPI/getPaymentSystems.js +1 -4
  76. package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  77. package/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  78. package/lib/api/RetailAPI/getTaskById.js +6 -0
  79. package/lib/api/RetailAPI/getTaskById.js.map +1 -0
  80. package/lib/api/RetailAPI/updateUserTask.d.ts +13 -9
  81. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  82. package/lib/common.css +1 -1
  83. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  84. package/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  85. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  87. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  89. package/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  90. package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  91. package/lib/components/CreditCardForm/formStateMap.js +1 -1
  92. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  93. package/lib/components/GrantSupport/GrantSupport.js +1 -1
  94. package/lib/components/GrantSupport/GrantSupport.js.map +1 -1
  95. package/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  96. package/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  97. package/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  98. package/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  99. package/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  100. package/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  101. package/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  102. package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  103. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  104. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  105. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  106. package/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  107. package/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  108. package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  109. package/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  110. package/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  111. package/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  112. package/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  113. package/lib/ui-kit/DraftDialog/utils.js +78 -0
  114. package/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  115. package/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  116. package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  117. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +4 -2
  118. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  119. package/lib/ui-kit/FormField/getObjectValidator.js +10 -10
  120. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  121. package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  122. package/mobile/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  123. package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  124. package/mobile/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  125. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +13 -9
  126. package/mobile/bundle/bundle.umd.js +271 -50
  127. package/mobile/bundle/bundle.umd.min.js +1 -1
  128. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  129. package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  130. package/mobile/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  131. package/mobile/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  132. package/mobile/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  133. package/mobile/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  134. package/mobile/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  135. package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  136. package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  137. package/mobile/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  138. package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  139. package/mobile/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  140. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  141. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  142. package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  143. package/mobile/dist/api/RetailAPI/getPaymentSystems.js +1 -4
  144. package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  145. package/mobile/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  146. package/mobile/dist/api/RetailAPI/getTaskById.js +9 -0
  147. package/mobile/dist/api/RetailAPI/getTaskById.js.map +1 -0
  148. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +13 -9
  149. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  150. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  151. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  152. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  153. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  154. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  155. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  156. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  157. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  158. package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
  159. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  160. package/mobile/dist/components/GrantSupport/GrantSupport.js +1 -1
  161. package/mobile/dist/components/GrantSupport/GrantSupport.js.map +1 -1
  162. package/mobile/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  163. package/mobile/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  164. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  165. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  166. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  167. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  168. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  169. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  170. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  171. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  172. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  173. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  174. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  175. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  176. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  177. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  178. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  179. package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  180. package/mobile/dist/ui-kit/DraftDialog/utils.js +85 -0
  181. package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  182. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  183. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  184. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -1
  185. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  186. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  187. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  188. package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  189. package/mobile/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  190. package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  191. package/mobile/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  192. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  193. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  194. package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  195. package/mobile/lib/api/RetailAPI/getPaymentSystems.js +1 -4
  196. package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  197. package/mobile/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  198. package/mobile/lib/api/RetailAPI/getTaskById.js +6 -0
  199. package/mobile/lib/api/RetailAPI/getTaskById.js.map +1 -0
  200. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +13 -9
  201. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  202. package/mobile/lib/common.css +1 -1
  203. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  204. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  205. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  206. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  207. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  208. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  209. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  210. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  211. package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
  212. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  213. package/mobile/lib/components/GrantSupport/GrantSupport.js +1 -1
  214. package/mobile/lib/components/GrantSupport/GrantSupport.js.map +1 -1
  215. package/mobile/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  216. package/mobile/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  217. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  218. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  219. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  220. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  221. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  222. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  223. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  224. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  225. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  226. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  227. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  228. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  229. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  230. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  231. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  232. package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  233. package/mobile/lib/ui-kit/DraftDialog/utils.js +78 -0
  234. package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  235. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  236. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  237. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +4 -2
  238. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  239. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +10 -10
  240. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  241. package/mobile/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  242. package/mobile/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  243. package/mobile/src/api/RetailAPI/getPaymentSystems.ts +3 -10
  244. package/mobile/src/api/RetailAPI/getTaskById.ts +12 -0
  245. package/mobile/src/api/RetailAPI/updateUserTask.ts +14 -9
  246. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +8 -8
  247. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  248. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  249. package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  250. package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
  251. package/mobile/src/components/GrantSupport/GrantSupport.tsx +1 -1
  252. package/mobile/src/ui-kit/ApplicationFormLayout/ApplicationFormLayout.tsx +1 -1
  253. package/mobile/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  254. package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  255. package/mobile/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  256. package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  257. package/mobile/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  258. package/mobile/src/ui-kit/DraftDialog/utils.ts +148 -0
  259. package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  260. package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +14 -6
  261. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +10 -10
  262. package/package.json +1 -1
  263. package/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  264. package/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  265. package/src/api/RetailAPI/getPaymentSystems.ts +3 -10
  266. package/src/api/RetailAPI/getTaskById.ts +12 -0
  267. package/src/api/RetailAPI/updateUserTask.ts +14 -9
  268. package/src/components/ApplicationLeadForm/LeadFormState.ts +8 -8
  269. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  270. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  271. package/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  272. package/src/components/CreditCardForm/formStateMap.tsx +1 -1
  273. package/src/components/GrantSupport/GrantSupport.tsx +1 -1
  274. package/src/ui-kit/ApplicationFormLayout/ApplicationFormLayout.tsx +1 -1
  275. package/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  276. package/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  277. package/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  278. package/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  279. package/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  280. package/src/ui-kit/DraftDialog/utils.ts +148 -0
  281. package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  282. package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +14 -6
  283. package/src/ui-kit/FormField/getObjectValidator.tsx +10 -10
@@ -0,0 +1,26 @@
1
+ import { type Participant, type PaymentType } from './updateUserTask';
2
+ export declare type Task = {
3
+ courierDeliveryFlg?: boolean;
4
+ creditPeriod?: number;
5
+ creditProgram: {
6
+ code: string;
7
+ name: string;
8
+ };
9
+ deliveryComment?: string;
10
+ deliveryDate?: string;
11
+ deliveryTimeCd?: {
12
+ value: string;
13
+ };
14
+ id: number;
15
+ loanAmount?: number;
16
+ office?: {
17
+ id: string;
18
+ };
19
+ participants: Participant[];
20
+ paymentTypeCd?: PaymentType;
21
+ };
22
+ declare type DraftTaskKZOResponse = {
23
+ tasks: Array<Task>;
24
+ };
25
+ export declare const draftTasksKZO: () => Promise<DraftTaskKZOResponse['tasks']>;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ declare type GetLastTaskStatusBody = {
2
+ profileId: number;
3
+ programId: string;
4
+ };
5
+ export declare const getLastTaskStatus: (body: GetLastTaskStatusBody) => Promise<number | null>;
6
+ export {};
@@ -1,4 +1,2 @@
1
- export declare const getPaymentSystems: (creditProgramId: string) => Promise<{
2
- id: string;
3
- text: string;
4
- }[]>;
1
+ import { type PaymentSystem } from './updateUserTask';
2
+ export declare const getPaymentSystems: (creditProgramId: string) => Promise<PaymentSystem[]>;
@@ -0,0 +1,6 @@
1
+ import { type Task } from './draftTasksKZO';
2
+ declare type GetTaskByIdBody = {
3
+ taskId: number;
4
+ };
5
+ export declare const getTaskById: (body: GetTaskByIdBody) => Promise<Task | undefined>;
6
+ export {};
@@ -28,18 +28,22 @@ export declare type PaymentType = {
28
28
  key: 'ANNUITY' | 'DIFFERENTIAL';
29
29
  value: string;
30
30
  };
31
+ export declare type PaymentSystem = {
32
+ name: string;
33
+ type: string;
34
+ };
31
35
  export declare type Participant = {
32
36
  birthDate?: string;
33
37
  id: number;
34
38
  midname?: string;
35
39
  name?: string;
36
40
  surname?: string;
37
- profile?: {
41
+ profile: {
38
42
  id: number;
39
43
  };
40
44
  armyIdFlg?: boolean;
41
45
  birthPlace?: string;
42
- childrenDependents?: number;
46
+ childrenDependents?: string;
43
47
  genderCd?: Option;
44
48
  dulIssueDate?: string;
45
49
  dulIssuedBy?: string;
@@ -50,13 +54,13 @@ export declare type Participant = {
50
54
  employeesNumberCd?: Option;
51
55
  employmentContractDate?: string;
52
56
  employmentTypeCd?: Option;
53
- generalSeniority?: number;
57
+ generalSeniority?: string;
54
58
  homeMatchFlg?: boolean;
55
59
  houseTypeCd?: Option;
56
60
  incomeCertificateCd?: Option;
57
61
  initiateBankruptcyFlg?: boolean;
58
- jobsNumber?: number;
59
- lastWorkDuration?: number;
62
+ jobsNumber?: string;
63
+ lastWorkDuration?: string;
60
64
  maritalStatusCd?: Option;
61
65
  militaryStatusCd?: Option;
62
66
  organizationActivityTypeCd?: Option;
@@ -64,7 +68,7 @@ export declare type Participant = {
64
68
  organizationKindCd?: Option;
65
69
  organizationName?: string;
66
70
  organizationTypeCd?: Option;
67
- otherDependents?: number;
71
+ otherDependents?: string;
68
72
  ownershipShare?: string;
69
73
  opf?: string;
70
74
  participantAddresses?: ParticipantAddress[];
@@ -76,14 +80,14 @@ export declare type Participant = {
76
80
  seniority?: string;
77
81
  seniorityInterruptionsFlg?: boolean;
78
82
  snils?: string;
79
- totalDependents?: number;
83
+ totalDependents?: string;
80
84
  bankruptcyFlg?: boolean;
81
85
  shareholderFlg?: boolean;
82
86
  nameLegalEntity?: string;
83
87
  creditInRshbCd?: Option;
84
88
  participantContacts?: Array<{
85
89
  contactTypeCd: {
86
- key: 'EMAIL' | 'MAIN_PHONE';
90
+ key: 'EMAIL' | 'MAIN_PHONE' | 'ORGANIZATION_PHONE';
87
91
  };
88
92
  value: string;
89
93
  }>;
@@ -94,7 +98,7 @@ export declare type Participant = {
94
98
  currencyCode?: {
95
99
  key: string;
96
100
  };
97
- paymentSystemTypeCd?: string;
101
+ paymentSystemTypeCd?: PaymentSystem;
98
102
  classCard?: Option;
99
103
  codeWord?: string;
100
104
  };
@@ -1202,7 +1202,7 @@
1202
1202
 
1203
1203
  const ApplicationFormLayout = JSX((props) => {
1204
1204
  const { className, title, children, ...rest } = props;
1205
- 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] }) }));
1205
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children] }) }));
1206
1206
  });
1207
1207
 
1208
1208
  function useDialog(Dialog, initialProps = {}) {
@@ -1624,14 +1624,14 @@
1624
1624
  birthday: defaultValidator('Укажите дату рождения'),
1625
1625
  limitedBirthday: limitedBirthdayValidator(),
1626
1626
  birthPlace: defaultValidator('Укажите место рождения'),
1627
- education: defaultValidator('Выберите ваше образование'),
1628
- housing: defaultValidator('Выберите тип жилья'),
1629
- employment: defaultValidator('Выберите информацию о трудоустройстве'),
1630
- organization: defaultValidator('Выберите тип организации'),
1631
- amountWorkers: defaultValidator('Выберите информацию о количестве сотрудников'),
1632
- employerActivities: defaultValidator('Выберите вид деятельности организации'),
1633
- employerOrganization: defaultValidator('Выберите вид организации'),
1634
- positionOrganization: defaultValidator('Выберите вашу должность'),
1627
+ education: defaultSelectValidator('Выберите ваше образование'),
1628
+ housing: defaultSelectValidator('Выберите тип жилья'),
1629
+ employment: defaultSelectValidator('Выберите информацию о трудоустройстве'),
1630
+ organization: defaultSelectValidator('Выберите тип организации'),
1631
+ amountWorkers: defaultSelectValidator('Выберите информацию о количестве сотрудников'),
1632
+ employerActivities: defaultSelectValidator('Выберите вид деятельности организации'),
1633
+ employerOrganization: defaultSelectValidator('Выберите вид организации'),
1634
+ positionOrganization: defaultSelectValidator('Выберите вашу должность'),
1635
1635
  dulSerie: serieValidator('Укажите серию паспорта'),
1636
1636
  dulNumber: numberValidator('Укажите номер паспорта'),
1637
1637
  dulIssueDateField: defaultValidator('Укажите дату выдачи паспорта'),
@@ -1667,7 +1667,7 @@
1667
1667
  consentPfrFlg: agreementValidator,
1668
1668
  consentOthersFlg: agreementValidator,
1669
1669
  consentInformFlg: agreementValidator,
1670
- familyStatus: defaultValidator('Выберите семейное положение'),
1670
+ familyStatus: defaultSelectValidator('Выберите семейное положение'),
1671
1671
  children: lengthStringValidator(2, 'Укажите количество детей'),
1672
1672
  familyMembers: lengthStringValidator(2, 'Укажите количество членов семьи'),
1673
1673
  dependents: lengthStringValidator(2, 'Укажите количество иждивенцев'),
@@ -1693,7 +1693,7 @@
1693
1693
  addressRetail: defaultSelectValidator('Выберите адрес банка'),
1694
1694
  addressMatch: defaultValidator(),
1695
1695
  codeWord: codeWordValidator('Необходимо ввести кодовое слово'),
1696
- confirmationIncome: defaultValidator(),
1696
+ confirmationIncome: defaultSelectValidator(),
1697
1697
  deliveryDate: defaultValidator('Укажите дату доставки'),
1698
1698
  addressCourier: addressDaDataValidator(),
1699
1699
  cardCategory: defaultValidator('Укажите категорию карты'),
@@ -3157,7 +3157,7 @@
3157
3157
  const [cardTypes, setCardTypes] = useState([]);
3158
3158
  const [programId] = useLocalStorage('programId');
3159
3159
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
3160
- const selectedPaymentSystem = field('paymentSystem').value;
3160
+ const selectedPaymentSystem = field('paymentSystem')?.value?.type;
3161
3161
  useEffect(() => {
3162
3162
  if (selectedPaymentSystem && programId) {
3163
3163
  (async () => {
@@ -3939,10 +3939,7 @@
3939
3939
  const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
3940
3940
  creditProgramId,
3941
3941
  });
3942
- return (data?.paymentSystems?.map((paymentSystem) => ({
3943
- id: paymentSystem.type,
3944
- text: paymentSystem.name,
3945
- })) ?? []);
3942
+ return data?.paymentSystems || [];
3946
3943
  };
3947
3944
 
3948
3945
  const PaymentSystemField = JSX(({ field, input }) => {
@@ -3957,8 +3954,10 @@
3957
3954
  })();
3958
3955
  }
3959
3956
  }, []);
3960
- return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: paymentSystemOptions, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required) }));
3957
+ const handleChange = useCallback((type) => onChange?.(paymentSystemOptions?.find((_) => _.type === type)), [paymentSystemOptions, onChange]);
3958
+ return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: formatPaymentSystems(paymentSystemOptions), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required), value: value?.type, onChange: handleChange }));
3961
3959
  });
3960
+ const formatPaymentSystems = (paymentSystems) => paymentSystems?.map((_) => ({ id: _.type, text: _.name })) ?? [];
3962
3961
 
3963
3962
  const isPlaceholder = (_) => _ === '_';
3964
3963
  const isDigit = (_) => /\d/.test(_);
@@ -4450,6 +4449,16 @@
4450
4449
 
4451
4450
  const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
4452
4451
 
4452
+ const getLastTaskStatus = async (body) => {
4453
+ const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
4454
+ return res?.statusCd === 'DRAFT' ? res?.taskId : null;
4455
+ };
4456
+
4457
+ const getTaskById = async (body) => {
4458
+ const res = await fetchRetailJSON('/user-data/getTaskById', 'POST', body);
4459
+ return res || undefined;
4460
+ };
4461
+
4453
4462
  const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
4454
4463
 
4455
4464
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
@@ -4477,16 +4486,6 @@
4477
4486
  };
4478
4487
  };
4479
4488
 
4480
- const useSetter = (target, key) => useCallback((value) => {
4481
- const newValue = value instanceof Function ? value(target[key]) : value;
4482
- if (newValue !== null && newValue !== undefined) {
4483
- target[key] = newValue;
4484
- }
4485
- else {
4486
- delete target[key];
4487
- }
4488
- }, [target, key]);
4489
-
4490
4489
  const sendCode = (body) => fetchRetailJSON('/sms/sendCode', 'POST', body).then((res) => !isErrorResult(res, body.phoneNumber));
4491
4490
  const isErrorResult = (res, phoneNumber) => Boolean(res) &&
4492
4491
  typeof res !== 'string' &&
@@ -4760,6 +4759,208 @@
4760
4759
  };
4761
4760
  };
4762
4761
 
4762
+ const useLeadFormStore = () => useLocalStore();
4763
+
4764
+ const useSetter = (target, key) => useCallback((value) => {
4765
+ const newValue = value instanceof Function ? value(target[key]) : value;
4766
+ if (newValue !== null && newValue !== undefined) {
4767
+ target[key] = newValue;
4768
+ }
4769
+ else {
4770
+ delete target[key];
4771
+ }
4772
+ }, [target, key]);
4773
+
4774
+ const DraftActionButton = JSX(({ title, icon, description, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, children: [jsx(Img, { image: { src: icon }, width: "78", height: "78" }), jsxs("div", { children: [jsx(Heading, { className: "text-left", title: title, headingType: "h5" }), description ? (jsx(Paragraph, { color: "text-secondary-text", size: "text-m", children: description })) : null] })] })));
4775
+
4776
+ const creditCodesToProgrammIdMap = {
4777
+ credit_cash: '10',
4778
+ credit_cash_single_doc: '28',
4779
+ credit_mcx: '39',
4780
+ family_offer_credit: '41',
4781
+ gas_engine_fuel: '33',
4782
+ pension_credit: '12',
4783
+ ref_credit: '11',
4784
+ ref_credit_single_doc: '29',
4785
+ self_employed: '34',
4786
+ summer_cash: '35',
4787
+ summer_cash_pens: '36',
4788
+ };
4789
+ const cardCodesToProgrammIdMap = {
4790
+ amur_card: '14',
4791
+ owner_card: '13',
4792
+ travel_card: '15',
4793
+ };
4794
+ const creditProgramCodeToProductIdMap = {
4795
+ ...creditCodesToProgrammIdMap,
4796
+ ...cardCodesToProgrammIdMap,
4797
+ };
4798
+ const getParticipantIncomes$1 = (participantIncomes) => {
4799
+ const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
4800
+ const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
4801
+ const incomeAverage = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "INCOME_AVERAGE" /* EIncomesType.INCOME_AVERAGE */)?.value;
4802
+ const additionalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "ADDITIONAL_INCOME" /* EIncomesType.ADDITIONAL_INCOME */)?.value;
4803
+ const otherIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_INCOME" /* EIncomesType.OTHER_INCOME */)?.value;
4804
+ const otherPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_PAYMENTS" /* EIncomesType.OTHER_PAYMENTS */)?.value;
4805
+ const rentalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RENTAL_INCOME" /* EIncomesType.RENTAL_INCOME */)?.value;
4806
+ const retirementIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RETIREMENT_INCOME" /* EIncomesType.RETIREMENT_INCOME */)?.value;
4807
+ return {
4808
+ wages,
4809
+ mandatoryPayments,
4810
+ incomeAverage,
4811
+ additionalIncome,
4812
+ otherIncome,
4813
+ otherPayments,
4814
+ rentalIncome,
4815
+ retirementIncome,
4816
+ };
4817
+ };
4818
+ const getParticipantAddresses$1 = (participantAddresses) => {
4819
+ const addressRegistration = participantAddresses?.find((address) => address.addressType.key === "REGISTRATION" /* EAddressType.REGISTRATION */);
4820
+ const addressFact = participantAddresses?.find((address) => address.addressType.key === "RESIDENTAL" /* EAddressType.RESIDENTAL */);
4821
+ const organizationAddress = participantAddresses?.find((address) => address.addressType.key === "WORK" /* EAddressType.WORK */);
4822
+ return {
4823
+ addressRegistration,
4824
+ addressFact,
4825
+ organizationAddress,
4826
+ };
4827
+ };
4828
+ const getParticipantContacts$1 = (participantContacts) => {
4829
+ const email = participantContacts?.find((contact) => contact.contactTypeCd.key === "EMAIL" /* EContactType.EMail */)?.value;
4830
+ const phone = participantContacts?.find((contact) => contact.contactTypeCd.key === "MAIN_PHONE" /* EContactType.MainPhone */)?.value;
4831
+ const organizationPhone = participantContacts?.find((contact) => contact.contactTypeCd.key === "ORGANIZATION_PHONE" /* EContactType.OrganizationPhone */)?.value;
4832
+ return {
4833
+ email,
4834
+ phone,
4835
+ organizationPhone,
4836
+ };
4837
+ };
4838
+ const getParticipantGender = (gender) => {
4839
+ return gender?.key
4840
+ ? {
4841
+ sex: gender.key === 'MAN' ? 'male' : 'female',
4842
+ }
4843
+ : null;
4844
+ };
4845
+ const getSelectValue = (option) => {
4846
+ return option?.key
4847
+ ? {
4848
+ key: option.key,
4849
+ text: option.value,
4850
+ }
4851
+ : undefined;
4852
+ };
4853
+
4854
+ const parseDraftTask = (task) => {
4855
+ const participant = task.participants[0];
4856
+ const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
4857
+ const { currencyCode: currency, paymentSystemTypeCd: paymentSystem, classCard: cardCategory, codeWord, birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDateField, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, } = participant;
4858
+ return {
4859
+ currency: currency?.key,
4860
+ paymentSystem,
4861
+ cardCategory: getSelectValue(cardCategory),
4862
+ codeWord,
4863
+ limitedBirthday,
4864
+ middleName,
4865
+ name,
4866
+ surname,
4867
+ birthPlace,
4868
+ dulIssueDateField,
4869
+ dulIssuedBy,
4870
+ dulNumber,
4871
+ dulSerie,
4872
+ dulSubdivisionCode,
4873
+ education: getSelectValue(education),
4874
+ participantDateRegistration,
4875
+ housing: getSelectValue(housing),
4876
+ beginDate,
4877
+ employment: getSelectValue(employment),
4878
+ organizationName,
4879
+ inn,
4880
+ employerActivities: getSelectValue(employerActivities),
4881
+ organization: getSelectValue(organization),
4882
+ employerOrganization: getSelectValue(employerOrganization),
4883
+ amountWorkers: getSelectValue(amountWorkers),
4884
+ legalForm,
4885
+ generalSeniority: generalSeniority?.toString(),
4886
+ experience5Years: experience5Years?.toString(),
4887
+ jobsNumber: jobsNumber?.toString(),
4888
+ lastJobExperience: lastJobExperience?.toString(),
4889
+ positionOrganization: getSelectValue(positionOrganization),
4890
+ familyStatus: getSelectValue(familyStatus),
4891
+ children: children?.toString(),
4892
+ familyMembers: familyMembers?.toString(),
4893
+ dependents: dependents?.toString(),
4894
+ conscription: getSelectValue(conscription),
4895
+ snils,
4896
+ armyIdFlg,
4897
+ bankruptcyFlg,
4898
+ shareholderFlg,
4899
+ legalEntityName,
4900
+ creditInRshbCd: getSelectValue(creditInRshbCd),
4901
+ calculator: {
4902
+ isInsurance,
4903
+ isSalaryClient,
4904
+ moneyValue,
4905
+ monthsValue,
4906
+ isAnnuity: paymentTypeCd?.key === 'ANNUITY',
4907
+ },
4908
+ ...getParticipantIncomes$1(participantIncomes),
4909
+ ...getParticipantAddresses$1(participantAddresses),
4910
+ ...getParticipantContacts$1(participantContacts),
4911
+ ...getParticipantGender(genderCd),
4912
+ };
4913
+ };
4914
+
4915
+ const DraftDialog = JSX(function ({ task, isFromLead = false, onClose = noop, }) {
4916
+ const leadFormStore = useLeadFormStore();
4917
+ const saveForm = useSetter(leadFormStore, 'leadForm');
4918
+ const navigator = locationNavigator();
4919
+ const { participants, creditProgram, id: taskId } = task;
4920
+ const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
4921
+ const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
4922
+ const nextStepLink = isCredit ? '/credit-lead' : '/credit-card-lead';
4923
+ const { name, midname, id: participantId, profile } = participants[0];
4924
+ const handleGoToDraft = useCallback(() => {
4925
+ const taskFromDraft = parseDraftTask(task);
4926
+ leadFormStore.participantId = participantId;
4927
+ leadFormStore.taskId = taskId;
4928
+ leadFormStore.profileId = profile?.id;
4929
+ leadFormStore.programId = programmId;
4930
+ saveForm(taskFromDraft);
4931
+ navigator.assign(nextStepLink);
4932
+ }, []);
4933
+ const handleGoToNewTask = useCallback(() => {
4934
+ navigator.assign(isCredit ? '/natural/loans/all-goals' : '/natural/creditcards/svoya');
4935
+ }, []);
4936
+ const handleGoToMainPage = useCallback(() => {
4937
+ navigator.assign('/');
4938
+ }, []);
4939
+ const appeal = name && midname ? `${name} ${midname}, ` : '';
4940
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "whitespace-pre-wrap", title: `${appeal}мы нашли черновик вашей заявки.\nПродолжите заполнение?`, headingType: "h5" }), jsx(DraftActionButton, { title: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0443", icon: "api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg", description: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u0439\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u0437 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", onClick: handleGoToDraft }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Заполнить новую заявку', icon: "api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg", onClick: isFromLead ? onClose : handleGoToNewTask }), jsx(Button, { type: "button", version: "secondary", className: "w-full text-h5", onClick: handleGoToMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4941
+ });
4942
+
4943
+ const EmptyDraftDialog = JSX(function ({ onClose = noop }) {
4944
+ const navigator = locationNavigator();
4945
+ const handleGoNewTask = useCallback(() => {
4946
+ navigator.assign('/natural/loans/all-goals');
4947
+ }, []);
4948
+ const handleGoMainPage = useCallback(() => {
4949
+ navigator.assign('/');
4950
+ }, []);
4951
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "text-center", title: "\u0417\u0430\u044F\u0432\u043A\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B", headingType: "h3" }), jsx(Paragraph, { size: "text-l", align: "text-center", children: "\u041F\u043E \u0434\u0430\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043D\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044B\u0445 \u0437\u0430\u044F\u0432\u043E\u043A. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u043B\u0438 \u0432\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443" }), jsx(Button, { type: "button", className: "w-full", onClick: handleGoNewTask, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443" }), jsx(Button, { type: "button", version: "secondary", className: "w-full", onClick: handleGoMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4952
+ });
4953
+
4954
+ const useDraftDialog = () => {
4955
+ const { open: openDraftDialog } = useDialog(DraftDialog);
4956
+ const { open: openEmptyDraftDialog } = useDialog(EmptyDraftDialog);
4957
+ return {
4958
+ open: ({ task, isFromLead, onClose }) => {
4959
+ task ? openDraftDialog({ task, isFromLead, onClose }) : openEmptyDraftDialog({});
4960
+ },
4961
+ };
4962
+ };
4963
+
4763
4964
  const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
4764
4965
 
4765
4966
  const EsiaLoginDialog = JSX(({ onClose }) => {
@@ -4891,22 +5092,26 @@
4891
5092
  };
4892
5093
  };
4893
5094
 
4894
- const useLeadFormStore = () => useLocalStore();
4895
-
4896
- const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
4897
- const [responseStatus, setResponseStatus] = useState('');
5095
+ const useSaveUserData = () => {
4898
5096
  const leadFormStore = useLeadFormStore();
4899
5097
  const saveForm = useSetter(leadFormStore, 'leadForm');
4900
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
4901
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
4902
- const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
4903
- const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
5098
+ const saveUserData = useCallback(({ participantId, taskId, profileId, formData, programId: programNumber }) => {
4904
5099
  leadFormStore.participantId = participantId;
4905
5100
  leadFormStore.taskId = taskId;
4906
5101
  leadFormStore.profileId = profileId;
4907
5102
  leadFormStore.programId = programNumber;
5103
+ saveForm(formData);
4908
5104
  }, []);
4909
- // eslint-disable-next-line consistent-return
5105
+ return saveUserData;
5106
+ };
5107
+
5108
+ const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
5109
+ const [responseStatus, setResponseStatus] = useState('');
5110
+ const saveUserData = useSaveUserData();
5111
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5112
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5113
+ const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5114
+ const draftDialog = useDraftDialog();
4910
5115
  const handleSubmit = useCallback(async (formData) => {
4911
5116
  const feedbackValidator = objectValidator(getObjectValidator(inputs));
4912
5117
  if (!isValidationSuccess(feedbackValidator(formData))) {
@@ -4917,17 +5122,34 @@
4917
5122
  profile: { phone: formatPhone(formData.phone) },
4918
5123
  });
4919
5124
  if (profileId && formData?.phone) {
5125
+ const sendCurrentTask = async () => {
5126
+ await updateUserData({
5127
+ programId,
5128
+ profileId,
5129
+ formData,
5130
+ saveUserData,
5131
+ });
5132
+ verifyPhoneDialog.close();
5133
+ consentBkiDialog.open(formData.phone, profileId);
5134
+ };
4920
5135
  const handleSuccessVerify = async () => {
4921
5136
  try {
4922
- await updateUserData({
4923
- programId,
5137
+ const lastTaskId = await getLastTaskStatus({
4924
5138
  profileId,
4925
- formData,
4926
- saveUserData,
4927
- saveForm,
5139
+ programId,
4928
5140
  });
4929
- verifyPhoneDialog.close();
4930
- consentBkiDialog.open(formData.phone, profileId);
5141
+ if (lastTaskId) {
5142
+ const task = await getTaskById({ taskId: lastTaskId });
5143
+ verifyPhoneDialog.close();
5144
+ draftDialog.open({
5145
+ task,
5146
+ isFromLead: true,
5147
+ onClose: sendCurrentTask,
5148
+ });
5149
+ }
5150
+ else {
5151
+ await sendCurrentTask();
5152
+ }
4931
5153
  }
4932
5154
  catch {
4933
5155
  setResponseStatus('Fail');
@@ -4952,7 +5174,7 @@
4952
5174
  responseStatus,
4953
5175
  };
4954
5176
  };
4955
- const updateUserData = async ({ programId, profileId, formData, saveUserData, saveForm, }) => {
5177
+ const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
4956
5178
  const transformedForm = transformOtherConsentsField(formData);
4957
5179
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
4958
5180
  const { taskId, participantId } = await createDraftTask({
@@ -4970,8 +5192,7 @@
4970
5192
  catch (ex) {
4971
5193
  console.log(ex);
4972
5194
  }
4973
- saveUserData({ participantId, taskId, profileId, programId });
4974
- saveForm(formData);
5195
+ saveUserData({ participantId, taskId, profileId, programId, formData });
4975
5196
  };
4976
5197
  const transformOtherConsentsField = (formData) => {
4977
5198
  const { consentOthersFlg, ...form } = formData;
@@ -5019,7 +5240,7 @@
5019
5240
  addressRegistration: '',
5020
5241
  participantDateRegistration: undefined,
5021
5242
  currency: '',
5022
- paymentSystem: '',
5243
+ paymentSystem: { name: '', type: '' },
5023
5244
  cardCategory: { key: '', text: '' },
5024
5245
  codeWord: '',
5025
5246
  addressRetail: { key: '', text: '' },
@@ -6680,7 +6901,7 @@
6680
6901
 
6681
6902
  const formStateMap$1 = [
6682
6903
  {
6683
- paymentSystem: '',
6904
+ paymentSystem: { name: '', type: '' },
6684
6905
  currency: '810',
6685
6906
  codeWord: '',
6686
6907
  },
@@ -8921,7 +9142,7 @@
8921
9142
  });
8922
9143
  const regionHref = regions?.find((_) => _.name === region.key)?.href;
8923
9144
  const buttonText = button?.text ? button.text : 'Перейти';
8924
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-m", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, regions ? (jsx(SelectControl, { label: "\u0412\u0430\u0448 \u0440\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ name = '' }) => ({ key: name, text: name })), value: region, onChange: setRegion })) : null, regionHref ? (jsx("div", { className: "text-center", children: jsx(LinkButton, { href: regionHref, target: "_blank", className: style('p-m w-full @xl:w-auto', buttonStyle), data: getAspectsWithInclude(data, region?.key), children: buttonText }) })) : null] }) }));
9145
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container space-y-m", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, regions ? (jsx(SelectControl, { label: "\u0412\u0430\u0448 \u0440\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ name = '' }) => ({ key: name, text: name })), value: region, onChange: setRegion })) : null, regionHref ? (jsx("div", { className: "text-center", children: jsx(LinkButton, { href: regionHref, target: "_blank", className: style('p-m w-full @xl:w-auto', buttonStyle), data: getAspectsWithInclude(data, region?.key), children: buttonText }) })) : null] }) }));
8925
9146
  });
8926
9147
 
8927
9148
  function useActiveRoute(items = []) {
@@ -10545,7 +10766,7 @@
10545
10766
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10546
10767
  });
10547
10768
 
10548
- const packageVersion = "0.14.698";
10769
+ const packageVersion = "0.14.700";
10549
10770
 
10550
10771
  exports.Blocks = Blocks;
10551
10772
  exports.ContentPage = ContentPage;