@redneckz/wildless-cms-uni-blocks 0.14.43 → 0.14.45
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/bundle.umd.js +29 -26
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ApplicationForm/renderWedTextarea.js +1 -1
- package/dist/components/ApplicationForm/renderWedTextarea.js.map +1 -1
- package/dist/components/Blocks.mobile.js +3 -1
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/CardTransfer/CardTransfer.js +8 -4
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/dist/components/CarouselLinks/CarouselLinkButton.js +3 -3
- package/dist/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
- package/dist/components/Header/DropdownMenu.js +2 -1
- package/dist/components/Header/DropdownMenu.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocItem.js +2 -2
- package/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js +1 -1
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.mobile.js +1 -1
- package/dist/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
- package/dist/ui-kit/Button/LikeButton.js +5 -9
- package/dist/ui-kit/Button/LikeButton.js.map +1 -1
- package/dist/ui-kit/Img/ImgAsPicture.js +2 -2
- package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/dist/ui-kit/SVG.js +4 -1
- package/dist/ui-kit/SVG.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/components/ApplicationForm/renderWedTextarea.js +1 -1
- package/lib/components/ApplicationForm/renderWedTextarea.js.map +1 -1
- package/lib/components/Blocks.mobile.js +3 -1
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/CardTransfer/CardTransfer.js +8 -4
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/lib/components/CarouselLinks/CarouselLinkButton.js +3 -3
- package/lib/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
- package/lib/components/Header/DropdownMenu.js +2 -1
- package/lib/components/Header/DropdownMenu.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocItem.js +2 -2
- package/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.fixture.d.ts +1 -0
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.fixture.mobile.d.ts +7 -0
- package/lib/components/OfficesAtmsMap/getScheduleDescription.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/renderAtmCard.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/renderBusinessSchedule.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js +1 -1
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.mobile.js +1 -1
- package/lib/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
- package/lib/ui-kit/Button/LikeButton.js +5 -9
- package/lib/ui-kit/Button/LikeButton.js.map +1 -1
- package/lib/ui-kit/Img/ImgAsPicture.js +2 -2
- package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/lib/ui-kit/SVG.js +4 -1
- package/lib/ui-kit/SVG.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +383 -128
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedTextarea.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedTextarea.js.map +1 -1
- package/mobile/dist/components/Blocks.js +3 -1
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/CardTransfer/CardTransfer.js +8 -4
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/dist/components/CarouselLinks/CarouselLinkButton.js +3 -3
- package/mobile/dist/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.js +2 -1
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocItem.js +2 -2
- package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/dist/components/ProductGallery/ProductGallery.js +1 -1
- package/mobile/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/dist/ui-kit/Button/LikeButton.js +5 -9
- package/mobile/dist/ui-kit/Button/LikeButton.js.map +1 -1
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +2 -2
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/dist/ui-kit/SVG.js +4 -1
- package/mobile/dist/ui-kit/SVG.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedTextarea.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedTextarea.js.map +1 -1
- package/mobile/lib/components/Blocks.js +3 -1
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransfer.js +8 -4
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/lib/components/CarouselLinks/CarouselLinkButton.js +3 -3
- package/mobile/lib/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.js +2 -1
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocItem.js +2 -2
- package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/lib/components/ProductGallery/ProductGallery.js +1 -1
- package/mobile/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/lib/ui-kit/Button/LikeButton.js +5 -9
- package/mobile/lib/ui-kit/Button/LikeButton.js.map +1 -1
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +2 -2
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/lib/ui-kit/SVG.js +4 -1
- package/mobile/lib/ui-kit/SVG.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/src/components/ApplicationForm/renderWedTextarea.tsx +2 -1
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.example.json +1 -1
- package/mobile/src/components/Blocks.ts +3 -1
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +10 -7
- package/mobile/src/components/CarouselLinks/CarouselLinkButton.tsx +5 -3
- package/mobile/src/components/Header/DropdownMenu.tsx +5 -2
- package/mobile/src/components/LinkDocs/LinkDocItem.tsx +4 -5
- package/mobile/src/components/OfficesAtmsMap/renderOfficeCard.tsx +3 -1
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +1 -1
- package/mobile/src/components/ProductGallery/ProductGallery.tsx +1 -1
- package/mobile/src/ui-kit/Button/LikeButton.tsx +18 -17
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +4 -2
- package/mobile/src/ui-kit/SVG.tsx +16 -3
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/renderWedTextarea.tsx +2 -1
- package/src/components/BenefitsBlock/BenefitsBlock.example.json +1 -1
- package/src/components/Blocks.mobile.ts +3 -1
- package/src/components/CardTransfer/CardTransfer.tsx +10 -7
- package/src/components/CarouselLinks/CarouselLinkButton.tsx +5 -3
- package/src/components/Header/DropdownMenu.tsx +5 -2
- package/src/components/LinkDocs/LinkDocItem.tsx +4 -5
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.fixture.mobile.tsx +43 -0
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.fixture.tsx +2 -0
- package/src/components/OfficesAtmsMap/renderOfficeCard.tsx +3 -1
- package/src/components/ProductBlock/ProductBlock.example.json +1 -1
- package/src/components/ProductGallery/ProductGallery.mobile.tsx +1 -1
- package/src/ui-kit/Button/LikeButton.tsx +18 -17
- package/src/ui-kit/Img/ImgAsPicture.tsx +4 -2
- package/src/ui-kit/SVG.tsx +16 -3
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
|
@@ -525,10 +525,10 @@
|
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
const REGIONS_URL$1 = '/api/v1/regions';
|
|
528
|
-
const EMPTY_VALUE$
|
|
528
|
+
const EMPTY_VALUE$5 = [];
|
|
529
529
|
function useGetRegions() {
|
|
530
530
|
const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
|
|
531
|
-
return data || EMPTY_VALUE$
|
|
531
|
+
return data || EMPTY_VALUE$5;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
const useDialogManager = () => ({
|
|
@@ -1013,14 +1013,14 @@
|
|
|
1013
1013
|
});
|
|
1014
1014
|
|
|
1015
1015
|
const BRANCHES_URL = '/api/v1/branches';
|
|
1016
|
-
const EMPTY_VALUE$
|
|
1016
|
+
const EMPTY_VALUE$4 = [];
|
|
1017
1017
|
function useBranches(regionCode) {
|
|
1018
1018
|
const { data } = useAsyncData(regionCode ? `${BRANCHES_URL}?regionCode=${regionCode}` : null, fetchSafeBoxes$1);
|
|
1019
|
-
return data || EMPTY_VALUE$
|
|
1019
|
+
return data || EMPTY_VALUE$4;
|
|
1020
1020
|
}
|
|
1021
1021
|
const fetchSafeBoxes$1 = async (url) => {
|
|
1022
1022
|
const result = await fetchJSON(url, { method: 'GET' });
|
|
1023
|
-
return result || EMPTY_VALUE$
|
|
1023
|
+
return result || EMPTY_VALUE$4;
|
|
1024
1024
|
};
|
|
1025
1025
|
|
|
1026
1026
|
const MIN_CREDIT_AMOUNT = 1000;
|
|
@@ -1165,15 +1165,15 @@
|
|
|
1165
1165
|
return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", className: "@xl:text-center mb-m" }), jsxs("div", { className: "max-w-[560px] m-auto space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "flex justify-between flex-col-reverse @xl:items-center @xl:flex-row max-w-[560px] m-auto", children: [jsx("div", { className: "flex-1", children: jsx(Footnote, { link: link }) }), renderSubmitButton(button)] })] }));
|
|
1166
1166
|
});
|
|
1167
1167
|
|
|
1168
|
-
const EMPTY_VALUE$
|
|
1168
|
+
const EMPTY_VALUE$3 = {};
|
|
1169
1169
|
const DEFAULT_FOLDER_NAME = 'wcms-resources';
|
|
1170
1170
|
function useSWRResource(filename, options = {}) {
|
|
1171
|
-
const { fallback = EMPTY_VALUE$
|
|
1171
|
+
const { fallback = EMPTY_VALUE$3, folderName = DEFAULT_FOLDER_NAME, setBasePath = false } = options;
|
|
1172
1172
|
const path = joinPath('/', setBasePath ? projectSettings.BASE_PATH : '', folderName, `${filename}.json`);
|
|
1173
1173
|
const { data } = useAsyncData(filename ? path : null, fetchJSONUnsafe, {
|
|
1174
1174
|
fallback,
|
|
1175
1175
|
});
|
|
1176
|
-
return data || EMPTY_VALUE$
|
|
1176
|
+
return data || EMPTY_VALUE$3;
|
|
1177
1177
|
}
|
|
1178
1178
|
|
|
1179
1179
|
const ApplicationFormGrantSupport = JSX((props) => {
|
|
@@ -1189,7 +1189,10 @@
|
|
|
1189
1189
|
});
|
|
1190
1190
|
|
|
1191
1191
|
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1192
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) =>
|
|
1192
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1193
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1194
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1195
|
+
}) }));
|
|
1193
1196
|
});
|
|
1194
1197
|
|
|
1195
1198
|
const CHECK_PATHS = [
|
|
@@ -1415,7 +1418,7 @@
|
|
|
1415
1418
|
? image.sources
|
|
1416
1419
|
.filter((_) => _?.src)
|
|
1417
1420
|
.sort(sourcesComparator)
|
|
1418
|
-
.map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '',
|
|
1421
|
+
.map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', width: image.size?.width, height: image.size?.height }, `${index}_${src}`)))
|
|
1419
1422
|
: null, image?.src
|
|
1420
1423
|
? renderImg({ ...image, src: adjustSrc(router, pathPrefix)(image.src) }, imageClassName)
|
|
1421
1424
|
: null] }));
|
|
@@ -1423,7 +1426,7 @@
|
|
|
1423
1426
|
const renderImg = (image, imageClassName = '') => (jsx("img", { src: image.src, className: style('object-contain', imageClassName), alt: image.alt || image.title, title: image.title || '', style: {
|
|
1424
1427
|
width: image.size?.width ? `${image.size?.width}px` : '100%',
|
|
1425
1428
|
height: image.size?.height ? `${image.size?.height}px` : 'auto',
|
|
1426
|
-
},
|
|
1429
|
+
}, width: image.size?.width, height: image.size?.height }));
|
|
1427
1430
|
const adjustSrc = (router, pathPrefix) => (src) => src && !isURL(src) ? adjustHref(router)(joinPath(pathPrefix, src)) : src;
|
|
1428
1431
|
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
1429
1432
|
|
|
@@ -1451,7 +1454,7 @@
|
|
|
1451
1454
|
const activeTextareaStyles = 'hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text';
|
|
1452
1455
|
const renderWedTextarea = (field) => {
|
|
1453
1456
|
const textField = field('text');
|
|
1454
|
-
return (jsxs("label", { children: [jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435" }) }), jsx("textarea", { placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441, \u043C\u0435\u0441\u0442\u043E \u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0431\u0438\u0437\u043D\u0435\u0441\u0430 \u0438 \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u043D\u043E\u0433\u043E \u0437\u0432\u043E\u043D\u043A\u0430", 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 || '')) })] }));
|
|
1457
|
+
return (jsxs("label", { htmlFor: "textarea", children: [jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435" }) }), jsx("textarea", { id: "textarea", placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441, \u043C\u0435\u0441\u0442\u043E \u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0431\u0438\u0437\u043D\u0435\u0441\u0430 \u0438 \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u043D\u043E\u0433\u043E \u0437\u0432\u043E\u043D\u043A\u0430", 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 || '')) })] }));
|
|
1455
1458
|
};
|
|
1456
1459
|
|
|
1457
1460
|
const initialFormState = {
|
|
@@ -1755,7 +1758,7 @@
|
|
|
1755
1758
|
});
|
|
1756
1759
|
}
|
|
1757
1760
|
};
|
|
1758
|
-
return dotCount ? (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className),
|
|
1761
|
+
return dotCount ? (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className), "data-ver": version, children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
1759
1762
|
});
|
|
1760
1763
|
|
|
1761
1764
|
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
@@ -2664,16 +2667,19 @@
|
|
|
2664
2667
|
};
|
|
2665
2668
|
const INITIAL_FORM_STATE = {
|
|
2666
2669
|
amount: 1500,
|
|
2667
|
-
_amount: 1500,
|
|
2668
2670
|
};
|
|
2669
2671
|
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, formType = 'private', ...rest }) => {
|
|
2670
|
-
const [{ amount
|
|
2671
|
-
const isDisabled =
|
|
2672
|
+
const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
|
|
2673
|
+
const [isDisabled, setDisabled] = useState(false);
|
|
2674
|
+
useEffect(() => {
|
|
2675
|
+
setDisabled(amount <= 0);
|
|
2676
|
+
}, [amount]);
|
|
2672
2677
|
const buttonStyle = isDisabled
|
|
2673
2678
|
? getDisabledButtonClasses({ version: button?.version })
|
|
2674
2679
|
: getRegularButtonClasses({ className: 'text-white', version: button?.version });
|
|
2675
2680
|
const link = useLink();
|
|
2676
|
-
|
|
2681
|
+
const { onClick } = link(button || {});
|
|
2682
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col items-center', className), defaultPadding: "p-6xl", ...rest, children: [title ? (jsx(Heading, { className: "pb-lg xl:pb-4xl self-start xl:self-center", headingType: "h3", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL_MAP[formType], children: [jsx(CurrencyInput, { valid: !isDisabled, placeholder: placeholder, label: label, ...field('amount', { parse: Number, format: String }) }), jsx("input", { type: "hidden", name: "amount", value: amount }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-m mt-lg', buttonStyle), disabled: isDisabled, onClick: onClick, children: button.text })) : null] })] }));
|
|
2677
2683
|
});
|
|
2678
2684
|
|
|
2679
2685
|
const useCarouselControls = (props, initialIndex = 0) => {
|
|
@@ -2888,10 +2894,10 @@
|
|
|
2888
2894
|
const LINK_CLASS_NAME = `absolute border
|
|
2889
2895
|
bg-white flex justify-between group-hover/link:text-primary-main`;
|
|
2890
2896
|
const LINK_BORDER_CLASS_NAME = 'hidden xl:block absolute w-full h-full border border-white';
|
|
2891
|
-
const CarouselLinkButton = JSX(({
|
|
2897
|
+
const CarouselLinkButton = JSX(({ className = '', ...linkProps }) => {
|
|
2892
2898
|
const link = useLink();
|
|
2893
|
-
const
|
|
2894
|
-
return text ? (jsx("div", { className: style('flex relative group/link pl-s pb-s min-w-[16rem] xl:min-w-[20rem]', className), children: jsxs("div", { className: "relative min-h-16 w-full", children: [jsxs("a", { className: style(LINK_CLASS_NAME, 'sm:rounded-md rounded-none w-full px-xl py-lg whitespace-nowrap z-10'), role: "link",
|
|
2899
|
+
const { text, href, target, onClick } = link(linkProps);
|
|
2900
|
+
return text ? (jsx("div", { className: style('flex relative group/link pl-s pb-s min-w-[16rem] xl:min-w-[20rem]', className), children: jsxs("div", { className: "relative min-h-16 w-full", children: [jsxs("a", { className: style(LINK_CLASS_NAME, 'sm:rounded-md rounded-none w-full px-xl py-lg whitespace-nowrap z-10'), role: "link", href: href, target: target, onClick: onClick, children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }), jsx(Img, { className: "group-hover/link:brightness-100 hidden xl:block ml-2xs", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main hidden xl:block", width: "24", height: "24" })] }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-1.5 -left-1.5') }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-3 -left-3') })] }) })) : null;
|
|
2895
2901
|
});
|
|
2896
2902
|
|
|
2897
2903
|
const MAX_LINKS_COUNT = 3;
|
|
@@ -3171,7 +3177,7 @@
|
|
|
3171
3177
|
return items.map((item) => (jsx(SlideCheckbox, { text: item.title, value: [value].flatMap((_) => _).includes(item.value), onChange: () => handleChange(item.value), type: multiple ? 'checkbox' : 'radio' }, item.value)));
|
|
3172
3178
|
});
|
|
3173
3179
|
|
|
3174
|
-
const renderFiltrationForm = ({ field, reset, filtrationSchema, resetButton, children, }) => (jsxs("form", { className: "flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0", children: [jsxs("div", { className: "flex flex-col @4xl:flex-row gap-5xl", children: [children, Object.entries(filtrationSchema).map(renderFormItem(field))] }), resetButton ? (jsx("div", { children: jsx(Button, { className: "w-full @4xl:w-72 @4xl:ml-s", onClick: reset, ...resetButton }) })) : null] }));
|
|
3180
|
+
const renderFiltrationForm$1 = ({ field, reset, filtrationSchema, resetButton, children, }) => (jsxs("form", { className: "flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0", children: [jsxs("div", { className: "flex flex-col @4xl:flex-row gap-5xl", children: [children, Object.entries(filtrationSchema).map(renderFormItem(field))] }), resetButton ? (jsx("div", { children: jsx(Button, { className: "w-full @4xl:w-72 @4xl:ml-s", onClick: reset, ...resetButton }) })) : null] }));
|
|
3175
3181
|
const renderFormItem = (field) => ([key, item]) => {
|
|
3176
3182
|
const type = item?.type;
|
|
3177
3183
|
switch (type) {
|
|
@@ -3237,7 +3243,7 @@
|
|
|
3237
3243
|
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
3238
3244
|
format: ({ min }) => String(min),
|
|
3239
3245
|
}) }), jsx(InputRange, { title: periodInput?.title, items: ['От 3 мес', 'До 5 лет'], list: months, ...field('period') })] }));
|
|
3240
|
-
return (jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [renderFiltrationForm({ field, reset, filtrationSchema, resetButton, children: Inputs }), jsx(BaseFiltrationInner, { blocksToRender: blocksToRender, ...rest })] }));
|
|
3246
|
+
return (jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [renderFiltrationForm$1({ field, reset, filtrationSchema, resetButton, children: Inputs }), jsx(BaseFiltrationInner, { blocksToRender: blocksToRender, ...rest })] }));
|
|
3241
3247
|
});
|
|
3242
3248
|
const sourceBookSchema = {
|
|
3243
3249
|
type: 'string',
|
|
@@ -3622,11 +3628,11 @@
|
|
|
3622
3628
|
return `${parseFloat((bytes / Math.pow(KILO, i)).toFixed(decimals))} ${KILO_SIZES[i]}`;
|
|
3623
3629
|
};
|
|
3624
3630
|
|
|
3625
|
-
const LinkDocItem = JSX(({ icon, text, fileFormat, fileSize
|
|
3631
|
+
const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, fileSize }) => {
|
|
3626
3632
|
const prefix = fileFormat || fileSize ? ',' : '';
|
|
3627
3633
|
const size = fileSize ?? '';
|
|
3628
3634
|
const format = fileFormat ? String(fileFormat) : '';
|
|
3629
|
-
return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link",
|
|
3635
|
+
return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, jsx(Text, { color: "text-secondary-text", children: href && `${size} ${prefix} ${format}` })] })) : null] }));
|
|
3630
3636
|
});
|
|
3631
3637
|
|
|
3632
3638
|
const linkIconStyle = 'min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md';
|
|
@@ -3668,7 +3674,7 @@
|
|
|
3668
3674
|
primary: 'text-white',
|
|
3669
3675
|
secondary: 'text-secondary-text',
|
|
3670
3676
|
};
|
|
3671
|
-
const Badge = JSX(({ count, version = 'secondary' }) => {
|
|
3677
|
+
const Badge$1 = JSX(({ count, version = 'secondary' }) => {
|
|
3672
3678
|
return (jsx("div", { className: style('w-6 h-6 rounded-full flex items-center justify-center', badgeBgStyleMap[version]), children: jsx(Text, { size: "text-xs", color: badgeTextColorStyleMap[version], children: count }) }));
|
|
3673
3679
|
});
|
|
3674
3680
|
|
|
@@ -3693,7 +3699,7 @@
|
|
|
3693
3699
|
const activeItemIndex = useMemo(() => Math.max(0, hotFilters.findIndex((_) => hotFilterRecordCmp(_.filter, filtrationState))), [hotFilters, filtrationState]);
|
|
3694
3700
|
const items = useMemo(() => hotFilters.map((_) => ({
|
|
3695
3701
|
text: _.text,
|
|
3696
|
-
appendRight: (jsx(Badge, { version: _ === hotFilters[activeItemIndex] ? 'primary' : 'secondary', count: getBadgeCount(blocks, _.filter) })),
|
|
3702
|
+
appendRight: (jsx(Badge$1, { version: _ === hotFilters[activeItemIndex] ? 'primary' : 'secondary', count: getBadgeCount(blocks, _.filter) })),
|
|
3697
3703
|
})), [hotFilters, blocks, activeItemIndex]);
|
|
3698
3704
|
const handleChange = useCallback((_) => {
|
|
3699
3705
|
onFiltrationStateChange(hotFilters[items.indexOf(_)].filter);
|
|
@@ -3769,63 +3775,57 @@
|
|
|
3769
3775
|
blocks: rest.block?.blocks,
|
|
3770
3776
|
onFiltrationStateChange: handleFiltrationStateChange,
|
|
3771
3777
|
});
|
|
3772
|
-
return (jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [jsx(TabsControl, { ...tabsControlProps }), renderFiltrationForm({ field, reset, filtrationSchema, resetButton }), jsx(BaseFiltrationInner, { blocksToRender: blocksToRender, ...rest })] }));
|
|
3778
|
+
return (jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [jsx(TabsControl, { ...tabsControlProps }), renderFiltrationForm$1({ field, reset, filtrationSchema, resetButton }), jsx(BaseFiltrationInner, { blocksToRender: blocksToRender, ...rest })] }));
|
|
3773
3779
|
});
|
|
3774
3780
|
MortgageFiltration.childrenTypes = ['ProductTile'];
|
|
3775
3781
|
MortgageFiltration.childSchema = (content) => content?.filtrationSchema || {};
|
|
3776
3782
|
|
|
3777
|
-
const
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
3784
|
-
|
|
3785
|
-
function renderBackwardButton(version, handleClick) {
|
|
3786
|
-
const iconVersion = version === 'primary' ? 'white' : 'black';
|
|
3787
|
-
const className = 'w-12 h-12 min-h-12 min-w-12 flex items-center justify-center';
|
|
3788
|
-
const text = 'Вернуться назад';
|
|
3789
|
-
return (jsxs("div", { className: "hidden sm:flex items-center gap-s", children: [jsx("div", { className: getRegularButtonClasses({ className, version, rounded: true }), onClick: handleClick, children: jsx(Img, { className: "w-4 h-4", image: {
|
|
3790
|
-
icon: 'ArrowLeftIcon',
|
|
3791
|
-
iconVersion: iconVersion,
|
|
3792
|
-
} }) }), jsx(Button, { version: "link", className: "group-data-secondary:text-white/80", text: text, ariaLabel: text, onClick: handleClick })] }));
|
|
3793
|
-
}
|
|
3783
|
+
const useLatestEvent = (eventBus, type, initialEvent) => {
|
|
3784
|
+
const [latestEvent, setLatestEvent] = useState(initialEvent || null);
|
|
3785
|
+
useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
|
|
3786
|
+
const fireEvent = useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
3787
|
+
return [latestEvent, fireEvent];
|
|
3788
|
+
};
|
|
3794
3789
|
|
|
3795
|
-
const
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3790
|
+
const REGION_URL = '/api/v1/region';
|
|
3791
|
+
const LOCATION_STORAGE_KEY = 'location';
|
|
3792
|
+
function useLocation(defaultLocation = 'Москва') {
|
|
3793
|
+
const [currentLocation, fireCurrentLocation] = useLatestEvent(defaultEventBus, 'location', restoreLocation() ?? { name: defaultLocation });
|
|
3794
|
+
const selectCurrentLocation = useCallback((_) => {
|
|
3795
|
+
storeLocation(_);
|
|
3796
|
+
fireCurrentLocation(_);
|
|
3800
3797
|
}, []);
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
const
|
|
3798
|
+
const { data } = useAsyncData(REGION_URL, fetchJSONUnsafe);
|
|
3799
|
+
useEffect(() => {
|
|
3800
|
+
if (data && !hasStoredLocation()) {
|
|
3801
|
+
fireCurrentLocation(data);
|
|
3802
|
+
}
|
|
3803
|
+
}, [data]);
|
|
3804
|
+
return [currentLocation ?? { name: defaultLocation }, selectCurrentLocation];
|
|
3805
|
+
}
|
|
3806
|
+
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
3807
|
+
const restoreLocation = () => {
|
|
3808
|
+
try {
|
|
3809
|
+
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
3810
|
+
return data && JSON.parse(data);
|
|
3811
|
+
}
|
|
3812
|
+
catch (ex) {
|
|
3813
|
+
return null;
|
|
3814
|
+
}
|
|
3815
|
+
};
|
|
3816
|
+
const storeLocation = (_) => {
|
|
3817
|
+
try {
|
|
3818
|
+
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
3819
|
+
}
|
|
3820
|
+
catch (ex) {
|
|
3821
|
+
// Do nothing
|
|
3822
|
+
}
|
|
3823
|
+
};
|
|
3811
3824
|
|
|
3812
|
-
const
|
|
3813
|
-
label: 'Адрес',
|
|
3814
|
-
data: address,
|
|
3815
|
-
iconName: 'GeolocationIcon',
|
|
3816
|
-
}), renderBlock({ label: 'Телефон(факс)', data: telephone, iconName: 'PhoneIcon' }), renderBlock({
|
|
3817
|
-
label: 'E-mail',
|
|
3818
|
-
data: email,
|
|
3819
|
-
iconName: 'MailIcon',
|
|
3820
|
-
dataColor: 'text-primary-main',
|
|
3821
|
-
}), button?.text ? renderButtonsSection([button]) : null] })] })));
|
|
3822
|
-
const renderDescriptionBlock = (__html) => (jsx("div", { className: "border-b border-main-divider pb-lg", children: jsx(RichText, { __html: __html }) }));
|
|
3823
|
-
const renderBlock = ({ label, data, iconName, dataColor = '' }) => data ? (jsxs("div", { className: "flex gap-s", children: [jsx(Icon, { iconVersion: "black", name: iconName, width: "24", height: "24" }), jsxs("div", { className: "flex flex-col gap-2xs", children: [jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: label }), jsx(Text, { size: "text-xl", color: dataColor, children: data })] })] })) : null;
|
|
3825
|
+
const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
|
|
3824
3826
|
|
|
3825
|
-
const
|
|
3826
|
-
|
|
3827
|
-
return (jsx(BlockWrapper, { defaultPadding: "p-0", ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) }));
|
|
3828
|
-
});
|
|
3827
|
+
const isClient = !isSSR();
|
|
3828
|
+
const ClientOnly = JSX(({ children }) => (isClient ? children : null));
|
|
3829
3829
|
|
|
3830
3830
|
function renderClusterer(yandexMaps, map, points) {
|
|
3831
3831
|
map.geoObjects.removeAll();
|
|
@@ -4024,6 +4024,306 @@
|
|
|
4024
4024
|
const mapByIndex = (arr, index) => arr.map((a) => a[index]);
|
|
4025
4025
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4026
4026
|
|
|
4027
|
+
const FILTRATION_LABELS = {
|
|
4028
|
+
safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
|
|
4029
|
+
workingSaturday: 'Открыты по субботам',
|
|
4030
|
+
terminalTypeAtms: 'Банкоматы',
|
|
4031
|
+
terminalTypeTerm: 'Терминалы',
|
|
4032
|
+
workAllTime: 'Круглосуточно',
|
|
4033
|
+
billAcceptorEnable: 'Прием наличных',
|
|
4034
|
+
};
|
|
4035
|
+
const renderFiltrationForm = (filters, { field, reset }) => (jsxs("div", { className: "pb-2xl", children: [filters?.length ? (jsx("div", { className: "flex flex-wrap gap-3xl pb-2xl", children: filters.map((key) => (jsx(Checkbox, { text: FILTRATION_LABELS[key], ...field(key) }, key))) })) : null, jsx(Button, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, text: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", appendRight: jsx(Icon, { name: "CloseIcon", width: "16", height: "16" }) })] }));
|
|
4036
|
+
|
|
4037
|
+
const defaultRenderCard = () => null;
|
|
4038
|
+
const defaultFilterItems = () => [];
|
|
4039
|
+
const OfficesAtmsMapLayout = JSX(({ className, data = [], renderCard = defaultRenderCard, filterItems = defaultFilterItems, initFilterState = {}, descriptionData, title, }) => {
|
|
4040
|
+
const [filtrationState, { field, reset }] = useForm(initFilterState);
|
|
4041
|
+
const filteredItems = filterItems(data, filtrationState);
|
|
4042
|
+
const points = filteredItems
|
|
4043
|
+
.map((_) => [_.gpsLatitude, _.gpsLongitude].filter(Boolean))
|
|
4044
|
+
.filter((_) => _ && _.length === 2);
|
|
4045
|
+
const lengthItems = filteredItems.length;
|
|
4046
|
+
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "pt-6xl px-6xl", children: [jsxs("div", { className: "flex gap-xs pb-2xl", children: [jsx(Heading, { headingType: "h2", children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: `(${lengthItems})` })) : null] }), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, renderFiltrationForm(Object.keys(initFilterState), { field, reset })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, className: "h-full" }) }) })] }), filteredItems.map(renderCard)] }));
|
|
4047
|
+
});
|
|
4048
|
+
const renderDescriptionBlock$1 = ({ description, list }) => description || list?.length ? (jsxs("div", { className: "p-xl mb-2xl border border-gray rounded-md", children: [description ? (jsx(Paragraph, { size: "text-l", font: "font-light", children: description })) : null, list?.length ? (jsx("div", { className: "flex gap-2xl flex-wrap pt-xs", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
|
|
4049
|
+
|
|
4050
|
+
const colorStyle = {
|
|
4051
|
+
yellow: { border: 'border-yellow-light', text: 'text-yellow' },
|
|
4052
|
+
green: { border: 'border-green-more-light', text: 'text-green-dark' },
|
|
4053
|
+
gray: { border: 'border-gray', text: 'text-secondary-text' },
|
|
4054
|
+
red: { border: 'border-error/30', text: 'text-error' },
|
|
4055
|
+
};
|
|
4056
|
+
const Badge = JSX(({ className, children, color = 'gray' }) => (jsx("div", { className: style('p-s border border-gray rounded-md flex items-center', colorStyle[color].border, className), children: jsx(Text, { size: "text-m", color: colorStyle[color].text, children: children }) })));
|
|
4057
|
+
|
|
4058
|
+
const CardCell = JSX(({ value, subText, children, ...props }) => {
|
|
4059
|
+
const textItems = (Array.isArray(value) ? value : value?.split(',') ?? []).filter(Boolean);
|
|
4060
|
+
if ([textItems.length, children, subText].every((_) => !_)) {
|
|
4061
|
+
return null;
|
|
4062
|
+
}
|
|
4063
|
+
return renderCardCell({ textItems, subText, children, ...props });
|
|
4064
|
+
});
|
|
4065
|
+
const renderCardCell = ({ label, labelSize = 'text-m', textItems, subColor, subText, className, children, }) => (jsxs("div", { className: style('flex gap-2xs flex-col h-full max-w-[300px]', className), children: [label ? (jsx(Text, { color: "text-secondary-text", font: "font-light", size: labelSize, children: label })) : null, children ||
|
|
4066
|
+
textItems.filter(Boolean).map((text, i) => (jsx(Text, { size: "text-l", children: text.trim() }, String(i)))), subText ? (jsx(Text, { color: subColor, size: "text-m", children: subText })) : null] }));
|
|
4067
|
+
|
|
4068
|
+
const CardRow = JSX(({ className, children }) => (jsx("div", { className: style('flex border-t border-solid border-main-divider py-xl gap-x-6xl gap-y-xl', className), children: children })));
|
|
4069
|
+
|
|
4070
|
+
const renderAtmCard = ({ location, address, billAcceptorType, terminalType, billAcceptorEnable, atmCode = '', atmAccess = '', workTime, }, index) => {
|
|
4071
|
+
const additionalInfo = [
|
|
4072
|
+
{
|
|
4073
|
+
label: 'Устройство',
|
|
4074
|
+
value: capitalizedFirstLetter(terminalType),
|
|
4075
|
+
},
|
|
4076
|
+
{ label: 'Модуль приема наличных', value: billAcceptorEnable ? 'Да' : 'Нет' },
|
|
4077
|
+
{
|
|
4078
|
+
label: 'Прием наличных пачкой',
|
|
4079
|
+
value: billAcceptorType === 'банкомат принимает пачками' ? 'Да' : 'Нет',
|
|
4080
|
+
},
|
|
4081
|
+
{
|
|
4082
|
+
label: 'Доступность',
|
|
4083
|
+
value: ['внешняя установка', 'территория банка'].includes(atmAccess) ? 'Общедоступный' : '',
|
|
4084
|
+
},
|
|
4085
|
+
{ label: 'Регистрационный номер', value: atmCode },
|
|
4086
|
+
];
|
|
4087
|
+
return (jsxs("div", { className: "bg-white col-span-12 p-3xl border-green border", children: [jsxs("div", { className: "flex justify-between", children: [jsx(Text, { size: "text-h4", children: capitalizedFirstLetter(location) }), jsx(Badge, { color: "green", children: capitalizedFirstLetter(workTime) })] }), address ? (jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), jsx(Text, { size: "text-l", children: address })] })) : null, jsx(CardRow, { className: "flex-wrap", children: additionalInfo?.map(renderInfo) })] }, String(index)));
|
|
4088
|
+
};
|
|
4089
|
+
const renderInfo = (item, index) => (jsx(CardCell, { ...item }, String(index)));
|
|
4090
|
+
const capitalizedFirstLetter = (text) => text ? `${text?.charAt(0)?.toUpperCase()}${text?.slice(1)}` : '';
|
|
4091
|
+
|
|
4092
|
+
const EMPTY_VALUE$2 = [];
|
|
4093
|
+
function useAtms(regionCode) {
|
|
4094
|
+
const { data = EMPTY_VALUE$2 } = useAsyncData(`/api/v1/atms?regionCode=${regionCode}`, fetchMap$1);
|
|
4095
|
+
return data;
|
|
4096
|
+
}
|
|
4097
|
+
const fetchMap$1 = async (url) => {
|
|
4098
|
+
const result = await fetchJSON(url, { method: 'GET' });
|
|
4099
|
+
return result || EMPTY_VALUE$2;
|
|
4100
|
+
};
|
|
4101
|
+
|
|
4102
|
+
const INITIAL_FILTRATION_STATE$1 = {
|
|
4103
|
+
terminalTypeAtms: true,
|
|
4104
|
+
terminalTypeTerm: false,
|
|
4105
|
+
workAllTime: false,
|
|
4106
|
+
billAcceptorEnable: false,
|
|
4107
|
+
};
|
|
4108
|
+
const FILTRATION_PREDICATES$1 = {
|
|
4109
|
+
terminalTypeAtms: (item) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
4110
|
+
terminalTypeTerm: (item) => item.terminalType?.toLowerCase() === 'терминал',
|
|
4111
|
+
workAllTime: (item) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
4112
|
+
billAcceptorEnable: (item) => Boolean(item.billAcceptorEnable),
|
|
4113
|
+
};
|
|
4114
|
+
const AtmsMap = JSX(({ data, className }) => {
|
|
4115
|
+
const [currentLocation] = useLocation();
|
|
4116
|
+
const regionCode = currentLocation?.code ?? '000';
|
|
4117
|
+
const officesData = useAtms(regionCode);
|
|
4118
|
+
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems$1, data: officesData, initFilterState: INITIAL_FILTRATION_STATE$1, renderCard: renderAtmCard, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: data }));
|
|
4119
|
+
});
|
|
4120
|
+
const filterItems$1 = (data, filtrationState) => {
|
|
4121
|
+
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
4122
|
+
const filtersOR = truthyFilters.filter((_) => _.startsWith('terminalType'));
|
|
4123
|
+
const filtersAND = truthyFilters.filter((_) => !filtersOR.includes(_));
|
|
4124
|
+
return data.filter((item) => {
|
|
4125
|
+
const resultAND = filtersAND.every((_) => FILTRATION_PREDICATES$1[_](item));
|
|
4126
|
+
const resultOR = filtersOR.length
|
|
4127
|
+
? filtersOR.some((_) => FILTRATION_PREDICATES$1[_](item))
|
|
4128
|
+
: true;
|
|
4129
|
+
return resultAND && resultOR;
|
|
4130
|
+
});
|
|
4131
|
+
};
|
|
4132
|
+
|
|
4133
|
+
const getScheduleDescription = (workScheduleWeek) => {
|
|
4134
|
+
const workingWeekday = workScheduleWeek.find((_) => _.key !== 'workingSaturday' && Boolean(_.status) && Boolean(_.workTime));
|
|
4135
|
+
const workingSaturday = workScheduleWeek.find((_) => _.key === 'workingSaturday' && Boolean(_.status) && Boolean(_.workTime));
|
|
4136
|
+
const daysOff = workScheduleWeek
|
|
4137
|
+
.filter((_) => !_.status)
|
|
4138
|
+
.map((_) => _.short?.toLowerCase())
|
|
4139
|
+
.join(', ');
|
|
4140
|
+
const rows = [
|
|
4141
|
+
buildScheduleText({
|
|
4142
|
+
workTime: workingWeekday?.workTime,
|
|
4143
|
+
lunchHour: workingWeekday?.lunchHour,
|
|
4144
|
+
daysOff: workingSaturday ? '' : daysOff,
|
|
4145
|
+
}),
|
|
4146
|
+
buildScheduleText({ workTime: workingSaturday?.workTime, lunchHour: workingSaturday?.lunchHour, daysOff }, true),
|
|
4147
|
+
].filter(Boolean);
|
|
4148
|
+
return jsx(CardCell, { label: "\u0420\u0435\u0436\u0438\u043C \u0440\u0430\u0431\u043E\u0442\u044B", value: rows, className: "max-w-none" });
|
|
4149
|
+
};
|
|
4150
|
+
const buildScheduleText = ({ workTime = '', lunchHour = '', daysOff = '' }, isSaturday = false) => {
|
|
4151
|
+
if (!workTime) {
|
|
4152
|
+
return '';
|
|
4153
|
+
}
|
|
4154
|
+
return [
|
|
4155
|
+
`${isSaturday ? 'Суббота' : 'Будние дни'}: ${workTime}`,
|
|
4156
|
+
lunchHour ? `перерыв: ${lunchHour}` : '',
|
|
4157
|
+
daysOff ? `не работает: ${daysOff}` : '',
|
|
4158
|
+
]
|
|
4159
|
+
.filter(Boolean)
|
|
4160
|
+
.join('; ');
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
const WEEKDAY_MAP = [
|
|
4164
|
+
['workingMonday', 'Пн', 'Понедельник'],
|
|
4165
|
+
['workingTuesday', 'Вт', 'Вторник'],
|
|
4166
|
+
['workingWednesday', 'Ср', 'Среда'],
|
|
4167
|
+
['workingThursday', 'Чт', 'Четверг'],
|
|
4168
|
+
['workingFriday', 'Пт', 'Пятница'],
|
|
4169
|
+
['workingSaturday', 'Сб', 'Суббота'],
|
|
4170
|
+
['workingSunday', 'Вс', 'Воскресенье'],
|
|
4171
|
+
];
|
|
4172
|
+
const getWorkScheduleWeek = (workSchedule) => WEEKDAY_MAP.map(([key, short, title]) => ({
|
|
4173
|
+
key,
|
|
4174
|
+
title,
|
|
4175
|
+
short,
|
|
4176
|
+
status: Boolean(workSchedule?.[key]),
|
|
4177
|
+
get workTime() {
|
|
4178
|
+
return key === 'workingSaturday' ? workSchedule?.workTimeSaturday : workSchedule?.workTime;
|
|
4179
|
+
},
|
|
4180
|
+
get lunchHour() {
|
|
4181
|
+
return key === 'workingSaturday' ? workSchedule?.lunchHourSaturday : workSchedule?.lunchHour;
|
|
4182
|
+
},
|
|
4183
|
+
get hasLunch() {
|
|
4184
|
+
return /\d+/.test(this.lunchHour ?? '');
|
|
4185
|
+
},
|
|
4186
|
+
}));
|
|
4187
|
+
|
|
4188
|
+
const renderBusinessSchedule = (scheduleDescription) => {
|
|
4189
|
+
if (!scheduleDescription) {
|
|
4190
|
+
return null;
|
|
4191
|
+
}
|
|
4192
|
+
const businessSchedule = getBusinessSchedule(scheduleDescription);
|
|
4193
|
+
return (jsxs(CardRow, { className: "border-none", children: [jsx(CardCell, { label: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", labelSize: "text-l", children: jsx("div", { className: "flex gap-1", children: businessSchedule.map(renderAlternativeDay) }) }), jsx(CardCell, { label: "\u0420\u0435\u0436\u0438\u043C \u0440\u0430\u0431\u043E\u0442\u044B", className: "max-w-none", children: jsx(Text, { children: scheduleDescription }) })] }));
|
|
4194
|
+
};
|
|
4195
|
+
const getBusinessSchedule = (scheduleDescription) => {
|
|
4196
|
+
const weekDayMap = WEEKDAY_MAP.map(([, short]) => ({ short, status: true }));
|
|
4197
|
+
const splittedScheduleDescription = scheduleDescription.split('/') ?? [];
|
|
4198
|
+
const lastPartScheduleDescription = splittedScheduleDescription[splittedScheduleDescription.length - 1]?.toLowerCase();
|
|
4199
|
+
if (!lastPartScheduleDescription?.includes('выходной')) {
|
|
4200
|
+
return weekDayMap;
|
|
4201
|
+
}
|
|
4202
|
+
return weekDayMap.map((_) => ({
|
|
4203
|
+
..._,
|
|
4204
|
+
status: !lastPartScheduleDescription?.includes(_.short.toLowerCase()),
|
|
4205
|
+
}));
|
|
4206
|
+
};
|
|
4207
|
+
const renderAlternativeDay = ({ short, status }, index) => (jsx("div", { className: style('w-9 h-9 rounded-md flex items-center justify-center', status ? 'bg-green-more-light text-green-dark' : 'bg-error/30 text-error'), children: jsx(Text, { size: "text-xs", children: short }) }, String(index)));
|
|
4208
|
+
|
|
4209
|
+
const currentWeekDayIdx = new Date().getDay();
|
|
4210
|
+
const renderOfficeCard = ({ name, address, phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }, index) => {
|
|
4211
|
+
if (!workSchedule) {
|
|
4212
|
+
return null;
|
|
4213
|
+
}
|
|
4214
|
+
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
4215
|
+
const labelSchedule = workSchedule?.businessScheduleVisibleTag
|
|
4216
|
+
? 'Для физических лиц'
|
|
4217
|
+
: 'Для физических и юридических лиц';
|
|
4218
|
+
return (jsxs("div", { className: "bg-white col-span-12 p-3xl border-green border", children: [jsxs("div", { className: "flex justify-between", children: [jsx(Text, { size: "text-h4", children: name }), renderCurrentDaySchedule(workScheduleWeek)] }), address ? (jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), jsx(Text, { size: "text-l", children: address })] })) : null, jsxs(CardRow, { className: "flex-wrap", children: [jsx(CardCell, { label: "\u0424\u0430\u043A\u0441", value: fax }), jsx(CardCell, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u0444\u0438\u043B\u0438\u0430\u043B\u0430", value: phone }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneBusiness }), jsx(CardCell, { label: "\u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneNatural }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u0439 \u043F\u043E \u0432\u0430\u043B\u044E\u0442\u043D\u043E\u043C\u0443 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E", value: phoneCurrencyControl }), jsx(CardCell, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442-\u0446\u0435\u043D\u0442\u0440", value: phoneCallCentre })] }), workSchedule.isMatchesPattern ? (jsx(CardRow, { children: jsx(CardCell, { label: labelSchedule, labelSize: "text-l", className: "w-full max-w-none", children: jsx("div", { className: "flex flex-wrap gap-xs sm:justify-between pt-xs", children: workScheduleWeek?.map(renderDay) }) }) })) : (jsxs(CardRow, { children: [jsx(CardCell, { label: labelSchedule, labelSize: "text-l", children: jsx("div", { className: "flex gap-1", children: workScheduleWeek?.map(renderAlternativeDay) }) }), getScheduleDescription(workScheduleWeek)] })), workSchedule?.businessScheduleVisibleTag
|
|
4219
|
+
? renderBusinessSchedule(workSchedule?.businessScheduleDescription)
|
|
4220
|
+
: null, exchangeRate?.currencies?.length ? (jsx(CardRow, { className: "flex-wrap", children: exchangeRate?.currencies?.map(renderCurrency) })) : null] }, String(index)));
|
|
4221
|
+
};
|
|
4222
|
+
const renderCurrency = ({ currency, buyExchangeRate, saleExchangeRate }, i) => (jsxs("div", { className: "flex gap-lg h-full", children: [currency?.currency ? jsx(CardCell, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", value: currency.currency }) : null, buyExchangeRate ? jsx(CardCell, { label: "\u041A\u0443\u043F\u0438\u0442\u044C", value: String(buyExchangeRate) }) : null, saleExchangeRate ? jsx(CardCell, { label: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C", value: String(saleExchangeRate) }) : null] }, String(i)));
|
|
4223
|
+
//TODO: Add logic time https://github.com/redneckz/wildless-cms-uni-blocks/pull/1549
|
|
4224
|
+
const renderCurrentDaySchedule = (workScheduleWeek) => {
|
|
4225
|
+
const [currentWeekDay] = workScheduleWeek?.slice(currentWeekDayIdx - 1) ?? [];
|
|
4226
|
+
if (!currentWeekDay) {
|
|
4227
|
+
return null;
|
|
4228
|
+
}
|
|
4229
|
+
const { lunchHour, status, workTime, hasLunch } = currentWeekDay;
|
|
4230
|
+
return status ? (jsxs("div", { className: "flex gap-s items-start whitespace-nowrap", children: [workTime ? jsx(Badge, { color: "green", children: workTime }) : null, lunchHour && hasLunch ? jsx(Badge, { color: "yellow", children: `перерыв: ${lunchHour}` }) : null] })) : (jsx(Badge, { color: "red", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }));
|
|
4231
|
+
};
|
|
4232
|
+
const renderDay = ({ title, status, workTime, lunchHour, hasLunch }, index) => (jsx(CardCell, { label: title, value: status && workTime ? workTime : '', subText: getSubTextLunch(lunchHour, hasLunch, status), subColor: !status || hasLunch ? 'text-error' : 'text-green-dark' }, String(index)));
|
|
4233
|
+
const getSubTextLunch = (lunchHour, hasLunch = false, status = false) => {
|
|
4234
|
+
if (!status) {
|
|
4235
|
+
return 'Не работает';
|
|
4236
|
+
}
|
|
4237
|
+
return lunchHour && hasLunch ? `Перерыв ${lunchHour}` : lunchHour;
|
|
4238
|
+
};
|
|
4239
|
+
|
|
4240
|
+
const EMPTY_VALUE$1 = [];
|
|
4241
|
+
function useOffices(regionCode) {
|
|
4242
|
+
const { data = EMPTY_VALUE$1 } = useAsyncData(`/api/v1/branches?regionCode=${regionCode}`, fetchMap);
|
|
4243
|
+
return data;
|
|
4244
|
+
}
|
|
4245
|
+
const fetchMap = async (url) => {
|
|
4246
|
+
const result = await fetchJSON(url, { method: 'GET' });
|
|
4247
|
+
return result || EMPTY_VALUE$1;
|
|
4248
|
+
};
|
|
4249
|
+
|
|
4250
|
+
const INITIAL_FILTRATION_STATE = {
|
|
4251
|
+
//safeBoxCaseVolumes: false, //TODO: temp hide
|
|
4252
|
+
workingSaturday: false,
|
|
4253
|
+
};
|
|
4254
|
+
const FILTRATION_PREDICATES = {
|
|
4255
|
+
//safeBoxCaseVolumes: (item: Branch) => Boolean(item.safeBoxCaseVolumes), //TODO: temp hide
|
|
4256
|
+
workingSaturday: (item) => Boolean(item.workSchedule?.workingSaturday),
|
|
4257
|
+
};
|
|
4258
|
+
const OfficesMap = JSX(({ className }) => {
|
|
4259
|
+
const [currentLocation] = useLocation();
|
|
4260
|
+
const regionCode = currentLocation?.code ?? '000';
|
|
4261
|
+
const officesData = useOffices(regionCode);
|
|
4262
|
+
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderOfficeCard, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
4263
|
+
});
|
|
4264
|
+
const filterItems = (data, filtrationState) => {
|
|
4265
|
+
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
4266
|
+
return data.filter((item) => truthyFilters.every((_) => FILTRATION_PREDICATES[_](item)));
|
|
4267
|
+
};
|
|
4268
|
+
|
|
4269
|
+
const OfficesAtmsMap = JSX(({ data, className, ...rest }) => {
|
|
4270
|
+
const dataType = data?.dataType ?? 'offices';
|
|
4271
|
+
return (jsx(BlockWrapper, { version: "transparent", className: style(className), defaultPadding: "p-0", ...rest, children: dataType === 'offices' ? jsx(OfficesMap, {}) : jsx(AtmsMap, { data: data }) }));
|
|
4272
|
+
});
|
|
4273
|
+
|
|
4274
|
+
const GOLDEN_RATIO = 1.618;
|
|
4275
|
+
const Placeholder = JSX(({ className, title, description = 'Блок в разработке...', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border', className), ...rest, children: [jsx(Headline, { className: "max-w-[600px]", title: title, description: description, headlineVersion: "L", align: "text-left", isEmbedded: true }), jsx("figure", { className: "m-0 mt-xl min-w-[80%]", children: renderShimmer() })] })));
|
|
4276
|
+
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
4277
|
+
.map((_) => Math.floor(_))
|
|
4278
|
+
.map(renderShimmerItem);
|
|
4279
|
+
const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-xs bg-secondary-light" }, String(index)));
|
|
4280
|
+
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
4281
|
+
|
|
4282
|
+
function renderBackwardButton(version, handleClick) {
|
|
4283
|
+
const iconVersion = version === 'primary' ? 'white' : 'black';
|
|
4284
|
+
const className = 'w-12 h-12 min-h-12 min-w-12 flex items-center justify-center';
|
|
4285
|
+
const text = 'Вернуться назад';
|
|
4286
|
+
return (jsxs("div", { className: "hidden sm:flex items-center gap-s", children: [jsx("div", { className: getRegularButtonClasses({ className, version, rounded: true }), onClick: handleClick, children: jsx(Img, { className: "w-4 h-4", image: {
|
|
4287
|
+
icon: 'ArrowLeftIcon',
|
|
4288
|
+
iconVersion: iconVersion,
|
|
4289
|
+
} }) }), jsx(Button, { version: "link", className: "group-data-secondary:text-white/80", text: text, ariaLabel: text, onClick: handleClick })] }));
|
|
4290
|
+
}
|
|
4291
|
+
|
|
4292
|
+
const ProductBlock = JSX(({ className, padding, backwardButton, showBorder, ...rest }) => {
|
|
4293
|
+
const router = useRouter();
|
|
4294
|
+
const handleClick = useCallback((ev) => {
|
|
4295
|
+
ev?.preventDefault();
|
|
4296
|
+
router.back();
|
|
4297
|
+
}, []);
|
|
4298
|
+
return (jsxs(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', getBorderStyle(showBorder), className), defaultPadding: "p-6xl", padding: padding, ...rest, children: [backwardButton
|
|
4299
|
+
? renderBackwardButton(!rest.version || rest.version === 'primary' ? 'primary' : 'white', handleClick)
|
|
4300
|
+
: null, jsx(BaseProductTile, { className: "grow h-full", ...rest })] }));
|
|
4301
|
+
});
|
|
4302
|
+
|
|
4303
|
+
const ProductGallery = JSX(({ className, padding, slides = [], ...rest }) => (jsx(BlockWrapper, { className: style('overflow-hidden relative', className), padding: padding, ...rest, children: jsx(SwipeListControl, { gap: 0, padding: 0, children: slides
|
|
4304
|
+
.map((s) => s.productBlock)
|
|
4305
|
+
.map((_, i) => (jsx("div", { className: "box-border h-full", children: jsx(BaseProductTile, { className: "px-5 h-full", headlineVersion: "L", ..._, ...rest }) }, String(i)))) }) })));
|
|
4306
|
+
|
|
4307
|
+
const ProductTile = JSX(({ className, padding, headlineVersion = 'S', isTabularBenefits = true, additionalDescription, imageOptions, isFullWidthTitle = true, ...rest }) => (jsx(BlockWrapper, { className: className, padding: "p-0", ...rest, children: jsx(BaseProductTile, { className: "h-full", defaultPadding: "p-4xl sm:p-xl", padding: padding, headlineVersion: headlineVersion, isTabularBenefits: isTabularBenefits, imageOptions: { isImageSecondary: true, ...imageOptions }, isFullWidthTitle: isFullWidthTitle, ...rest, children: additionalDescription ? (jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription })) : null }) })));
|
|
4308
|
+
|
|
4309
|
+
const RepresentativeOfficeInfo = JSX(({ address, email, telephone, button, className = '', __html, icon, title, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border text-left space-y-s', className), version: version, ...rest, children: [jsxs("div", { className: "w-full flex justify-between flex-row-reverse", children: [isIcon(icon) ? (jsx("div", { className: 'w-10 h-7 sm:w-24 sm:h-16', children: jsx(Img, { image: icon }) })) : null, title ? jsx(Heading, { headingType: "h3", as: "h3", title: title }) : null] }), jsxs("div", { className: "w-full space-y-m", children: [__html ? renderDescriptionBlock(__html) : null, renderBlock({
|
|
4310
|
+
label: 'Адрес',
|
|
4311
|
+
data: address,
|
|
4312
|
+
iconName: 'GeolocationIcon',
|
|
4313
|
+
}), renderBlock({ label: 'Телефон(факс)', data: telephone, iconName: 'PhoneIcon' }), renderBlock({
|
|
4314
|
+
label: 'E-mail',
|
|
4315
|
+
data: email,
|
|
4316
|
+
iconName: 'MailIcon',
|
|
4317
|
+
dataColor: 'text-primary-main',
|
|
4318
|
+
}), button?.text ? renderButtonsSection([button]) : null] })] })));
|
|
4319
|
+
const renderDescriptionBlock = (__html) => (jsx("div", { className: "border-b border-main-divider pb-lg", children: jsx(RichText, { __html: __html }) }));
|
|
4320
|
+
const renderBlock = ({ label, data, iconName, dataColor = '' }) => data ? (jsxs("div", { className: "flex gap-s", children: [jsx(Icon, { iconVersion: "black", name: iconName, width: "24", height: "24" }), jsxs("div", { className: "flex flex-col gap-2xs", children: [jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: label }), jsx(Text, { size: "text-xl", color: dataColor, children: data })] })] })) : null;
|
|
4321
|
+
|
|
4322
|
+
const RichTextBlock = JSX((props) => {
|
|
4323
|
+
const { __html, richVersion, ...rest } = props;
|
|
4324
|
+
return (jsx(BlockWrapper, { defaultPadding: "p-0", ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) }));
|
|
4325
|
+
});
|
|
4326
|
+
|
|
4027
4327
|
const RadioButtons = JSX(({ className = '' }) => {
|
|
4028
4328
|
const [selectedOption, setSelectedOption] = useState('option2');
|
|
4029
4329
|
const onChange = useCallback((_) => setSelectedOption(_), []);
|
|
@@ -4274,48 +4574,6 @@
|
|
|
4274
4574
|
return dialogs;
|
|
4275
4575
|
};
|
|
4276
4576
|
|
|
4277
|
-
const useLatestEvent = (eventBus, type, initialEvent) => {
|
|
4278
|
-
const [latestEvent, setLatestEvent] = useState(initialEvent || null);
|
|
4279
|
-
useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
|
|
4280
|
-
const fireEvent = useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
4281
|
-
return [latestEvent, fireEvent];
|
|
4282
|
-
};
|
|
4283
|
-
|
|
4284
|
-
const REGION_URL = '/api/v1/region';
|
|
4285
|
-
const LOCATION_STORAGE_KEY = 'location';
|
|
4286
|
-
function useLocation(defaultLocation = 'Москва') {
|
|
4287
|
-
const [currentLocation, fireCurrentLocation] = useLatestEvent(defaultEventBus, 'location', restoreLocation() ?? { name: defaultLocation });
|
|
4288
|
-
const selectCurrentLocation = useCallback((_) => {
|
|
4289
|
-
storeLocation(_);
|
|
4290
|
-
fireCurrentLocation(_);
|
|
4291
|
-
}, []);
|
|
4292
|
-
const { data } = useAsyncData(REGION_URL, fetchJSONUnsafe);
|
|
4293
|
-
useEffect(() => {
|
|
4294
|
-
if (data && !hasStoredLocation()) {
|
|
4295
|
-
fireCurrentLocation(data);
|
|
4296
|
-
}
|
|
4297
|
-
}, [data]);
|
|
4298
|
-
return [currentLocation ?? { name: defaultLocation }, selectCurrentLocation];
|
|
4299
|
-
}
|
|
4300
|
-
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
4301
|
-
const restoreLocation = () => {
|
|
4302
|
-
try {
|
|
4303
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4304
|
-
return data && JSON.parse(data);
|
|
4305
|
-
}
|
|
4306
|
-
catch (ex) {
|
|
4307
|
-
return null;
|
|
4308
|
-
}
|
|
4309
|
-
};
|
|
4310
|
-
const storeLocation = (_) => {
|
|
4311
|
-
try {
|
|
4312
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4313
|
-
}
|
|
4314
|
-
catch (ex) {
|
|
4315
|
-
// Do nothing
|
|
4316
|
-
}
|
|
4317
|
-
};
|
|
4318
|
-
|
|
4319
4577
|
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
4320
4578
|
|
|
4321
4579
|
const Dialog = JSX(({ className, head, children, onClose }) => {
|
|
@@ -4962,7 +5220,6 @@
|
|
|
4962
5220
|
CarouselTariffsCard,
|
|
4963
5221
|
ComparisonTable,
|
|
4964
5222
|
DepositFiltration,
|
|
4965
|
-
MortgageFiltration,
|
|
4966
5223
|
ErrorBlock,
|
|
4967
5224
|
ExchangeRateTile,
|
|
4968
5225
|
Footer,
|
|
@@ -4972,6 +5229,8 @@
|
|
|
4972
5229
|
ImgBlock,
|
|
4973
5230
|
LinkDocs,
|
|
4974
5231
|
MobileAppTile,
|
|
5232
|
+
MortgageFiltration,
|
|
5233
|
+
OfficesAtmsMap,
|
|
4975
5234
|
Placeholder,
|
|
4976
5235
|
ProductBlock,
|
|
4977
5236
|
ProductGallery,
|
|
@@ -5146,16 +5405,12 @@
|
|
|
5146
5405
|
|
|
5147
5406
|
const LikeButton = JSX(({ className, onClick, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 w-9 bg-inherit cursor-pointer ${className || ''}`, onClick: onClick, "aria-label": ariaLabel, children: renderLikeIcon() })));
|
|
5148
5407
|
const renderLikeIcon = () => {
|
|
5149
|
-
const
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
strokeWidth: '1.5',
|
|
5154
|
-
};
|
|
5155
|
-
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("path", { ...params, strokeMiterlimit: "10",
|
|
5156
|
-
/* eslint-disable max-len */
|
|
5157
|
-
d: "M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77" }), jsx("path", { ...params, d: "M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z" })] }));
|
|
5408
|
+
const handPath = 'M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1' +
|
|
5409
|
+
' 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77';
|
|
5410
|
+
const cuffPath = 'M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z';
|
|
5411
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [renderLinkIconPath(handPath), renderLinkIconPath(cuffPath)] }));
|
|
5158
5412
|
};
|
|
5413
|
+
const renderLinkIconPath = (d) => (jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", strokeMiterlimit: "10", d: d }));
|
|
5159
5414
|
|
|
5160
5415
|
const LikeControl = JSX(({ className = '' }) => {
|
|
5161
5416
|
const router = useRouter();
|
|
@@ -5183,7 +5438,7 @@
|
|
|
5183
5438
|
|
|
5184
5439
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
5185
5440
|
|
|
5186
|
-
const packageVersion = "0.14.
|
|
5441
|
+
const packageVersion = "0.14.44";
|
|
5187
5442
|
|
|
5188
5443
|
exports.Blocks = Blocks;
|
|
5189
5444
|
exports.ContentPage = ContentPage;
|