@redneckz/wildless-cms-uni-blocks 0.14.568 → 0.14.570

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 (123) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +86 -63
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  5. package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  6. package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  7. package/bundle/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  8. package/bundle/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  9. package/bundle/ui-kit/FormField/constants.d.ts +0 -1
  10. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  11. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
  12. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  13. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  14. package/dist/ui-kit/Checkbox/CheckboxGroup.js +2 -1
  15. package/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
  16. package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  17. package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  18. package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js +26 -0
  19. package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
  20. package/dist/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  21. package/dist/ui-kit/FormField/Fields/ProductField.js +3 -3
  22. package/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  23. package/dist/ui-kit/FormField/constants.d.ts +0 -1
  24. package/dist/ui-kit/FormField/constants.js +1 -9
  25. package/dist/ui-kit/FormField/constants.js.map +1 -1
  26. package/dist/ui-kit/FormField/getField.js +6 -1
  27. package/dist/ui-kit/FormField/getField.js.map +1 -1
  28. package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  29. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  30. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  31. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
  32. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  33. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  34. package/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +1 -0
  35. package/lib/ui-kit/Checkbox/CheckboxGroup.js +2 -1
  36. package/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
  37. package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  38. package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  39. package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js +24 -0
  40. package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
  41. package/lib/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  42. package/lib/ui-kit/FormField/Fields/ProductField.js +3 -3
  43. package/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  44. package/lib/ui-kit/FormField/constants.d.ts +0 -1
  45. package/lib/ui-kit/FormField/constants.js +0 -8
  46. package/lib/ui-kit/FormField/constants.js.map +1 -1
  47. package/lib/ui-kit/FormField/getField.js +6 -1
  48. package/lib/ui-kit/FormField/getField.js.map +1 -1
  49. package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
  50. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  51. package/mobile/bundle/bundle.umd.js +86 -63
  52. package/mobile/bundle/bundle.umd.min.js +1 -1
  53. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  54. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  55. package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  56. package/mobile/bundle/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  57. package/mobile/bundle/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  58. package/mobile/bundle/ui-kit/FormField/constants.d.ts +0 -1
  59. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  60. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
  61. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  62. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  63. package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js +2 -1
  64. package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
  65. package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  66. package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  67. package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js +26 -0
  68. package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
  69. package/mobile/dist/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  70. package/mobile/dist/ui-kit/FormField/Fields/ProductField.js +3 -3
  71. package/mobile/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  72. package/mobile/dist/ui-kit/FormField/constants.d.ts +0 -1
  73. package/mobile/dist/ui-kit/FormField/constants.js +1 -9
  74. package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
  75. package/mobile/dist/ui-kit/FormField/getField.js +6 -1
  76. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  77. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  78. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  79. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
  80. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
  81. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  82. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
  83. package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js +2 -1
  84. package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
  85. package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
  86. package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
  87. package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js +24 -0
  88. package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
  89. package/mobile/lib/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
  90. package/mobile/lib/ui-kit/FormField/Fields/ProductField.js +3 -3
  91. package/mobile/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  92. package/mobile/lib/ui-kit/FormField/constants.d.ts +0 -1
  93. package/mobile/lib/ui-kit/FormField/constants.js +0 -8
  94. package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
  95. package/mobile/lib/ui-kit/FormField/getField.js +6 -1
  96. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  97. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
  98. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  99. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
  100. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +6 -856
  101. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -9
  102. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -1
  103. package/mobile/src/ui-kit/Checkbox/CheckboxGroup.tsx +7 -1
  104. package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +1 -1
  105. package/mobile/src/ui-kit/FormField/Fields/ConsentToAllDocsField.tsx +29 -0
  106. package/mobile/src/ui-kit/FormField/Fields/ProductField.tsx +13 -4
  107. package/mobile/src/ui-kit/FormField/constants.tsx +0 -9
  108. package/mobile/src/ui-kit/FormField/getField.tsx +7 -1
  109. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
  110. package/package.json +1 -1
  111. package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
  112. package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +6 -856
  113. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +8 -10
  114. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +7 -10
  115. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -9
  116. package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -1
  117. package/src/ui-kit/Checkbox/CheckboxGroup.tsx +7 -1
  118. package/src/ui-kit/Checkbox/CheckboxProps.ts +1 -1
  119. package/src/ui-kit/FormField/Fields/ConsentToAllDocsField.tsx +29 -0
  120. package/src/ui-kit/FormField/Fields/ProductField.tsx +13 -4
  121. package/src/ui-kit/FormField/constants.tsx +0 -9
  122. package/src/ui-kit/FormField/getField.tsx +7 -1
  123. package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
@@ -1131,14 +1131,6 @@
1131
1131
  { key: 'phone', text: 'Телефонный звонок' },
1132
1132
  { key: 'email', text: 'Электронное сообщение' },
1133
1133
  ];
1134
- const PRODUCT_TYPE = [
1135
- { key: 'Карта дебетовая', text: 'Карта дебетовая' },
1136
- { key: 'Карта кредитная', text: 'Карта кредитная' },
1137
- { key: 'Потребительский кредит', text: 'Потребительский кредит' },
1138
- { key: 'Ипотечный кредит', text: 'Ипотечный кредит' },
1139
- { key: 'Вклад', text: 'Вклад' },
1140
- { key: 'Накопительный счет', text: 'Накопительный счет' },
1141
- ];
1142
1134
  const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
1143
1135
 
1144
1136
  const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
@@ -1502,6 +1494,7 @@
1502
1494
  localities: defaultValidator,
1503
1495
  consentDataProcessing: agreementValidator,
1504
1496
  annualRevenue: defaultValidator,
1497
+ consentToAllDocs: agreementValidator,
1505
1498
  };
1506
1499
  const getObjectValidator = (inputs) => {
1507
1500
  const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
@@ -1707,6 +1700,78 @@
1707
1700
 
1708
1701
  const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...getValidation(field('comment'), validatorObj.comment, input?.required), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
1709
1702
 
1703
+ const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
1704
+ const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
1705
+ const onToggle = useCallback(() => {
1706
+ setIsUnfolded((_) => !_);
1707
+ }, []);
1708
+ const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
1709
+ const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
1710
+ return isFoldButtonOnTop ? (jsxs("div", { className: className, role: "group", children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, role: "group", children: [sectionNode, buttonNode] }));
1711
+ });
1712
+
1713
+ function useResizeObserver(callback, deps) {
1714
+ const ref = useRef(null);
1715
+ useEffect(() => {
1716
+ const element = ref?.current;
1717
+ if (!element) {
1718
+ return undefined;
1719
+ }
1720
+ const observer = new ResizeObserver((entries) => {
1721
+ callback(element, entries[0]);
1722
+ });
1723
+ observer.observe(element);
1724
+ return () => {
1725
+ observer.disconnect();
1726
+ };
1727
+ }, [callback, ...deps]);
1728
+ return ref;
1729
+ }
1730
+
1731
+ const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
1732
+ const containerRef = useRef(null);
1733
+ const childrenWrapperRef = useResizeObserver((childrenWrapperEl) => {
1734
+ if (containerRef.current) {
1735
+ containerRef.current.style.maxHeight = isUnfolded
1736
+ ? `${childrenWrapperEl.scrollHeight}px`
1737
+ : '';
1738
+ }
1739
+ }, [isUnfolded]);
1740
+ return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} `, children: jsx("div", { className: className, ref: childrenWrapperRef, children: children }) }));
1741
+ });
1742
+
1743
+ const CheckboxGroup = JSX(({ className, items = [], ...props }) => {
1744
+ const isChecked = items.every((_) => _?.value);
1745
+ const handleGeneralToggle = (value) => {
1746
+ for (const item of items) {
1747
+ item?.onChange && item.onChange(value);
1748
+ }
1749
+ };
1750
+ return (jsx("div", { className: style('w-full', className), children: jsx(Foldable, { isFoldButtonOnTop: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col gap-lg pl-2xl py-xs", children: items.map(Checkbox) })), renderFoldButton: renderGeneralCheckbox(jsx(CheckboxWithError, { required: true, value: isChecked, onChange: handleGeneralToggle, ...props })) }) }));
1751
+ });
1752
+ const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-center", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "p-m", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
1753
+
1754
+ const items = [
1755
+ {
1756
+ field: 'processPersonalDataLeadFlg',
1757
+ text: 'Согласие на обработку персональных данных',
1758
+ required: true,
1759
+ },
1760
+ {
1761
+ field: 'consentOtherFlg',
1762
+ text: 'Согласие на информирование о продуктах и услугах Банка',
1763
+ required: true,
1764
+ },
1765
+ {
1766
+ field: 'consentProviderFlg',
1767
+ text: 'Согласие об использовании простой электронной подписи',
1768
+ required: true,
1769
+ },
1770
+ { field: 'consentPfrFlg', text: 'Согласие на запрос в ПФР Открыты по субботам', required: true },
1771
+ { field: 'consentPhotoFlg', text: 'Прочие согласия (согласие на фотографирование)' },
1772
+ ];
1773
+ const ConsentToAllDocsField = JSX(({ field }) => (jsx(CheckboxGroup, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0432\u0441\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B", items: items.map((_) => ({ ...field(_.field), text: _.text, required: _.required })) })));
1774
+
1710
1775
  const FeedbackMethodField = JSX(({ field }) => (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'), validatorObj.feedbackMethod) })));
1711
1776
 
1712
1777
  const FeedbackTypeField = JSX(({ field }) => {
@@ -1785,7 +1850,8 @@
1785
1850
 
1786
1851
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1787
1852
 
1788
- const ProductField = JSX(({ field }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: PRODUCT_TYPE, ...withValidator(field('product'), validatorObj.product) })));
1853
+ const ProductField = UniBlock(({ field, source }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: arrayToOptions(source?.productList), ...withValidator(field('product'), validatorObj.product) })));
1854
+ const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
1789
1855
 
1790
1856
  const RegionField = JSX(({ field, input, url }) => {
1791
1857
  const regions = useRegions(url);
@@ -1844,6 +1910,9 @@
1844
1910
  return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
1845
1911
  }
1846
1912
 
1913
+ const PRODUCT_REF = {
1914
+ $ref: '/wcms-resources/outservice-productlist.json',
1915
+ };
1847
1916
  const getField =
1848
1917
  // eslint-disable-next-line max-lines-per-function
1849
1918
  (field, typeForm) => (input, i) => {
@@ -1862,7 +1931,7 @@
1862
1931
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
1863
1932
  birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
1864
1933
  desiredMeetingDate: (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, required) })),
1865
- product: jsx(ProductField, { field: field }),
1934
+ product: jsx(ProductField, { field: field, source: PRODUCT_REF }),
1866
1935
  localities: jsx(LocalitiesField, { field: field, input: input }),
1867
1936
  isClient: jsx(IsClientField, { field: field }),
1868
1937
  consentToReceiveMaterials: (jsx(CheckboxWithError, { ...field('consentToReceiveMaterials'), text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435" })),
@@ -1882,6 +1951,7 @@
1882
1951
  bankEmpolee: (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') })),
1883
1952
  applicationDate: (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') })),
1884
1953
  secondaryPhone: jsx(SecondaryPhoneField, { field: field }),
1954
+ сonsentToAllDocs: jsx(ConsentToAllDocsField, { field: field }),
1885
1955
  };
1886
1956
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(i))) : null;
1887
1957
  };
@@ -2031,12 +2101,12 @@
2031
2101
  return { ...formState, typeForm: { key: typeForm, text: '' } };
2032
2102
  };
2033
2103
 
2034
- const Footnote$1 = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "!text-left text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
2104
+ const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "!text-left text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
2035
2105
 
2036
2106
  const renderSubmitButton$1 = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
2037
2107
 
2038
2108
  const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
2039
- const renderAgreementSubmit$1 = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote$1, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote$1, { text: agreementText, link: link })), renderSubmitButton$1(button)] }));
2109
+ const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton$1(button)] }));
2040
2110
 
2041
2111
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [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" }), jsxs("div", { className: "flex sm:justify-center 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": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 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": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
2042
2112
 
@@ -2074,7 +2144,7 @@
2074
2144
  reset();
2075
2145
  }
2076
2146
  }, [responseType]);
2077
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit$1(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
2147
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
2078
2148
  });
2079
2149
  const getFilteredInputs = (inputs, data) => inputs
2080
2150
  .filter((_) => _)
@@ -2131,18 +2201,12 @@
2131
2201
  return { ...formState, typeForm: { key: typeForm, text: '' } };
2132
2202
  };
2133
2203
 
2134
- const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "!text-left text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
2135
-
2136
2204
  const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
2137
2205
 
2138
- const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), consentDataProcessing
2139
- ? renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)
2140
- : null] }), renderSubmitButton(button)] }));
2141
-
2142
2206
  const API = LeadServiceAPI();
2143
2207
  const ApplicationLeadForm = JSX(
2144
2208
  // eslint-disable-next-line max-lines-per-function
2145
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, ...rest }) => {
2209
+ ({ className, title, typeForm = '', sections = [], button, endpoint, ...rest }) => {
2146
2210
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
2147
2211
  const initialFormState = getInitialFormState(inputs, typeForm);
2148
2212
  const [responseType, setResponseType] = useState('');
@@ -2161,14 +2225,13 @@
2161
2225
  return status;
2162
2226
  }, []);
2163
2227
  const [, { field, onSubmit, reset }] = useForm(initialFormState, { onSubmit: handleSubmit });
2164
- const fieldName = getConsentDataProcessing(inputs)?.name;
2165
2228
  useEffect(() => {
2166
2229
  if (responseType === 'OK') {
2167
2230
  setResponseType('');
2168
2231
  reset();
2169
2232
  }
2170
2233
  }, [responseType]);
2171
- return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }) }));
2234
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderSubmitButton(button)] }) }));
2172
2235
  });
2173
2236
 
2174
2237
  const NotFound = JSX(({ title, description }) => {
@@ -2462,46 +2525,6 @@
2462
2525
  return (jsx(DefaultFoldButton, { icon: icons[Number(isUnfolded)], label: labels[Number(isUnfolded)], onClick: onToggle }));
2463
2526
  };
2464
2527
 
2465
- const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
2466
- const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
2467
- const onToggle = useCallback(() => {
2468
- setIsUnfolded((_) => !_);
2469
- }, []);
2470
- const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
2471
- const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
2472
- return isFoldButtonOnTop ? (jsxs("div", { className: className, role: "group", children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, role: "group", children: [sectionNode, buttonNode] }));
2473
- });
2474
-
2475
- function useResizeObserver(callback, deps) {
2476
- const ref = useRef(null);
2477
- useEffect(() => {
2478
- const element = ref?.current;
2479
- if (!element) {
2480
- return undefined;
2481
- }
2482
- const observer = new ResizeObserver((entries) => {
2483
- callback(element, entries[0]);
2484
- });
2485
- observer.observe(element);
2486
- return () => {
2487
- observer.disconnect();
2488
- };
2489
- }, [callback, ...deps]);
2490
- return ref;
2491
- }
2492
-
2493
- const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
2494
- const containerRef = useRef(null);
2495
- const childrenWrapperRef = useResizeObserver((childrenWrapperEl) => {
2496
- if (containerRef.current) {
2497
- containerRef.current.style.maxHeight = isUnfolded
2498
- ? `${childrenWrapperEl.scrollHeight}px`
2499
- : '';
2500
- }
2501
- }, [isUnfolded]);
2502
- return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} `, children: jsx("div", { className: className, ref: childrenWrapperRef, children: children }) }));
2503
- });
2504
-
2505
2528
  const ICONS$1 = ['ArrowDownIcon', 'ArrowUpIcon'];
2506
2529
  const resultsGridStyle = 'space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs';
2507
2530
  const renderGridBlocks = ({ topItemsCount = 0, label = '', block, blocksToRender = [], ...rest }) => {
@@ -6660,7 +6683,7 @@
6660
6683
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6661
6684
  });
6662
6685
 
6663
- const packageVersion = "0.14.567";
6686
+ const packageVersion = "0.14.569";
6664
6687
 
6665
6688
  exports.Blocks = Blocks;
6666
6689
  exports.ContentPage = ContentPage;