@redneckz/wildless-cms-uni-blocks 0.14.1029 → 0.14.1031

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 (215) hide show
  1. package/bundle/api/getSubmitBody.d.ts +4225 -865
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +79 -7
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  6. package/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  7. package/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  8. package/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  9. package/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  10. package/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  11. package/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  12. package/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  13. package/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  14. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  15. package/dist/api/getSubmitBody.d.ts +4225 -865
  16. package/dist/api/getSubmitBody.js +14 -0
  17. package/dist/api/getSubmitBody.js.map +1 -1
  18. package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  19. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  20. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  21. package/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  22. package/dist/components/ApplicationForm/Footnote.js +1 -1
  23. package/dist/components/ApplicationForm/Footnote.js.map +1 -1
  24. package/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  25. package/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  26. package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  27. package/dist/components/Blocks.js +2 -0
  28. package/dist/components/Blocks.js.map +1 -1
  29. package/dist/components/Blocks.mobile.js +2 -0
  30. package/dist/components/Blocks.mobile.js.map +1 -1
  31. package/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  32. package/dist/components/ReferalForm/ReferalForm.js +33 -0
  33. package/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  34. package/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  35. package/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  36. package/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  37. package/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  38. package/dist/components/ReferalForm/ResultLink.js +13 -0
  39. package/dist/components/ReferalForm/ResultLink.js.map +1 -0
  40. package/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  41. package/dist/components/ReferalForm/referalFormData.js +19 -0
  42. package/dist/components/ReferalForm/referalFormData.js.map +1 -0
  43. package/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  44. package/dist/components/ReferalForm/renderLinkInput.js +20 -0
  45. package/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  46. package/dist/components/ReferalForm/renderSections.d.ts +3 -0
  47. package/dist/components/ReferalForm/renderSections.js +10 -0
  48. package/dist/components/ReferalForm/renderSections.js.map +1 -0
  49. package/dist/hooks/useDadataParty.js +1 -1
  50. package/dist/hooks/useDadataParty.js.map +1 -1
  51. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  52. package/lib/api/getSubmitBody.d.ts +4225 -865
  53. package/lib/api/getSubmitBody.js +14 -0
  54. package/lib/api/getSubmitBody.js.map +1 -1
  55. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  56. package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  57. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  58. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  59. package/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  60. package/lib/components/ApplicationForm/Footnote.js +1 -1
  61. package/lib/components/ApplicationForm/Footnote.js.map +1 -1
  62. package/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  63. package/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  64. package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  65. package/lib/components/Blocks.js +2 -0
  66. package/lib/components/Blocks.js.map +1 -1
  67. package/lib/components/Blocks.mobile.js +2 -0
  68. package/lib/components/Blocks.mobile.js.map +1 -1
  69. package/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  70. package/lib/components/ReferalForm/ReferalForm.fixture.d.ts +5 -0
  71. package/lib/components/ReferalForm/ReferalForm.fixture.mobile.d.ts +5 -0
  72. package/lib/components/ReferalForm/ReferalForm.js +31 -0
  73. package/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  74. package/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  75. package/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  76. package/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  77. package/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  78. package/lib/components/ReferalForm/ResultLink.js +11 -0
  79. package/lib/components/ReferalForm/ResultLink.js.map +1 -0
  80. package/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  81. package/lib/components/ReferalForm/referalFormData.js +17 -0
  82. package/lib/components/ReferalForm/referalFormData.js.map +1 -0
  83. package/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  84. package/lib/components/ReferalForm/renderLinkInput.js +18 -0
  85. package/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  86. package/lib/components/ReferalForm/renderSections.d.ts +3 -0
  87. package/lib/components/ReferalForm/renderSections.js +7 -0
  88. package/lib/components/ReferalForm/renderSections.js.map +1 -0
  89. package/lib/hooks/useDadataParty.js +1 -1
  90. package/lib/hooks/useDadataParty.js.map +1 -1
  91. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  92. package/mobile/bundle/api/getSubmitBody.d.ts +4225 -865
  93. package/mobile/bundle/bundle.umd.js +79 -7
  94. package/mobile/bundle/bundle.umd.min.js +1 -1
  95. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  96. package/mobile/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
  97. package/mobile/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  98. package/mobile/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
  99. package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  100. package/mobile/bundle/components/ReferalForm/ResultLink.d.ts +7 -0
  101. package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
  102. package/mobile/bundle/components/ReferalForm/renderLinkInput.d.ts +7 -0
  103. package/mobile/bundle/components/ReferalForm/renderSections.d.ts +3 -0
  104. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  105. package/mobile/dist/api/getSubmitBody.d.ts +4225 -865
  106. package/mobile/dist/api/getSubmitBody.js +14 -0
  107. package/mobile/dist/api/getSubmitBody.js.map +1 -1
  108. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  109. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  110. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  111. package/mobile/dist/components/ApplicationForm/Footnote.d.ts +1 -0
  112. package/mobile/dist/components/ApplicationForm/Footnote.js +1 -1
  113. package/mobile/dist/components/ApplicationForm/Footnote.js.map +1 -1
  114. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  115. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  116. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  117. package/mobile/dist/components/Blocks.js +2 -0
  118. package/mobile/dist/components/Blocks.js.map +1 -1
  119. package/mobile/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
  120. package/mobile/dist/components/ReferalForm/ReferalForm.js +33 -0
  121. package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -0
  122. package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  123. package/mobile/dist/components/ReferalForm/ReferalFormContent.js +2 -0
  124. package/mobile/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
  125. package/mobile/dist/components/ReferalForm/ResultLink.d.ts +7 -0
  126. package/mobile/dist/components/ReferalForm/ResultLink.js +13 -0
  127. package/mobile/dist/components/ReferalForm/ResultLink.js.map +1 -0
  128. package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -0
  129. package/mobile/dist/components/ReferalForm/referalFormData.js +19 -0
  130. package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -0
  131. package/mobile/dist/components/ReferalForm/renderLinkInput.d.ts +7 -0
  132. package/mobile/dist/components/ReferalForm/renderLinkInput.js +20 -0
  133. package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
  134. package/mobile/dist/components/ReferalForm/renderSections.d.ts +3 -0
  135. package/mobile/dist/components/ReferalForm/renderSections.js +10 -0
  136. package/mobile/dist/components/ReferalForm/renderSections.js.map +1 -0
  137. package/mobile/dist/hooks/useDadataParty.js +1 -1
  138. package/mobile/dist/hooks/useDadataParty.js.map +1 -1
  139. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  140. package/mobile/lib/api/getSubmitBody.d.ts +4225 -865
  141. package/mobile/lib/api/getSubmitBody.js +14 -0
  142. package/mobile/lib/api/getSubmitBody.js.map +1 -1
  143. package/mobile/lib/common.css +1 -1
  144. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  145. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  146. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
  147. package/mobile/lib/components/ApplicationForm/Footnote.d.ts +1 -0
  148. package/mobile/lib/components/ApplicationForm/Footnote.js +1 -1
  149. package/mobile/lib/components/ApplicationForm/Footnote.js.map +1 -1
  150. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
  151. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
  152. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  153. package/mobile/lib/components/Blocks.js +2 -0
  154. package/mobile/lib/components/Blocks.js.map +1 -1
  155. package/mobile/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
  156. package/mobile/lib/components/ReferalForm/ReferalForm.js +31 -0
  157. package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -0
  158. package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +14 -0
  159. package/mobile/lib/components/ReferalForm/ReferalFormContent.js +2 -0
  160. package/mobile/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
  161. package/mobile/lib/components/ReferalForm/ResultLink.d.ts +7 -0
  162. package/mobile/lib/components/ReferalForm/ResultLink.js +11 -0
  163. package/mobile/lib/components/ReferalForm/ResultLink.js.map +1 -0
  164. package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -0
  165. package/mobile/lib/components/ReferalForm/referalFormData.js +17 -0
  166. package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -0
  167. package/mobile/lib/components/ReferalForm/renderLinkInput.d.ts +7 -0
  168. package/mobile/lib/components/ReferalForm/renderLinkInput.js +18 -0
  169. package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
  170. package/mobile/lib/components/ReferalForm/renderSections.d.ts +3 -0
  171. package/mobile/lib/components/ReferalForm/renderSections.js +7 -0
  172. package/mobile/lib/components/ReferalForm/renderSections.js.map +1 -0
  173. package/mobile/lib/hooks/useDadataParty.js +1 -1
  174. package/mobile/lib/hooks/useDadataParty.js.map +1 -1
  175. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  176. package/mobile/src/api/getSubmitBody.ts +17 -0
  177. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  178. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  179. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  180. package/mobile/src/components/ApplicationForm/Footnote.tsx +10 -1
  181. package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  182. package/mobile/src/components/Blocks.ts +2 -0
  183. package/mobile/src/components/ReferalForm/ReferalForm.example.json +8 -0
  184. package/mobile/src/components/ReferalForm/ReferalForm.tsx +80 -0
  185. package/mobile/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  186. package/mobile/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  187. package/mobile/src/components/ReferalForm/ResultLink.tsx +23 -0
  188. package/mobile/src/components/ReferalForm/referalFormData.ts +18 -0
  189. package/mobile/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  190. package/mobile/src/components/ReferalForm/renderSections.tsx +18 -0
  191. package/mobile/src/hooks/useDadataParty.ts +1 -1
  192. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  193. package/package.json +1 -1
  194. package/src/api/getSubmitBody.ts +17 -0
  195. package/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
  196. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +36 -0
  197. package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  198. package/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
  199. package/src/components/ApplicationForm/Footnote.tsx +10 -1
  200. package/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
  201. package/src/components/Blocks.mobile.ts +2 -0
  202. package/src/components/Blocks.ts +2 -0
  203. package/src/components/ReferalForm/ReferalForm.example.json +8 -0
  204. package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +24 -0
  205. package/src/components/ReferalForm/ReferalForm.fixture.tsx +24 -0
  206. package/src/components/ReferalForm/ReferalForm.tsx +80 -0
  207. package/src/components/ReferalForm/ReferalForm.ui.json +12 -0
  208. package/src/components/ReferalForm/ReferalFormContent.ts +15 -0
  209. package/src/components/ReferalForm/ResultLink.tsx +23 -0
  210. package/src/components/ReferalForm/referalFormData.ts +18 -0
  211. package/src/components/ReferalForm/renderLinkInput.tsx +35 -0
  212. package/src/components/ReferalForm/renderSections.tsx +18 -0
  213. package/src/hooks/useDadataParty.ts +1 -1
  214. package/src/icons/IconName.ts +4 -4
  215. package/src/model/FormTypeFieldDef.ts +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderSections.js","sourceRoot":"","sources":["../../../src/components/ReferalForm/renderSections.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAyB,EACzB,KAA+C,EAC/C,EAAE,CACF,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACrB,eAA0B,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,aAC7E,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,EACpB,CAAC,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAW,KAAK,CAAC,CAAC,KAF1C,WAAW,CAAC,EAAE,CAGlB,CACP,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { getDaDataHints } from '../retail/api/dadataHints/dadataHints.js';
2
2
  const INN_DADATA_URL = 'suggest/party';
3
- export const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
3
+ export const useDadataParty = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery }))?.map((_) => ({
4
4
  fullName: _?.value,
5
5
  address: _?.data?.address?.value,
6
6
  inn: _?.data?.inn,
@@ -1 +1 @@
1
- {"version":3,"file":"useDadataParty.js","sourceRoot":"","sources":["../../src/hooks/useDadataParty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,cAAc,GAAG,eAAe,CAAC;AAQvC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,WAAmB,EAA8B,EAAE,CACtF,CAAC,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,QAAQ,EAAE,CAAC,EAAE,KAAK;IAClB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK;IAChC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG;CAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"useDadataParty.js","sourceRoot":"","sources":["../../src/hooks/useDadataParty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,cAAc,GAAG,eAAe,CAAC;AAQvC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,WAAmB,EAA8B,EAAE,CACtF,CAAC,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/E,QAAQ,EAAE,CAAC,EAAE,KAAK;IAClB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK;IAChC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG;CAClB,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  /** @hidden */
2
- export declare type FormTypeFieldDef = '' | 'ACQR' | 'ANALITIC' | 'ANTIFRAUD' | 'BCRD' | 'BROK' | 'BROKACCOUNT' | 'COLLECTION' | 'CORRUPTION' | 'CRED' | 'DPST' | 'PRODUCT' | 'SELFCOLLECTION' | 'KVED' | 'ULTRASERVICE' | 'FEEDBACK' | 'FEEDBACK_QS' | 'OUTSERVICE' | 'FCB' | 'CREDL' | 'CONT' | 'SUPPORT' | 'INVESTADVISER' | 'FINOMBUDSMAN' | 'PF' | 'UNIVERSAL' | 'PRACTICE' | 'CALC';
2
+ export declare type FormTypeFieldDef = '' | 'ACQR' | 'ANALITIC' | 'ANTIFRAUD' | 'BCRD' | 'BROK' | 'BROKACCOUNT' | 'COLLECTION' | 'CORRUPTION' | 'CRED' | 'DPST' | 'PRODUCT' | 'SELFCOLLECTION' | 'KVED' | 'ULTRASERVICE' | 'FEEDBACK' | 'FEEDBACK_QS' | 'OUTSERVICE' | 'FCB' | 'CREDL' | 'CONT' | 'SUPPORT' | 'INVESTADVISER' | 'FINOMBUDSMAN' | 'PF' | 'UNIVERSAL' | 'PRACTICE' | 'CALC' | 'REF';
@@ -73,6 +73,7 @@ export const getSubmitBody = ({ body, endpoint, router }: submitBodyProps) => {
73
73
  }),
74
74
  ...getRkoTariffName(typeForm),
75
75
  ...staticBody,
76
+ ...getReferalRkoData(body, typeForm),
76
77
  };
77
78
  };
78
79
 
@@ -124,3 +125,19 @@ const getRkoTariffName = (typeForm?: string) =>
124
125
  partnerComments: globalThis?.sessionStorage.getItem('rkoTariffName') ?? 'Неизвестный тариф',
125
126
  }
126
127
  : {};
128
+
129
+ const getReferalRkoData = (body: LeadRequest, typeForm?: string) => {
130
+ const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
131
+
132
+ const partnerComments = params.get('utm_mail');
133
+ const partner = params.get('utm_source');
134
+
135
+ return typeForm === 'REF'
136
+ ? {
137
+ name: body.fullName,
138
+ fullName: undefined,
139
+ partnerComments,
140
+ partner,
141
+ }
142
+ : {};
143
+ };
@@ -1841,5 +1841,43 @@
1841
1841
  }
1842
1842
  }
1843
1843
  }
1844
+ ],
1845
+ [
1846
+ "Заявка на РКО по ссылке друга",
1847
+ {
1848
+ "content": {
1849
+ "version": "primary",
1850
+ "padding": "",
1851
+ "title": "Открыть счёт РКО",
1852
+ "typeForm": "REF",
1853
+ "endpoint": "sendcorporatelead",
1854
+ "sections": [
1855
+ {
1856
+ "inputs": [{ "name": "fullName", "required": true, "label": "ФИО" }]
1857
+ },
1858
+ {
1859
+ "columns": 2,
1860
+ "inputs": [
1861
+ { "name": "phone", "required": true },
1862
+ { "name": "email", "required": true }
1863
+ ]
1864
+ }
1865
+ ],
1866
+ "button": {
1867
+ "text": "Открыть счет",
1868
+ "version": "primary"
1869
+ },
1870
+ "link": {
1871
+ "text": "условиями передачи данных",
1872
+ "href": "/privacy-policy",
1873
+ "target": "_blank"
1874
+ },
1875
+ "additionalLink": {
1876
+ "text": "условиями проведения акции",
1877
+ "href": "/promo-link",
1878
+ "target": "_blank"
1879
+ }
1880
+ }
1881
+ }
1844
1882
  ]
1845
1883
  ]
@@ -51,6 +51,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
51
51
  sections = [],
52
52
  button,
53
53
  link,
54
+ additionalLink,
54
55
  endpoint,
55
56
  additionalParams,
56
57
  withSnowplow,
@@ -117,6 +118,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
117
118
  {renderAgreementSubmit({
118
119
  consentDataProcessing,
119
120
  link,
121
+ additionalLink,
120
122
  button,
121
123
  typeForm,
122
124
  })}
@@ -116,6 +116,16 @@ export type ApplicationFormContent = UniBlockContent &
116
116
  /** @default "" */
117
117
  target?: Target;
118
118
  };
119
+ /**
120
+ * @title Условия проведения акции
121
+ * @required ["text", "href"]
122
+ */
123
+ additionalLink?: TextProps & {
124
+ /** @title URL (href) */
125
+ href?: string;
126
+ /** @default "" */
127
+ target?: Target;
128
+ };
119
129
  typeForm?: FormTypeFieldDef;
120
130
  endpoint?: EndpointType;
121
131
  /** @title Дополнительные параметры формы */
@@ -7,9 +7,10 @@ import { Text } from '../../ui-kit/Text/Text';
7
7
 
8
8
  type FootnoteProps = TextProps & {
9
9
  link?: LinkProps;
10
+ additionalLink?: LinkProps;
10
11
  };
11
12
 
12
- export const Footnote = JSX<FootnoteProps>(({ text, link }) => (
13
+ export const Footnote = JSX<FootnoteProps>(({ text, link, additionalLink }) => (
13
14
  <Paragraph size="text-l" font="font-light" color="text-secondary-text">
14
15
  {text ? <Text>{text}</Text> : null}
15
16
  {link ? (
@@ -17,5 +18,13 @@ export const Footnote = JSX<FootnoteProps>(({ text, link }) => (
17
18
  {link.text}
18
19
  </Link>
19
20
  ) : null}
21
+ {additionalLink ? (
22
+ <Text>
23
+ {' и '}
24
+ <Link {...additionalLink} ariaLabel="условия проведения акции">
25
+ {additionalLink.text}
26
+ </Link>
27
+ </Text>
28
+ ) : null}
20
29
  </Paragraph>
21
30
  ));
@@ -14,11 +14,13 @@ const agreementTextPF = 'Нажимая на кнопку, вы подтверж
14
14
  export const renderAgreementSubmit = ({
15
15
  consentDataProcessing,
16
16
  link,
17
+ additionalLink,
17
18
  button,
18
19
  typeForm,
19
20
  }: {
20
21
  consentDataProcessing?: FieldProps<boolean>;
21
22
  link?: LinkProps;
23
+ additionalLink?: LinkProps;
22
24
  button?: SubmitButtonProps;
23
25
  typeForm?: string;
24
26
  }) => (
@@ -32,7 +34,11 @@ export const renderAgreementSubmit = ({
32
34
  {renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)}
33
35
  </div>
34
36
  ) : (
35
- <Footnote text={typeForm === 'PF' ? agreementTextPF : agreementText} link={link} />
37
+ <Footnote
38
+ text={typeForm === 'PF' ? agreementTextPF : agreementText}
39
+ link={link}
40
+ additionalLink={additionalLink}
41
+ />
36
42
  )}
37
43
  <SubmitButton className="w-full @xl:w-auto">
38
44
  {button?.text ? button.text : 'Отправить заявку'}
@@ -37,6 +37,7 @@ import { MobileAppTile } from './MobileAppTile/MobileAppTile';
37
37
  import { OfficesAtmsMap } from './OfficesAtmsMap/OfficesAtmsMap';
38
38
  import { ProductBlock } from './ProductBlock/ProductBlock';
39
39
  import { RatesTable } from './RatesTable/RatesTable';
40
+ import { ReferalForm } from './ReferalForm/ReferalForm';
40
41
  import { RichTextBlock } from './RichTextBlock/RichTextBlock';
41
42
  import { RkoTariffCardsTable } from './RkoTariffCardsTable/RkoTariffCardsTable';
42
43
  import { RollupItem } from './RollupItem/RollupItem';
@@ -94,4 +95,5 @@ export const Blocks: BlocksRegistry = {
94
95
  CalculatorRko,
95
96
  RkoTariffCardsTable,
96
97
  RatesTable,
98
+ ReferalForm,
97
99
  };
@@ -0,0 +1,8 @@
1
+ {
2
+ "content": {
3
+ "link": "https://www.rshb.ru/business/dlya-druga/rko",
4
+ "button": {
5
+ "text": "Получить ссылку"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,80 @@
1
+ import { useCallback, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useForm } from '../../hooks/useForm/useForm';
3
+ import { ApplicationFormLayout } from '../../ui-kit/ApplicationFormLayout/ApplicationFormLayout';
4
+ import { SubmitButton } from '../../ui-kit/Button/SubmitButton';
5
+ import { getFormValidator } from '../../ui-kit/FormField/getObjectValidator';
6
+ import { Link } from '../../ui-kit/Link/Link';
7
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
8
+ import { type Option } from '../../ui-kit/Select/Option';
9
+ import { Text } from '../../ui-kit/Text/Text';
10
+ import { UniBlock } from '../../UniBlock/UniBlock';
11
+ import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
12
+ import { type FieldDef } from '../ApplicationForm/ApplicationFormContent';
13
+ import { type ReferalFormContent } from './ReferalFormContent';
14
+ import { sections } from './referalFormData';
15
+ import { renderSections } from './renderSections';
16
+ import { ResultLink } from './ResultLink';
17
+
18
+ export interface FormState {
19
+ email?: string;
20
+ dadataPartyInnSelect?: Option;
21
+ }
22
+
23
+ export interface ReferalFormProps extends ReferalFormContent, UniBlockProps {}
24
+
25
+ export const ReferalForm = UniBlock<ReferalFormProps>(
26
+ ({ link = '', button, copyIcon, ...rest }) => {
27
+ const [isShowResultLink, setIsShowResultLink] = useState(false);
28
+ const [referalLink, setReferalLink] = useState('');
29
+ const inputs = useMemo(
30
+ () => (sections?.flatMap((_) => _?.inputs) || []) as FieldDef[],
31
+ [sections],
32
+ );
33
+
34
+ const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
35
+
36
+ const handleSubmit = useCallback(async (formData: FormState) => {
37
+ setReferalLink(
38
+ `${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`,
39
+ );
40
+ setIsShowResultLink(true);
41
+ }, []);
42
+
43
+ const [, { field, onSubmit }] = useForm(
44
+ {},
45
+ {
46
+ resetOnSubmit: true,
47
+ formValidator,
48
+ onSubmit: handleSubmit,
49
+ },
50
+ );
51
+
52
+ return (
53
+ <ApplicationFormLayout
54
+ className="container space-y-m col-span-12"
55
+ title={getTitle(isShowResultLink)}
56
+ {...rest}
57
+ >
58
+ {isShowResultLink ? (
59
+ <ResultLink link={referalLink} copyIcon={copyIcon} />
60
+ ) : (
61
+ <form onSubmit={onSubmit}>
62
+ {renderSections(sections, field)}
63
+ <Paragraph size="text-l" font="font-light" color="text-secondary-text">
64
+ <Text>Нажимая кнопку, вы подтверждаете согласие с </Text>
65
+ <Link href="/privacy-policy" target="_blank" ariaLabel="условия передачи данных">
66
+ условиями передачи данных
67
+ </Link>
68
+ </Paragraph>
69
+ <SubmitButton className="w-full @xl:w-auto mt-xs">
70
+ {button?.text ?? 'Получить ссылку'}
71
+ </SubmitButton>
72
+ </form>
73
+ )}
74
+ </ApplicationFormLayout>
75
+ );
76
+ },
77
+ );
78
+
79
+ const getTitle = (isShowResultLink = false) =>
80
+ isShowResultLink ? 'Ваша личная ссылка' : 'Как получить бесплатное обслуживание счёта';
@@ -0,0 +1,12 @@
1
+ {
2
+ "style": {
3
+ "ui:options": {
4
+ "minCols": 12
5
+ }
6
+ },
7
+ "content": {
8
+ "copyIcon": {
9
+ "ui:field": "picture"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,15 @@
1
+ import { type TextProps } from '../../model/HeadlineType';
2
+ import { type Picture } from '../../model/Picture';
3
+ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
4
+
5
+ /**
6
+ * @title Форма для создания реферальной ссылки
7
+ */
8
+ export type ReferalFormContent = UniBlockContent & {
9
+ /** @title Адрес страницы с заявкой для реферала */
10
+ link?: string;
11
+ /** @title Кнопка */
12
+ button?: TextProps;
13
+ /** @title Иконка кнопки копирования */
14
+ copyIcon?: Picture;
15
+ };
@@ -0,0 +1,23 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { type Picture } from '../../model/Picture';
3
+ import { Text } from '../../ui-kit/Text/Text';
4
+ import { renderLinkInput } from './renderLinkInput';
5
+
6
+ type ResultLinkProps = {
7
+ link: string;
8
+ copyIcon?: Picture;
9
+ };
10
+
11
+ export const ResultLink = JSX<ResultLinkProps>(({ link, copyIcon }) => {
12
+ return (
13
+ <div>
14
+ <div className="@xl:text-center @xl:col-span-2 mb-m">
15
+ <Text size="text-h6">Скопируйте ссылку и отправьте другу</Text>
16
+ </div>
17
+ {renderLinkInput({
18
+ value: link,
19
+ copyIcon,
20
+ })}
21
+ </div>
22
+ );
23
+ });
@@ -0,0 +1,18 @@
1
+ import { type SectionsProps } from '../../model/InputSectionsType';
2
+
3
+ export const sections: SectionsProps[] = [
4
+ { title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
5
+ {
6
+ columns: 2,
7
+ inputs: [
8
+ {
9
+ name: 'dadataPartyInnSelect',
10
+ required: true,
11
+ },
12
+ {
13
+ name: 'email',
14
+ required: true,
15
+ },
16
+ ],
17
+ },
18
+ ];
@@ -0,0 +1,35 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { type Picture } from '../../model/Picture';
4
+ import { Img } from '../../ui-kit/Img/Img';
5
+ import { type InputProps } from '../../ui-kit/Input/InputProps';
6
+ import { defaultStyle } from '../../ui-kit/Input/styles';
7
+ import { style } from '../../utils/style';
8
+
9
+ type renderLinkInputProps = InputProps & {
10
+ copyIcon?: Picture;
11
+ };
12
+
13
+ export const renderLinkInput = JSX<renderLinkInputProps>(({ className, value = '', copyIcon }) => {
14
+ const onClick = useCallback(async () => {
15
+ try {
16
+ await globalThis.navigator.clipboard.writeText(value);
17
+ } catch {
18
+ console.log('Ошибка копирования');
19
+ }
20
+ }, []);
21
+
22
+ return (
23
+ <div className={style('relative flex items-center max-w-lg m-auto', className)}>
24
+ <input
25
+ className={style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle)}
26
+ type="text"
27
+ value={value}
28
+ disabled={true}
29
+ />
30
+ <div role="button" className="absolute right-3" onClick={onClick}>
31
+ <Img image={copyIcon} />
32
+ </div>
33
+ </div>
34
+ );
35
+ });
@@ -0,0 +1,18 @@
1
+ import type { FormFieldRegisterer } from '../../hooks/useForm/useForm';
2
+ import type { SectionsProps } from '../../model/InputSectionsType';
3
+ import { getField } from '../../ui-kit/FormField/getField';
4
+ import { inputColumnStyles } from '../../ui-kit/FormField/inputColumnStyle';
5
+ import { renderTitle } from '../../ui-kit/FormField/renderTitle';
6
+ import { style } from '../../utils/style';
7
+ import { type FieldDef } from '../ApplicationForm/ApplicationFormContent';
8
+
9
+ export const renderSections = (
10
+ sections: SectionsProps[],
11
+ field: FormFieldRegisterer<Record<string, any>>,
12
+ ) =>
13
+ sections.map((_, i) => (
14
+ <div key={`section-${i}`} className={style(inputColumnStyles(_.columns), 'grid')}>
15
+ {renderTitle(_.title)}
16
+ {(_?.inputs || [])?.map(getField<FieldDef>(field))}
17
+ </div>
18
+ ));
@@ -9,7 +9,7 @@ export interface DaDataPartyHint {
9
9
  }
10
10
 
11
11
  export const useDadataParty = async (searchQuery: string): Promise<DaDataPartyHint[]> =>
12
- (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
12
+ (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery }))?.map((_) => ({
13
13
  fullName: _?.value,
14
14
  address: _?.data?.address?.value,
15
15
  inn: _?.data?.inn,
@@ -27,4 +27,5 @@ export type FormTypeFieldDef =
27
27
  | 'PF'
28
28
  | 'UNIVERSAL'
29
29
  | 'PRACTICE'
30
- | 'CALC';
30
+ | 'CALC'
31
+ | 'REF';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.1029",
3
+ "version": "0.14.1031",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -73,6 +73,7 @@ export const getSubmitBody = ({ body, endpoint, router }: submitBodyProps) => {
73
73
  }),
74
74
  ...getRkoTariffName(typeForm),
75
75
  ...staticBody,
76
+ ...getReferalRkoData(body, typeForm),
76
77
  };
77
78
  };
78
79
 
@@ -124,3 +125,19 @@ const getRkoTariffName = (typeForm?: string) =>
124
125
  partnerComments: globalThis?.sessionStorage.getItem('rkoTariffName') ?? 'Неизвестный тариф',
125
126
  }
126
127
  : {};
128
+
129
+ const getReferalRkoData = (body: LeadRequest, typeForm?: string) => {
130
+ const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
131
+
132
+ const partnerComments = params.get('utm_mail');
133
+ const partner = params.get('utm_source');
134
+
135
+ return typeForm === 'REF'
136
+ ? {
137
+ name: body.fullName,
138
+ fullName: undefined,
139
+ partnerComments,
140
+ partner,
141
+ }
142
+ : {};
143
+ };
@@ -1841,5 +1841,43 @@
1841
1841
  }
1842
1842
  }
1843
1843
  }
1844
+ ],
1845
+ [
1846
+ "Заявка на РКО по ссылке друга",
1847
+ {
1848
+ "content": {
1849
+ "version": "primary",
1850
+ "padding": "",
1851
+ "title": "Открыть счёт РКО",
1852
+ "typeForm": "REF",
1853
+ "endpoint": "sendcorporatelead",
1854
+ "sections": [
1855
+ {
1856
+ "inputs": [{ "name": "fullName", "required": true, "label": "ФИО" }]
1857
+ },
1858
+ {
1859
+ "columns": 2,
1860
+ "inputs": [
1861
+ { "name": "phone", "required": true },
1862
+ { "name": "email", "required": true }
1863
+ ]
1864
+ }
1865
+ ],
1866
+ "button": {
1867
+ "text": "Открыть счет",
1868
+ "version": "primary"
1869
+ },
1870
+ "link": {
1871
+ "text": "условиями передачи данных",
1872
+ "href": "/privacy-policy",
1873
+ "target": "_blank"
1874
+ },
1875
+ "additionalLink": {
1876
+ "text": "условиями проведения акции",
1877
+ "href": "/promo-link",
1878
+ "target": "_blank"
1879
+ }
1880
+ }
1881
+ }
1844
1882
  ]
1845
1883
  ]
@@ -29,6 +29,12 @@ const linkCorpAgent: LinkProps = {
29
29
  target: '_blank',
30
30
  };
31
31
 
32
+ const linkPromo: LinkProps = {
33
+ text: 'условиями проведения акции',
34
+ href: '/promo-link',
35
+ target: '_blank',
36
+ };
37
+
32
38
  export default {
33
39
  default: (
34
40
  <div className="container grid grid-cols-12">
@@ -1151,4 +1157,34 @@ export default {
1151
1157
  <DialogManager />
1152
1158
  </div>
1153
1159
  ),
1160
+ referalRko: (
1161
+ <div className="container grid grid-cols-12">
1162
+ <ApplicationForm
1163
+ className="col-span-12"
1164
+ title="Заявка на РКО по ссылке друга"
1165
+ typeForm="REF"
1166
+ endpoint="sendcorporatelead"
1167
+ sections={[
1168
+ {
1169
+ inputs: [{ name: 'fullName', required: true, label: 'ФИО' }],
1170
+ },
1171
+ {
1172
+ columns: 2,
1173
+ inputs: [
1174
+ { name: 'phone', required: true },
1175
+ { name: 'email', required: true },
1176
+ ],
1177
+ },
1178
+ ]}
1179
+ button={{
1180
+ text: 'Открыть счет',
1181
+ version: 'primary',
1182
+ }}
1183
+ link={linkCorp}
1184
+ additionalLink={linkPromo}
1185
+ />
1186
+ <PopupManager />
1187
+ <DialogManager />
1188
+ </div>
1189
+ ),
1154
1190
  };
@@ -51,6 +51,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
51
51
  sections = [],
52
52
  button,
53
53
  link,
54
+ additionalLink,
54
55
  endpoint,
55
56
  additionalParams,
56
57
  withSnowplow,
@@ -117,6 +118,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
117
118
  {renderAgreementSubmit({
118
119
  consentDataProcessing,
119
120
  link,
121
+ additionalLink,
120
122
  button,
121
123
  typeForm,
122
124
  })}
@@ -116,6 +116,16 @@ export type ApplicationFormContent = UniBlockContent &
116
116
  /** @default "" */
117
117
  target?: Target;
118
118
  };
119
+ /**
120
+ * @title Условия проведения акции
121
+ * @required ["text", "href"]
122
+ */
123
+ additionalLink?: TextProps & {
124
+ /** @title URL (href) */
125
+ href?: string;
126
+ /** @default "" */
127
+ target?: Target;
128
+ };
119
129
  typeForm?: FormTypeFieldDef;
120
130
  endpoint?: EndpointType;
121
131
  /** @title Дополнительные параметры формы */
@@ -7,9 +7,10 @@ import { Text } from '../../ui-kit/Text/Text';
7
7
 
8
8
  type FootnoteProps = TextProps & {
9
9
  link?: LinkProps;
10
+ additionalLink?: LinkProps;
10
11
  };
11
12
 
12
- export const Footnote = JSX<FootnoteProps>(({ text, link }) => (
13
+ export const Footnote = JSX<FootnoteProps>(({ text, link, additionalLink }) => (
13
14
  <Paragraph size="text-l" font="font-light" color="text-secondary-text">
14
15
  {text ? <Text>{text}</Text> : null}
15
16
  {link ? (
@@ -17,5 +18,13 @@ export const Footnote = JSX<FootnoteProps>(({ text, link }) => (
17
18
  {link.text}
18
19
  </Link>
19
20
  ) : null}
21
+ {additionalLink ? (
22
+ <Text>
23
+ {' и '}
24
+ <Link {...additionalLink} ariaLabel="условия проведения акции">
25
+ {additionalLink.text}
26
+ </Link>
27
+ </Text>
28
+ ) : null}
20
29
  </Paragraph>
21
30
  ));
@@ -14,11 +14,13 @@ const agreementTextPF = 'Нажимая на кнопку, вы подтверж
14
14
  export const renderAgreementSubmit = ({
15
15
  consentDataProcessing,
16
16
  link,
17
+ additionalLink,
17
18
  button,
18
19
  typeForm,
19
20
  }: {
20
21
  consentDataProcessing?: FieldProps<boolean>;
21
22
  link?: LinkProps;
23
+ additionalLink?: LinkProps;
22
24
  button?: SubmitButtonProps;
23
25
  typeForm?: string;
24
26
  }) => (
@@ -32,7 +34,11 @@ export const renderAgreementSubmit = ({
32
34
  {renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)}
33
35
  </div>
34
36
  ) : (
35
- <Footnote text={typeForm === 'PF' ? agreementTextPF : agreementText} link={link} />
37
+ <Footnote
38
+ text={typeForm === 'PF' ? agreementTextPF : agreementText}
39
+ link={link}
40
+ additionalLink={additionalLink}
41
+ />
36
42
  )}
37
43
  <SubmitButton className="w-full @xl:w-auto">
38
44
  {button?.text ? button.text : 'Отправить заявку'}