@redneckz/wildless-cms-uni-blocks 0.14.872 → 0.14.874
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/bundle.umd.js +31 -2
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/dist/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/dist/retail/components/NoConsentDialog/NoConsentDialog.js +27 -0
- package/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.fixture.d.ts +5 -0
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.js +25 -0
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +32 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js +27 -0
- package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
- package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js +25 -0
- package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -1
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/mobile/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +55 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -1
- package/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/src/icons/IconName.ts +4 -4
- package/src/retail/components/NoConsentDialog/NoConsentDialog.fixture.tsx +7 -0
- package/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +55 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -2436,6 +2436,23 @@
|
|
|
2436
2436
|
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm }))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
|
|
2437
2437
|
});
|
|
2438
2438
|
|
|
2439
|
+
const NoConsentDialog = JSX(({ attempts, onClose = noop }) => {
|
|
2440
|
+
const navigator = locationNavigator();
|
|
2441
|
+
const isMaxAttempts = attempts > 1;
|
|
2442
|
+
const returnToMainPage = useCallback(() => {
|
|
2443
|
+
navigator.assign('/natural');
|
|
2444
|
+
}, []);
|
|
2445
|
+
const handleClose = useCallback(() => {
|
|
2446
|
+
if (isMaxAttempts) {
|
|
2447
|
+
returnToMainPage();
|
|
2448
|
+
}
|
|
2449
|
+
else {
|
|
2450
|
+
onClose();
|
|
2451
|
+
}
|
|
2452
|
+
}, [isMaxAttempts]);
|
|
2453
|
+
return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Paragraph, { align: "text-center", children: "\u0423\u0432\u0430\u0436\u0430\u0435\u043C\u044B\u0439 \u043A\u043B\u0438\u0435\u043D\u0442!" }), jsx(Paragraph, { align: "text-center", children: "\u0414\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043A\u0440\u0435\u0434\u0438\u0442\u0430 \u0412\u0430\u043C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u044C\u0441\u044F \u0432 \u043E\u0444\u0438\u0441 \u0411\u0430\u043D\u043A\u0430" }), jsxs("div", { className: "flex flex-col sm:flex-row gap-xl items-center", children: [jsx(Button, { type: "button", version: "secondary", onClick: returnToMainPage, children: "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C" }), isMaxAttempts ? null : (jsx(Button, { type: "button", onClick: onClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" }))] })] }) }));
|
|
2454
|
+
});
|
|
2455
|
+
|
|
2439
2456
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
2440
2457
|
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
2441
2458
|
const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
|
|
@@ -6266,9 +6283,11 @@
|
|
|
6266
6283
|
|
|
6267
6284
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
|
|
6268
6285
|
const [esiaStatus, setEsiaStatus] = useState();
|
|
6286
|
+
const [attemptsWithoutConsents, setAttemptsWithoutConsents] = useState(0);
|
|
6269
6287
|
const leadForm = useRef(null);
|
|
6270
6288
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
6271
6289
|
const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
|
|
6290
|
+
const noConsentDialog = useDialog(NoConsentDialog);
|
|
6272
6291
|
const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
|
|
6273
6292
|
const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
|
|
6274
6293
|
const initialFormState = useInitApplicationLead({
|
|
@@ -6288,6 +6307,16 @@
|
|
|
6288
6307
|
formValidator,
|
|
6289
6308
|
onSubmit: handleSubmit,
|
|
6290
6309
|
});
|
|
6310
|
+
const onSubmitWithPrecondition = (ev) => {
|
|
6311
|
+
if (!field('processPersonalDataFlg')?.value) {
|
|
6312
|
+
setAttemptsWithoutConsents((prev) => prev + 1);
|
|
6313
|
+
attemptsWithoutConsents > 0 &&
|
|
6314
|
+
noConsentDialog.open({
|
|
6315
|
+
attempts: attemptsWithoutConsents,
|
|
6316
|
+
});
|
|
6317
|
+
}
|
|
6318
|
+
onSubmit?.(ev);
|
|
6319
|
+
};
|
|
6291
6320
|
const responseTypeDialog = useDialog(ResponseTypeDialog);
|
|
6292
6321
|
useEffect(() => {
|
|
6293
6322
|
if (ok !== undefined) {
|
|
@@ -6304,7 +6333,7 @@
|
|
|
6304
6333
|
reset();
|
|
6305
6334
|
}
|
|
6306
6335
|
}, [leadForm?.current, esiaStatus]);
|
|
6307
|
-
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, { onChangeEsiaStatus: setEsiaStatus }) : null, jsxs("form", { onSubmit:
|
|
6336
|
+
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, { onChangeEsiaStatus: setEsiaStatus }) : null, jsxs("form", { onSubmit: onSubmitWithPrecondition, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
|
|
6308
6337
|
});
|
|
6309
6338
|
const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
|
|
6310
6339
|
const getExtendedValidatorObj = (productType) => ({
|
|
@@ -11148,7 +11177,7 @@
|
|
|
11148
11177
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11149
11178
|
});
|
|
11150
11179
|
|
|
11151
|
-
const packageVersion = "0.14.
|
|
11180
|
+
const packageVersion = "0.14.873";
|
|
11152
11181
|
|
|
11153
11182
|
exports.Blocks = Blocks;
|
|
11154
11183
|
exports.ContentPage = ContentPage;
|