@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.
Files changed (102) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +294 -211
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  6. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  7. package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  8. package/bundle/components/ApplicationForm/handleSubmit.d.ts +16 -0
  9. package/bundle/components/ApplicationForm/renderUserData.d.ts +8 -1
  10. package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  11. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  12. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  13. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +49 -0
  14. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
  15. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  16. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  17. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +13 -28
  18. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  19. package/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  20. package/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
  21. package/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
  22. package/dist/components/ApplicationForm/handleSubmit.d.ts +16 -0
  23. package/dist/components/ApplicationForm/handleSubmit.js +71 -0
  24. package/dist/components/ApplicationForm/handleSubmit.js.map +1 -0
  25. package/dist/components/ApplicationForm/renderUserData.d.ts +8 -1
  26. package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  27. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  28. package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  29. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  30. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  31. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +47 -0
  32. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
  33. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  34. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  35. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +14 -29
  36. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  37. package/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  38. package/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
  39. package/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
  40. package/lib/components/ApplicationForm/handleSubmit.d.ts +16 -0
  41. package/lib/components/ApplicationForm/handleSubmit.js +66 -0
  42. package/lib/components/ApplicationForm/handleSubmit.js.map +1 -0
  43. package/lib/components/ApplicationForm/renderUserData.d.ts +8 -1
  44. package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  45. package/mobile/bundle/bundle.umd.js +294 -211
  46. package/mobile/bundle/bundle.umd.min.js +1 -1
  47. package/mobile/bundle/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  48. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  49. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  50. package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  51. package/mobile/bundle/components/ApplicationForm/handleSubmit.d.ts +16 -0
  52. package/mobile/bundle/components/ApplicationForm/renderUserData.d.ts +8 -1
  53. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  54. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  55. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  56. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +49 -0
  57. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
  58. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  59. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  60. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +13 -28
  61. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  62. package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  63. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
  64. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
  65. package/mobile/dist/components/ApplicationForm/handleSubmit.d.ts +16 -0
  66. package/mobile/dist/components/ApplicationForm/handleSubmit.js +71 -0
  67. package/mobile/dist/components/ApplicationForm/handleSubmit.js.map +1 -0
  68. package/mobile/dist/components/ApplicationForm/renderUserData.d.ts +8 -1
  69. package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  70. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  71. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  72. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.d.ts +12 -0
  73. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +47 -0
  74. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -0
  75. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
  76. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +9 -12
  77. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +14 -29
  78. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  79. package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
  80. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
  81. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
  82. package/mobile/lib/components/ApplicationForm/handleSubmit.d.ts +16 -0
  83. package/mobile/lib/components/ApplicationForm/handleSubmit.js +66 -0
  84. package/mobile/lib/components/ApplicationForm/handleSubmit.js.map +1 -0
  85. package/mobile/lib/components/ApplicationForm/renderUserData.d.ts +8 -1
  86. package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  87. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +6 -9
  88. package/mobile/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +86 -0
  89. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
  90. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +26 -61
  91. package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
  92. package/mobile/src/components/ApplicationForm/handleSubmit.tsx +87 -0
  93. package/mobile/src/components/ApplicationForm/renderUserData.tsx +11 -1
  94. package/package.json +2 -2
  95. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +14 -0
  96. package/src/components/ApplicationForm/ApplicationForm.tsx +6 -9
  97. package/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +86 -0
  98. package/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
  99. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +26 -61
  100. package/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
  101. package/src/components/ApplicationForm/handleSubmit.tsx +87 -0
  102. package/src/components/ApplicationForm/renderUserData.tsx +11 -1
@@ -1207,7 +1207,7 @@
1207
1207
 
1208
1208
  const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
1209
1209
 
1210
- const initialFormState$6 = {
1210
+ const initialFormState$7 = {
1211
1211
  acquiringType: { key: 'Торговый эквайринг' },
1212
1212
  fullName: '',
1213
1213
  inn: '',
@@ -1239,11 +1239,231 @@
1239
1239
  phone: phone.replace(/[^+\d]/g, ''),
1240
1240
  });
1241
1241
  }, [onSubmit]);
1242
- const [, { field, ...formProps }] = useForm(initialFormState$6, handleSubmit);
1242
+ const [, { field, ...formProps }] = useForm(initialFormState$7, handleSubmit);
1243
1243
  const regions = useGetRegions();
1244
1244
  return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [renderAcquiringRegion({ regions, field, title: 'Вид эквайринга и регион' }), renderAcquiringDataOrganization(field, 'Данные организации'), renderSlideCheckboxes(field), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
1245
1245
  });
1246
1246
 
1247
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1248
+ 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) => {
1249
+ const resultOptions = { ...commonOptions, ...options };
1250
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1251
+ }) }));
1252
+ });
1253
+
1254
+ const CHECK_PATHS = [
1255
+ {
1256
+ 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',
1257
+ fillRule: 'evenodd',
1258
+ clipRule: 'evenodd',
1259
+ fill: 'white',
1260
+ },
1261
+ ];
1262
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1263
+ const handleChange = useCallback((e) => {
1264
+ if (disabled) {
1265
+ return;
1266
+ }
1267
+ e.preventDefault();
1268
+ onChange && onChange(!value);
1269
+ }, [onChange, disabled, value]);
1270
+ 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" }));
1271
+ 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] }) }));
1272
+ });
1273
+ const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1274
+
1275
+ 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)] }));
1276
+
1277
+ const formatDate = (date, toTimeStamp = false) => {
1278
+ if (typeof date === 'string') {
1279
+ return date.split('-').reverse().join('.');
1280
+ }
1281
+ else {
1282
+ const day = String(date.getDate()).padStart(2, '0');
1283
+ const month = String(date.getMonth() + 1).padStart(2, '0');
1284
+ const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
1285
+ return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
1286
+ }
1287
+ };
1288
+
1289
+ const noop = () => {
1290
+ // Do nothing
1291
+ };
1292
+
1293
+ const DAY_COUNT = 6;
1294
+ const WEEK_COUNT = 7;
1295
+ const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
1296
+ const calendarCells = [];
1297
+ let dayCounter = 1;
1298
+ for (let i = 0; i < DAY_COUNT; i++) {
1299
+ const rowCells = [];
1300
+ for (let j = 0; j < WEEK_COUNT; j++) {
1301
+ if (i === 0 && j < firstDayOfWeek) {
1302
+ rowCells.push(jsx("td", {}, `empty-${j}`));
1303
+ }
1304
+ else if (dayCounter > totalDays) {
1305
+ rowCells.push(jsx("td", {}, `empty-${j}`));
1306
+ }
1307
+ else {
1308
+ const currentDate = new Date(currentYear, currentMonth, dayCounter);
1309
+ const isToday = checkIsToday(currentDate, today);
1310
+ const isDisabled = checkIsDisabled(currentDate, min, max);
1311
+ rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
1312
+ dayCounter++;
1313
+ }
1314
+ }
1315
+ calendarCells.push(jsx("tr", { children: rowCells }, `row-${i}`));
1316
+ }
1317
+ return calendarCells;
1318
+ };
1319
+ const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
1320
+ const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
1321
+ 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');
1322
+
1323
+ const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
1324
+ const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
1325
+ const handleDateClick = useCallback((date) => onDateSelect(date), []);
1326
+ const { firstDayOfWeek, totalDays } = useMemo(() => ({
1327
+ firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
1328
+ totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
1329
+ }), [currentYear, currentMonth]);
1330
+ 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({
1331
+ firstDayOfWeek,
1332
+ today,
1333
+ totalDays,
1334
+ currentYear,
1335
+ currentMonth,
1336
+ min,
1337
+ max,
1338
+ onDateClick: handleDateClick,
1339
+ }) })] }));
1340
+ });
1341
+
1342
+ const months = [
1343
+ 'Январь',
1344
+ 'Февраль',
1345
+ 'Март',
1346
+ 'Апрель',
1347
+ 'Май',
1348
+ 'Июнь',
1349
+ 'Июль',
1350
+ 'Август',
1351
+ 'Сентябрь',
1352
+ 'Октябрь',
1353
+ 'Ноябрь',
1354
+ 'Декабрь',
1355
+ ];
1356
+
1357
+ const START_YEAR = 1940;
1358
+ const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
1359
+
1360
+ const MONTHS_COUNT = 11;
1361
+ const MONTHS_OPTIONS = months.map((key) => ({ key }));
1362
+ const YEARS_OPTIONS = getYears()
1363
+ .reverse()
1364
+ .map((key) => ({ key: String(key) }));
1365
+ const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
1366
+ const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
1367
+ const ref = useOutsideClick(close);
1368
+ const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
1369
+ const handleNextMonth = useCallback(() => {
1370
+ if (selectedMonth + 1 <= MONTHS_COUNT) {
1371
+ onMonthSelect(selectedMonth + 1);
1372
+ }
1373
+ else {
1374
+ onMonthSelect(0);
1375
+ onYearSelect(selectedYear + 1);
1376
+ }
1377
+ }, [selectedMonth]);
1378
+ const handlePrevMonth = useCallback(() => {
1379
+ if (selectedMonth - 1 >= 0) {
1380
+ onMonthSelect(selectedMonth - 1);
1381
+ }
1382
+ else {
1383
+ onMonthSelect(11);
1384
+ onYearSelect(selectedYear - 1);
1385
+ }
1386
+ }, [selectedMonth]);
1387
+ const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
1388
+ const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
1389
+ return {
1390
+ handleChangeVisibleCalendar,
1391
+ handleNextMonth,
1392
+ handlePrevMonth,
1393
+ handleSelectMonth,
1394
+ handleSelectYear,
1395
+ monthsOptions: MONTHS_OPTIONS,
1396
+ yearsOptions: YEARS_OPTIONS,
1397
+ ref,
1398
+ };
1399
+ };
1400
+
1401
+ const ICON_PROPS = {
1402
+ name: 'ArrowUpIcon',
1403
+ iconVersion: 'black',
1404
+ width: '24',
1405
+ height: '24',
1406
+ };
1407
+ const SELECT_PROPS = {
1408
+ className: 'min-w-32',
1409
+ iconVersion: 'black',
1410
+ isBorder: false,
1411
+ };
1412
+ const formStyle = 'flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer ' +
1413
+ 'hover:border-black active:border-black focus:border-black';
1414
+ const DatePicker = JSX(({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
1415
+ const [showCalendar, { setValue }] = useBool(false);
1416
+ const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
1417
+ const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
1418
+ const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
1419
+ onYearSelect: setSelectedYear,
1420
+ onMonthSelect: setSelectedMonth,
1421
+ onShowCalendar: setValue,
1422
+ selectedYear,
1423
+ selectedMonth,
1424
+ showCalendar,
1425
+ });
1426
+ 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] }));
1427
+ });
1428
+ 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" })] }));
1429
+
1430
+ 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)] })));
1431
+
1432
+ 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) })] }));
1433
+
1434
+ const initialFormState$6 = {
1435
+ typeForm: { key: 'ANTIFRAUD', text: 'Предупреждение о мошенничестве' },
1436
+ surname: '',
1437
+ name: '',
1438
+ middleName: '',
1439
+ phone: '',
1440
+ birthday: undefined,
1441
+ isClient: false,
1442
+ comment: '',
1443
+ consentDataProcessing: false,
1444
+ };
1445
+ const feedbackValidator = objectValidator({
1446
+ typeForm: defaultValidator,
1447
+ surname: defaultValidator,
1448
+ name: nameValidator,
1449
+ birthday: defaultValidator,
1450
+ phone: phoneValidator,
1451
+ consentDataProcessing: consentDataProcessingValidator,
1452
+ });
1453
+ const ApplicationFormAntiFraud = JSX(({ button, link, onSubmit }) => {
1454
+ const handleSubmit = useCallback((formState) => {
1455
+ const { typeForm, phone, ...usedFields } = formState;
1456
+ const submitData = {
1457
+ ...usedFields,
1458
+ typeForm: typeForm.key,
1459
+ phone: phone.replace(/[^+\d]/g, ''),
1460
+ };
1461
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1462
+ }, [onSubmit]);
1463
+ const [, { field, ...formProps }] = useForm(initialFormState$6, handleSubmit);
1464
+ 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)] }) }) }));
1465
+ });
1466
+
1247
1467
  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) })] }) }));
1248
1468
 
1249
1469
  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) }));
@@ -1447,192 +1667,68 @@
1447
1667
  { key: 'Юридическое лицо / ИП' },
1448
1668
  ];
1449
1669
 
1450
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1451
- 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) => {
1452
- const resultOptions = { ...commonOptions, ...options };
1453
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1454
- }) }));
1455
- });
1456
-
1457
- const CHECK_PATHS = [
1458
- {
1459
- 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',
1460
- fillRule: 'evenodd',
1461
- clipRule: 'evenodd',
1462
- fill: 'white',
1463
- },
1464
- ];
1465
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1466
- const handleChange = useCallback((e) => {
1467
- if (disabled) {
1468
- return;
1469
- }
1470
- e.preventDefault();
1471
- onChange && onChange(!value);
1472
- }, [onChange, disabled, value]);
1473
- 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" }));
1474
- 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] }) }));
1475
- });
1476
- const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1477
-
1478
- 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)] }));
1479
-
1480
- const formatDate = (date, toTimeStamp = false) => {
1481
- if (typeof date === 'string') {
1482
- return date.split('-').reverse().join('.');
1483
- }
1484
- else {
1485
- const day = String(date.getDate()).padStart(2, '0');
1486
- const month = String(date.getMonth() + 1).padStart(2, '0');
1487
- const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
1488
- return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
1489
- }
1490
- };
1491
-
1492
- const noop = () => {
1493
- // Do nothing
1494
- };
1495
-
1496
- const DAY_COUNT = 6;
1497
- const WEEK_COUNT = 7;
1498
- const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
1499
- const calendarCells = [];
1500
- let dayCounter = 1;
1501
- for (let i = 0; i < DAY_COUNT; i++) {
1502
- const rowCells = [];
1503
- for (let j = 0; j < WEEK_COUNT; j++) {
1504
- if (i === 0 && j < firstDayOfWeek) {
1505
- rowCells.push(jsx("td", {}, `empty-${j}`));
1506
- }
1507
- else if (dayCounter > totalDays) {
1508
- rowCells.push(jsx("td", {}, `empty-${j}`));
1509
- }
1510
- else {
1511
- const currentDate = new Date(currentYear, currentMonth, dayCounter);
1512
- const isToday = checkIsToday(currentDate, today);
1513
- const isDisabled = checkIsDisabled(currentDate, min, max);
1514
- rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
1515
- dayCounter++;
1516
- }
1517
- }
1518
- calendarCells.push(jsx("tr", { children: rowCells }, `row-${i}`));
1519
- }
1520
- return calendarCells;
1670
+ const feedbackValidatorDefaultObject = {
1671
+ typeForm: defaultValidator,
1672
+ region: defaultValidator,
1673
+ surname: defaultValidator,
1674
+ name: nameValidator,
1675
+ feedbackMethod: defaultValidator,
1676
+ phone: phoneValidator,
1677
+ email: defaultValidator,
1678
+ comment: defaultValidator,
1679
+ consentDataProcessing: consentDataProcessingValidator,
1521
1680
  };
1522
- const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
1523
- const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
1524
- 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');
1525
-
1526
- const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
1527
- const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
1528
- const handleDateClick = useCallback((date) => onDateSelect(date), []);
1529
- const { firstDayOfWeek, totalDays } = useMemo(() => ({
1530
- firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
1531
- totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
1532
- }), [currentYear, currentMonth]);
1533
- 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({
1534
- firstDayOfWeek,
1535
- today,
1536
- totalDays,
1537
- currentYear,
1538
- currentMonth,
1539
- min,
1540
- max,
1541
- onDateClick: handleDateClick,
1542
- }) })] }));
1543
- });
1544
-
1545
- const months = [
1546
- 'Январь',
1547
- 'Февраль',
1548
- 'Март',
1549
- 'Апрель',
1550
- 'Май',
1551
- 'Июнь',
1552
- 'Июль',
1553
- 'Август',
1554
- 'Сентябрь',
1555
- 'Октябрь',
1556
- 'Ноябрь',
1557
- 'Декабрь',
1558
- ];
1559
-
1560
- const START_YEAR = 1940;
1561
- const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
1562
-
1563
- const MONTHS_COUNT = 11;
1564
- const MONTHS_OPTIONS = months.map((key) => ({ key }));
1565
- const YEARS_OPTIONS = getYears()
1566
- .reverse()
1567
- .map((key) => ({ key: String(key) }));
1568
- const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
1569
- const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
1570
- const ref = useOutsideClick(close);
1571
- const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
1572
- const handleNextMonth = useCallback(() => {
1573
- if (selectedMonth + 1 <= MONTHS_COUNT) {
1574
- onMonthSelect(selectedMonth + 1);
1575
- }
1576
- else {
1577
- onMonthSelect(0);
1578
- onYearSelect(selectedYear + 1);
1579
- }
1580
- }, [selectedMonth]);
1581
- const handlePrevMonth = useCallback(() => {
1582
- if (selectedMonth - 1 >= 0) {
1583
- onMonthSelect(selectedMonth - 1);
1584
- }
1585
- else {
1586
- onMonthSelect(11);
1587
- onYearSelect(selectedYear - 1);
1588
- }
1589
- }, [selectedMonth]);
1590
- const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
1591
- const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
1592
- return {
1593
- handleChangeVisibleCalendar,
1594
- handleNextMonth,
1595
- handlePrevMonth,
1596
- handleSelectMonth,
1597
- handleSelectYear,
1598
- monthsOptions: MONTHS_OPTIONS,
1599
- yearsOptions: YEARS_OPTIONS,
1600
- ref,
1681
+ const handleSubmitIndividual = (formState, onSubmit) => {
1682
+ const feedbackValidator = objectValidator({
1683
+ ...feedbackValidatorDefaultObject,
1684
+ addressBranch: defaultValidator,
1685
+ });
1686
+ const { region, phone, secondaryPhone } = formState;
1687
+ const submitData = {
1688
+ ...formState,
1689
+ typeForm: formState.typeForm.key,
1690
+ addressBranch: formState.addressBranch?.text || '',
1691
+ feedbackMethod: formState.feedbackMethod.text,
1692
+ regionBranch: region?.text,
1693
+ phoneNumber: phone.replace(/[^+\d]/g, ''),
1694
+ secondaryPhoneNumber: secondaryPhone,
1601
1695
  };
1696
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1602
1697
  };
1603
-
1604
- const ICON_PROPS = {
1605
- name: 'ArrowUpIcon',
1606
- iconVersion: 'black',
1607
- width: '24',
1608
- height: '24',
1609
- };
1610
- const SELECT_PROPS = {
1611
- className: 'min-w-32',
1612
- iconVersion: 'black',
1613
- isBorder: false,
1698
+ const handleSubmitLegal = (formState, onSubmit) => {
1699
+ const feedbackValidator = objectValidator({
1700
+ ...feedbackValidatorDefaultObject,
1701
+ addressBranch: defaultValidator,
1702
+ inn: innValidator,
1703
+ });
1704
+ const { secondaryPhone, email } = formState;
1705
+ const submitData = {
1706
+ ...formState,
1707
+ typeForm: formState.typeForm.key,
1708
+ region: formState.region?.text,
1709
+ addressBranch: formState.addressBranch?.text || '',
1710
+ feedbackMethod: formState.feedbackMethod.text,
1711
+ phone: formState.phone.replace(/[^+\d]/g, ''),
1712
+ secondaryPhoneNumber: secondaryPhone,
1713
+ mail: email,
1714
+ };
1715
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
1614
1716
  };
1615
- const formStyle = 'flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer ' +
1616
- 'hover:border-black active:border-black focus:border-black';
1617
- const DatePicker = JSX(({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
1618
- const [showCalendar, { setValue }] = useBool(false);
1619
- const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
1620
- const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
1621
- const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
1622
- onYearSelect: setSelectedYear,
1623
- onMonthSelect: setSelectedMonth,
1624
- onShowCalendar: setValue,
1625
- selectedYear,
1626
- selectedMonth,
1627
- showCalendar,
1717
+ const handleSubmitQuestion = (formState, onSubmit) => {
1718
+ const feedbackValidator = objectValidator({
1719
+ ...feedbackValidatorDefaultObject,
1720
+ birthday: defaultValidator,
1628
1721
  });
1629
- 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] }));
1630
- });
1631
- 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" })] }));
1632
-
1633
- 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)] })));
1634
-
1635
- 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) })] }));
1722
+ const { region, phone } = formState;
1723
+ const submitData = {
1724
+ ...formState,
1725
+ typeForm: formState.typeForm.key,
1726
+ feedbackMethod: formState.feedbackMethod.text,
1727
+ regionBranch: region?.text,
1728
+ phoneNumber: phone.replace(/[^+\d]/g, ''),
1729
+ };
1730
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1731
+ };
1636
1732
 
1637
1733
  const initialFormState$2 = {
1638
1734
  typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
@@ -1647,32 +1743,18 @@
1647
1743
  comment: '',
1648
1744
  consentDataProcessing: false,
1649
1745
  };
1650
- const feedbackValidator = objectValidator({
1651
- typeForm: defaultValidator,
1652
- region: defaultValidator,
1653
- department: defaultValidator,
1654
- name: nameValidator,
1655
- birthday: defaultValidator,
1656
- feedbackMethod: defaultValidator,
1657
- phone: phoneValidator,
1658
- email: defaultValidator,
1659
- consentDataProcessing: consentDataProcessingValidator,
1660
- inn: innValidator,
1661
- });
1662
1746
  const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
1663
- const handleSubmit = useCallback((formState) => {
1664
- const { typeForm, region, department, phone, email, inn, fullName, feedbackMethod, ...usedFields } = formState;
1665
- const submitData = {
1666
- ...usedFields,
1667
- typeForm: typeForm.key,
1668
- department: department?.text || '',
1669
- feedbackMethod: feedbackMethod.text,
1670
- [isLegalEntity ? 'region' : 'regionBranch']: region?.text,
1671
- [isLegalEntity ? 'phone' : 'phoneNumber']: phone.replace(/[^+\d]/g, ''),
1672
- [isLegalEntity ? 'mail' : 'email']: email,
1673
- ...(isLegalEntity ? { inn, fullName } : {}),
1674
- };
1675
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, isLegalEntity);
1747
+ const handleSubmit = useCallback((feedbackFormState) => {
1748
+ const isLegal = getLegalEntity(feedbackFormState.typeForm.key, feedbackFormState.serviceDirection?.key);
1749
+ if (isLegal) {
1750
+ handleSubmitLegal(feedbackFormState, onSubmit);
1751
+ }
1752
+ else if (feedbackFormState.typeForm.key === 'FEEDBACK') {
1753
+ handleSubmitQuestion(feedbackFormState, onSubmit);
1754
+ }
1755
+ else {
1756
+ handleSubmitIndividual(feedbackFormState, onSubmit);
1757
+ }
1676
1758
  }, [onSubmit]);
1677
1759
  const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
1678
1760
  const branch = useGetRegions();
@@ -1682,7 +1764,7 @@
1682
1764
  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 = '' }) => ({
1683
1765
  key: branchCode,
1684
1766
  text: address,
1685
- })), ...withValidator(field('department'), 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('secondaryPhoneNumber') }), 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)] }) }) }));
1767
+ })), ...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)] }) }) }));
1686
1768
  });
1687
1769
  const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1688
1770
 
@@ -1818,6 +1900,7 @@
1818
1900
  ApplicationFormGrantSupport,
1819
1901
  ApplicationFormIndividuals,
1820
1902
  ApplicationFormFeedback,
1903
+ ApplicationFormAntiFraud,
1821
1904
  };
1822
1905
 
1823
1906
  const ResponseNotification = JSX(({ responseType }) => {
@@ -1831,7 +1914,7 @@
1831
1914
  const ApplicationForm = JSX((props) => {
1832
1915
  const { className, formBlock, ...rest } = props;
1833
1916
  const [responseType, setResponseType] = useState('');
1834
- const handleSubmit = useCallback(async (data, isIndividualType) => {
1917
+ const handleSubmit = useCallback(async (data, isIndividualType = false) => {
1835
1918
  const status = (await API.send(data, isIndividualType)) ? 'OK' : 'Fail';
1836
1919
  setResponseType(status);
1837
1920
  return status;
@@ -5521,7 +5604,7 @@
5521
5604
 
5522
5605
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
5523
5606
 
5524
- const packageVersion = "0.14.134";
5607
+ const packageVersion = "0.14.135";
5525
5608
 
5526
5609
  exports.Blocks = Blocks;
5527
5610
  exports.ContentPage = ContentPage;