@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +86 -63
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/bundle/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/bundle/ui-kit/FormField/constants.d.ts +0 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/dist/ui-kit/Checkbox/CheckboxGroup.js +2 -1
- package/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js +26 -0
- package/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/dist/ui-kit/FormField/Fields/ProductField.js +3 -3
- package/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
- package/dist/ui-kit/FormField/constants.d.ts +0 -1
- package/dist/ui-kit/FormField/constants.js +1 -9
- package/dist/ui-kit/FormField/constants.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +6 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +1 -0
- package/lib/ui-kit/Checkbox/CheckboxGroup.js +2 -1
- package/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
- package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js +24 -0
- package/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/lib/ui-kit/FormField/Fields/ProductField.js +3 -3
- package/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
- package/lib/ui-kit/FormField/constants.d.ts +0 -1
- package/lib/ui-kit/FormField/constants.js +0 -8
- package/lib/ui-kit/FormField/constants.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +6 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +86 -63
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/mobile/bundle/ui-kit/FormField/constants.d.ts +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js +2 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js +26 -0
- package/mobile/dist/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/mobile/dist/ui-kit/FormField/Fields/ProductField.js +3 -3
- package/mobile/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/constants.d.ts +0 -1
- package/mobile/dist/ui-kit/FormField/constants.js +1 -9
- package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +6 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +3 -5
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js +2 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js +24 -0
- package/mobile/lib/ui-kit/FormField/Fields/ConsentToAllDocsField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/ProductField.d.ts +8 -1
- package/mobile/lib/ui-kit/FormField/Fields/ProductField.js +3 -3
- package/mobile/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/constants.d.ts +0 -1
- package/mobile/lib/ui-kit/FormField/constants.js +0 -8
- package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +6 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +6 -856
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -9
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -1
- package/mobile/src/ui-kit/Checkbox/CheckboxGroup.tsx +7 -1
- package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +1 -1
- package/mobile/src/ui-kit/FormField/Fields/ConsentToAllDocsField.tsx +29 -0
- package/mobile/src/ui-kit/FormField/Fields/ProductField.tsx +13 -4
- package/mobile/src/ui-kit/FormField/constants.tsx +0 -9
- package/mobile/src/ui-kit/FormField/getField.tsx +7 -1
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +6 -856
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +8 -10
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +7 -10
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -9
- package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -1
- package/src/ui-kit/Checkbox/CheckboxGroup.tsx +7 -1
- package/src/ui-kit/Checkbox/CheckboxProps.ts +1 -1
- package/src/ui-kit/FormField/Fields/ConsentToAllDocsField.tsx +29 -0
- package/src/ui-kit/FormField/Fields/ProductField.tsx +13 -4
- package/src/ui-kit/FormField/constants.tsx +0 -9
- package/src/ui-kit/FormField/getField.tsx +7 -1
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -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 =
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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}`))),
|
|
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.
|
|
6686
|
+
const packageVersion = "0.14.569";
|
|
6664
6687
|
|
|
6665
6688
|
exports.Blocks = Blocks;
|
|
6666
6689
|
exports.ContentPage = ContentPage;
|