@redneckz/wildless-cms-uni-blocks 0.14.135 → 0.14.136
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 +294 -211
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/bundle/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/bundle/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +49 -0
- package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js +13 -28
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/dist/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/dist/components/ApplicationForm/handleSubmit.js +71 -0
- package/dist/components/ApplicationForm/handleSubmit.js.map +1 -0
- package/dist/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +47 -0
- package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js +14 -29
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/lib/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/lib/components/ApplicationForm/handleSubmit.js +66 -0
- package/lib/components/ApplicationForm/handleSubmit.js.map +1 -0
- package/lib/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +294 -211
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/mobile/bundle/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +49 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +13 -28
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/mobile/dist/components/ApplicationForm/handleSubmit.js +71 -0
- package/mobile/dist/components/ApplicationForm/handleSubmit.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +47 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +14 -29
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/handleSubmit.d.ts +16 -0
- package/mobile/lib/components/ApplicationForm/handleSubmit.js +66 -0
- package/mobile/lib/components/ApplicationForm/handleSubmit.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/renderUserData.d.ts +8 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +6 -9
- package/mobile/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +86 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +26 -61
- package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
- package/mobile/src/components/ApplicationForm/handleSubmit.tsx +87 -0
- package/mobile/src/components/ApplicationForm/renderUserData.tsx +11 -1
- package/package.json +2 -2
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +14 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +6 -9
- package/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +86 -0
- package/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
- package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +26 -61
- package/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
- package/src/components/ApplicationForm/handleSubmit.tsx +87 -0
- package/src/components/ApplicationForm/renderUserData.tsx +11 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -1199,7 +1199,7 @@
|
|
|
1199
1199
|
|
|
1200
1200
|
const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
|
|
1201
1201
|
|
|
1202
|
-
const initialFormState$
|
|
1202
|
+
const initialFormState$7 = {
|
|
1203
1203
|
acquiringType: { key: 'Торговый эквайринг' },
|
|
1204
1204
|
fullName: '',
|
|
1205
1205
|
inn: '',
|
|
@@ -1231,11 +1231,231 @@
|
|
|
1231
1231
|
phone: phone.replace(/[^+\d]/g, ''),
|
|
1232
1232
|
});
|
|
1233
1233
|
}, [onSubmit]);
|
|
1234
|
-
const [, { field, ...formProps }] = useForm(initialFormState$
|
|
1234
|
+
const [, { field, ...formProps }] = useForm(initialFormState$7, handleSubmit);
|
|
1235
1235
|
const regions = useGetRegions();
|
|
1236
1236
|
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [renderAcquiringRegion({ regions, field, title: 'Вид эквайринга и регион' }), renderAcquiringDataOrganization(field, 'Данные организации'), renderSlideCheckboxes(field), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
|
|
1237
1237
|
});
|
|
1238
1238
|
|
|
1239
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1240
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1241
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1242
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1243
|
+
}) }));
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1246
|
+
const CHECK_PATHS = [
|
|
1247
|
+
{
|
|
1248
|
+
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
1249
|
+
fillRule: 'evenodd',
|
|
1250
|
+
clipRule: 'evenodd',
|
|
1251
|
+
fill: 'white',
|
|
1252
|
+
},
|
|
1253
|
+
];
|
|
1254
|
+
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1255
|
+
const handleChange = useCallback((e) => {
|
|
1256
|
+
if (disabled) {
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
e.preventDefault();
|
|
1260
|
+
onChange && onChange(!value);
|
|
1261
|
+
}, [onChange, disabled, value]);
|
|
1262
|
+
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1263
|
+
return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: "checkbox", "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
|
|
1264
|
+
});
|
|
1265
|
+
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1266
|
+
|
|
1267
|
+
const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u0441 ", link: link })] }), renderErrorText(withValidator(consentDataProcessing, consentDataProcessingValidator).error)] }), renderSubmitButton(button)] }));
|
|
1268
|
+
|
|
1269
|
+
const formatDate = (date, toTimeStamp = false) => {
|
|
1270
|
+
if (typeof date === 'string') {
|
|
1271
|
+
return date.split('-').reverse().join('.');
|
|
1272
|
+
}
|
|
1273
|
+
else {
|
|
1274
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
1275
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1276
|
+
const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
|
|
1277
|
+
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
const noop = () => {
|
|
1282
|
+
// Do nothing
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
const DAY_COUNT = 6;
|
|
1286
|
+
const WEEK_COUNT = 7;
|
|
1287
|
+
const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
|
|
1288
|
+
const calendarCells = [];
|
|
1289
|
+
let dayCounter = 1;
|
|
1290
|
+
for (let i = 0; i < DAY_COUNT; i++) {
|
|
1291
|
+
const rowCells = [];
|
|
1292
|
+
for (let j = 0; j < WEEK_COUNT; j++) {
|
|
1293
|
+
if (i === 0 && j < firstDayOfWeek) {
|
|
1294
|
+
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1295
|
+
}
|
|
1296
|
+
else if (dayCounter > totalDays) {
|
|
1297
|
+
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
const currentDate = new Date(currentYear, currentMonth, dayCounter);
|
|
1301
|
+
const isToday = checkIsToday(currentDate, today);
|
|
1302
|
+
const isDisabled = checkIsDisabled(currentDate, min, max);
|
|
1303
|
+
rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
|
|
1304
|
+
dayCounter++;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
calendarCells.push(jsx("tr", { children: rowCells }, `row-${i}`));
|
|
1308
|
+
}
|
|
1309
|
+
return calendarCells;
|
|
1310
|
+
};
|
|
1311
|
+
const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
|
|
1312
|
+
const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
|
|
1313
|
+
const getDayStyles = (isToday, isDisabled) => style('p-s text-center rounded-md border', isToday ? '' : 'border-transparent hover:bg-gray', isDisabled ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
|
|
1314
|
+
|
|
1315
|
+
const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
|
|
1316
|
+
const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
|
|
1317
|
+
const handleDateClick = useCallback((date) => onDateSelect(date), []);
|
|
1318
|
+
const { firstDayOfWeek, totalDays } = useMemo(() => ({
|
|
1319
|
+
firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
|
|
1320
|
+
totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
|
|
1321
|
+
}), [currentYear, currentMonth]);
|
|
1322
|
+
return (jsxs("table", { className: "mx-auto", children: [jsx("thead", { className: "text-gray font-light", children: jsx("tr", { children: WEEK_DAYS.map((day, index) => (jsx("th", { className: "p-s", children: day }, String(index)))) }) }), jsx("tbody", { children: renderCalendarCells({
|
|
1323
|
+
firstDayOfWeek,
|
|
1324
|
+
today,
|
|
1325
|
+
totalDays,
|
|
1326
|
+
currentYear,
|
|
1327
|
+
currentMonth,
|
|
1328
|
+
min,
|
|
1329
|
+
max,
|
|
1330
|
+
onDateClick: handleDateClick,
|
|
1331
|
+
}) })] }));
|
|
1332
|
+
});
|
|
1333
|
+
|
|
1334
|
+
const months = [
|
|
1335
|
+
'Январь',
|
|
1336
|
+
'Февраль',
|
|
1337
|
+
'Март',
|
|
1338
|
+
'Апрель',
|
|
1339
|
+
'Май',
|
|
1340
|
+
'Июнь',
|
|
1341
|
+
'Июль',
|
|
1342
|
+
'Август',
|
|
1343
|
+
'Сентябрь',
|
|
1344
|
+
'Октябрь',
|
|
1345
|
+
'Ноябрь',
|
|
1346
|
+
'Декабрь',
|
|
1347
|
+
];
|
|
1348
|
+
|
|
1349
|
+
const START_YEAR = 1940;
|
|
1350
|
+
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
1351
|
+
|
|
1352
|
+
const MONTHS_COUNT = 11;
|
|
1353
|
+
const MONTHS_OPTIONS = months.map((key) => ({ key }));
|
|
1354
|
+
const YEARS_OPTIONS = getYears()
|
|
1355
|
+
.reverse()
|
|
1356
|
+
.map((key) => ({ key: String(key) }));
|
|
1357
|
+
const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
|
|
1358
|
+
const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
|
|
1359
|
+
const ref = useOutsideClick(close);
|
|
1360
|
+
const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
|
|
1361
|
+
const handleNextMonth = useCallback(() => {
|
|
1362
|
+
if (selectedMonth + 1 <= MONTHS_COUNT) {
|
|
1363
|
+
onMonthSelect(selectedMonth + 1);
|
|
1364
|
+
}
|
|
1365
|
+
else {
|
|
1366
|
+
onMonthSelect(0);
|
|
1367
|
+
onYearSelect(selectedYear + 1);
|
|
1368
|
+
}
|
|
1369
|
+
}, [selectedMonth]);
|
|
1370
|
+
const handlePrevMonth = useCallback(() => {
|
|
1371
|
+
if (selectedMonth - 1 >= 0) {
|
|
1372
|
+
onMonthSelect(selectedMonth - 1);
|
|
1373
|
+
}
|
|
1374
|
+
else {
|
|
1375
|
+
onMonthSelect(11);
|
|
1376
|
+
onYearSelect(selectedYear - 1);
|
|
1377
|
+
}
|
|
1378
|
+
}, [selectedMonth]);
|
|
1379
|
+
const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
|
|
1380
|
+
const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
|
|
1381
|
+
return {
|
|
1382
|
+
handleChangeVisibleCalendar,
|
|
1383
|
+
handleNextMonth,
|
|
1384
|
+
handlePrevMonth,
|
|
1385
|
+
handleSelectMonth,
|
|
1386
|
+
handleSelectYear,
|
|
1387
|
+
monthsOptions: MONTHS_OPTIONS,
|
|
1388
|
+
yearsOptions: YEARS_OPTIONS,
|
|
1389
|
+
ref,
|
|
1390
|
+
};
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
const ICON_PROPS = {
|
|
1394
|
+
name: 'ArrowUpIcon',
|
|
1395
|
+
iconVersion: 'black',
|
|
1396
|
+
width: '24',
|
|
1397
|
+
height: '24',
|
|
1398
|
+
};
|
|
1399
|
+
const SELECT_PROPS = {
|
|
1400
|
+
className: 'min-w-32',
|
|
1401
|
+
iconVersion: 'black',
|
|
1402
|
+
isBorder: false,
|
|
1403
|
+
};
|
|
1404
|
+
const formStyle = 'flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer ' +
|
|
1405
|
+
'hover:border-black active:border-black focus:border-black';
|
|
1406
|
+
const DatePicker = JSX(({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
|
|
1407
|
+
const [showCalendar, { setValue }] = useBool(false);
|
|
1408
|
+
const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
|
|
1409
|
+
const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
|
1410
|
+
const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
|
|
1411
|
+
onYearSelect: setSelectedYear,
|
|
1412
|
+
onMonthSelect: setSelectedMonth,
|
|
1413
|
+
onShowCalendar: setValue,
|
|
1414
|
+
selectedYear,
|
|
1415
|
+
selectedMonth,
|
|
1416
|
+
showCalendar,
|
|
1417
|
+
});
|
|
1418
|
+
return (jsxs("div", { className: style(className, 'relative'), ref: ref, children: [jsx(Text, { size: "text-m", "font-weight": "font-light", children: label }), renderDatePickerForm(handleChangeVisibleCalendar, value, valid), showCalendar ? (jsxs("div", { className: "absolute bg-white z-20 select-none", children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, onDateSelect: onChange, min: minDate, max: maxDate })] })) : null] }));
|
|
1419
|
+
});
|
|
1420
|
+
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
|
|
1421
|
+
|
|
1422
|
+
const DatePickerControl = JSX(({ className, label, value = undefined, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx(DatePicker, { value: value, onChange: onChange, valid: Boolean(!error) }), renderErrorText(error)] })));
|
|
1423
|
+
|
|
1424
|
+
const renderUserData = (field) => (jsxs("div", { children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F*", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u0418\u043C\u044F*", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F*", ...withValidator(field('birthday'), defaultValidator) })] }));
|
|
1425
|
+
|
|
1426
|
+
const initialFormState$6 = {
|
|
1427
|
+
typeForm: { key: 'ANTIFRAUD', text: 'Предупреждение о мошенничестве' },
|
|
1428
|
+
surname: '',
|
|
1429
|
+
name: '',
|
|
1430
|
+
middleName: '',
|
|
1431
|
+
phone: '',
|
|
1432
|
+
birthday: undefined,
|
|
1433
|
+
isClient: false,
|
|
1434
|
+
comment: '',
|
|
1435
|
+
consentDataProcessing: false,
|
|
1436
|
+
};
|
|
1437
|
+
const feedbackValidator = objectValidator({
|
|
1438
|
+
typeForm: defaultValidator,
|
|
1439
|
+
surname: defaultValidator,
|
|
1440
|
+
name: nameValidator,
|
|
1441
|
+
birthday: defaultValidator,
|
|
1442
|
+
phone: phoneValidator,
|
|
1443
|
+
consentDataProcessing: consentDataProcessingValidator,
|
|
1444
|
+
});
|
|
1445
|
+
const ApplicationFormAntiFraud = JSX(({ button, link, onSubmit }) => {
|
|
1446
|
+
const handleSubmit = useCallback((formState) => {
|
|
1447
|
+
const { typeForm, phone, ...usedFields } = formState;
|
|
1448
|
+
const submitData = {
|
|
1449
|
+
...usedFields,
|
|
1450
|
+
typeForm: typeForm.key,
|
|
1451
|
+
phone: phone.replace(/[^+\d]/g, ''),
|
|
1452
|
+
};
|
|
1453
|
+
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
|
|
1454
|
+
}, [onSubmit]);
|
|
1455
|
+
const [, { field, ...formProps }] = useForm(initialFormState$6, handleSubmit);
|
|
1456
|
+
return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [renderUserData(field), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
|
|
1457
|
+
});
|
|
1458
|
+
|
|
1239
1459
|
const renderBusinessCardDataOrganization = (field) => (jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), secondChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] }) }));
|
|
1240
1460
|
|
|
1241
1461
|
const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
|
|
@@ -1439,192 +1659,68 @@
|
|
|
1439
1659
|
{ key: 'Юридическое лицо / ИП' },
|
|
1440
1660
|
];
|
|
1441
1661
|
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
fillRule: 'evenodd',
|
|
1453
|
-
clipRule: 'evenodd',
|
|
1454
|
-
fill: 'white',
|
|
1455
|
-
},
|
|
1456
|
-
];
|
|
1457
|
-
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1458
|
-
const handleChange = useCallback((e) => {
|
|
1459
|
-
if (disabled) {
|
|
1460
|
-
return;
|
|
1461
|
-
}
|
|
1462
|
-
e.preventDefault();
|
|
1463
|
-
onChange && onChange(!value);
|
|
1464
|
-
}, [onChange, disabled, value]);
|
|
1465
|
-
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1466
|
-
return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: "checkbox", "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
|
|
1467
|
-
});
|
|
1468
|
-
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1469
|
-
|
|
1470
|
-
const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u0441 ", link: link })] }), renderErrorText(withValidator(consentDataProcessing, consentDataProcessingValidator).error)] }), renderSubmitButton(button)] }));
|
|
1471
|
-
|
|
1472
|
-
const formatDate = (date, toTimeStamp = false) => {
|
|
1473
|
-
if (typeof date === 'string') {
|
|
1474
|
-
return date.split('-').reverse().join('.');
|
|
1475
|
-
}
|
|
1476
|
-
else {
|
|
1477
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
1478
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1479
|
-
const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
|
|
1480
|
-
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
|
|
1484
|
-
const noop = () => {
|
|
1485
|
-
// Do nothing
|
|
1486
|
-
};
|
|
1487
|
-
|
|
1488
|
-
const DAY_COUNT = 6;
|
|
1489
|
-
const WEEK_COUNT = 7;
|
|
1490
|
-
const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
|
|
1491
|
-
const calendarCells = [];
|
|
1492
|
-
let dayCounter = 1;
|
|
1493
|
-
for (let i = 0; i < DAY_COUNT; i++) {
|
|
1494
|
-
const rowCells = [];
|
|
1495
|
-
for (let j = 0; j < WEEK_COUNT; j++) {
|
|
1496
|
-
if (i === 0 && j < firstDayOfWeek) {
|
|
1497
|
-
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1498
|
-
}
|
|
1499
|
-
else if (dayCounter > totalDays) {
|
|
1500
|
-
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1501
|
-
}
|
|
1502
|
-
else {
|
|
1503
|
-
const currentDate = new Date(currentYear, currentMonth, dayCounter);
|
|
1504
|
-
const isToday = checkIsToday(currentDate, today);
|
|
1505
|
-
const isDisabled = checkIsDisabled(currentDate, min, max);
|
|
1506
|
-
rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
|
|
1507
|
-
dayCounter++;
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
calendarCells.push(jsx("tr", { children: rowCells }, `row-${i}`));
|
|
1511
|
-
}
|
|
1512
|
-
return calendarCells;
|
|
1662
|
+
const feedbackValidatorDefaultObject = {
|
|
1663
|
+
typeForm: defaultValidator,
|
|
1664
|
+
region: defaultValidator,
|
|
1665
|
+
surname: defaultValidator,
|
|
1666
|
+
name: nameValidator,
|
|
1667
|
+
feedbackMethod: defaultValidator,
|
|
1668
|
+
phone: phoneValidator,
|
|
1669
|
+
email: defaultValidator,
|
|
1670
|
+
comment: defaultValidator,
|
|
1671
|
+
consentDataProcessing: consentDataProcessingValidator,
|
|
1513
1672
|
};
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
totalDays,
|
|
1529
|
-
currentYear,
|
|
1530
|
-
currentMonth,
|
|
1531
|
-
min,
|
|
1532
|
-
max,
|
|
1533
|
-
onDateClick: handleDateClick,
|
|
1534
|
-
}) })] }));
|
|
1535
|
-
});
|
|
1536
|
-
|
|
1537
|
-
const months = [
|
|
1538
|
-
'Январь',
|
|
1539
|
-
'Февраль',
|
|
1540
|
-
'Март',
|
|
1541
|
-
'Апрель',
|
|
1542
|
-
'Май',
|
|
1543
|
-
'Июнь',
|
|
1544
|
-
'Июль',
|
|
1545
|
-
'Август',
|
|
1546
|
-
'Сентябрь',
|
|
1547
|
-
'Октябрь',
|
|
1548
|
-
'Ноябрь',
|
|
1549
|
-
'Декабрь',
|
|
1550
|
-
];
|
|
1551
|
-
|
|
1552
|
-
const START_YEAR = 1940;
|
|
1553
|
-
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
1554
|
-
|
|
1555
|
-
const MONTHS_COUNT = 11;
|
|
1556
|
-
const MONTHS_OPTIONS = months.map((key) => ({ key }));
|
|
1557
|
-
const YEARS_OPTIONS = getYears()
|
|
1558
|
-
.reverse()
|
|
1559
|
-
.map((key) => ({ key: String(key) }));
|
|
1560
|
-
const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
|
|
1561
|
-
const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
|
|
1562
|
-
const ref = useOutsideClick(close);
|
|
1563
|
-
const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
|
|
1564
|
-
const handleNextMonth = useCallback(() => {
|
|
1565
|
-
if (selectedMonth + 1 <= MONTHS_COUNT) {
|
|
1566
|
-
onMonthSelect(selectedMonth + 1);
|
|
1567
|
-
}
|
|
1568
|
-
else {
|
|
1569
|
-
onMonthSelect(0);
|
|
1570
|
-
onYearSelect(selectedYear + 1);
|
|
1571
|
-
}
|
|
1572
|
-
}, [selectedMonth]);
|
|
1573
|
-
const handlePrevMonth = useCallback(() => {
|
|
1574
|
-
if (selectedMonth - 1 >= 0) {
|
|
1575
|
-
onMonthSelect(selectedMonth - 1);
|
|
1576
|
-
}
|
|
1577
|
-
else {
|
|
1578
|
-
onMonthSelect(11);
|
|
1579
|
-
onYearSelect(selectedYear - 1);
|
|
1580
|
-
}
|
|
1581
|
-
}, [selectedMonth]);
|
|
1582
|
-
const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
|
|
1583
|
-
const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
|
|
1584
|
-
return {
|
|
1585
|
-
handleChangeVisibleCalendar,
|
|
1586
|
-
handleNextMonth,
|
|
1587
|
-
handlePrevMonth,
|
|
1588
|
-
handleSelectMonth,
|
|
1589
|
-
handleSelectYear,
|
|
1590
|
-
monthsOptions: MONTHS_OPTIONS,
|
|
1591
|
-
yearsOptions: YEARS_OPTIONS,
|
|
1592
|
-
ref,
|
|
1673
|
+
const handleSubmitIndividual = (formState, onSubmit) => {
|
|
1674
|
+
const feedbackValidator = objectValidator({
|
|
1675
|
+
...feedbackValidatorDefaultObject,
|
|
1676
|
+
addressBranch: defaultValidator,
|
|
1677
|
+
});
|
|
1678
|
+
const { region, phone, secondaryPhone } = formState;
|
|
1679
|
+
const submitData = {
|
|
1680
|
+
...formState,
|
|
1681
|
+
typeForm: formState.typeForm.key,
|
|
1682
|
+
addressBranch: formState.addressBranch?.text || '',
|
|
1683
|
+
feedbackMethod: formState.feedbackMethod.text,
|
|
1684
|
+
regionBranch: region?.text,
|
|
1685
|
+
phoneNumber: phone.replace(/[^+\d]/g, ''),
|
|
1686
|
+
secondaryPhoneNumber: secondaryPhone,
|
|
1593
1687
|
};
|
|
1688
|
+
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
|
|
1594
1689
|
};
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1690
|
+
const handleSubmitLegal = (formState, onSubmit) => {
|
|
1691
|
+
const feedbackValidator = objectValidator({
|
|
1692
|
+
...feedbackValidatorDefaultObject,
|
|
1693
|
+
addressBranch: defaultValidator,
|
|
1694
|
+
inn: innValidator,
|
|
1695
|
+
});
|
|
1696
|
+
const { secondaryPhone, email } = formState;
|
|
1697
|
+
const submitData = {
|
|
1698
|
+
...formState,
|
|
1699
|
+
typeForm: formState.typeForm.key,
|
|
1700
|
+
region: formState.region?.text,
|
|
1701
|
+
addressBranch: formState.addressBranch?.text || '',
|
|
1702
|
+
feedbackMethod: formState.feedbackMethod.text,
|
|
1703
|
+
phone: formState.phone.replace(/[^+\d]/g, ''),
|
|
1704
|
+
secondaryPhoneNumber: secondaryPhone,
|
|
1705
|
+
mail: email,
|
|
1706
|
+
};
|
|
1707
|
+
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
|
|
1606
1708
|
};
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
|
|
1612
|
-
const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
|
1613
|
-
const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
|
|
1614
|
-
onYearSelect: setSelectedYear,
|
|
1615
|
-
onMonthSelect: setSelectedMonth,
|
|
1616
|
-
onShowCalendar: setValue,
|
|
1617
|
-
selectedYear,
|
|
1618
|
-
selectedMonth,
|
|
1619
|
-
showCalendar,
|
|
1709
|
+
const handleSubmitQuestion = (formState, onSubmit) => {
|
|
1710
|
+
const feedbackValidator = objectValidator({
|
|
1711
|
+
...feedbackValidatorDefaultObject,
|
|
1712
|
+
birthday: defaultValidator,
|
|
1620
1713
|
});
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1714
|
+
const { region, phone } = formState;
|
|
1715
|
+
const submitData = {
|
|
1716
|
+
...formState,
|
|
1717
|
+
typeForm: formState.typeForm.key,
|
|
1718
|
+
feedbackMethod: formState.feedbackMethod.text,
|
|
1719
|
+
regionBranch: region?.text,
|
|
1720
|
+
phoneNumber: phone.replace(/[^+\d]/g, ''),
|
|
1721
|
+
};
|
|
1722
|
+
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
|
|
1723
|
+
};
|
|
1628
1724
|
|
|
1629
1725
|
const initialFormState$2 = {
|
|
1630
1726
|
typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
|
|
@@ -1639,32 +1735,18 @@
|
|
|
1639
1735
|
comment: '',
|
|
1640
1736
|
consentDataProcessing: false,
|
|
1641
1737
|
};
|
|
1642
|
-
const feedbackValidator = objectValidator({
|
|
1643
|
-
typeForm: defaultValidator,
|
|
1644
|
-
region: defaultValidator,
|
|
1645
|
-
department: defaultValidator,
|
|
1646
|
-
name: nameValidator,
|
|
1647
|
-
birthday: defaultValidator,
|
|
1648
|
-
feedbackMethod: defaultValidator,
|
|
1649
|
-
phone: phoneValidator,
|
|
1650
|
-
email: defaultValidator,
|
|
1651
|
-
consentDataProcessing: consentDataProcessingValidator,
|
|
1652
|
-
inn: innValidator,
|
|
1653
|
-
});
|
|
1654
1738
|
const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
|
|
1655
|
-
const handleSubmit = useCallback((
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
};
|
|
1667
|
-
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, isLegalEntity);
|
|
1739
|
+
const handleSubmit = useCallback((feedbackFormState) => {
|
|
1740
|
+
const isLegal = getLegalEntity(feedbackFormState.typeForm.key, feedbackFormState.serviceDirection?.key);
|
|
1741
|
+
if (isLegal) {
|
|
1742
|
+
handleSubmitLegal(feedbackFormState, onSubmit);
|
|
1743
|
+
}
|
|
1744
|
+
else if (feedbackFormState.typeForm.key === 'FEEDBACK') {
|
|
1745
|
+
handleSubmitQuestion(feedbackFormState, onSubmit);
|
|
1746
|
+
}
|
|
1747
|
+
else {
|
|
1748
|
+
handleSubmitIndividual(feedbackFormState, onSubmit);
|
|
1749
|
+
}
|
|
1668
1750
|
}, [onSubmit]);
|
|
1669
1751
|
const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
|
|
1670
1752
|
const branch = useGetRegions();
|
|
@@ -1674,7 +1756,7 @@
|
|
|
1674
1756
|
return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(field('typeForm'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), defaultValidator) })) : null, jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: branch.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: regions.map(({ branchCode = '', address = '' }) => ({
|
|
1675
1757
|
key: branchCode,
|
|
1676
1758
|
text: address,
|
|
1677
|
-
})), ...withValidator(field('
|
|
1759
|
+
})), ...withValidator(field('addressBranch'), defaultValidator) })) : null, renderUserData(field), isLegalEntity ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0418\u041D\u041D*", ...withValidator(field('inn'), innValidator) }), jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') })] })) : null, jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430*", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), defaultValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...field('secondaryPhone') }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430*", ...withValidator(field('email'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') }), jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430*", ...withValidator(field('email'), defaultValidator) })), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435*", isTextarea: true }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
|
|
1678
1760
|
});
|
|
1679
1761
|
const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
|
|
1680
1762
|
|
|
@@ -1810,6 +1892,7 @@
|
|
|
1810
1892
|
ApplicationFormGrantSupport,
|
|
1811
1893
|
ApplicationFormIndividuals,
|
|
1812
1894
|
ApplicationFormFeedback,
|
|
1895
|
+
ApplicationFormAntiFraud,
|
|
1813
1896
|
};
|
|
1814
1897
|
|
|
1815
1898
|
const ResponseNotification = JSX(({ responseType }) => {
|
|
@@ -1823,7 +1906,7 @@
|
|
|
1823
1906
|
const ApplicationForm = JSX((props) => {
|
|
1824
1907
|
const { className, formBlock, ...rest } = props;
|
|
1825
1908
|
const [responseType, setResponseType] = useState('');
|
|
1826
|
-
const handleSubmit = useCallback(async (data, isIndividualType) => {
|
|
1909
|
+
const handleSubmit = useCallback(async (data, isIndividualType = false) => {
|
|
1827
1910
|
const status = (await API.send(data, isIndividualType)) ? 'OK' : 'Fail';
|
|
1828
1911
|
setResponseType(status);
|
|
1829
1912
|
return status;
|
|
@@ -5899,7 +5982,7 @@
|
|
|
5899
5982
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
|
|
5900
5983
|
}
|
|
5901
5984
|
|
|
5902
|
-
const packageVersion = "0.14.
|
|
5985
|
+
const packageVersion = "0.14.135";
|
|
5903
5986
|
|
|
5904
5987
|
exports.Blocks = Blocks;
|
|
5905
5988
|
exports.ContentPage = ContentPage;
|