@redneckz/wildless-cms-uni-blocks 0.14.256 → 0.14.258
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 +3 -3
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +8 -3
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +26 -29
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -1
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/dist/ui-kit/DialogManager/Dialog.js +2 -2
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +8 -3
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +26 -29
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -1
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/lib/ui-kit/DialogManager/Dialog.js +2 -2
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/LocationDialog/renderForeignOffices.d.ts +0 -1
- package/lib/ui-kit/LocationDialog/renderRegion.d.ts +0 -1
- package/lib/ui-kit/LocationDialog/renderRegionGroup.d.ts +0 -1
- package/mobile/bundle/bundle.umd.js +162 -39
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/mobile/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/mobile/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +8 -3
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +26 -29
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +2 -2
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +8 -3
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +26 -29
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +2 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +3 -0
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +2 -2
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +1 -1
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +34 -3
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +43 -44
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +2 -1
- package/mobile/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +4 -2
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +8 -2
- package/package.json +1 -1
- package/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +1 -1
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +34 -3
- package/src/components/StickyBottomMenu/StickyBottomMenu.fixture.mobile.tsx +0 -2
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +43 -44
- package/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +2 -1
- package/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +4 -2
- package/src/ui-kit/DialogManager/Dialog.tsx +8 -2
|
@@ -2,16 +2,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { useActiveRoute } from '../../hooks/useActiveRoute.js';
|
|
5
|
+
import { useLocation } from '../../hooks/useLocation.js';
|
|
5
6
|
import { Dialog } from '../../ui-kit/DialogManager/Dialog.js';
|
|
6
7
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
7
8
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
9
|
+
import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog.js';
|
|
8
10
|
import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer.js';
|
|
9
11
|
import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll.js';
|
|
10
12
|
import { style } from '../../utils/style.js';
|
|
11
13
|
import { ActiveSubMenuItem } from './ActiveSubMenuItem.js';
|
|
12
14
|
import { TopItemMobile } from './TopItemMobile.js';
|
|
13
15
|
export const BurgerMenuDialog = JSX((props) => {
|
|
14
|
-
const { topItems, officesLink } = props;
|
|
16
|
+
const { topItems, defaultLocation, officesLink } = props;
|
|
17
|
+
const [location] = useLocation(defaultLocation);
|
|
18
|
+
const locationDialog = useLocationDialog(props);
|
|
15
19
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
16
20
|
itemCount: topItems?.length ?? 0,
|
|
17
21
|
});
|
|
@@ -28,8 +32,9 @@ export const BurgerMenuDialog = JSX((props) => {
|
|
|
28
32
|
}
|
|
29
33
|
}, [activeTopItemIndex, scroll]);
|
|
30
34
|
const handleTopItemClick = useCallback((idx) => setActiveTopItemIndex(idx), []);
|
|
31
|
-
return (_jsx(Dialog, { head: _jsx("div", { className: "flex items-center", children: _jsx(Heading, { as: "h4", title: "\u041C\u0435\u043D\u044E" }) }), children: _jsxs("div", { className: "flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md", children: [_jsx("div", { className: "w-full mb-3", children: _jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: 0, gap: 10, className: "pb-3", children: topItems?.map((item, i) => (_jsx(TopItemMobile, { item: item, isActive: activeTopItemIndex === i, onClick: () => handleTopItemClick(i) }, String(i)))) }) }), _jsxs("div", { className: "relative grow", children: [renderActiveSubMenu(activeMenuSubItems, activeRoute?.href), renderOfficeLink(officesLink)] })] }) }));
|
|
35
|
+
return (_jsx(Dialog, { onClick: (e) => e.stopPropagation(), head: _jsx("div", { className: "flex items-center", children: _jsx(Heading, { as: "h4", title: "\u041C\u0435\u043D\u044E" }) }), children: _jsxs("div", { className: "flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md", children: [_jsx("div", { className: "w-full mb-3", children: _jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: 0, gap: 10, className: "pb-3", children: topItems?.map((item, i) => (_jsx(TopItemMobile, { item: item, isActive: activeTopItemIndex === i, onClick: () => handleTopItemClick(i) }, String(i)))) }) }), _jsxs("div", { className: "relative grow", children: [renderActiveSubMenu(activeMenuSubItems, activeRoute?.href), renderOfficeLink(officesLink), renderLocation(location, () => locationDialog.open())] })] }) }));
|
|
32
36
|
});
|
|
33
37
|
const renderActiveSubMenu = (activeMenuSubItems, basePath) => activeMenuSubItems ? (_jsx("div", { children: activeMenuSubItems.map((_, i) => (_jsx(ActiveSubMenuItem, { item: _, basePath: basePath }, String(i)))) })) : null;
|
|
34
|
-
const renderOfficeLink = (officesLink) => officesLink ? (_jsx("div", { className: "mt-3", children: _jsxs("a", { className: style('text-primary-text', `
|
|
38
|
+
const renderOfficeLink = (officesLink) => officesLink ? (_jsx("div", { className: "mt-3", children: _jsxs("a", { className: style('text-primary-text', `p-4 text-h5 font-light flex justify-between cursor-pointer`, 'shadow-main-black', 'rounded-xl'), href: officesLink, rel: "noopener noreferrer", "aria-label": "\u041E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", children: [_jsx("span", { children: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B" }), _jsx(Img, { image: { icon: 'ArrowRightIcon', iconVersion: 'color' }, width: "24", height: "24", className: "text-secondary-text opacity-30" })] }) })) : null;
|
|
39
|
+
const renderLocation = (location, onClick) => (_jsxs("div", { className: style('text-primary-text', `p-4 text-h5 font-light flex justify-between cursor-pointer`, 'shadow-main-black', 'rounded-xl', 'mt-3'), onClick: onClick, children: [_jsx("div", { className: "flex flex-col items-start", children: _jsxs("span", { children: ["\u0412\u0430\u0448\u0430 \u043B\u043E\u043A\u0430\u0446\u0438\u044F - ", location.name] }) }), _jsx(Img, { image: { icon: 'ArrowRightIcon', iconVersion: 'color' }, width: "24", height: "24", className: "text-secondary-text opacity-30" })] }));
|
|
35
40
|
//# sourceMappingURL=BurgerMenuDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BurgerMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/BurgerMenuDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE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,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,SAAS,EAAC,gCAAgC,GAC1C,IACA,GACA,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AAEX,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,OAAoB,EAAE,EAAE,CAAC,CACjE,eACE,SAAS,EAAE,KAAK,CACd,mBAAmB,EACnB,4DAA4D,EAC5D,mBAAmB,EACnB,YAAY,EACZ,MAAM,CACP,EACD,OAAO,EAAE,OAAO,aAEhB,cAAK,SAAS,EAAC,2BAA2B,YACxC,qGAAsB,QAAQ,CAAC,IAAI,IAAQ,GACvC,EACN,KAAC,GAAG,IACF,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,EACvD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,SAAS,EAAC,gCAAgC,GAC1C,IACE,CACP,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { useCallback, useEffect, useRef, useState } from '@redneckz/uni-jsx/lib/
|
|
|
3
3
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
4
4
|
import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Dialog } from '../../ui-kit/DialogManager/Dialog.js';
|
|
7
|
+
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
8
8
|
import { UniBlock } from '../../UniBlock/UniBlock.js';
|
|
9
9
|
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger.js';
|
|
10
10
|
import { StickyBottomMenuItem } from './StickyBottomMenuItem.js';
|
|
@@ -13,48 +13,41 @@ const EMPTY_MENU = [];
|
|
|
13
13
|
// eslint-disable-next-line max-lines-per-function
|
|
14
14
|
export const StickyBottomMenu = UniBlock(({ sticky, ...rest }) => {
|
|
15
15
|
const { menuItems = EMPTY_MENU } = sticky ?? {};
|
|
16
|
-
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog(rest.options?.page?.sitemap ?? {});
|
|
17
|
-
const popup = usePopupManager();
|
|
16
|
+
const [isBurgerMenuDialogOpen, { toggle, close, openDialog }] = useBurgerMenuDialog(rest.options?.page?.sitemap ?? {});
|
|
18
17
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
19
18
|
const leftItems = menuItems.slice(0, middleIdx);
|
|
20
19
|
const rightItems = menuItems.slice(middleIdx);
|
|
21
20
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
22
21
|
const [currentItemPosition, setCurrentItemPosition] = useState('');
|
|
23
|
-
const [
|
|
24
|
-
const
|
|
25
|
-
|
|
22
|
+
const [popupDialogState, { setFalse: setPopupDialogClosed, setTrue: setPopupDialogOpened }] = useBool();
|
|
23
|
+
const closePopupDialog = useCallback(() => {
|
|
24
|
+
setPopupDialogClosed();
|
|
26
25
|
setActiveIndex(-1);
|
|
27
26
|
setCurrentItemPosition('');
|
|
28
|
-
|
|
29
|
-
}, [
|
|
27
|
+
close();
|
|
28
|
+
}, [close]);
|
|
30
29
|
const menuRef = useRef(null);
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
30
|
+
const popupDialogRef = useOutsideClick(closePopupDialog);
|
|
31
|
+
const openPopupDialog = useCallback((index, itemsPosition) => {
|
|
32
|
+
setPopupDialogOpened();
|
|
34
33
|
close();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
top: Math.max(globalThis.document?.documentElement?.clientHeight || 0, globalThis.innerHeight || 0) *
|
|
38
|
-
0.3 -
|
|
39
|
-
134,
|
|
40
|
-
left: menuDimensions?.left || 0,
|
|
41
|
-
width: menuDimensions?.width,
|
|
42
|
-
fixed: true,
|
|
34
|
+
openDialog(_jsx(Dialog, { onClick: (e) => e.stopPropagation(), className: "mt-[20%]", onClose: closePopupDialog, head: _jsx("div", { className: "flex items-center", children: _jsx(Heading, { as: "h4", title: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title }) }), children: _jsx("div", { className: "bg-white pb-24 pt-1 text-l", ref: popupDialogRef }) }), {
|
|
35
|
+
id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title,
|
|
43
36
|
});
|
|
44
|
-
}, [close,
|
|
37
|
+
}, [close, closePopupDialog]);
|
|
45
38
|
const handleMenuItemClick = useCallback((index, itemsPosition) => {
|
|
46
39
|
setCurrentItemPosition(itemsPosition);
|
|
47
40
|
setActiveIndex(index);
|
|
48
|
-
|
|
49
|
-
}, [
|
|
41
|
+
openPopupDialog(index, itemsPosition);
|
|
42
|
+
}, [openPopupDialog]);
|
|
50
43
|
useEffect(() => {
|
|
51
|
-
if (!
|
|
44
|
+
if (!popupDialogRef.current) {
|
|
52
45
|
return;
|
|
53
46
|
}
|
|
54
|
-
if (!
|
|
55
|
-
|
|
47
|
+
if (!popupDialogRef.current.shadowRoot) {
|
|
48
|
+
popupDialogRef.current?.attachShadow({ mode: 'open' });
|
|
56
49
|
}
|
|
57
|
-
const shadowRoot =
|
|
50
|
+
const shadowRoot = popupDialogRef.current.shadowRoot;
|
|
58
51
|
if (!shadowRoot) {
|
|
59
52
|
return;
|
|
60
53
|
}
|
|
@@ -64,8 +57,12 @@ export const StickyBottomMenu = UniBlock(({ sticky, ...rest }) => {
|
|
|
64
57
|
else {
|
|
65
58
|
shadowRoot.innerHTML = rightItems[activeIndex]?.__html || '';
|
|
66
59
|
}
|
|
67
|
-
}, [activeIndex, currentItemPosition,
|
|
68
|
-
return (_jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: _jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick:
|
|
60
|
+
}, [activeIndex, currentItemPosition, popupDialogState]);
|
|
61
|
+
return (_jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: _jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: (e) => {
|
|
62
|
+
closePopupDialog();
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
toggle();
|
|
65
|
+
} }), rightItems.map(renderMenuItem(handleMenuItemClick, 'right', { activeIndex, currentItemPosition }))] }) }));
|
|
69
66
|
});
|
|
70
67
|
const renderMenuItem = (handleMenuItemClick, itemsPosition, currentActiveItem) => (_, i, arr) => {
|
|
71
68
|
return (_jsx(StickyBottomMenuItem, { item: _, isActive: arr[currentActiveItem.activeIndex]?.title === _?.title &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAA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EAAE,EAAE;wBACb,gBAAgB,EAAE,CAAC;wBACnB,CAAC,CAAC,eAAe,EAAE,CAAC;wBACpB,MAAM,EAAE,CAAC;oBACX,CAAC,GACD,EACD,UAAU,CAAC,GAAG,CACb,cAAc,CAAC,mBAAmB,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC,CACnF,IACG,GACO,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAClB,CACE,mBAAmE,EACnE,aAAqB,EACrB,iBAAoC,EACpC,EAAE,CACJ,CAAC,CAAiB,EAAE,CAAS,EAAE,GAAqB,EAAE,EAAE;IACtD,OAAO,CACL,KAAC,oBAAoB,IAEnB,IAAI,EAAE,CAAC,EACP,QAAQ,EACN,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,KAAK;YACtD,iBAAiB,CAAC,mBAAmB,KAAK,aAAa,EAEzD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,mBAAmB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QACxC,CAAC,IATI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CAUzB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
1
2
|
interface StickyBottomMenuBurgerProps {
|
|
2
3
|
isActive?: boolean;
|
|
3
|
-
onClick?: () => void;
|
|
4
|
+
onClick?: (e: PreventableEvent) => void;
|
|
4
5
|
}
|
|
5
6
|
export declare const StickyBottomMenuBurger: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuBurgerProps, any, any>;
|
|
6
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenuBurger.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuBurger.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAA8B,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChG,kBACE,SAAS,EAAE,KAAK,CACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,QAAQ,aAEb,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,YAAY,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAI,gCAElF,CACV,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { type DialogOptions } from '../../ui-kit/DialogManager/useDialogManager';
|
|
1
3
|
import { type BurgerMenuDialogProps } from './BurgerMenuDialog';
|
|
2
4
|
export declare const BURGER_MENU_DIALOG_ID = "burgerMenuDialog";
|
|
3
5
|
export declare const useBurgerMenuDialog: (props: BurgerMenuDialogProps) => [boolean, {
|
|
4
6
|
open: () => void;
|
|
5
7
|
close: () => void;
|
|
6
8
|
toggle: () => void;
|
|
9
|
+
openDialog: (dialog: VNode, options: DialogOptions) => void;
|
|
7
10
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBurgerMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/useBurgerMenuDialog.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useBurgerMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/useBurgerMenuDialog.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAElF,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAA4B,EAS5B,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEjE,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,YAAY,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAC,gBAAgB,OAAK,KAAK,GAAI,EAAE,EAAE,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC9F,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,IAAI,gBAAgB,EAAE;YACpB,QAAQ,EAAE,CAAC;SACZ;aAAM;YACL,IAAI,EAAE,CAAC;SACR;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { type PreventableEvent } from '../PreventableEvent';
|
|
2
3
|
export interface DialogProps {
|
|
3
4
|
className?: string;
|
|
4
5
|
head?: VNode;
|
|
5
6
|
onClose?: () => void;
|
|
7
|
+
onClick?: (e: PreventableEvent) => void;
|
|
6
8
|
}
|
|
7
9
|
export declare const Dialog: import("@redneckz/uni-jsx").UNIComponent<DialogProps, any, any>;
|
|
@@ -4,12 +4,12 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
4
4
|
import { style } from '../../utils/style.js';
|
|
5
5
|
import { CloseButton } from './CloseButton.js';
|
|
6
6
|
import { useDialogManager } from './useDialogManager.js';
|
|
7
|
-
export const Dialog = JSX(({ className, head, children, onClose }) => {
|
|
7
|
+
export const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
8
8
|
const { close } = useDialogManager();
|
|
9
9
|
const handleClose = useCallback(() => {
|
|
10
10
|
close();
|
|
11
11
|
onClose && onClose();
|
|
12
12
|
}, [onClose]);
|
|
13
|
-
return (_jsxs("div", { className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [_jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [_jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), _jsx("div", { className: "container", children: head })] }), _jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
13
|
+
return (_jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [_jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [_jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), _jsx("div", { className: "container", children: head })] }), _jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/ui-kit/DialogManager/Dialog.t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CAAC,CAAC"}
|
|
@@ -4757,6 +4757,15 @@
|
|
|
4757
4757
|
|
|
4758
4758
|
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", type: "button", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
4759
4759
|
|
|
4760
|
+
const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
4761
|
+
const { close } = useDialogManager();
|
|
4762
|
+
const handleClose = useCallback(() => {
|
|
4763
|
+
close();
|
|
4764
|
+
onClose && onClose();
|
|
4765
|
+
}, [onClose]);
|
|
4766
|
+
return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
4767
|
+
});
|
|
4768
|
+
|
|
4760
4769
|
const StickyBottomMenuBurger = JSX(({ isActive, onClick }) => (jsxs("button", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), onClick: onClick, type: "button", children: [jsx(Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
4761
4770
|
|
|
4762
4771
|
const StickyBottomMenuItem = JSX(({ isActive, item, onClick }) => {
|
|
@@ -4815,14 +4824,128 @@
|
|
|
4815
4824
|
return [activeIndex, items[activeIndex]];
|
|
4816
4825
|
}
|
|
4817
4826
|
|
|
4818
|
-
const
|
|
4827
|
+
const groupBy = (list, keyGetter) => {
|
|
4828
|
+
const result = new Map();
|
|
4829
|
+
for (const item of list) {
|
|
4830
|
+
const key = keyGetter(item);
|
|
4831
|
+
const group = result.get(key) || [];
|
|
4832
|
+
result.set(key, [...group, item]);
|
|
4833
|
+
}
|
|
4834
|
+
return result;
|
|
4835
|
+
};
|
|
4836
|
+
|
|
4837
|
+
const JARO_WINKLER_P = 0.1;
|
|
4838
|
+
const JARO_WINKLER_MAX_L = 4;
|
|
4839
|
+
const jaroWinklerDistance = (s1) => (s2) => {
|
|
4840
|
+
if (s1 === s2) {
|
|
4841
|
+
return 1;
|
|
4842
|
+
}
|
|
4843
|
+
if (!s1 || !s2) {
|
|
4844
|
+
return 0;
|
|
4845
|
+
}
|
|
4846
|
+
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
4847
|
+
if (m === 0) {
|
|
4848
|
+
return 0;
|
|
4849
|
+
}
|
|
4850
|
+
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
4851
|
+
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
4852
|
+
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
4853
|
+
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
4854
|
+
};
|
|
4855
|
+
function computeM(s1, s2) {
|
|
4856
|
+
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
4857
|
+
const s1Matches = Array.from({ length: s1.length });
|
|
4858
|
+
const s2Matches = Array.from({ length: s2.length });
|
|
4859
|
+
let m = 0;
|
|
4860
|
+
for (let i = 0; i < s1.length; i++) {
|
|
4861
|
+
const low = Math.max(0, i - range);
|
|
4862
|
+
const high = Math.min(i + range, s2.length - 1);
|
|
4863
|
+
for (let j = low; j <= high; j++) {
|
|
4864
|
+
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
4865
|
+
continue;
|
|
4866
|
+
}
|
|
4867
|
+
m++;
|
|
4868
|
+
s1Matches[i] = true;
|
|
4869
|
+
s2Matches[j] = true;
|
|
4870
|
+
}
|
|
4871
|
+
}
|
|
4872
|
+
return { m, s1Matches, s2Matches };
|
|
4873
|
+
}
|
|
4874
|
+
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
4875
|
+
let t = 0;
|
|
4876
|
+
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
4877
|
+
if (!s1Matches[i]) {
|
|
4878
|
+
continue;
|
|
4879
|
+
}
|
|
4880
|
+
let j = k;
|
|
4881
|
+
for (; j < s2.length; j++) {
|
|
4882
|
+
if (s2Matches[j]) {
|
|
4883
|
+
k = j + 1;
|
|
4884
|
+
break;
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4887
|
+
if (s1[i] !== s2[j]) {
|
|
4888
|
+
t++;
|
|
4889
|
+
}
|
|
4890
|
+
}
|
|
4891
|
+
return t;
|
|
4892
|
+
}
|
|
4893
|
+
function computePrefixL(s1, s2) {
|
|
4894
|
+
let prefixL = 0;
|
|
4895
|
+
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
4896
|
+
prefixL++;
|
|
4897
|
+
}
|
|
4898
|
+
return prefixL;
|
|
4899
|
+
}
|
|
4900
|
+
|
|
4901
|
+
const renderForeignOffices = (foreignOffices) => foreignOffices?.length ? (jsxs("div", { className: "sm:border-t sm:border-main-divider mt-2xs pt-2xs", children: [jsx("div", { className: "mb-m", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: "\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0437\u0430 \u0440\u0443\u0431\u0435\u0436\u043E\u043C:" }) }), jsx("div", { className: "flex flex-col sm:flex-row gap-5xl", children: foreignOffices.map((office, i) => (jsx(ForeignOffice, { ...office }, String(i)))) })] })) : null;
|
|
4902
|
+
const ForeignOffice = JSX(({ icon, ...rest }) => {
|
|
4903
|
+
const link = useLink();
|
|
4904
|
+
const { text, target, href, onClick } = link(rest);
|
|
4905
|
+
return (jsxs("div", { className: "flex gap-s items-center", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }) })) : null] }));
|
|
4906
|
+
});
|
|
4907
|
+
|
|
4908
|
+
const renderRegion = (onChangeLocation) => (region) => region.name ? (jsx(LinkWrapper, { isRemote: true, href: `/branches/${region.slug}`, className: "mb-xs sm:mb-2xs hover:text-primary-hover", onClick: () => {
|
|
4909
|
+
onChangeLocation && onChangeLocation(region);
|
|
4910
|
+
}, children: jsx(Text, { size: "text-l", font: "font-light", children: region.name }) }, String(region.id))) : null;
|
|
4911
|
+
|
|
4912
|
+
const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
|
|
4913
|
+
|
|
4914
|
+
const SearchBar = JSX(({ className, searchTerm, onSearch }) => {
|
|
4915
|
+
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: `h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border
|
|
4916
|
+
outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text`, value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
4917
|
+
});
|
|
4918
|
+
|
|
4919
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
4920
|
+
const LocationDialog = JSX(({ foreignOffices, defaultLocation }) => {
|
|
4921
|
+
const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
|
|
4922
|
+
const link = useLink({ isRemote: true });
|
|
4923
|
+
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
4924
|
+
const [query, setQuery] = useState('');
|
|
4925
|
+
const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
|
|
4926
|
+
const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
|
|
4819
4927
|
const { close } = useDialogManager();
|
|
4820
|
-
const
|
|
4928
|
+
const handleChangeLocation = useCallback((region) => {
|
|
4929
|
+
selectCurrentLocation(region);
|
|
4821
4930
|
close();
|
|
4822
|
-
|
|
4823
|
-
}, [
|
|
4824
|
-
|
|
4825
|
-
|
|
4931
|
+
}, []);
|
|
4932
|
+
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { isRemote: true, href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
4933
|
+
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
4934
|
+
.map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
|
|
4935
|
+
});
|
|
4936
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) || '';
|
|
4937
|
+
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
4938
|
+
...region,
|
|
4939
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
|
|
4940
|
+
}));
|
|
4941
|
+
|
|
4942
|
+
const useLocationDialog = (props) => {
|
|
4943
|
+
const { open, close } = useDialogManager();
|
|
4944
|
+
return {
|
|
4945
|
+
open: (options = {}) => open(jsx(LocationDialog, { ...props }), options),
|
|
4946
|
+
close,
|
|
4947
|
+
};
|
|
4948
|
+
};
|
|
4826
4949
|
|
|
4827
4950
|
const ActiveSubMenuItem = JSX(({ item, basePath }) => {
|
|
4828
4951
|
const isAnotherPortal = projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
@@ -4830,13 +4953,15 @@
|
|
|
4830
4953
|
const { href, target, onClick } = link(item);
|
|
4831
4954
|
const router = useRouter();
|
|
4832
4955
|
const isActive = isHrefActive(router)({ href });
|
|
4833
|
-
return (jsx("div", { className: "mt-3", children: jsxs("a", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `
|
|
4956
|
+
return (jsx("div", { className: "mt-3", children: jsxs("a", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `p-4 text-h5 font-light flex justify-between cursor-pointer`, 'shadow-main-black', 'rounded-xl'), href: href, target: target, onClick: onClick, children: [item.text, jsx(Img, { image: { icon: 'ArrowRightIcon', iconVersion: 'color' }, width: "24", height: "24", className: "text-secondary-text opacity-30" })] }) }));
|
|
4834
4957
|
});
|
|
4835
4958
|
|
|
4836
4959
|
const TopItemMobile = ({ item, isActive, onClick }) => (jsx("div", { className: style('relative rounded-2xl p-2', isActive ? 'bg-primary-main' : 'bg-main-gray'), children: jsx("button", { type: "button", className: "relative", onClick: onClick, children: jsx("span", { className: style('whitespace-nowrap', isActive ? 'text-white' : ''), children: item.text }) }) }));
|
|
4837
4960
|
|
|
4838
4961
|
const BurgerMenuDialog = JSX((props) => {
|
|
4839
|
-
const { topItems, officesLink } = props;
|
|
4962
|
+
const { topItems, defaultLocation, officesLink } = props;
|
|
4963
|
+
const [location] = useLocation(defaultLocation);
|
|
4964
|
+
const locationDialog = useLocationDialog(props);
|
|
4840
4965
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
4841
4966
|
itemCount: topItems?.length ?? 0,
|
|
4842
4967
|
});
|
|
@@ -4853,10 +4978,11 @@
|
|
|
4853
4978
|
}
|
|
4854
4979
|
}, [activeTopItemIndex, scroll]);
|
|
4855
4980
|
const handleTopItemClick = useCallback((idx) => setActiveTopItemIndex(idx), []);
|
|
4856
|
-
return (jsx(Dialog, { head: jsx("div", { className: "flex items-center", children: jsx(Heading, { as: "h4", title: "\u041C\u0435\u043D\u044E" }) }), children: jsxs("div", { className: "flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md", children: [jsx("div", { className: "w-full mb-3", children: jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: 0, gap: 10, className: "pb-3", children: topItems?.map((item, i) => (jsx(TopItemMobile, { item: item, isActive: activeTopItemIndex === i, onClick: () => handleTopItemClick(i) }, String(i)))) }) }), jsxs("div", { className: "relative grow", children: [renderActiveSubMenu(activeMenuSubItems, activeRoute?.href), renderOfficeLink(officesLink)] })] }) }));
|
|
4981
|
+
return (jsx(Dialog, { onClick: (e) => e.stopPropagation(), head: jsx("div", { className: "flex items-center", children: jsx(Heading, { as: "h4", title: "\u041C\u0435\u043D\u044E" }) }), children: jsxs("div", { className: "flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md", children: [jsx("div", { className: "w-full mb-3", children: jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: 0, gap: 10, className: "pb-3", children: topItems?.map((item, i) => (jsx(TopItemMobile, { item: item, isActive: activeTopItemIndex === i, onClick: () => handleTopItemClick(i) }, String(i)))) }) }), jsxs("div", { className: "relative grow", children: [renderActiveSubMenu(activeMenuSubItems, activeRoute?.href), renderOfficeLink(officesLink), renderLocation(location, () => locationDialog.open())] })] }) }));
|
|
4857
4982
|
});
|
|
4858
4983
|
const renderActiveSubMenu = (activeMenuSubItems, basePath) => activeMenuSubItems ? (jsx("div", { children: activeMenuSubItems.map((_, i) => (jsx(ActiveSubMenuItem, { item: _, basePath: basePath }, String(i)))) })) : null;
|
|
4859
|
-
const renderOfficeLink = (officesLink) => officesLink ? (jsx("div", { className: "mt-3", children: jsxs("a", { className: style('text-primary-text', `
|
|
4984
|
+
const renderOfficeLink = (officesLink) => officesLink ? (jsx("div", { className: "mt-3", children: jsxs("a", { className: style('text-primary-text', `p-4 text-h5 font-light flex justify-between cursor-pointer`, 'shadow-main-black', 'rounded-xl'), href: officesLink, rel: "noopener noreferrer", "aria-label": "\u041E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", children: [jsx("span", { children: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B" }), jsx(Img, { image: { icon: 'ArrowRightIcon', iconVersion: 'color' }, width: "24", height: "24", className: "text-secondary-text opacity-30" })] }) })) : null;
|
|
4985
|
+
const renderLocation = (location, onClick) => (jsxs("div", { className: style('text-primary-text', `p-4 text-h5 font-light flex justify-between cursor-pointer`, 'shadow-main-black', 'rounded-xl', 'mt-3'), onClick: onClick, children: [jsx("div", { className: "flex flex-col items-start", children: jsxs("span", { children: ["\u0412\u0430\u0448\u0430 \u043B\u043E\u043A\u0430\u0446\u0438\u044F - ", location.name] }) }), jsx(Img, { image: { icon: 'ArrowRightIcon', iconVersion: 'color' }, width: "24", height: "24", className: "text-secondary-text opacity-30" })] }));
|
|
4860
4986
|
|
|
4861
4987
|
const BURGER_MENU_DIALOG_ID = 'burgerMenuDialog';
|
|
4862
4988
|
const useBurgerMenuDialog = (props) => {
|
|
@@ -4872,55 +4998,48 @@
|
|
|
4872
4998
|
open();
|
|
4873
4999
|
}
|
|
4874
5000
|
};
|
|
4875
|
-
return [isBurgerMenuOpen, { open, close, toggle }];
|
|
5001
|
+
return [isBurgerMenuOpen, { open, close, toggle, openDialog }];
|
|
4876
5002
|
};
|
|
4877
5003
|
|
|
4878
5004
|
const EMPTY_MENU = [];
|
|
4879
5005
|
// eslint-disable-next-line max-lines-per-function
|
|
4880
5006
|
const StickyBottomMenu = UniBlock(({ sticky, ...rest }) => {
|
|
4881
5007
|
const { menuItems = EMPTY_MENU } = sticky ?? {};
|
|
4882
|
-
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog(rest.options?.page?.sitemap ?? {});
|
|
4883
|
-
const popup = usePopupManager();
|
|
5008
|
+
const [isBurgerMenuDialogOpen, { toggle, close, openDialog }] = useBurgerMenuDialog(rest.options?.page?.sitemap ?? {});
|
|
4884
5009
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
4885
5010
|
const leftItems = menuItems.slice(0, middleIdx);
|
|
4886
5011
|
const rightItems = menuItems.slice(middleIdx);
|
|
4887
5012
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
4888
5013
|
const [currentItemPosition, setCurrentItemPosition] = useState('');
|
|
4889
|
-
const [
|
|
4890
|
-
const
|
|
4891
|
-
|
|
5014
|
+
const [popupDialogState, { setFalse: setPopupDialogClosed, setTrue: setPopupDialogOpened }] = useBool();
|
|
5015
|
+
const closePopupDialog = useCallback(() => {
|
|
5016
|
+
setPopupDialogClosed();
|
|
4892
5017
|
setActiveIndex(-1);
|
|
4893
5018
|
setCurrentItemPosition('');
|
|
4894
|
-
|
|
4895
|
-
}, [
|
|
5019
|
+
close();
|
|
5020
|
+
}, [close]);
|
|
4896
5021
|
const menuRef = useRef(null);
|
|
4897
|
-
const
|
|
4898
|
-
const
|
|
4899
|
-
|
|
5022
|
+
const popupDialogRef = useOutsideClick(closePopupDialog);
|
|
5023
|
+
const openPopupDialog = useCallback((index, itemsPosition) => {
|
|
5024
|
+
setPopupDialogOpened();
|
|
4900
5025
|
close();
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
top: Math.max(globalThis.document?.documentElement?.clientHeight || 0, globalThis.innerHeight || 0) *
|
|
4904
|
-
0.3 -
|
|
4905
|
-
134,
|
|
4906
|
-
left: menuDimensions?.left || 0,
|
|
4907
|
-
width: menuDimensions?.width,
|
|
4908
|
-
fixed: true,
|
|
5026
|
+
openDialog(jsx(Dialog, { onClick: (e) => e.stopPropagation(), className: "mt-[20%]", onClose: closePopupDialog, head: jsx("div", { className: "flex items-center", children: jsx(Heading, { as: "h4", title: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title }) }), children: jsx("div", { className: "bg-white pb-24 pt-1 text-l", ref: popupDialogRef }) }), {
|
|
5027
|
+
id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title,
|
|
4909
5028
|
});
|
|
4910
|
-
}, [close,
|
|
5029
|
+
}, [close, closePopupDialog]);
|
|
4911
5030
|
const handleMenuItemClick = useCallback((index, itemsPosition) => {
|
|
4912
5031
|
setCurrentItemPosition(itemsPosition);
|
|
4913
5032
|
setActiveIndex(index);
|
|
4914
|
-
|
|
4915
|
-
}, [
|
|
5033
|
+
openPopupDialog(index, itemsPosition);
|
|
5034
|
+
}, [openPopupDialog]);
|
|
4916
5035
|
useEffect(() => {
|
|
4917
|
-
if (!
|
|
5036
|
+
if (!popupDialogRef.current) {
|
|
4918
5037
|
return;
|
|
4919
5038
|
}
|
|
4920
|
-
if (!
|
|
4921
|
-
|
|
5039
|
+
if (!popupDialogRef.current.shadowRoot) {
|
|
5040
|
+
popupDialogRef.current?.attachShadow({ mode: 'open' });
|
|
4922
5041
|
}
|
|
4923
|
-
const shadowRoot =
|
|
5042
|
+
const shadowRoot = popupDialogRef.current.shadowRoot;
|
|
4924
5043
|
if (!shadowRoot) {
|
|
4925
5044
|
return;
|
|
4926
5045
|
}
|
|
@@ -4930,8 +5049,12 @@
|
|
|
4930
5049
|
else {
|
|
4931
5050
|
shadowRoot.innerHTML = rightItems[activeIndex]?.__html || '';
|
|
4932
5051
|
}
|
|
4933
|
-
}, [activeIndex, currentItemPosition,
|
|
4934
|
-
return (jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick:
|
|
5052
|
+
}, [activeIndex, currentItemPosition, popupDialogState]);
|
|
5053
|
+
return (jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: (e) => {
|
|
5054
|
+
closePopupDialog();
|
|
5055
|
+
e.stopPropagation();
|
|
5056
|
+
toggle();
|
|
5057
|
+
} }), rightItems.map(renderMenuItem(handleMenuItemClick, 'right', { activeIndex, currentItemPosition }))] }) }));
|
|
4935
5058
|
});
|
|
4936
5059
|
const renderMenuItem = (handleMenuItemClick, itemsPosition, currentActiveItem) => (_, i, arr) => {
|
|
4937
5060
|
return (jsx(StickyBottomMenuItem, { item: _, isActive: arr[currentActiveItem.activeIndex]?.title === _?.title &&
|
|
@@ -5531,7 +5654,7 @@
|
|
|
5531
5654
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
5532
5655
|
});
|
|
5533
5656
|
|
|
5534
|
-
const packageVersion = "0.14.
|
|
5657
|
+
const packageVersion = "0.14.257";
|
|
5535
5658
|
|
|
5536
5659
|
exports.Blocks = Blocks;
|
|
5537
5660
|
exports.ContentPage = ContentPage;
|