@redneckz/wildless-cms-uni-blocks 0.14.1039 → 0.14.1041
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +65 -113
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
- package/bundle/retail/api/getTaskById.d.ts +1 -1
- package/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ReferalForm/ReferalForm.js +6 -6
- package/dist/components/ReferalForm/ReferalForm.js.map +1 -1
- package/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/dist/components/ReferalForm/referalFormData.d.ts +2 -2
- package/dist/components/ReferalForm/referalFormData.js +8 -14
- package/dist/components/ReferalForm/referalFormData.js.map +1 -1
- package/dist/components/ReferalForm/renderLinkInput.js +4 -1
- package/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/dist/retail/api/getTaskById.d.ts +1 -1
- package/dist/retail/api/getTaskById.js +4 -1
- package/dist/retail/api/getTaskById.js.map +1 -1
- package/dist/retail/components/DraftDialog/utils.js +20 -18
- package/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ReferalForm/ReferalForm.js +6 -6
- package/lib/components/ReferalForm/ReferalForm.js.map +1 -1
- package/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/lib/components/ReferalForm/referalFormData.d.ts +2 -2
- package/lib/components/ReferalForm/referalFormData.js +7 -13
- package/lib/components/ReferalForm/referalFormData.js.map +1 -1
- package/lib/components/ReferalForm/renderLinkInput.js +4 -1
- package/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/lib/retail/api/getTaskById.d.ts +1 -1
- package/lib/retail/api/getTaskById.js +4 -1
- package/lib/retail/api/getTaskById.js.map +1 -1
- package/lib/retail/components/DraftDialog/utils.js +20 -18
- package/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +65 -113
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/bundle/retail/api/getTaskById.d.ts +1 -1
- package/mobile/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ReferalForm/ReferalForm.js +6 -6
- package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -1
- package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/dist/components/ReferalForm/referalFormData.js +8 -14
- package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -1
- package/mobile/dist/components/ReferalForm/renderLinkInput.js +4 -1
- package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/mobile/dist/retail/api/getTaskById.d.ts +1 -1
- package/mobile/dist/retail/api/getTaskById.js +4 -1
- package/mobile/dist/retail/api/getTaskById.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ReferalForm/ReferalForm.js +6 -6
- package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -1
- package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/lib/components/ReferalForm/referalFormData.js +7 -13
- package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -1
- package/mobile/lib/components/ReferalForm/renderLinkInput.js +4 -1
- package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/mobile/lib/retail/api/getTaskById.d.ts +1 -1
- package/mobile/lib/retail/api/getTaskById.js +4 -1
- package/mobile/lib/retail/api/getTaskById.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/mobile/src/components/ReferalForm/ReferalForm.example.json +3 -1
- package/mobile/src/components/ReferalForm/ReferalForm.tsx +11 -11
- package/mobile/src/components/ReferalForm/ReferalFormContent.ts +11 -9
- package/mobile/src/components/ReferalForm/referalFormData.ts +8 -14
- package/mobile/src/components/ReferalForm/renderLinkInput.tsx +5 -1
- package/mobile/src/retail/api/getTaskById.ts +7 -2
- package/mobile/src/retail/components/DraftDialog/utils.ts +20 -18
- package/mobile/src/retail/utils/productTypeToTaskType.ts +13 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/src/components/ReferalForm/ReferalForm.example.json +3 -1
- package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +2 -0
- package/src/components/ReferalForm/ReferalForm.fixture.tsx +2 -0
- package/src/components/ReferalForm/ReferalForm.tsx +11 -11
- package/src/components/ReferalForm/ReferalFormContent.ts +11 -9
- package/src/components/ReferalForm/referalFormData.ts +8 -14
- package/src/components/ReferalForm/renderLinkInput.tsx +5 -1
- package/src/retail/api/getTaskById.ts +7 -2
- package/src/retail/components/DraftDialog/utils.ts +20 -18
- package/src/retail/utils/productTypeToTaskType.ts +13 -0
- package/bundle/components/ReferalForm/renderSections.d.ts +0 -3
- package/dist/components/ReferalForm/renderSections.d.ts +0 -3
- package/dist/components/ReferalForm/renderSections.js +0 -10
- package/dist/components/ReferalForm/renderSections.js.map +0 -1
- package/lib/components/ReferalForm/renderSections.d.ts +0 -3
- package/lib/components/ReferalForm/renderSections.js +0 -7
- package/lib/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/bundle/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/dist/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/dist/components/ReferalForm/renderSections.js +0 -10
- package/mobile/dist/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/lib/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/lib/components/ReferalForm/renderSections.js +0 -7
- package/mobile/lib/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/src/components/ReferalForm/renderSections.tsx +0 -18
- package/src/components/ReferalForm/renderSections.tsx +0 -18
package/bundle/bundle.umd.js
CHANGED
|
@@ -3833,7 +3833,7 @@
|
|
|
3833
3833
|
|
|
3834
3834
|
const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
|
|
3835
3835
|
|
|
3836
|
-
const renderSections
|
|
3836
|
+
const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
|
|
3837
3837
|
|
|
3838
3838
|
const useInterval = (handler, period) => {
|
|
3839
3839
|
const timer = useRef(null);
|
|
@@ -4042,7 +4042,7 @@
|
|
|
4042
4042
|
});
|
|
4043
4043
|
const fieldName = getConsentDataProcessing(inputs)?.name;
|
|
4044
4044
|
const consentDataProcessing = fieldName ? field('consentDataProcessing') : undefined;
|
|
4045
|
-
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections
|
|
4045
|
+
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
|
|
4046
4046
|
consentDataProcessing,
|
|
4047
4047
|
link,
|
|
4048
4048
|
additionalLink,
|
|
@@ -6895,7 +6895,9 @@
|
|
|
6895
6895
|
};
|
|
6896
6896
|
|
|
6897
6897
|
const getTaskById = async (body) => {
|
|
6898
|
-
const
|
|
6898
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
6899
|
+
const endpoint = isNewMicroservice ? '/public-data/getTaskById' : '/user-data/getTaskById';
|
|
6900
|
+
const res = await fetchRetailJSON(endpoint, 'POST', body);
|
|
6899
6901
|
return res || undefined;
|
|
6900
6902
|
};
|
|
6901
6903
|
|
|
@@ -7385,25 +7387,27 @@
|
|
|
7385
7387
|
: undefined;
|
|
7386
7388
|
};
|
|
7387
7389
|
const getProductData = (taskType) => {
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7390
|
+
switch (taskType) {
|
|
7391
|
+
case 'debit':
|
|
7392
|
+
return {
|
|
7393
|
+
nextStepLink: '/debit-card-lead',
|
|
7394
|
+
newTaskLink: '/natural/debetcards',
|
|
7395
|
+
description: 'На дебетовую карту',
|
|
7396
|
+
};
|
|
7397
|
+
case 'credit':
|
|
7398
|
+
return {
|
|
7399
|
+
nextStepLink: '/credit-lead',
|
|
7400
|
+
newTaskLink: '/natural/loans/all-goals',
|
|
7401
|
+
description: 'На получение кредита',
|
|
7402
|
+
};
|
|
7403
|
+
case 'card':
|
|
7404
|
+
default:
|
|
7405
|
+
return {
|
|
7406
|
+
nextStepLink: '/credit-card-lead',
|
|
7407
|
+
newTaskLink: '/natural/creditcards/svoya',
|
|
7408
|
+
description: 'На получение кредитной карты',
|
|
7409
|
+
};
|
|
7401
7410
|
}
|
|
7402
|
-
return {
|
|
7403
|
-
nextStepLink: '/credit-card-lead',
|
|
7404
|
-
newTaskLink: '/natural/creditcards/svoya',
|
|
7405
|
-
description: 'На получение кредитной карты',
|
|
7406
|
-
};
|
|
7407
7411
|
};
|
|
7408
7412
|
|
|
7409
7413
|
const parseDraftTask = (task) => {
|
|
@@ -7538,59 +7542,6 @@
|
|
|
7538
7542
|
};
|
|
7539
7543
|
};
|
|
7540
7544
|
|
|
7541
|
-
const draftTaskCard = async () => {
|
|
7542
|
-
// TODO: Заглушка - бэкенд в разработке
|
|
7543
|
-
return [];
|
|
7544
|
-
};
|
|
7545
|
-
|
|
7546
|
-
const draftTaskCredit = async () => {
|
|
7547
|
-
const res = await fetchRetailJSON('/public-data/draftTaskCredit', 'GET');
|
|
7548
|
-
return res ? [res] : [];
|
|
7549
|
-
};
|
|
7550
|
-
|
|
7551
|
-
const draftTaskDebit = async () => {
|
|
7552
|
-
// TODO: Заглушка - бэкенд в разработке
|
|
7553
|
-
return [];
|
|
7554
|
-
};
|
|
7555
|
-
|
|
7556
|
-
const collectDrafts = (creditResults, cardResults, debitResults) => {
|
|
7557
|
-
const drafts = [];
|
|
7558
|
-
const results = [
|
|
7559
|
-
{ result: creditResults, type: 'credit' },
|
|
7560
|
-
{ result: cardResults, type: 'card' },
|
|
7561
|
-
{ result: debitResults, type: 'debit' },
|
|
7562
|
-
];
|
|
7563
|
-
results.forEach(({ result, type }) => {
|
|
7564
|
-
if (result.status === 'fulfilled' && result.value.length > 0) {
|
|
7565
|
-
drafts.push({ task: result.value[0], type });
|
|
7566
|
-
}
|
|
7567
|
-
});
|
|
7568
|
-
return drafts;
|
|
7569
|
-
};
|
|
7570
|
-
const findLatestDraft = (drafts) => {
|
|
7571
|
-
return drafts.reduce((latest, current) => {
|
|
7572
|
-
const latestDate = new Date(latest.task.createdDate || 0);
|
|
7573
|
-
const currentDate = new Date(current.task.createdDate || 0);
|
|
7574
|
-
return currentDate > latestDate ? current : latest;
|
|
7575
|
-
});
|
|
7576
|
-
};
|
|
7577
|
-
const useDraftSearch = () => {
|
|
7578
|
-
const searchDrafts = useCallback(async () => {
|
|
7579
|
-
const [creditResults, cardResults, debitResults] = await Promise.allSettled([
|
|
7580
|
-
draftTaskCredit(),
|
|
7581
|
-
draftTaskCard(),
|
|
7582
|
-
draftTaskDebit(),
|
|
7583
|
-
]);
|
|
7584
|
-
const drafts = collectDrafts(creditResults, cardResults, debitResults);
|
|
7585
|
-
if (drafts.length === 0) {
|
|
7586
|
-
return { draft: null, taskType: undefined };
|
|
7587
|
-
}
|
|
7588
|
-
const latestDraft = findLatestDraft(drafts);
|
|
7589
|
-
return { draft: latestDraft.task, taskType: latestDraft.type };
|
|
7590
|
-
}, []);
|
|
7591
|
-
return { searchDrafts };
|
|
7592
|
-
};
|
|
7593
|
-
|
|
7594
7545
|
// TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
|
|
7595
7546
|
const getUpdateUserProfileData = (profileId, formData, consents) => {
|
|
7596
7547
|
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
|
|
@@ -7608,6 +7559,16 @@
|
|
|
7608
7559
|
};
|
|
7609
7560
|
};
|
|
7610
7561
|
|
|
7562
|
+
const productTypeToTaskType = (productType) => {
|
|
7563
|
+
if (productType === 'debitCard') {
|
|
7564
|
+
return 'debit';
|
|
7565
|
+
}
|
|
7566
|
+
if (productType === 'creditCard') {
|
|
7567
|
+
return 'card';
|
|
7568
|
+
}
|
|
7569
|
+
return 'credit';
|
|
7570
|
+
};
|
|
7571
|
+
|
|
7611
7572
|
const getCreditLeadFormTaskData = ({ participantId, taskId, profileId, formData, marketingInfo, consents, }) => {
|
|
7612
7573
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
7613
7574
|
const participantInfo = getParticipant({ participantId, profileId, formData, consents });
|
|
@@ -7739,7 +7700,6 @@
|
|
|
7739
7700
|
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
7740
7701
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
7741
7702
|
const draftDialog = useDraftDialog();
|
|
7742
|
-
const { searchDrafts } = useDraftSearch();
|
|
7743
7703
|
const handleFailSendForm = () => {
|
|
7744
7704
|
verifyPhoneDialog.close();
|
|
7745
7705
|
changeSubmitFormStatus(false);
|
|
@@ -7788,7 +7748,7 @@
|
|
|
7788
7748
|
draftDialog.open({
|
|
7789
7749
|
task,
|
|
7790
7750
|
isFromLead: true,
|
|
7791
|
-
taskType: productType
|
|
7751
|
+
taskType: productTypeToTaskType(productType),
|
|
7792
7752
|
sendAspects,
|
|
7793
7753
|
onClose: sendCurrentTask,
|
|
7794
7754
|
});
|
|
@@ -7857,7 +7817,6 @@
|
|
|
7857
7817
|
common,
|
|
7858
7818
|
draftDialog,
|
|
7859
7819
|
sendCurrentTask,
|
|
7860
|
-
searchDrafts,
|
|
7861
7820
|
});
|
|
7862
7821
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
7863
7822
|
verifyPhoneDialog.open({
|
|
@@ -7901,25 +7860,24 @@
|
|
|
7901
7860
|
onFail: handleFailSendForm,
|
|
7902
7861
|
});
|
|
7903
7862
|
};
|
|
7904
|
-
const createHandleSuccessVerifyNew = ({ common, draftDialog, sendCurrentTask,
|
|
7905
|
-
const { verifyPhoneDialog, sendAspects, handleFailSendForm } = common;
|
|
7863
|
+
const createHandleSuccessVerifyNew = ({ common, draftDialog, sendCurrentTask, }) => async () => {
|
|
7864
|
+
const { verifyPhoneDialog, sendAspects, handleFailSendForm, userId, programId, productType } = common;
|
|
7906
7865
|
try {
|
|
7907
|
-
const {
|
|
7908
|
-
|
|
7909
|
-
|
|
7866
|
+
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
7867
|
+
if (lastTaskId) {
|
|
7868
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
7869
|
+
verifyPhoneDialog.close();
|
|
7910
7870
|
draftDialog.open({
|
|
7911
|
-
task
|
|
7912
|
-
|
|
7871
|
+
task,
|
|
7872
|
+
isFromLead: true,
|
|
7873
|
+
taskType: productTypeToTaskType(productType),
|
|
7874
|
+
sendAspects,
|
|
7875
|
+
onClose: sendCurrentTask,
|
|
7913
7876
|
});
|
|
7914
|
-
return;
|
|
7915
7877
|
}
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
isFromLead: true,
|
|
7920
|
-
sendAspects,
|
|
7921
|
-
onClose: sendCurrentTask,
|
|
7922
|
-
});
|
|
7878
|
+
else {
|
|
7879
|
+
await sendCurrentTask();
|
|
7880
|
+
}
|
|
7923
7881
|
}
|
|
7924
7882
|
catch {
|
|
7925
7883
|
handleFailSendForm();
|
|
@@ -14186,25 +14144,20 @@
|
|
|
14186
14144
|
return (jsxs(BlockWrapper, { className: style('p-6xl space-y-xl', className), defaultPadding: "p-0", ...rest, children: [jsx(Heading, { className: "mb-xl", children: title }), isArchive ? renderDataPickForm() : null, ratesList.map((list, i) => (jsx(RatesTableItem, { list: list, isRatesValid: isRatesValid, isArchive: isArchive, infoMessage: infoMessage }, String(i)))), href ? renderLink(href) : null] }));
|
|
14187
14145
|
});
|
|
14188
14146
|
|
|
14189
|
-
const
|
|
14190
|
-
{ title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
|
|
14147
|
+
const inputs = [
|
|
14191
14148
|
{
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
{
|
|
14199
|
-
name: 'email',
|
|
14200
|
-
required: true,
|
|
14201
|
-
},
|
|
14202
|
-
],
|
|
14149
|
+
name: 'dadataPartyInnSelect',
|
|
14150
|
+
required: true,
|
|
14151
|
+
},
|
|
14152
|
+
{
|
|
14153
|
+
name: 'email',
|
|
14154
|
+
required: true,
|
|
14203
14155
|
},
|
|
14204
14156
|
];
|
|
14205
14157
|
|
|
14206
|
-
const
|
|
14207
|
-
|
|
14158
|
+
const defaultIcon = {
|
|
14159
|
+
icon: 'CopyIcon',
|
|
14160
|
+
};
|
|
14208
14161
|
const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
|
|
14209
14162
|
const onClick = useCallback(async () => {
|
|
14210
14163
|
try {
|
|
@@ -14214,7 +14167,7 @@
|
|
|
14214
14167
|
console.log('Ошибка копирования');
|
|
14215
14168
|
}
|
|
14216
14169
|
}, []);
|
|
14217
|
-
return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon }) })] }));
|
|
14170
|
+
return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon ?? defaultIcon, width: "20px" }) })] }));
|
|
14218
14171
|
});
|
|
14219
14172
|
|
|
14220
14173
|
const ResultLink = JSX(({ link, copyIcon }) => {
|
|
@@ -14224,10 +14177,9 @@
|
|
|
14224
14177
|
})] }));
|
|
14225
14178
|
});
|
|
14226
14179
|
|
|
14227
|
-
const ReferalForm = UniBlock(({ link = '', button, copyIcon, ...rest }) => {
|
|
14180
|
+
const ReferalForm = UniBlock(({ title, description, link = '', button, copyIcon, ...rest }) => {
|
|
14228
14181
|
const [isShowResultLink, setIsShowResultLink] = useState(false);
|
|
14229
14182
|
const [referalLink, setReferalLink] = useState('');
|
|
14230
|
-
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
14231
14183
|
const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
|
|
14232
14184
|
const handleSubmit = useCallback(async (formData) => {
|
|
14233
14185
|
setReferalLink(`${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`);
|
|
@@ -14238,9 +14190,9 @@
|
|
|
14238
14190
|
formValidator,
|
|
14239
14191
|
onSubmit: handleSubmit,
|
|
14240
14192
|
});
|
|
14241
|
-
return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [
|
|
14193
|
+
return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(title, isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [jsxs("div", { className: "grid @xl:grid-cols-2 gap-x-m", children: [renderTitle(description), inputs.map(getField(field))] }), jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), jsx(Link, { href: "/privacy-policy", target: "_blank", ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438 \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(SubmitButton$1, { className: "w-full @xl:w-auto mt-xs", children: button?.text ?? 'Получить ссылку' })] })) }));
|
|
14242
14194
|
});
|
|
14243
|
-
const getTitle = (isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' :
|
|
14195
|
+
const getTitle = (title = '', isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' : title;
|
|
14244
14196
|
|
|
14245
14197
|
const RichTextBlock = UniBlock((props) => {
|
|
14246
14198
|
const { __html, dynamicQueryParamText = {}, dynamicTextSource, richVersion = '', ...rest } = props;
|
|
@@ -14782,7 +14734,7 @@
|
|
|
14782
14734
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
14783
14735
|
});
|
|
14784
14736
|
|
|
14785
|
-
const packageVersion = "0.14.
|
|
14737
|
+
const packageVersion = "0.14.1040";
|
|
14786
14738
|
|
|
14787
14739
|
exports.Blocks = Blocks;
|
|
14788
14740
|
exports.ContentPage = ContentPage;
|