@redneckz/wildless-cms-uni-blocks 0.14.81 → 0.14.82
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 +1 -1
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/bundle/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/bundle/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/bundle/hooks/useActiveRoute.d.ts +3 -2
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +11 -18
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js +8 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +15 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/dist/hooks/useActiveRoute.d.ts +3 -2
- package/dist/hooks/useActiveRoute.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +12 -19
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js +6 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +13 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/lib/hooks/useActiveRoute.d.ts +3 -2
- package/lib/hooks/useActiveRoute.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +15 -36
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/bundle/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +11 -18
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js +8 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +15 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/dist/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/dist/hooks/useActiveRoute.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +12 -19
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js +6 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +13 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/lib/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/lib/hooks/useActiveRoute.js.map +1 -1
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +28 -23
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +21 -0
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +42 -0
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuProps.tsx +1 -5
- package/mobile/src/hooks/useActiveRoute.ts +3 -4
- package/package.json +1 -1
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +28 -23
- package/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +21 -0
- package/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +42 -0
- package/src/components/StickyBottomMenu/StickyBottomMenuProps.tsx +1 -5
- package/src/hooks/useActiveRoute.ts +3 -4
- package/bundle/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/bundle/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/dist/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/dist/components/StickyBottomMenu/RenderItem.js +0 -25
- package/dist/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/dist/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/dist/components/StickyBottomMenu/RenderMenuItems.js +0 -11
- package/dist/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/lib/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/lib/components/StickyBottomMenu/RenderItem.js +0 -23
- package/lib/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/lib/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/lib/components/StickyBottomMenu/RenderMenuItems.js +0 -9
- package/lib/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/bundle/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/bundle/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/dist/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js +0 -25
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js +0 -11
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/lib/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js +0 -23
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js +0 -9
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/mobile/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
- package/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -2,30 +2,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.StickyBottomMenu = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
5
|
+
const useActiveRoute_1 = require("../../hooks/useActiveRoute");
|
|
6
6
|
const useSWRResource_1 = require("../../hooks/useSWRResource");
|
|
7
7
|
const ProjectSettings_1 = require("../../ProjectSettings");
|
|
8
8
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
9
|
-
const
|
|
9
|
+
const StickyBottomMenuBurger_1 = require("./StickyBottomMenuBurger");
|
|
10
|
+
const StickyBottomMenuItem_1 = require("./StickyBottomMenuItem");
|
|
10
11
|
const useBurgerMenuDialog_1 = require("./useBurgerMenuDialog");
|
|
12
|
+
const EMPTY_MENU = [];
|
|
11
13
|
exports.StickyBottomMenu = (0, uni_jsx_1.JSX)(({ ...rest }) => {
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
title: 'Меню',
|
|
16
|
-
icon: {
|
|
17
|
-
icon: 'BurgerIcon',
|
|
18
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
19
|
-
},
|
|
20
|
-
isActive: isBurgerMenuDialogOpen,
|
|
21
|
-
};
|
|
14
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = (0, useBurgerMenuDialog_1.useBurgerMenuDialog)();
|
|
15
|
+
const { menuItems = EMPTY_MENU } = (0, useSWRResource_1.useSWRResource)(ProjectSettings_1.projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
16
|
+
const [, activeItem] = (0, useActiveRoute_1.useActiveRoute)(menuItems);
|
|
22
17
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
burgerMenu,
|
|
26
|
-
...menuItems.slice(middleIdx),
|
|
27
|
-
], [menuItems, middleIdx, burgerMenu]);
|
|
18
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
19
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
28
20
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: (0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: (0, jsx_runtime_1.jsx)(
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: (0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: (0, jsx_runtime_1.jsxs)("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(activeItem, close)), (0, jsx_runtime_1.jsx)(StickyBottomMenuBurger_1.StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: toggle }), rightItems.map(renderMenuItem(activeItem, close))] }) }) }));
|
|
30
22
|
});
|
|
23
|
+
const renderMenuItem = (activeItem, close) => (_, i) => ((0, jsx_runtime_1.jsx)(StickyBottomMenuItem_1.StickyBottomMenuItem, { isActive: _ === activeItem, item: _, onClick: close }, _.href || String(i)));
|
|
31
24
|
//# sourceMappingURL=StickyBottomMenu.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,+DAA4D;AAC5D,+DAA4D;AAC5D,2DAAwD;AACxD,4DAAyD;AACzD,qEAAkE;AAElE,iEAA8D;AAE9D,+DAA4D;AAE5D,MAAM,UAAU,GAAG,EAAE,CAAC;AAET,QAAA,gBAAgB,GAAG,IAAA,aAAG,EAAwB,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzE,MAAM,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAA,yCAAmB,GAAE,CAAC;IAE1E,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,GAAG,IAAA,+BAAc,EAC/C,iCAAe,CAAC,kBAAkB,IAAI,oBAAoB,EAC1D,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,CAC9F,CAAC;IAEF,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,IAAA,+BAAc,EAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE9C,uFAAuF;IACvF,OAAO,CACL,gCAAK,SAAS,EAAC,aAAa,oBAAgB,8BAA8B,YACxE,uBAAC,2BAAY,IACX,SAAS,EAAC,6FAA6F,EACvG,OAAO,EAAC,KAAK,YAEb,iCAAK,SAAS,EAAC,iEAAiE,aAC7E,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,EACjD,uBAAC,+CAAsB,IAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAI,EAC5E,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,IAC9C,GACO,GACX,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,UAAoB,EAAE,KAAiB,EAAE,EAAE,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC7F,CACE,uBAAC,2CAAoB,IAEnB,QAAQ,EAAE,CAAC,KAAK,UAAU,EAC1B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,KAAK,IAHT,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAIxB,CACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.StickyBottomMenuBurger = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
6
|
+
const style_1 = require("../../utils/style");
|
|
7
|
+
exports.StickyBottomMenuBurger = (0, uni_jsx_1.JSX)(({ isActive, onClick }) => ((0, jsx_runtime_1.jsxs)("button", { className: (0, style_1.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, children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
8
|
+
//# sourceMappingURL=StickyBottomMenuBurger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuBurger.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAC9C,6CAA0C;AAO7B,QAAA,sBAAsB,GAAG,IAAA,aAAG,EAA8B,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChG,oCACE,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,OAAO,EAAE,OAAO,aAEhB,uBAAC,WAAI,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.StickyBottomMenuItem = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const useLink_1 = require("../../hooks/useLink");
|
|
6
|
+
const ProjectSettings_1 = require("../../ProjectSettings");
|
|
7
|
+
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
8
|
+
const style_1 = require("../../utils/style");
|
|
9
|
+
exports.StickyBottomMenuItem = (0, uni_jsx_1.JSX)(({ isActive, item, onClick }) => {
|
|
10
|
+
const isAnotherPortal = !ProjectSettings_1.projectSettings?.BASE_PATH || !item?.href?.startsWith(ProjectSettings_1.projectSettings.BASE_PATH);
|
|
11
|
+
const link = (0, useLink_1.useLink)({ isRemote: isAnotherPortal });
|
|
12
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("a", { className: (0, style_1.style)(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), href: href, target: "_self", title: item?.title || '', onClick: handleClick, children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=StickyBottomMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAC9C,2DAAwD;AACxD,iDAA8C;AAC9C,6CAA0C;AAS7B,QAAA,oBAAoB,GAAG,IAAA,aAAG,EACrC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,MAAM,eAAe,GACnB,CAAC,iCAAe,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,iCAAe,CAAC,SAAS,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3E,OAAO,CACL,+BACE,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,OAAO,EACd,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,EACxB,OAAO,EAAE,WAAW,aAEpB,uBAAC,WAAI,IACH,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EACtB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GACzC,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":";;AAAA,0EAAuE;
|
|
1
|
+
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":";;AAAA,0EAAuE;AACvE,2CAAwC;AAExC,SAAgB,cAAc,CAC5B,QAAyB,EAAE;IAE3B,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC;AAPD,wCAOC"}
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import {
|
|
3
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute.js';
|
|
4
4
|
import { useSWRResource } from '../../hooks/useSWRResource.js';
|
|
5
5
|
import { projectSettings } from '../../ProjectSettings.js';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
7
|
-
import {
|
|
7
|
+
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger.js';
|
|
8
|
+
import { StickyBottomMenuItem } from './StickyBottomMenuItem.js';
|
|
8
9
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog.js';
|
|
10
|
+
const EMPTY_MENU = [];
|
|
9
11
|
export const StickyBottomMenu = JSX(({ ...rest }) => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
title: 'Меню',
|
|
14
|
-
icon: {
|
|
15
|
-
icon: 'BurgerIcon',
|
|
16
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
17
|
-
},
|
|
18
|
-
isActive: isBurgerMenuDialogOpen,
|
|
19
|
-
};
|
|
12
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
13
|
+
const { menuItems = EMPTY_MENU } = useSWRResource(projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
14
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
20
15
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
burgerMenu,
|
|
24
|
-
...menuItems.slice(middleIdx),
|
|
25
|
-
], [menuItems, middleIdx, burgerMenu]);
|
|
16
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
17
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
26
18
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
27
|
-
return (_jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: _jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: _jsx(
|
|
19
|
+
return (_jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: _jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: _jsxs("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(activeItem, close)), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: toggle }), rightItems.map(renderMenuItem(activeItem, close))] }) }) }));
|
|
28
20
|
});
|
|
21
|
+
const renderMenuItem = (activeItem, close) => (_, i) => (_jsx(StickyBottomMenuItem, { isActive: _ === activeItem, item: _, onClick: close }, _.href || String(i)));
|
|
29
22
|
//# sourceMappingURL=StickyBottomMenu.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.mobile.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzE,MAAM,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC;IAE1E,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,GAAG,cAAc,CAC/C,eAAe,CAAC,kBAAkB,IAAI,oBAAoB,EAC1D,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,CAC9F,CAAC;IAEF,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE9C,uFAAuF;IACvF,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,oBAAgB,8BAA8B,YACxE,KAAC,YAAY,IACX,SAAS,EAAC,6FAA6F,EACvG,OAAO,EAAC,KAAK,YAEb,eAAK,SAAS,EAAC,iEAAiE,aAC7E,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,EACjD,KAAC,sBAAsB,IAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAI,EAC5E,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,IAC9C,GACO,GACX,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,UAAoB,EAAE,KAAiB,EAAE,EAAE,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC7F,CACE,KAAC,oBAAoB,IAEnB,QAAQ,EAAE,CAAC,KAAK,UAAU,EAC1B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,KAAK,IAHT,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAIxB,CACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
4
|
+
import { style } from '../../utils/style.js';
|
|
5
|
+
export 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, children: [_jsx(Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
6
|
+
//# sourceMappingURL=StickyBottomMenuBurger.js.map
|
|
@@ -0,0 +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;AAC9C,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,aAEhB,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useLink } from '../../hooks/useLink.js';
|
|
4
|
+
import { projectSettings } from '../../ProjectSettings.js';
|
|
5
|
+
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
6
|
+
import { style } from '../../utils/style.js';
|
|
7
|
+
export const StickyBottomMenuItem = JSX(({ isActive, item, onClick }) => {
|
|
8
|
+
const isAnotherPortal = !projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
9
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
10
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
11
|
+
return (_jsxs("a", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), href: href, target: "_self", title: item?.title || '', onClick: handleClick, children: [_jsx(Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=StickyBottomMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CACrC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,MAAM,eAAe,GACnB,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3E,OAAO,CACL,aACE,SAAS,EAAE,KAAK,CACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,OAAO,EACd,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,EACxB,OAAO,EAAE,WAAW,aAEpB,KAAC,IAAI,IACH,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EACtB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GACzC,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,cAAc,CAC5B,QAAyB,EAAE;IAE3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -4557,26 +4557,13 @@
|
|
|
4557
4557
|
return [activeIndex, items[activeIndex]];
|
|
4558
4558
|
}
|
|
4559
4559
|
|
|
4560
|
-
const
|
|
4561
|
-
const isAnotherPortal = projectSettings?.BASE_PATH
|
|
4562
|
-
? !item?.href?.startsWith(projectSettings?.BASE_PATH)
|
|
4563
|
-
: true;
|
|
4564
|
-
const link = useLink({ isRemote: isAnotherPortal });
|
|
4565
|
-
const { href, target, onClick: handleClick, } = link({
|
|
4566
|
-
href: item?.href || '',
|
|
4567
|
-
target: '_self',
|
|
4568
|
-
});
|
|
4569
|
-
const isActiveItem = item?.icon?.icon === 'BurgerIcon' ? item.isActive : isActive;
|
|
4570
|
-
const iconVersion = isActiveItem ? 'color' : 'black';
|
|
4571
|
-
return (jsxs("a", { className: style(isActiveItem ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), onClick: () => (item?.icon?.icon === 'BurgerIcon' && onClick ? onClick() : handleClick()), href: href, target: target, children: [jsx(Img, { className: "w-6 h-6", image: {
|
|
4572
|
-
icon: item?.icon?.icon,
|
|
4573
|
-
iconVersion: iconVersion,
|
|
4574
|
-
} }), item?.title || ''] }));
|
|
4575
|
-
});
|
|
4560
|
+
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, children: [jsx(Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
4576
4561
|
|
|
4577
|
-
const
|
|
4578
|
-
const
|
|
4579
|
-
|
|
4562
|
+
const StickyBottomMenuItem = JSX(({ isActive, item, onClick }) => {
|
|
4563
|
+
const isAnotherPortal = !projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
4564
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
4565
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
4566
|
+
return (jsxs("a", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), href: href, target: "_self", title: item?.title || '', onClick: handleClick, children: [jsx(Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
|
|
4580
4567
|
});
|
|
4581
4568
|
|
|
4582
4569
|
const isDialogOpen = (id, dialogs) => dialogs.find((item) => item.id === id, id);
|
|
@@ -4968,26 +4955,18 @@
|
|
|
4968
4955
|
return [Boolean(isBurgerMenuOpen), { open, close, toggle }];
|
|
4969
4956
|
};
|
|
4970
4957
|
|
|
4958
|
+
const EMPTY_MENU = [];
|
|
4971
4959
|
const StickyBottomMenu = JSX(({ ...rest }) => {
|
|
4972
|
-
const
|
|
4973
|
-
const
|
|
4974
|
-
const
|
|
4975
|
-
title: 'Меню',
|
|
4976
|
-
icon: {
|
|
4977
|
-
icon: 'BurgerIcon',
|
|
4978
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
4979
|
-
},
|
|
4980
|
-
isActive: isBurgerMenuDialogOpen,
|
|
4981
|
-
};
|
|
4960
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
4961
|
+
const { menuItems = EMPTY_MENU } = useSWRResource(projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
4962
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
4982
4963
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
4983
|
-
const
|
|
4984
|
-
|
|
4985
|
-
burgerMenu,
|
|
4986
|
-
...menuItems.slice(middleIdx),
|
|
4987
|
-
], [menuItems, middleIdx, burgerMenu]);
|
|
4964
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
4965
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
4988
4966
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
4989
|
-
return (jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: jsx(
|
|
4967
|
+
return (jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: jsxs("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(activeItem, close)), jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: toggle }), rightItems.map(renderMenuItem(activeItem, close))] }) }) }));
|
|
4990
4968
|
});
|
|
4969
|
+
const renderMenuItem = (activeItem, close) => (_, i) => (jsx(StickyBottomMenuItem, { isActive: _ === activeItem, item: _, onClick: close }, _.href || String(i)));
|
|
4991
4970
|
|
|
4992
4971
|
const scrollButtonStyle = 'hidden sm:flex absolute z-40 top-0';
|
|
4993
4972
|
const ScrollableTabsControl = JSX(({ className, items = [], value, onChange, tabsType }) => {
|
|
@@ -5420,7 +5399,7 @@
|
|
|
5420
5399
|
|
|
5421
5400
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
5422
5401
|
|
|
5423
|
-
const packageVersion = "0.14.
|
|
5402
|
+
const packageVersion = "0.14.81";
|
|
5424
5403
|
|
|
5425
5404
|
exports.Blocks = Blocks;
|
|
5426
5405
|
exports.ContentPage = ContentPage;
|