@redneckz/wildless-cms-uni-blocks 0.14.1029 → 0.14.1030
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.
- package/bundle/api/getSubmitBody.d.ts +4225 -865
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +85 -9
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
- package/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/bundle/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/bundle/components/ReferalForm/ResultLink.d.ts +5 -0
- package/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
- package/bundle/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/bundle/components/ReferalForm/renderSections.d.ts +3 -0
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/api/getSubmitBody.d.ts +4225 -865
- package/dist/api/getSubmitBody.js +14 -0
- package/dist/api/getSubmitBody.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/dist/components/ApplicationForm/Footnote.d.ts +1 -0
- package/dist/components/ApplicationForm/Footnote.js +1 -1
- package/dist/components/ApplicationForm/Footnote.js.map +1 -1
- package/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/dist/components/ReferalForm/ReferalForm.js +33 -0
- package/dist/components/ReferalForm/ReferalForm.js.map +1 -0
- package/dist/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/dist/components/ReferalForm/ReferalFormContent.js +2 -0
- package/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
- package/dist/components/ReferalForm/ResultLink.d.ts +5 -0
- package/dist/components/ReferalForm/ResultLink.js +12 -0
- package/dist/components/ReferalForm/ResultLink.js.map +1 -0
- package/dist/components/ReferalForm/referalFormData.d.ts +2 -0
- package/dist/components/ReferalForm/referalFormData.js +19 -0
- package/dist/components/ReferalForm/referalFormData.js.map +1 -0
- package/dist/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/dist/components/ReferalForm/renderLinkInput.js +25 -0
- package/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
- package/dist/components/ReferalForm/renderSections.d.ts +3 -0
- package/dist/components/ReferalForm/renderSections.js +10 -0
- package/dist/components/ReferalForm/renderSections.js.map +1 -0
- package/dist/hooks/useDadataParty.js +1 -1
- package/dist/hooks/useDadataParty.js.map +1 -1
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/api/getSubmitBody.d.ts +4225 -865
- package/lib/api/getSubmitBody.js +14 -0
- package/lib/api/getSubmitBody.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/lib/components/ApplicationForm/Footnote.d.ts +1 -0
- package/lib/components/ApplicationForm/Footnote.js +1 -1
- package/lib/components/ApplicationForm/Footnote.js.map +1 -1
- package/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/lib/components/ReferalForm/ReferalForm.fixture.d.ts +5 -0
- package/lib/components/ReferalForm/ReferalForm.fixture.mobile.d.ts +5 -0
- package/lib/components/ReferalForm/ReferalForm.js +31 -0
- package/lib/components/ReferalForm/ReferalForm.js.map +1 -0
- package/lib/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/lib/components/ReferalForm/ReferalFormContent.js +2 -0
- package/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
- package/lib/components/ReferalForm/ResultLink.d.ts +5 -0
- package/lib/components/ReferalForm/ResultLink.js +10 -0
- package/lib/components/ReferalForm/ResultLink.js.map +1 -0
- package/lib/components/ReferalForm/referalFormData.d.ts +2 -0
- package/lib/components/ReferalForm/referalFormData.js +17 -0
- package/lib/components/ReferalForm/referalFormData.js.map +1 -0
- package/lib/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/lib/components/ReferalForm/renderLinkInput.js +23 -0
- package/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
- package/lib/components/ReferalForm/renderSections.d.ts +3 -0
- package/lib/components/ReferalForm/renderSections.js +7 -0
- package/lib/components/ReferalForm/renderSections.js.map +1 -0
- package/lib/hooks/useDadataParty.js +1 -1
- package/lib/hooks/useDadataParty.js.map +1 -1
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/api/getSubmitBody.d.ts +4225 -865
- package/mobile/bundle/bundle.umd.js +20 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/mobile/bundle/components/ApplicationForm/Footnote.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/mobile/bundle/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/mobile/bundle/components/ReferalForm/ResultLink.d.ts +5 -0
- package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -0
- package/mobile/bundle/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/mobile/bundle/components/ReferalForm/renderSections.d.ts +3 -0
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/api/getSubmitBody.d.ts +4225 -865
- package/mobile/dist/api/getSubmitBody.js +14 -0
- package/mobile/dist/api/getSubmitBody.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/mobile/dist/components/ApplicationForm/Footnote.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/Footnote.js +1 -1
- package/mobile/dist/components/ApplicationForm/Footnote.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/mobile/dist/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/mobile/dist/components/ReferalForm/ReferalForm.js +33 -0
- package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -0
- package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/mobile/dist/components/ReferalForm/ReferalFormContent.js +2 -0
- package/mobile/dist/components/ReferalForm/ReferalFormContent.js.map +1 -0
- package/mobile/dist/components/ReferalForm/ResultLink.d.ts +5 -0
- package/mobile/dist/components/ReferalForm/ResultLink.js +12 -0
- package/mobile/dist/components/ReferalForm/ResultLink.js.map +1 -0
- package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -0
- package/mobile/dist/components/ReferalForm/referalFormData.js +19 -0
- package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -0
- package/mobile/dist/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/mobile/dist/components/ReferalForm/renderLinkInput.js +25 -0
- package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -0
- package/mobile/dist/components/ReferalForm/renderSections.d.ts +3 -0
- package/mobile/dist/components/ReferalForm/renderSections.js +10 -0
- package/mobile/dist/components/ReferalForm/renderSections.js.map +1 -0
- package/mobile/dist/hooks/useDadataParty.js +1 -1
- package/mobile/dist/hooks/useDadataParty.js.map +1 -1
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/api/getSubmitBody.d.ts +4225 -865
- package/mobile/lib/api/getSubmitBody.js +14 -0
- package/mobile/lib/api/getSubmitBody.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +10 -0
- package/mobile/lib/components/ApplicationForm/Footnote.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/Footnote.js +1 -1
- package/mobile/lib/components/ApplicationForm/Footnote.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +2 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/mobile/lib/components/ReferalForm/ReferalForm.d.ts +10 -0
- package/mobile/lib/components/ReferalForm/ReferalForm.js +31 -0
- package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -0
- package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +11 -0
- package/mobile/lib/components/ReferalForm/ReferalFormContent.js +2 -0
- package/mobile/lib/components/ReferalForm/ReferalFormContent.js.map +1 -0
- package/mobile/lib/components/ReferalForm/ResultLink.d.ts +5 -0
- package/mobile/lib/components/ReferalForm/ResultLink.js +10 -0
- package/mobile/lib/components/ReferalForm/ResultLink.js.map +1 -0
- package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -0
- package/mobile/lib/components/ReferalForm/referalFormData.js +17 -0
- package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -0
- package/mobile/lib/components/ReferalForm/renderLinkInput.d.ts +2 -0
- package/mobile/lib/components/ReferalForm/renderLinkInput.js +23 -0
- package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -0
- package/mobile/lib/components/ReferalForm/renderSections.d.ts +3 -0
- package/mobile/lib/components/ReferalForm/renderSections.js +7 -0
- package/mobile/lib/components/ReferalForm/renderSections.js.map +1 -0
- package/mobile/lib/hooks/useDadataParty.js +1 -1
- package/mobile/lib/hooks/useDadataParty.js.map +1 -1
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/src/api/getSubmitBody.ts +17 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
- package/mobile/src/components/ApplicationForm/Footnote.tsx +10 -1
- package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
- package/mobile/src/components/ReferalForm/ReferalForm.example.json +8 -0
- package/mobile/src/components/ReferalForm/ReferalForm.tsx +78 -0
- package/mobile/src/components/ReferalForm/ReferalForm.ui.json +1 -0
- package/mobile/src/components/ReferalForm/ReferalFormContent.ts +12 -0
- package/mobile/src/components/ReferalForm/ResultLink.tsx +20 -0
- package/mobile/src/components/ReferalForm/referalFormData.ts +18 -0
- package/mobile/src/components/ReferalForm/renderLinkInput.tsx +37 -0
- package/mobile/src/components/ReferalForm/renderSections.tsx +18 -0
- package/mobile/src/hooks/useDadataParty.ts +1 -1
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/package.json +1 -1
- package/src/api/getSubmitBody.ts +17 -0
- package/src/components/ApplicationForm/ApplicationForm.example.json +38 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +36 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
- package/src/components/ApplicationForm/ApplicationFormContent.ts +10 -0
- package/src/components/ApplicationForm/Footnote.tsx +10 -1
- package/src/components/ApplicationForm/renderAgreementSubmit.tsx +7 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ReferalForm/ReferalForm.example.json +8 -0
- package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +16 -0
- package/src/components/ReferalForm/ReferalForm.fixture.tsx +16 -0
- package/src/components/ReferalForm/ReferalForm.tsx +78 -0
- package/src/components/ReferalForm/ReferalForm.ui.json +1 -0
- package/src/components/ReferalForm/ReferalFormContent.ts +12 -0
- package/src/components/ReferalForm/ResultLink.tsx +20 -0
- package/src/components/ReferalForm/referalFormData.ts +18 -0
- package/src/components/ReferalForm/renderLinkInput.tsx +37 -0
- package/src/components/ReferalForm/renderSections.tsx +18 -0
- package/src/hooks/useDadataParty.ts +1 -1
- package/src/model/FormTypeFieldDef.ts +2 -1
|
@@ -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
|
|
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 : 'Отправить заявку'}
|
|
@@ -0,0 +1,78 @@
|
|
|
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>(({ link = '', button, ...rest }) => {
|
|
26
|
+
const [isShowResultLink, setIsShowResultLink] = useState(false);
|
|
27
|
+
const [referalLink, setReferalLink] = useState('');
|
|
28
|
+
const inputs = useMemo(
|
|
29
|
+
() => (sections?.flatMap((_) => _?.inputs) || []) as FieldDef[],
|
|
30
|
+
[sections],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
|
|
34
|
+
|
|
35
|
+
const handleSubmit = useCallback(async (formData: FormState) => {
|
|
36
|
+
setReferalLink(
|
|
37
|
+
`${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`,
|
|
38
|
+
);
|
|
39
|
+
setIsShowResultLink(true);
|
|
40
|
+
}, []);
|
|
41
|
+
|
|
42
|
+
const [, { field, onSubmit }] = useForm(
|
|
43
|
+
{},
|
|
44
|
+
{
|
|
45
|
+
resetOnSubmit: true,
|
|
46
|
+
formValidator,
|
|
47
|
+
onSubmit: handleSubmit,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<ApplicationFormLayout
|
|
53
|
+
className="container space-y-m col-span-12"
|
|
54
|
+
title={getTitle(isShowResultLink)}
|
|
55
|
+
{...rest}
|
|
56
|
+
>
|
|
57
|
+
{isShowResultLink ? (
|
|
58
|
+
<ResultLink link={referalLink} />
|
|
59
|
+
) : (
|
|
60
|
+
<form onSubmit={onSubmit}>
|
|
61
|
+
{renderSections(sections, field)}
|
|
62
|
+
<Paragraph size="text-l" font="font-light" color="text-secondary-text">
|
|
63
|
+
<Text>Нажимая кнопку, вы подтверждаете согласие с </Text>
|
|
64
|
+
<Link href="/privacy-policy" target="_blank" ariaLabel="условия передачи данных">
|
|
65
|
+
условиями передачи данных
|
|
66
|
+
</Link>
|
|
67
|
+
</Paragraph>
|
|
68
|
+
<SubmitButton className="w-full @xl:w-auto">
|
|
69
|
+
{button?.text ?? 'Получить ссылку'}
|
|
70
|
+
</SubmitButton>
|
|
71
|
+
</form>
|
|
72
|
+
)}
|
|
73
|
+
</ApplicationFormLayout>
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const getTitle = (isShowResultLink = false) =>
|
|
78
|
+
isShowResultLink ? 'Ваша личная ссылка' : 'Как получить бесплатное обслуживание счёта';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TextProps } from '../../model/HeadlineType';
|
|
2
|
+
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title Форма для создания реферальной ссылки
|
|
6
|
+
*/
|
|
7
|
+
export type ReferalFormContent = UniBlockContent & {
|
|
8
|
+
/** @title Адрес страницы с заявкой для реферала */
|
|
9
|
+
link?: string;
|
|
10
|
+
/** @title Кнопка */
|
|
11
|
+
button?: TextProps;
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
3
|
+
import { renderLinkInput } from './renderLinkInput';
|
|
4
|
+
|
|
5
|
+
type ResultLinkProps = {
|
|
6
|
+
link: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ResultLink = JSX<ResultLinkProps>(({ link }) => {
|
|
10
|
+
return (
|
|
11
|
+
<div>
|
|
12
|
+
<div className="@xl:text-center @xl:col-span-2 mb-m">
|
|
13
|
+
<Text size="text-h6">Скопируйте ссылку и отправьте другу</Text>
|
|
14
|
+
</div>
|
|
15
|
+
{renderLinkInput({
|
|
16
|
+
value: link,
|
|
17
|
+
})}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
@@ -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,37 @@
|
|
|
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
|
+
const icon: Picture = {
|
|
10
|
+
src: 'CopyIcon.svg',
|
|
11
|
+
iconVersion: 'normal',
|
|
12
|
+
size: { width: 20 },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const renderLinkInput = JSX<InputProps>(({ className, value = '' }) => {
|
|
16
|
+
const onClick = useCallback(async () => {
|
|
17
|
+
try {
|
|
18
|
+
await globalThis.navigator.clipboard.writeText(value);
|
|
19
|
+
} catch {
|
|
20
|
+
console.log('Ошибка копирования');
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className={style('relative flex items-center max-w-lg m-auto', className)}>
|
|
26
|
+
<input
|
|
27
|
+
className={style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle)}
|
|
28
|
+
type="text"
|
|
29
|
+
value={value}
|
|
30
|
+
disabled={true}
|
|
31
|
+
/>
|
|
32
|
+
<div role="button" className="absolute right-3" onClick={onClick}>
|
|
33
|
+
<Img image={icon} />
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
@@ -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 }))
|
|
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,
|
package/package.json
CHANGED
package/src/api/getSubmitBody.ts
CHANGED
|
@@ -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
|
|
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 : 'Отправить заявку'}
|
package/src/components/Blocks.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { MobileAppTile } from './MobileAppTile/MobileAppTile';
|
|
|
38
38
|
import { OfficesAtmsMap } from './OfficesAtmsMap/OfficesAtmsMap';
|
|
39
39
|
import { ProductBlock } from './ProductBlock/ProductBlock';
|
|
40
40
|
import { RatesTable } from './RatesTable/RatesTable';
|
|
41
|
+
import { ReferalForm } from './ReferalForm/ReferalForm';
|
|
41
42
|
import { RichTextBlock } from './RichTextBlock/RichTextBlock';
|
|
42
43
|
import { RkoTariffCardsTable } from './RkoTariffCardsTable/RkoTariffCardsTable';
|
|
43
44
|
import { RollupItem } from './RollupItem/RollupItem';
|
|
@@ -98,4 +99,5 @@ export const Blocks: BlocksRegistry = {
|
|
|
98
99
|
CalculatorRko,
|
|
99
100
|
RkoTariffCardsTable,
|
|
100
101
|
RatesTable,
|
|
102
|
+
ReferalForm,
|
|
101
103
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
4
|
+
import { ReferalForm } from './ReferalForm';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
default: (
|
|
8
|
+
<div className="container grid grid-cols-12">
|
|
9
|
+
<ReferalForm
|
|
10
|
+
link="https://www.rshb.ru/business/dlya-druga/rko"
|
|
11
|
+
button={{ text: 'Получить ссылку' }}
|
|
12
|
+
/>
|
|
13
|
+
<PopupManager />
|
|
14
|
+
</div>
|
|
15
|
+
),
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
4
|
+
import { ReferalForm } from './ReferalForm';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
default: (
|
|
8
|
+
<div className="container grid grid-cols-12">
|
|
9
|
+
<ReferalForm
|
|
10
|
+
link="https://www.rshb.ru/business/dlya-druga/rko"
|
|
11
|
+
button={{ text: 'Получить ссылку' }}
|
|
12
|
+
/>
|
|
13
|
+
<PopupManager />
|
|
14
|
+
</div>
|
|
15
|
+
),
|
|
16
|
+
};
|