@redneckz/wildless-cms-uni-blocks 0.14.895 → 0.14.897
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 +48 -15
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useForm/useForm.d.ts +2 -0
- package/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/bundle/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/bundle/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/dist/components/CardTransfer/SubmitFailedDialog.js +1 -1
- package/dist/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
- package/dist/hooks/useForm/useForm.d.ts +2 -0
- package/dist/hooks/useForm/useForm.js +17 -0
- package/dist/hooks/useForm/useForm.js.map +1 -1
- package/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/dist/retail/components/DraftDialog/DraftDialog.js +1 -1
- package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/dist/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
- package/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
- package/dist/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
- package/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/dist/ui-kit/DialogManager/Dialog.js +6 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/dist/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/dist/ui-kit/FormField/RefWrapper.js +16 -0
- package/dist/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/dist/ui-kit/FormField/getField.js +2 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/LocationDialog/LocationDialog.js +2 -1
- package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
- package/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +24 -0
- package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/CardTransfer/SubmitFailedDialog.js +1 -1
- package/lib/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
- package/lib/hooks/useForm/useForm.d.ts +2 -0
- package/lib/hooks/useForm/useForm.js +17 -0
- package/lib/hooks/useForm/useForm.js.map +1 -1
- package/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/lib/retail/components/DraftDialog/DraftDialog.js +1 -1
- package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/lib/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
- package/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
- package/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/lib/ui-kit/DialogManager/Dialog.js +6 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/lib/ui-kit/FormField/RefWrapper.js +14 -0
- package/lib/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/lib/ui-kit/FormField/getField.js +2 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/LocationDialog/LocationDialog.js +2 -1
- package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
- package/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.fixture.d.ts +5 -0
- package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +22 -0
- package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +47 -14
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/mobile/bundle/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/bundle/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/mobile/dist/components/CardTransfer/SubmitFailedDialog.js +1 -1
- package/mobile/dist/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
- package/mobile/dist/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/dist/hooks/useForm/useForm.js +17 -0
- package/mobile/dist/hooks/useForm/useForm.js.map +1 -1
- package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/mobile/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +1 -1
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
- package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
- package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
- package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +6 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/dist/ui-kit/FormField/RefWrapper.js +16 -0
- package/mobile/dist/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/getField.js +2 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +2 -1
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
- package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +24 -0
- package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/CardTransfer/SubmitFailedDialog.js +1 -1
- package/mobile/lib/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
- package/mobile/lib/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/lib/hooks/useForm/useForm.js +17 -0
- package/mobile/lib/hooks/useForm/useForm.js.map +1 -1
- package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
- package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
- package/mobile/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
- package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
- package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
- package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.d.ts +2 -2
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +6 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/lib/ui-kit/FormField/RefWrapper.js +14 -0
- package/mobile/lib/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/getField.js +2 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +2 -1
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
- package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
- package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +22 -0
- package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
- package/mobile/src/components/CardTransfer/SubmitFailedDialog.tsx +1 -1
- package/mobile/src/hooks/useForm/useForm.ts +31 -2
- package/mobile/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -5
- package/mobile/src/retail/components/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -4
- package/mobile/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
- package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +1 -1
- package/mobile/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +1 -4
- package/mobile/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +1 -4
- package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -4
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +15 -6
- package/mobile/src/ui-kit/FormField/RefWrapper.tsx +20 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +3 -2
- package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +11 -13
- package/mobile/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
- package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +4 -1
- package/mobile/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.tsx +83 -0
- package/package.json +1 -1
- package/src/components/CardTransfer/SubmitFailedDialog.tsx +1 -1
- package/src/hooks/useForm/useForm.ts +31 -2
- package/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -5
- package/src/retail/components/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -4
- package/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
- package/src/retail/components/DraftDialog/DraftDialog.tsx +1 -1
- package/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +1 -4
- package/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +1 -4
- package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -4
- package/src/ui-kit/DialogManager/Dialog.tsx +15 -6
- package/src/ui-kit/FormField/RefWrapper.tsx +20 -0
- package/src/ui-kit/FormField/getField.tsx +3 -2
- package/src/ui-kit/LocationDialog/LocationDialog.tsx +11 -13
- package/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
- package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +4 -1
- package/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.fixture.tsx +32 -0
- package/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.tsx +83 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1244,6 +1244,7 @@
|
|
|
1244
1244
|
|
|
1245
1245
|
function useForm(initialState, { resetOnSubmit, formValidator, normalizer, onChange, onSubmit } = {}) {
|
|
1246
1246
|
const [formState, setFormState] = useNormalizedFormState(initialState, normalizer, onChange);
|
|
1247
|
+
const fieldRefs = useRef(getRefsObject(initialState));
|
|
1247
1248
|
const [isDirtyForm, { setTrue: markAsDirty, setFalse: markAsClean }] = useBool(false);
|
|
1248
1249
|
const dirtyFieldsMap = useRef({});
|
|
1249
1250
|
const [fieldValidatorsMap, { isValid, errors }] = useFormValidator(formState, formValidator);
|
|
@@ -1254,6 +1255,12 @@
|
|
|
1254
1255
|
const fieldValidator = options?.validator ?? fieldValidatorsMap[fieldName];
|
|
1255
1256
|
const fieldErrors = isDirty && fieldValidator ? fieldValidator(value) : [];
|
|
1256
1257
|
return {
|
|
1258
|
+
setFieldRef: (_) => {
|
|
1259
|
+
if (fieldRefs.current) {
|
|
1260
|
+
fieldRefs.current[fieldName] = _;
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
fieldRef: fieldRefs.current?.[fieldName],
|
|
1257
1264
|
value: format ? format(value) : value,
|
|
1258
1265
|
isDirty,
|
|
1259
1266
|
errors: fieldValidator && fieldErrors,
|
|
@@ -1283,11 +1290,21 @@
|
|
|
1283
1290
|
onSubmit?.(formState, ev);
|
|
1284
1291
|
}
|
|
1285
1292
|
else {
|
|
1293
|
+
const errorFieldName = getErrorFieldName(formState, fieldValidatorsMap);
|
|
1286
1294
|
markAsDirty();
|
|
1295
|
+
field(errorFieldName).fieldRef?.scrollIntoView({ behavior: 'smooth' });
|
|
1287
1296
|
}
|
|
1288
1297
|
}, [resetOnSubmit, formState, isValid, reset, onSubmit]);
|
|
1289
1298
|
return [formState, { errors, field, update, reset, onSubmit: handleSubmit }];
|
|
1290
1299
|
}
|
|
1300
|
+
const getRefsObject = (initialState) => Object.keys(initialState).reduce((acc, key) => ({ ...acc, [key]: null }), {});
|
|
1301
|
+
const getErrorFieldName = (formState, fieldValidatorsMap = {}) => {
|
|
1302
|
+
const [errorFieldName = ''] = Object.entries(formState).find(([fieldName, value]) => {
|
|
1303
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
1304
|
+
return fieldValidatorsMap[fieldName]?.(value)?.length;
|
|
1305
|
+
}) ?? [];
|
|
1306
|
+
return errorFieldName;
|
|
1307
|
+
};
|
|
1291
1308
|
|
|
1292
1309
|
function copy(source, target) {
|
|
1293
1310
|
for (const [k, v] of source.entries()) {
|
|
@@ -1464,7 +1481,12 @@
|
|
|
1464
1481
|
|
|
1465
1482
|
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
1466
1483
|
|
|
1467
|
-
const
|
|
1484
|
+
const MAX_WIDTH_STYLE = {
|
|
1485
|
+
sm: 'max-w-sm top-1/3',
|
|
1486
|
+
lg: 'max-w-lg',
|
|
1487
|
+
'4xl': 'max-w-4xl',
|
|
1488
|
+
};
|
|
1489
|
+
const Dialog = JSX(({ head, maxWidth = '4xl', children, onClose, onClick }) => (jsxs("div", { className: style('relative bg-white p-lg pb-6xl my-6xl mx-auto rounded-lg w-full', MAX_WIDTH_STYLE[maxWidth]), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0 z-10", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container", children: children })] })));
|
|
1468
1490
|
|
|
1469
1491
|
function useDialog(Dialog, initialProps = {}) {
|
|
1470
1492
|
const { open, close, ...rest } = useDialogManager();
|
|
@@ -1655,7 +1677,7 @@
|
|
|
1655
1677
|
(async () => setCaptcha(URL.createObjectURL(await createCaptcha(phoneNumber))))();
|
|
1656
1678
|
}, []);
|
|
1657
1679
|
useEffect(handleCreateCaptcha, []);
|
|
1658
|
-
return (jsx(Dialog, {
|
|
1680
|
+
return (jsx(Dialog, { head: jsx(Logo, {}), onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsxs("div", { className: "flex", children: [jsx("img", { className: "grow", src: captcha }), jsx(Button, { className: "w-8", embedded: true, onClick: handleCreateCaptcha, children: jsx(Icon, { iconVersion: "normal", name: "RefreshIcon" }) })] }), jsx(Input, { className: "w-80", onChange: setCode, value: code, placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438" }), hasError ? jsx("div", { className: "text-error", children: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043E\u0434" }) : null, jsxs("div", { className: "flex w-80 justify-between", children: [jsx(Button, { version: "secondary", onClick: closeAll, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F" }), jsx(SubmitButton$1, { version: "secondary", disabled: !code, onClick: handleCheckCaptcha, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })] }), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
|
|
1659
1681
|
});
|
|
1660
1682
|
|
|
1661
1683
|
const InputCode = JSX(({ values, setValues, hasError, errorText }) => {
|
|
@@ -1826,7 +1848,7 @@
|
|
|
1826
1848
|
handleSendCode();
|
|
1827
1849
|
}
|
|
1828
1850
|
}, []);
|
|
1829
|
-
return (jsx(Dialog, {
|
|
1851
|
+
return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center rounded-md", children: [jsx(Headline, { className: "w-full", title: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430", description: `Мы отправили код на ${phone}`, headlineVersion: "XS", isEmbedded: true, as: "h6" }), jsx(InputCode, { values: values, setValues: setValues, errorText: errorText, hasError: hasError }), renderText$3(timeNextReq, handleSendCode), withDescription ? (jsxs(RichText, { itemSize: "list-s", children: [jsx("span", { children: "\u0412\u0432\u043E\u0434\u044F \u043A\u043E\u0434, \u044F \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044E, \u0447\u0442\u043E \u043E\u0437\u043D\u0430\u043A\u043E\u043C\u043B\u0435\u043D \u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u044E: " }), jsx("ul", { children: consents?.map((_, i) => (jsx("li", { children: _ }, `${_}-${i}`))) })] })) : null, renderNextButton(isSubmitButtonDisabled, handleSubmit), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
|
|
1830
1852
|
});
|
|
1831
1853
|
const renderNextButton = (disabled, onClick) => (jsx(SubmitButton, { text: "\u0414\u0430\u043B\u0435\u0435", disabled: disabled, onClick: onClick }));
|
|
1832
1854
|
const renderText$3 = (timeNextReq, handleSendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-base", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "pl-2xs", seconds: timeNextReq })] })) : (jsx(Button, { embedded: true, onClick: handleSendCode, children: jsx(ButtonTitle, { children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }) }));
|
|
@@ -2934,6 +2956,16 @@
|
|
|
2934
2956
|
|
|
2935
2957
|
const ConsentToReceiveMaterialsField = JSX(({ field, input }) => (jsx(Checkbox, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435", ...field(input?.name ?? '') })));
|
|
2936
2958
|
|
|
2959
|
+
const RefWrapper = JSX(({ onFieldRef = noop, children }) => {
|
|
2960
|
+
const ref = useRef(null);
|
|
2961
|
+
useEffect(() => {
|
|
2962
|
+
if (ref.current) {
|
|
2963
|
+
onFieldRef(ref.current);
|
|
2964
|
+
}
|
|
2965
|
+
}, []);
|
|
2966
|
+
return jsx("div", { ref: ref, children: children });
|
|
2967
|
+
});
|
|
2968
|
+
|
|
2937
2969
|
function shouldRenderField({ input, field, }) {
|
|
2938
2970
|
const { condition } = input;
|
|
2939
2971
|
const { value } = field(condition?.name || '');
|
|
@@ -2994,7 +3026,7 @@
|
|
|
2994
3026
|
...externalInputs,
|
|
2995
3027
|
};
|
|
2996
3028
|
const Component = fieldsRegister[String(input.name)];
|
|
2997
|
-
return shouldRenderField({ input, field }) && Component ? (jsx(
|
|
3029
|
+
return shouldRenderField({ input, field }) && Component ? (jsx(RefWrapper, { onFieldRef: field(input.name ?? '').setFieldRef, children: jsx(Component, { field: field, input: input, params: params }) }, String(i))) : null;
|
|
2998
3030
|
};
|
|
2999
3031
|
|
|
3000
3032
|
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2 gap-x-m' : '@xl:grid-cols-1 gap-x-0';
|
|
@@ -3008,7 +3040,7 @@
|
|
|
3008
3040
|
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
3009
3041
|
не звонят с использованием мессенджеров.`
|
|
3010
3042
|
: 'Совсем скоро мы с вами свяжемся';
|
|
3011
|
-
return (jsx(Dialog, {
|
|
3043
|
+
return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', description: ok ? responseOKDescription : 'Пожалуйста, повторите позднее', headlineVersion: "XS", isEmbedded: true }), jsx(Button, { type: "button", onClick: onClose, children: "\u0425\u043E\u0440\u043E\u0448\u043E" })] }) }));
|
|
3012
3044
|
});
|
|
3013
3045
|
|
|
3014
3046
|
const getPartnerComments = (data) => {
|
|
@@ -3183,7 +3215,7 @@
|
|
|
3183
3215
|
onClose();
|
|
3184
3216
|
}
|
|
3185
3217
|
}, [isMaxAttempts]);
|
|
3186
|
-
return (jsx(Dialog, {
|
|
3218
|
+
return (jsx(Dialog, { 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" }))] })] }) }));
|
|
3187
3219
|
});
|
|
3188
3220
|
|
|
3189
3221
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
@@ -4491,7 +4523,7 @@
|
|
|
4491
4523
|
|
|
4492
4524
|
const DocumentDialog = JSX(({ src, onClose, onDocumentRead }) => {
|
|
4493
4525
|
const isMobileMode = useMobileMode();
|
|
4494
|
-
return (jsxs(Dialog, {
|
|
4526
|
+
return (jsxs(Dialog, { onClose: onClose, children: [isMobileMode ? (jsx("img", { src: src })) : (jsx("iframe", { src: `${src}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" })), jsx(Button, { className: "mx-auto mt-m", type: "button", onClick: () => {
|
|
4495
4527
|
onDocumentRead?.();
|
|
4496
4528
|
onClose?.();
|
|
4497
4529
|
}, children: "\u041E\u0437\u043D\u0430\u043A\u043E\u043C\u0438\u0442\u044C\u0441\u044F" })] }));
|
|
@@ -5643,7 +5675,7 @@
|
|
|
5643
5675
|
setShowRefuseContent(value === 'REFUSE');
|
|
5644
5676
|
}, []);
|
|
5645
5677
|
const consentText = showRefuseContent ? refuseConsentText : defaultConsentText;
|
|
5646
|
-
return (jsx(Dialog, {
|
|
5678
|
+
return (jsx(Dialog, { onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx("div", { role: "button", onClick: openDocument, children: jsx(Heading, { className: "text-center text-balance", headingType: "h2", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleSubmit, children: "\u0414\u0430\u043B\u0435\u0435" })] }) }));
|
|
5647
5679
|
});
|
|
5648
5680
|
|
|
5649
5681
|
const useConsentBkiDialog = (onClose) => {
|
|
@@ -5989,7 +6021,7 @@
|
|
|
5989
6021
|
const handleGoToNewTask = useCallback(() => {
|
|
5990
6022
|
navigator.assign(productData.newTaskLink);
|
|
5991
6023
|
}, []);
|
|
5992
|
-
return (jsx(Dialog, {
|
|
6024
|
+
return (jsx(Dialog, { onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask })] })] }) }));
|
|
5993
6025
|
});
|
|
5994
6026
|
|
|
5995
6027
|
const EmptyDraftDialog = JSX(function ({ isDebit, onClose = noop }) {
|
|
@@ -6001,7 +6033,7 @@
|
|
|
6001
6033
|
const handleGoMainPage = useCallback(() => {
|
|
6002
6034
|
navigator.assign('/');
|
|
6003
6035
|
}, []);
|
|
6004
|
-
return (jsx(Dialog, {
|
|
6036
|
+
return (jsx(Dialog, { onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "text-center", title: "\u0417\u0430\u044F\u0432\u043A\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B", headingType: "h3" }), jsx(Paragraph, { size: "text-l", align: "text-center", children: "\u041F\u043E \u0434\u0430\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043D\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044B\u0445 \u0437\u0430\u044F\u0432\u043E\u043A. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u043B\u0438 \u0432\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443" }), jsx(Button, { type: "button", className: "w-full", onClick: handleGoNewTask, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443" }), jsx(Button, { type: "button", version: "secondary", className: "w-full", onClick: handleGoMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
|
|
6005
6037
|
});
|
|
6006
6038
|
|
|
6007
6039
|
const useDraftDialog = () => {
|
|
@@ -7824,7 +7856,7 @@
|
|
|
7824
7856
|
const FAILED_TITLE = 'Ошибка перевода';
|
|
7825
7857
|
const SubmitFailedDialog = ({ onClose, errorCode, errorMessage, }) => {
|
|
7826
7858
|
const description = errorCode ? `Код ошибки - ${errorCode}` : 'Пожалуйста, повторите позднее';
|
|
7827
|
-
return (jsx(Dialog, {
|
|
7859
|
+
return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: 'ResponseFailIcon', iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: FAILED_TITLE, description: description, headlineVersion: "XS", isEmbedded: true }), errorMessage ? (jsxs("div", { className: "bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12", children: [jsx("div", { className: "col-span-8", children: errorMessage }), jsx("div", { className: "col-span-4", children: jsx(Img, { image: { icon: 'ResponseFailIcon', iconVersion: 'normal' } }) })] })) : null] }) }));
|
|
7828
7860
|
};
|
|
7829
7861
|
|
|
7830
7862
|
const useSubmitCardTransfer = (formType) => {
|
|
@@ -10335,7 +10367,7 @@
|
|
|
10335
10367
|
initialQuery,
|
|
10336
10368
|
});
|
|
10337
10369
|
const searchItems = useMemo(() => combineTopItemsAndSearchResult(navigationItems)(searchResult), [navigationItems, searchResult]);
|
|
10338
|
-
return (jsx(Dialog, { head: jsx(SearchInput, { autoFocus: true, ...searchInputProps }), onClose: onClose, children: jsx(Sitemap, { navigationItems: searchItems }) }));
|
|
10370
|
+
return (jsx(Dialog, { head: jsx(SearchInput, { className: "mt-s", autoFocus: true, ...searchInputProps }), onClose: onClose, children: jsx(Sitemap, { navigationItems: searchItems }) }));
|
|
10339
10371
|
});
|
|
10340
10372
|
const combineTopItemsAndSearchResult = (topItems) => (searchResult) => topItems?.length && searchResult?.length
|
|
10341
10373
|
? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
|
|
@@ -10732,10 +10764,11 @@
|
|
|
10732
10764
|
locationStore.location = _;
|
|
10733
10765
|
onClose?.();
|
|
10734
10766
|
}, [locationStore, onClose]);
|
|
10735
|
-
return (jsxs(Dialog, {
|
|
10767
|
+
return (jsxs(Dialog, { head: renderHead(query, setQuery, branches), onClose: onClose, children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
10736
10768
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
10737
10769
|
.map(renderRegion(branches?.dataSelect, handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-3 md:columns-4 lg:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation, branches?.dataSelect)) })), renderForeignOffices(foreignOffices)] }));
|
|
10738
10770
|
});
|
|
10771
|
+
const renderHead = (query, setQuery, branches) => (jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), jsx(SelectedLocation, { defaultLocation: branches?.default }), jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }));
|
|
10739
10772
|
const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
|
|
10740
10773
|
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
10741
10774
|
...region,
|
|
@@ -10873,7 +10906,7 @@
|
|
|
10873
10906
|
return docFormat.includes('/') ? docFormat.replace(regexp, '') : docFormat;
|
|
10874
10907
|
};
|
|
10875
10908
|
|
|
10876
|
-
const ReportDialog = JSX(({ href, __html, target, onClose }) => (jsxs(Dialog, {
|
|
10909
|
+
const ReportDialog = JSX(({ href, __html, target, onClose }) => (jsxs(Dialog, { maxWidth: "lg", onClose: onClose, children: [__html ? jsx(RichText, { __html: __html }) : null, jsxs("div", { className: "flex flex-row mx-auto w-fit gap-lg py-lg", children: [jsx(Link, { href: href, target: target, version: "primary", ariaLabel: "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435", onClick: onClose, children: "\u042F \u0441\u043E\u0433\u043B\u0430\u0441\u0435\u043D" }), jsx(Button, { type: "button", version: "secondary", onClick: onClose, children: "\u042F \u043D\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0435\u043D" })] }), jsx("div", { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443 \u00AB\u042F \u0421\u041E\u0413\u041B\u0410\u0421\u0415\u041D\u00BB \u043D\u0438\u0436\u0435 \u0412\u044B \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F. \u0420\u0430\u0441\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0435\u043D\u0438\u0435 \u0438\u043B\u0438 \u0440\u0430\u0441\u043A\u0440\u044B\u0442\u0438\u0435 \u043B\u044E\u0431\u043E\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043D\u043D\u043E\u0433\u043E \u0417\u0430\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u0438\u043B\u0438 \u043B\u044E\u0431\u043E\u0439 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438, \u0438\u043B\u0438 \u0440\u0435\u043A\u043E\u043C\u0435\u043D\u0434\u0430\u0446\u0438\u0438 \u0432 \u043D\u0435\u043C \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E.\u00BB" })] })));
|
|
10877
10910
|
|
|
10878
10911
|
const ReportDialogButton = JSX(({ text, href, target, __html, icon }) => {
|
|
10879
10912
|
const { open } = useDialog(ReportDialog);
|
|
@@ -11665,7 +11698,7 @@
|
|
|
11665
11698
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11666
11699
|
});
|
|
11667
11700
|
|
|
11668
|
-
const packageVersion = "0.14.
|
|
11701
|
+
const packageVersion = "0.14.896";
|
|
11669
11702
|
|
|
11670
11703
|
exports.Blocks = Blocks;
|
|
11671
11704
|
exports.ContentPage = ContentPage;
|