@redneckz/wildless-cms-uni-blocks 0.14.134 → 0.14.135

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 (147) hide show
  1. package/bundle/bundle.umd.js +51 -41
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  4. package/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  5. package/bundle/components/ApplicationForm/InputControl.d.ts +2 -9
  6. package/bundle/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  7. package/bundle/components/ApplicationForm/renderTextarea.d.ts +9 -1
  8. package/bundle/ui-kit/Input/InputProps.d.ts +2 -1
  9. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  10. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +21 -19
  11. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  12. package/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  13. package/dist/components/ApplicationForm/ApplicationFormIndividuals.js +9 -9
  14. package/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  15. package/dist/components/ApplicationForm/ApplicationFormWed.js +5 -1
  16. package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  17. package/dist/components/ApplicationForm/InputControl.d.ts +2 -9
  18. package/dist/components/ApplicationForm/InputControl.js +1 -1
  19. package/dist/components/ApplicationForm/InputControl.js.map +1 -1
  20. package/dist/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  21. package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  22. package/dist/components/ApplicationForm/feedbackTypes.js +1 -1
  23. package/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  24. package/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  25. package/dist/components/ApplicationForm/renderIndividualsFields.js +1 -1
  26. package/dist/components/ApplicationForm/renderIndividualsFields.js.map +1 -1
  27. package/dist/components/ApplicationForm/renderTextarea.d.ts +9 -1
  28. package/dist/components/ApplicationForm/renderTextarea.js +2 -1
  29. package/dist/components/ApplicationForm/renderTextarea.js.map +1 -1
  30. package/dist/components/ApplicationForm/renderUserData.js +1 -1
  31. package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  32. package/dist/ui-kit/Input/Input.js +8 -5
  33. package/dist/ui-kit/Input/Input.js.map +1 -1
  34. package/dist/ui-kit/Input/InputProps.d.ts +2 -1
  35. package/lib/common.css +1 -1
  36. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  37. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +21 -19
  38. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  39. package/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  40. package/lib/components/ApplicationForm/ApplicationFormIndividuals.js +9 -9
  41. package/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  42. package/lib/components/ApplicationForm/ApplicationFormWed.js +5 -1
  43. package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  44. package/lib/components/ApplicationForm/InputControl.d.ts +2 -9
  45. package/lib/components/ApplicationForm/InputControl.js +1 -1
  46. package/lib/components/ApplicationForm/InputControl.js.map +1 -1
  47. package/lib/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  48. package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  49. package/lib/components/ApplicationForm/feedbackTypes.js +1 -1
  50. package/lib/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  51. package/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  52. package/lib/components/ApplicationForm/renderIndividualsFields.js +1 -1
  53. package/lib/components/ApplicationForm/renderIndividualsFields.js.map +1 -1
  54. package/lib/components/ApplicationForm/renderTextarea.d.ts +9 -1
  55. package/lib/components/ApplicationForm/renderTextarea.js +2 -1
  56. package/lib/components/ApplicationForm/renderTextarea.js.map +1 -1
  57. package/lib/components/ApplicationForm/renderUserData.js +1 -1
  58. package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  59. package/lib/ui-kit/Input/Input.js +8 -5
  60. package/lib/ui-kit/Input/Input.js.map +1 -1
  61. package/lib/ui-kit/Input/InputProps.d.ts +2 -1
  62. package/mobile/bundle/bundle.umd.js +51 -41
  63. package/mobile/bundle/bundle.umd.min.js +1 -1
  64. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  65. package/mobile/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  66. package/mobile/bundle/components/ApplicationForm/InputControl.d.ts +2 -9
  67. package/mobile/bundle/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  68. package/mobile/bundle/components/ApplicationForm/renderTextarea.d.ts +9 -1
  69. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +2 -1
  70. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  71. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +21 -19
  72. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  73. package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  74. package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js +9 -9
  75. package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  76. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js +5 -1
  77. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  78. package/mobile/dist/components/ApplicationForm/InputControl.d.ts +2 -9
  79. package/mobile/dist/components/ApplicationForm/InputControl.js +1 -1
  80. package/mobile/dist/components/ApplicationForm/InputControl.js.map +1 -1
  81. package/mobile/dist/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  82. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  83. package/mobile/dist/components/ApplicationForm/feedbackTypes.js +1 -1
  84. package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  85. package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  86. package/mobile/dist/components/ApplicationForm/renderIndividualsFields.js +1 -1
  87. package/mobile/dist/components/ApplicationForm/renderIndividualsFields.js.map +1 -1
  88. package/mobile/dist/components/ApplicationForm/renderTextarea.d.ts +9 -1
  89. package/mobile/dist/components/ApplicationForm/renderTextarea.js +2 -1
  90. package/mobile/dist/components/ApplicationForm/renderTextarea.js.map +1 -1
  91. package/mobile/dist/components/ApplicationForm/renderUserData.js +1 -1
  92. package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
  93. package/mobile/dist/ui-kit/Input/Input.js +8 -5
  94. package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
  95. package/mobile/dist/ui-kit/Input/InputProps.d.ts +2 -1
  96. package/mobile/lib/common.css +1 -1
  97. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +4 -5
  98. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +21 -19
  99. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  100. package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +2 -2
  101. package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js +9 -9
  102. package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
  103. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js +5 -1
  104. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  105. package/mobile/lib/components/ApplicationForm/InputControl.d.ts +2 -9
  106. package/mobile/lib/components/ApplicationForm/InputControl.js +1 -1
  107. package/mobile/lib/components/ApplicationForm/InputControl.js.map +1 -1
  108. package/mobile/lib/components/ApplicationForm/PhoneInputControl.d.ts +2 -2
  109. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  110. package/mobile/lib/components/ApplicationForm/feedbackTypes.js +1 -1
  111. package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  112. package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  113. package/mobile/lib/components/ApplicationForm/renderIndividualsFields.js +1 -1
  114. package/mobile/lib/components/ApplicationForm/renderIndividualsFields.js.map +1 -1
  115. package/mobile/lib/components/ApplicationForm/renderTextarea.d.ts +9 -1
  116. package/mobile/lib/components/ApplicationForm/renderTextarea.js +2 -1
  117. package/mobile/lib/components/ApplicationForm/renderTextarea.js.map +1 -1
  118. package/mobile/lib/components/ApplicationForm/renderUserData.js +1 -1
  119. package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
  120. package/mobile/lib/ui-kit/Input/Input.js +8 -5
  121. package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
  122. package/mobile/lib/ui-kit/Input/InputProps.d.ts +2 -1
  123. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +66 -54
  124. package/mobile/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +13 -12
  125. package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +5 -4
  126. package/mobile/src/components/ApplicationForm/InputControl.tsx +5 -11
  127. package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +2 -2
  128. package/mobile/src/components/ApplicationForm/feedbackTypes.ts +1 -1
  129. package/mobile/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +1 -1
  130. package/mobile/src/components/ApplicationForm/renderIndividualsFields.tsx +2 -2
  131. package/mobile/src/components/ApplicationForm/renderTextarea.tsx +35 -23
  132. package/mobile/src/components/ApplicationForm/renderUserData.tsx +4 -4
  133. package/mobile/src/ui-kit/Input/Input.tsx +45 -31
  134. package/mobile/src/ui-kit/Input/InputProps.ts +2 -1
  135. package/package.json +1 -1
  136. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +66 -54
  137. package/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +13 -12
  138. package/src/components/ApplicationForm/ApplicationFormWed.tsx +5 -4
  139. package/src/components/ApplicationForm/InputControl.tsx +5 -11
  140. package/src/components/ApplicationForm/PhoneInputControl.tsx +2 -2
  141. package/src/components/ApplicationForm/feedbackTypes.ts +1 -1
  142. package/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +1 -1
  143. package/src/components/ApplicationForm/renderIndividualsFields.tsx +2 -2
  144. package/src/components/ApplicationForm/renderTextarea.tsx +35 -23
  145. package/src/components/ApplicationForm/renderUserData.tsx +4 -4
  146. package/src/ui-kit/Input/Input.tsx +45 -31
  147. package/src/ui-kit/Input/InputProps.ts +2 -1
@@ -981,7 +981,7 @@
981
981
  const ApplicationFieldsetLayout = JSX(({ title, firstChildren, secondChildren }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none", children: [title ? (jsx("legend", { className: "w-full", children: jsx(Heading, { title: title, headingType: "h6", className: "@xl:text-center" }) })) : null, firstChildren, secondChildren] })));
982
982
  const formChildrenStyle = '@xl:w-1/2 space-y-s';
983
983
 
984
- const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, }) => {
984
+ const Input = JSX(({ key, className = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, isTextarea = false, }) => {
985
985
  const inputRef = useRef(null);
986
986
  const handleChange = useCallback((e) => {
987
987
  onChange && onChange(e.target?.value || '');
@@ -991,16 +991,19 @@
991
991
  inputRef.current?.focus();
992
992
  }
993
993
  }, [autoFocus, inputRef]);
994
+ const defaultStyle = 'w-full border rounded-md text-primary-text outline-none p-m';
994
995
  const paddingStyle = children ? 'pr-3xl' : '';
995
- const validStyle = valid
996
- ? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
997
- : 'border-error';
998
- return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { ref: inputRef, className: style('w-full h-14 border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
996
+ const validStyle = getValidStyle(valid);
997
+ return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? renderLabel$1(label) : null, isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle, validStyle), id: style('textarea', id), name: name || id, placeholder: placeholder, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur }, key)) : (jsx("input", { type: type, className: style('h-14', defaultStyle, paddingStyle, validStyle), ref: inputRef, id: id, name: name || id, placeholder: placeholder, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key))] }), children] }));
999
998
  });
999
+ const renderLabel$1 = (label) => (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) }));
1000
+ const getValidStyle = (valid) => valid
1001
+ ? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
1002
+ : 'border-error';
1000
1003
 
1001
1004
  const renderErrorText = (error) => (jsx("div", { className: "h-4", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
1002
1005
 
1003
- const InputControl = JSX(({ className, label, value = '', error, onChange, onBlur }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), renderErrorText(error)] })));
1006
+ const InputControl = JSX(({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: placeholder }), renderErrorText(error)] })));
1004
1007
 
1005
1008
  const isPlaceholder = (_) => _ === '_';
1006
1009
  const isDigit = (_) => /\d/.test(_);
@@ -1424,7 +1427,7 @@
1424
1427
  },
1425
1428
  {
1426
1429
  text: 'Качество обслуживания',
1427
- key: 'FEEDBACK_QC',
1430
+ key: 'FEEDBACK_QS',
1428
1431
  },
1429
1432
  ];
1430
1433
  const FEEDBACK_METHOD = [
@@ -1464,10 +1467,7 @@
1464
1467
  });
1465
1468
  const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1466
1469
 
1467
- const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex 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)] }));
1468
-
1469
- const activeTextareaStyles = 'hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text';
1470
- const renderTextarea = (textField, text, placeholder = '') => (jsxs("label", { className: "space-y-xs", htmlFor: "textarea", children: [text ? (jsx("div", { children: jsx(Text, { size: "text-m", font: "font-light", children: text }) })) : null, jsx("textarea", { id: "textarea", placeholder: placeholder, className: style('block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray', activeTextareaStyles), value: textField.value, onInput: ((e) => textField.onChange && textField.onChange(e.target?.value || '')) })] }));
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
1471
 
1472
1472
  const formatDate = (date, toTimeStamp = false) => {
1473
1473
  if (typeof date === 'string') {
@@ -1624,7 +1624,7 @@
1624
1624
 
1625
1625
  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)] })));
1626
1626
 
1627
- 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)", ...withValidator(field('middleName'), nameValidator) }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F*", ...withValidator(field('date'), defaultValidator) })] }));
1627
+ 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) })] }));
1628
1628
 
1629
1629
  const initialFormState$2 = {
1630
1630
  typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
@@ -1632,12 +1632,10 @@
1632
1632
  surname: '',
1633
1633
  name: '',
1634
1634
  middleName: '',
1635
- date: undefined,
1635
+ birthday: undefined,
1636
1636
  feedbackMethod: { key: 'Телефонный звонок' },
1637
1637
  phone: '',
1638
- phoneAdditional: '',
1639
- mail: '',
1640
- text: '',
1638
+ email: '',
1641
1639
  comment: '',
1642
1640
  consentDataProcessing: false,
1643
1641
  };
@@ -1646,34 +1644,39 @@
1646
1644
  region: defaultValidator,
1647
1645
  department: defaultValidator,
1648
1646
  name: nameValidator,
1649
- date: defaultValidator,
1647
+ birthday: defaultValidator,
1650
1648
  feedbackMethod: defaultValidator,
1651
1649
  phone: phoneValidator,
1652
- mail: defaultValidator,
1650
+ email: defaultValidator,
1653
1651
  consentDataProcessing: consentDataProcessingValidator,
1654
1652
  inn: innValidator,
1655
1653
  });
1656
1654
  const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
1657
1655
  const handleSubmit = useCallback((formState) => {
1656
+ const { typeForm, region, department, phone, email, inn, fullName, feedbackMethod, ...usedFields } = formState;
1658
1657
  const submitData = {
1659
- ...formState,
1660
- typeForm: formState.typeForm.key,
1661
- region: formState.region?.text || '',
1662
- department: formState.department?.text || '',
1663
- phone: formState.phone.replace(/[^+\d]/g, ''),
1658
+ ...usedFields,
1659
+ typeForm: typeForm.key,
1660
+ department: department?.text || '',
1661
+ feedbackMethod: feedbackMethod.text,
1662
+ [isLegalEntity ? 'region' : 'regionBranch']: region?.text,
1663
+ [isLegalEntity ? 'phone' : 'phoneNumber']: phone.replace(/[^+\d]/g, ''),
1664
+ [isLegalEntity ? 'mail' : 'email']: email,
1665
+ ...(isLegalEntity ? { inn, fullName } : {}),
1664
1666
  };
1665
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1667
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, isLegalEntity);
1666
1668
  }, [onSubmit]);
1667
1669
  const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
1668
- const regions = useGetRegions();
1669
- const branches = useBranches(formState.region?.key).filter((branch) => branch?.address);
1670
- const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QC';
1671
- const isLegalEntity = isQualityService && field('serviceDirection').value?.key === 'Юридическое лицо / ИП';
1672
- 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: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }), jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
1670
+ const branch = useGetRegions();
1671
+ const regions = useBranches(formState?.region?.key).filter((region) => region?.address);
1672
+ const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
1673
+ const isLegalEntity = getLegalEntity(field('typeForm').value?.key, field('serviceDirection').value?.key);
1674
+ 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 = '' }) => ({
1673
1675
  key: branchCode,
1674
1676
  text: address,
1675
- })), ...withValidator(field('department'), defaultValidator) }), 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", ...withValidator(field('fullName'), defaultValidator) })] })) : 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.map(({ key: key = '' }) => ({ key, text: key })), ...withValidator(field('feedbackMethod'), defaultValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(PhoneInputControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phoneAdditional'), phoneValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), 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", ...withValidator(field('bankEmpolee'), defaultValidator) }), 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", ...withValidator(field('applicationDate'), defaultValidator) })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })), renderTextarea(field('text'), 'Ваше сообщение*'), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1677
+ })), ...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)] }) }) }));
1676
1678
  });
1679
+ const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1677
1680
 
1678
1681
  const ApplicationFormGrantSupport = JSX((props) => {
1679
1682
  const { button, sourceBookDir } = props;
@@ -1692,8 +1695,8 @@
1692
1695
  name: '',
1693
1696
  middleName: '',
1694
1697
  phone: '',
1695
- mail: '',
1696
- date: undefined,
1698
+ email: '',
1699
+ birthday: undefined,
1697
1700
  consentDataProcessing: true,
1698
1701
  };
1699
1702
  const individualsValidator = objectValidator({
@@ -1701,28 +1704,28 @@
1701
1704
  name: nameValidator,
1702
1705
  middleName: nameValidator,
1703
1706
  phone: phoneValidator,
1704
- mail: defaultValidator,
1705
- date: defaultValidator,
1707
+ email: defaultValidator,
1708
+ birthday: defaultValidator,
1706
1709
  });
1707
1710
  const ApplicationFormIndividuals = JSX((props) => {
1708
1711
  const { button, link, product, onSubmit } = props;
1709
1712
  const handleSubmit = useCallback((formState) => {
1710
- const { surname, name, middleName, phone, mail, date, consentDataProcessing } = formState;
1713
+ const { surname, name, middleName, phone, email, birthday, consentDataProcessing } = formState;
1711
1714
  isValidationSuccess(individualsValidator(formState)) &&
1712
1715
  onSubmit({
1713
1716
  typeForm: 'dpst',
1714
1717
  surname,
1715
1718
  name,
1716
1719
  middleName,
1717
- mail,
1720
+ email,
1718
1721
  consentDataProcessing,
1719
- phone: phone.replace(/[^+\d]/g, ''),
1720
- date: date?.toISOString().slice(0, 10) || '',
1722
+ phoneNumber: phone.replace(/[^+\d]/g, ''),
1723
+ birthday: birthday?.toISOString().slice(0, 10) || '',
1721
1724
  product: product || '',
1722
1725
  }, true);
1723
1726
  }, [onSubmit]);
1724
1727
  const [, { field, ...formProps }] = useForm(initialFormState$1, handleSubmit);
1725
- return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E", ...withValidator(field('middleName'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), secondChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F*", ...withValidator(field('date'), defaultValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] }) }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }));
1728
+ return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E", ...withValidator(field('middleName'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), secondChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F*", ...withValidator(field('birthday'), defaultValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })] }) }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }));
1726
1729
  });
1727
1730
 
1728
1731
  const renderContacts = () => (jsxs("div", { className: "flex gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] }));
@@ -1734,6 +1737,9 @@
1734
1737
  return (jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: "gap-xl grid @xl:flex @xl:items-center", children: [jsx(Radio, { name: "vedTypes", text: "\u0412\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C", value: "currencyControl", checked: value === 'currencyControl', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0440\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "documentOperations", checked: value === 'documentOperations', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u041A\u043E\u043D\u0432\u0435\u0440\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "conversionTransactions", checked: value === 'conversionTransactions', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u0418\u043D\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u0412\u042D\u0414", value: "otherIssues", checked: value === 'otherIssues', onChange: (_) => onChange && onChange(_) })] }) }));
1735
1738
  };
1736
1739
 
1740
+ const activeTextareaStyles = 'hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text';
1741
+ const renderTextarea = ({ textField, text, placeholder = '', error }) => (jsxs("div", { children: [jsxs("label", { className: "space-y-xs", htmlFor: "textarea", children: [text ? (jsx("div", { children: jsx(Text, { size: "text-m", font: "font-light", children: text }) })) : null, jsx("textarea", { id: "textarea", placeholder: placeholder, className: style('block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray', activeTextareaStyles), value: textField.value, onInput: ((e) => textField.onChange && textField.onChange(e.target?.value || '')) })] }), renderErrorText(error)] }));
1742
+
1737
1743
  const renderWedDataOrganization = ({ field, regions }) => {
1738
1744
  const isCurrencyControl = field('vedTypes').value === 'currencyControl';
1739
1745
  return (jsxs("div", { className: "space-y-s", children: [isCurrencyControl ? (jsx(SelectControl, { 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) })) : null, jsxs("div", { className: "grid @xl:grid-cols-2 @xl:gap-x-lg gap-s", children: [isCurrencyControl ? (jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })) : null, 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", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), !isCurrencyControl ? (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })) : null] })] }));
@@ -1788,7 +1794,11 @@
1788
1794
  const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
1789
1795
  const regions = useGetRegions();
1790
1796
  const textField = field('text');
1791
- return (jsxs("form", { className: "container space-y-lg", onSubmit: formProps.onSubmit, children: [renderQuestionsInterested(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "@xl:text-center" }), renderWedDataOrganization({ field, regions }), renderTextarea(textField, 'Обращение', 'Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка'), renderSubmitButton(button), jsx(Footnote, { link: link }), jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), renderContacts()] }));
1797
+ return (jsxs("form", { className: "container space-y-lg", onSubmit: formProps.onSubmit, children: [renderQuestionsInterested(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "@xl:text-center" }), renderWedDataOrganization({ field, regions }), renderTextarea({
1798
+ textField,
1799
+ text: 'Обращение',
1800
+ placeholder: 'Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка',
1801
+ }), renderSubmitButton(button), jsx(Footnote, { link: link }), jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), renderContacts()] }));
1792
1802
  });
1793
1803
 
1794
1804
  const EmbeddableForms = {
@@ -5889,7 +5899,7 @@
5889
5899
  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" }) }));
5890
5900
  }
5891
5901
 
5892
- const packageVersion = "0.14.133";
5902
+ const packageVersion = "0.14.134";
5893
5903
 
5894
5904
  exports.Blocks = Blocks;
5895
5905
  exports.ContentPage = ContentPage;