@redneckz/wildless-cms-uni-blocks 0.14.80 → 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 +4 -19
- 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/dist/ui-kit/YandexMap/YandexMap.js +1 -2
- package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/lib/common.css +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/lib/ui-kit/YandexMap/YandexMap.js +1 -2
- package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +18 -54
- 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/dist/ui-kit/YandexMap/YandexMap.js +1 -2
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/lib/common.css +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/lib/ui-kit/YandexMap/YandexMap.js +1 -2
- package/mobile/lib/ui-kit/YandexMap/YandexMap.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/mobile/src/ui-kit/YandexMap/YandexMap.tsx +0 -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/src/ui-kit/YandexMap/YandexMap.tsx +0 -4
- package/bundle/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/bundle/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +0 -2
- 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/dist/ui-kit/YandexMap/renderOpenMap.d.ts +0 -2
- package/dist/ui-kit/YandexMap/renderOpenMap.js +0 -19
- package/dist/ui-kit/YandexMap/renderOpenMap.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/lib/ui-kit/YandexMap/renderOpenMap.d.ts +0 -1
- package/lib/ui-kit/YandexMap/renderOpenMap.js +0 -16
- package/lib/ui-kit/YandexMap/renderOpenMap.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/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +0 -2
- 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/dist/ui-kit/YandexMap/renderOpenMap.d.ts +0 -2
- package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js +0 -19
- package/mobile/dist/ui-kit/YandexMap/renderOpenMap.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/lib/ui-kit/YandexMap/renderOpenMap.d.ts +0 -2
- package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js +0 -16
- package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js.map +0 -1
- package/mobile/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/mobile/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
- package/mobile/src/ui-kit/YandexMap/renderOpenMap.tsx +0 -26
- package/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
- package/src/ui-kit/YandexMap/renderOpenMap.tsx +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YandexMap.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/YandexMap.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,cAAc;AACd,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,
|
|
1
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IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC"}
|
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
3
3
|
import { useSWRResource } from '../../hooks/useSWRResource';
|
|
4
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger';
|
|
7
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
8
|
+
import { StickyBottomMenuItem } from './StickyBottomMenuItem';
|
|
9
|
+
import { type StickyBottomMenuProps } from './StickyBottomMenuProps';
|
|
8
10
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
9
11
|
|
|
12
|
+
const EMPTY_MENU = [];
|
|
13
|
+
|
|
10
14
|
export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
11
|
-
const {
|
|
15
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
16
|
+
|
|
17
|
+
const { menuItems = EMPTY_MENU } = useSWRResource<StickyBottomMenuProps>(
|
|
12
18
|
projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu',
|
|
13
19
|
{ fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true },
|
|
14
20
|
);
|
|
15
21
|
|
|
16
|
-
const [
|
|
22
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
17
23
|
|
|
18
|
-
const burgerMenu = {
|
|
19
|
-
title: 'Меню',
|
|
20
|
-
icon: {
|
|
21
|
-
icon: 'BurgerIcon',
|
|
22
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
23
|
-
},
|
|
24
|
-
isActive: isBurgerMenuDialogOpen,
|
|
25
|
-
};
|
|
26
24
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
[
|
|
30
|
-
...menuItems.slice(0, middleIdx),
|
|
31
|
-
burgerMenu,
|
|
32
|
-
...menuItems.slice(middleIdx),
|
|
33
|
-
] as MenuItemProps[],
|
|
34
|
-
[menuItems, middleIdx, burgerMenu],
|
|
35
|
-
);
|
|
25
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
26
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
36
27
|
|
|
37
28
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
38
29
|
return (
|
|
@@ -41,8 +32,22 @@ export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
|
41
32
|
className="@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]"
|
|
42
33
|
padding="p-0"
|
|
43
34
|
>
|
|
44
|
-
<
|
|
35
|
+
<div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
|
|
36
|
+
{leftItems.map(renderMenuItem(activeItem, close))}
|
|
37
|
+
<StickyBottomMenuBurger isActive={isBurgerMenuDialogOpen} onClick={toggle} />
|
|
38
|
+
{rightItems.map(renderMenuItem(activeItem, close))}
|
|
39
|
+
</div>
|
|
45
40
|
</BlockWrapper>
|
|
46
41
|
</div>
|
|
47
42
|
);
|
|
48
43
|
});
|
|
44
|
+
|
|
45
|
+
const renderMenuItem = (activeItem: MenuItem, close: () => void) => (_: MenuItem, i: number) =>
|
|
46
|
+
(
|
|
47
|
+
<StickyBottomMenuItem
|
|
48
|
+
key={_.href || String(i)}
|
|
49
|
+
isActive={_ === activeItem}
|
|
50
|
+
item={_}
|
|
51
|
+
onClick={close}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
|
|
5
|
+
interface StickyBottomMenuBurgerProps {
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StickyBottomMenuBurger = JSX<StickyBottomMenuBurgerProps>(({ isActive, onClick }) => (
|
|
11
|
+
<button
|
|
12
|
+
className={style(
|
|
13
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
14
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
15
|
+
)}
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
>
|
|
18
|
+
<Icon className="w-6 h-6" name="BurgerIcon" iconVersion={isActive ? 'color' : 'black'} />
|
|
19
|
+
Меню
|
|
20
|
+
</button>
|
|
21
|
+
));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
4
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
7
|
+
|
|
8
|
+
interface StickyBottomMenuItemProps {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
item?: MenuItem;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const StickyBottomMenuItem = JSX<StickyBottomMenuItemProps>(
|
|
15
|
+
({ isActive, item, onClick }) => {
|
|
16
|
+
const isAnotherPortal =
|
|
17
|
+
!projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
18
|
+
|
|
19
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
20
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<a
|
|
24
|
+
className={style(
|
|
25
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
26
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
27
|
+
)}
|
|
28
|
+
href={href}
|
|
29
|
+
target="_self"
|
|
30
|
+
title={item?.title || ''}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
>
|
|
33
|
+
<Icon
|
|
34
|
+
className="w-6 h-6"
|
|
35
|
+
name={item?.icon?.icon}
|
|
36
|
+
iconVersion={isActive ? 'color' : 'black'}
|
|
37
|
+
/>
|
|
38
|
+
{item?.title || ''}
|
|
39
|
+
</a>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
3
|
|
|
4
|
-
export interface MenuItemProps extends MenuItem {
|
|
5
|
-
isActive?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
9
|
-
menuItems?:
|
|
5
|
+
menuItems?: MenuItem[];
|
|
10
6
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { isTopItemActive } from '../components/Header/isTopItemActive';
|
|
2
|
-
import { type TopMenuItemProps } from '../services/sitemap/SitemapData';
|
|
3
2
|
import { useRouter } from './useRouter';
|
|
4
3
|
|
|
5
|
-
export function useActiveRoute(
|
|
6
|
-
items:
|
|
7
|
-
): [number,
|
|
4
|
+
export function useActiveRoute<T extends { href?: string }>(
|
|
5
|
+
items: T[] | undefined = [],
|
|
6
|
+
): [number, T] {
|
|
8
7
|
const router = useRouter();
|
|
9
8
|
const activeIndex = items.findIndex(isTopItemActive(router));
|
|
10
9
|
|
|
@@ -6,7 +6,6 @@ import type ymaps from 'yandex-maps';
|
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
7
|
import { Icon } from '../Icon/Icon';
|
|
8
8
|
import { renderClusterer } from './renderClusterer';
|
|
9
|
-
import { renderOpenMap } from './renderOpenMap';
|
|
10
9
|
import { renderUserGeolocation } from './renderUserGeolocation';
|
|
11
10
|
import { useYandexMaps } from './useYandexMaps';
|
|
12
11
|
import { ZoomButton } from './ZoomButton';
|
|
@@ -89,9 +88,6 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
89
88
|
|
|
90
89
|
return (
|
|
91
90
|
<div id="map" className={style(!isFullScreen && 'relative', 'w-full', className)}>
|
|
92
|
-
<div className={style('absolute flex left-2 top-4 w-1/2', zIndex)}>
|
|
93
|
-
{renderOpenMap(pointsCenter)}
|
|
94
|
-
</div>
|
|
95
91
|
<div
|
|
96
92
|
className={style(Object.values(FULLSCREEN_STYLES), zIndex, 'right-2 top-4 bg-white')}
|
|
97
93
|
onClick={toggleFullscreen}
|
package/package.json
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
3
3
|
import { useSWRResource } from '../../hooks/useSWRResource';
|
|
4
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger';
|
|
7
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
8
|
+
import { StickyBottomMenuItem } from './StickyBottomMenuItem';
|
|
9
|
+
import { type StickyBottomMenuProps } from './StickyBottomMenuProps';
|
|
8
10
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
9
11
|
|
|
12
|
+
const EMPTY_MENU = [];
|
|
13
|
+
|
|
10
14
|
export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
11
|
-
const {
|
|
15
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
16
|
+
|
|
17
|
+
const { menuItems = EMPTY_MENU } = useSWRResource<StickyBottomMenuProps>(
|
|
12
18
|
projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu',
|
|
13
19
|
{ fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true },
|
|
14
20
|
);
|
|
15
21
|
|
|
16
|
-
const [
|
|
22
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
17
23
|
|
|
18
|
-
const burgerMenu = {
|
|
19
|
-
title: 'Меню',
|
|
20
|
-
icon: {
|
|
21
|
-
icon: 'BurgerIcon',
|
|
22
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
23
|
-
},
|
|
24
|
-
isActive: isBurgerMenuDialogOpen,
|
|
25
|
-
};
|
|
26
24
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
[
|
|
30
|
-
...menuItems.slice(0, middleIdx),
|
|
31
|
-
burgerMenu,
|
|
32
|
-
...menuItems.slice(middleIdx),
|
|
33
|
-
] as MenuItemProps[],
|
|
34
|
-
[menuItems, middleIdx, burgerMenu],
|
|
35
|
-
);
|
|
25
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
26
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
36
27
|
|
|
37
28
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
38
29
|
return (
|
|
@@ -41,8 +32,22 @@ export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
|
41
32
|
className="@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]"
|
|
42
33
|
padding="p-0"
|
|
43
34
|
>
|
|
44
|
-
<
|
|
35
|
+
<div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
|
|
36
|
+
{leftItems.map(renderMenuItem(activeItem, close))}
|
|
37
|
+
<StickyBottomMenuBurger isActive={isBurgerMenuDialogOpen} onClick={toggle} />
|
|
38
|
+
{rightItems.map(renderMenuItem(activeItem, close))}
|
|
39
|
+
</div>
|
|
45
40
|
</BlockWrapper>
|
|
46
41
|
</div>
|
|
47
42
|
);
|
|
48
43
|
});
|
|
44
|
+
|
|
45
|
+
const renderMenuItem = (activeItem: MenuItem, close: () => void) => (_: MenuItem, i: number) =>
|
|
46
|
+
(
|
|
47
|
+
<StickyBottomMenuItem
|
|
48
|
+
key={_.href || String(i)}
|
|
49
|
+
isActive={_ === activeItem}
|
|
50
|
+
item={_}
|
|
51
|
+
onClick={close}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
|
|
5
|
+
interface StickyBottomMenuBurgerProps {
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StickyBottomMenuBurger = JSX<StickyBottomMenuBurgerProps>(({ isActive, onClick }) => (
|
|
11
|
+
<button
|
|
12
|
+
className={style(
|
|
13
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
14
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
15
|
+
)}
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
>
|
|
18
|
+
<Icon className="w-6 h-6" name="BurgerIcon" iconVersion={isActive ? 'color' : 'black'} />
|
|
19
|
+
Меню
|
|
20
|
+
</button>
|
|
21
|
+
));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
4
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
7
|
+
|
|
8
|
+
interface StickyBottomMenuItemProps {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
item?: MenuItem;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const StickyBottomMenuItem = JSX<StickyBottomMenuItemProps>(
|
|
15
|
+
({ isActive, item, onClick }) => {
|
|
16
|
+
const isAnotherPortal =
|
|
17
|
+
!projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
18
|
+
|
|
19
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
20
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<a
|
|
24
|
+
className={style(
|
|
25
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
26
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
27
|
+
)}
|
|
28
|
+
href={href}
|
|
29
|
+
target="_self"
|
|
30
|
+
title={item?.title || ''}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
>
|
|
33
|
+
<Icon
|
|
34
|
+
className="w-6 h-6"
|
|
35
|
+
name={item?.icon?.icon}
|
|
36
|
+
iconVersion={isActive ? 'color' : 'black'}
|
|
37
|
+
/>
|
|
38
|
+
{item?.title || ''}
|
|
39
|
+
</a>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
3
|
|
|
4
|
-
export interface MenuItemProps extends MenuItem {
|
|
5
|
-
isActive?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
9
|
-
menuItems?:
|
|
5
|
+
menuItems?: MenuItem[];
|
|
10
6
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { isTopItemActive } from '../components/Header/isTopItemActive';
|
|
2
|
-
import { type TopMenuItemProps } from '../services/sitemap/SitemapData';
|
|
3
2
|
import { useRouter } from './useRouter';
|
|
4
3
|
|
|
5
|
-
export function useActiveRoute(
|
|
6
|
-
items:
|
|
7
|
-
): [number,
|
|
4
|
+
export function useActiveRoute<T extends { href?: string }>(
|
|
5
|
+
items: T[] | undefined = [],
|
|
6
|
+
): [number, T] {
|
|
8
7
|
const router = useRouter();
|
|
9
8
|
const activeIndex = items.findIndex(isTopItemActive(router));
|
|
10
9
|
|
|
@@ -6,7 +6,6 @@ import type ymaps from 'yandex-maps';
|
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
7
|
import { Icon } from '../Icon/Icon';
|
|
8
8
|
import { renderClusterer } from './renderClusterer';
|
|
9
|
-
import { renderOpenMap } from './renderOpenMap';
|
|
10
9
|
import { renderUserGeolocation } from './renderUserGeolocation';
|
|
11
10
|
import { useYandexMaps } from './useYandexMaps';
|
|
12
11
|
import { ZoomButton } from './ZoomButton';
|
|
@@ -89,9 +88,6 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
89
88
|
|
|
90
89
|
return (
|
|
91
90
|
<div id="map" className={style(!isFullScreen && 'relative', 'w-full', className)}>
|
|
92
|
-
<div className={style('absolute flex left-2 top-4 w-1/2', zIndex)}>
|
|
93
|
-
{renderOpenMap(pointsCenter)}
|
|
94
|
-
</div>
|
|
95
91
|
<div
|
|
96
92
|
className={style(Object.values(FULLSCREEN_STYLES), zIndex, 'right-2 top-4 bg-white')}
|
|
97
93
|
onClick={toggleFullscreen}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderItemProps {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
item?: MenuItemProps;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const RenderItem: import("@redneckz/uni-jsx").UNIComponent<RenderItemProps, any, any>;
|
|
8
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderMenuItems {
|
|
3
|
-
menuItems: MenuItemProps[];
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const RenderMenuItems: import("@redneckz/uni-jsx").UNIComponent<RenderMenuItems, any, any>;
|
|
7
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderItemProps {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
item?: MenuItemProps;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const RenderItem: import("@redneckz/uni-jsx").UNIComponent<RenderItemProps, any, any>;
|
|
8
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.RenderItem = 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 Img_1 = require("../../ui-kit/Img/Img");
|
|
8
|
-
const style_1 = require("../../utils/style");
|
|
9
|
-
exports.RenderItem = (0, uni_jsx_1.JSX)(({ isActive, item, onClick }) => {
|
|
10
|
-
const isAnotherPortal = ProjectSettings_1.projectSettings?.BASE_PATH
|
|
11
|
-
? !item?.href?.startsWith(ProjectSettings_1.projectSettings?.BASE_PATH)
|
|
12
|
-
: true;
|
|
13
|
-
const link = (0, useLink_1.useLink)({ isRemote: isAnotherPortal });
|
|
14
|
-
const { href, target, onClick: handleClick, } = link({
|
|
15
|
-
href: item?.href || '',
|
|
16
|
-
target: '_self',
|
|
17
|
-
});
|
|
18
|
-
const isActiveItem = item?.icon?.icon === 'BurgerIcon' ? item.isActive : isActive;
|
|
19
|
-
const iconVersion = isActiveItem ? 'color' : 'black';
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)("a", { className: (0, style_1.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: [(0, jsx_runtime_1.jsx)(Img_1.Img, { className: "w-6 h-6", image: {
|
|
21
|
-
icon: item?.icon?.icon,
|
|
22
|
-
iconVersion: iconVersion,
|
|
23
|
-
} }), item?.title || ''] }));
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=RenderItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/RenderItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAC9C,2DAAwD;AACxD,8CAA2C;AAC3C,6CAA0C;AAS7B,QAAA,UAAU,GAAG,IAAA,aAAG,EAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7E,MAAM,eAAe,GAAG,iCAAe,EAAE,SAAS;QAChD,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,iCAAe,EAAE,SAAS,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EAAE,WAAW,GACrB,GAAG,IAAI,CAAC;QACP,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE;QACtB,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClF,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAErD,OAAO,CACL,+BACE,SAAS,EAAE,IAAA,aAAK,EACd,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACxD,2EAA2E,CAC5E,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,EACzF,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,aAEd,uBAAC,SAAG,IACF,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE;oBACL,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;oBACtB,WAAW,EAAE,WAAW;iBACzB,GACD,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderMenuItems {
|
|
3
|
-
menuItems: MenuItemProps[];
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const RenderMenuItems: import("@redneckz/uni-jsx").UNIComponent<RenderMenuItems, any, any>;
|
|
7
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.RenderMenuItems = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const useActiveRoute_1 = require("../../hooks/useActiveRoute");
|
|
6
|
-
const RenderItem_1 = require("./RenderItem");
|
|
7
|
-
exports.RenderMenuItems = (0, uni_jsx_1.JSX)(({ menuItems, onClick }) => {
|
|
8
|
-
const [activeIndex] = (0, useActiveRoute_1.useActiveRoute)(menuItems);
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: menuItems.map((_, i) => ((0, jsx_runtime_1.jsx)(RenderItem_1.RenderItem, { isActive: i === activeIndex, item: _, onClick: onClick }, String(i)))) }));
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=RenderMenuItems.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMenuItems.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/RenderMenuItems.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,+DAA4D;AAC5D,6CAA0C;AAQ7B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAkB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7E,MAAM,CAAC,WAAW,CAAC,GAAG,IAAA,+BAAc,EAAC,SAAS,CAAC,CAAC;IAEhD,OAAO,CACL,gCAAK,SAAS,EAAC,iEAAiE,YAC7E,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,uBAAC,uBAAU,IAAiB,QAAQ,EAAE,CAAC,KAAK,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,IAAjE,MAAM,CAAC,CAAC,CAAC,CAA4D,CACvF,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.renderOpenMap = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
const styles = {
|
|
5
|
-
focus: 'focus:border-primary-text focus:border',
|
|
6
|
-
hover: 'hover:bg-primary-hover',
|
|
7
|
-
active: 'active:bg-primary-active',
|
|
8
|
-
border: 'border border-transparent rounded-md',
|
|
9
|
-
position: 'flex items-center justify-center',
|
|
10
|
-
font: 'text-center font-sans',
|
|
11
|
-
};
|
|
12
|
-
const renderOpenMap = (pointsCenter) => {
|
|
13
|
-
const getYandexMapUrl = () => {
|
|
14
|
-
return `https://yandex.ru/maps/?ll=${[pointsCenter[1], pointsCenter[0]]}&z=10&l=map`;
|
|
15
|
-
};
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("a", { className: `select-none cursor-pointer px-4xl h-12 bg-primary-main text-white ${Object.values(styles).join(' ')}`, href: getYandexMapUrl(), target: "_blank", children: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043A\u0430\u0440\u0442\u0435" }));
|
|
17
|
-
};
|
|
18
|
-
exports.renderOpenMap = renderOpenMap;
|
|
19
|
-
//# sourceMappingURL=renderOpenMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderOpenMap.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/renderOpenMap.tsx"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,wCAAwC;IAC/C,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,0BAA0B;IAClC,MAAM,EAAE,sCAAsC;IAC9C,QAAQ,EAAE,kCAAkC;IAC5C,IAAI,EAAE,uBAAuB;CAC9B,CAAC;AAEK,MAAM,aAAa,GAAG,CAAC,YAAsB,EAAE,EAAE;IACtD,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,OAAO,8BAA8B,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IACvF,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,SAAS,EAAE,qEAAqE,MAAM,CAAC,MAAM,CAC3F,MAAM,CACP,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACb,IAAI,EAAE,eAAe,EAAE,EACvB,MAAM,EAAC,QAAQ,uGAGb,CACL,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderItemProps {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
item?: MenuItemProps;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const RenderItem: import("@redneckz/uni-jsx").UNIComponent<RenderItemProps, any, any>;
|
|
8
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
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 { Img } from '../../ui-kit/Img/Img.js';
|
|
6
|
-
import { style } from '../../utils/style.js';
|
|
7
|
-
export const RenderItem = JSX(({ isActive, item, onClick }) => {
|
|
8
|
-
const isAnotherPortal = projectSettings?.BASE_PATH
|
|
9
|
-
? !item?.href?.startsWith(projectSettings?.BASE_PATH)
|
|
10
|
-
: true;
|
|
11
|
-
const link = useLink({ isRemote: isAnotherPortal });
|
|
12
|
-
const { href, target, onClick: handleClick, } = link({
|
|
13
|
-
href: item?.href || '',
|
|
14
|
-
target: '_self',
|
|
15
|
-
});
|
|
16
|
-
const isActiveItem = item?.icon?.icon === 'BurgerIcon' ? item.isActive : isActive;
|
|
17
|
-
const iconVersion = isActiveItem ? 'color' : 'black';
|
|
18
|
-
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: {
|
|
19
|
-
icon: item?.icon?.icon,
|
|
20
|
-
iconVersion: iconVersion,
|
|
21
|
-
} }), item?.title || ''] }));
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=RenderItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/RenderItem.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,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7E,MAAM,eAAe,GAAG,eAAe,EAAE,SAAS;QAChD,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EAAE,WAAW,GACrB,GAAG,IAAI,CAAC;QACP,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE;QACtB,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClF,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAErD,OAAO,CACL,aACE,SAAS,EAAE,KAAK,CACd,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACxD,2EAA2E,CAC5E,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,EACzF,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,aAEd,KAAC,GAAG,IACF,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE;oBACL,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;oBACtB,WAAW,EAAE,WAAW;iBACzB,GACD,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderMenuItems {
|
|
3
|
-
menuItems: MenuItemProps[];
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const RenderMenuItems: import("@redneckz/uni-jsx").UNIComponent<RenderMenuItems, any, any>;
|
|
7
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { useActiveRoute } from '../../hooks/useActiveRoute.js';
|
|
4
|
-
import { RenderItem } from './RenderItem.js';
|
|
5
|
-
export const RenderMenuItems = JSX(({ menuItems, onClick }) => {
|
|
6
|
-
const [activeIndex] = useActiveRoute(menuItems);
|
|
7
|
-
return (_jsx("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: menuItems.map((_, i) => (_jsx(RenderItem, { isActive: i === activeIndex, item: _, onClick: onClick }, String(i)))) }));
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=RenderMenuItems.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMenuItems.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/RenderMenuItems.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAkB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7E,MAAM,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAEhD,OAAO,CACL,cAAK,SAAS,EAAC,iEAAiE,YAC7E,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,KAAC,UAAU,IAAiB,QAAQ,EAAE,CAAC,KAAK,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,IAAjE,MAAM,CAAC,CAAC,CAAC,CAA4D,CACvF,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const renderOpenMap: (pointsCenter: number[]) => JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
const styles = {
|
|
3
|
-
focus: 'focus:border-primary-text focus:border',
|
|
4
|
-
hover: 'hover:bg-primary-hover',
|
|
5
|
-
active: 'active:bg-primary-active',
|
|
6
|
-
border: 'border border-transparent rounded-md',
|
|
7
|
-
position: 'flex items-center justify-center',
|
|
8
|
-
font: 'text-center font-sans',
|
|
9
|
-
};
|
|
10
|
-
export const renderOpenMap = (pointsCenter) => {
|
|
11
|
-
const getYandexMapUrl = () => {
|
|
12
|
-
return `https://yandex.ru/maps/?ll=${[pointsCenter[1], pointsCenter[0]]}&z=10&l=map`;
|
|
13
|
-
};
|
|
14
|
-
return (_jsx("a", { className: `select-none cursor-pointer px-4xl h-12 bg-primary-main text-white ${Object.values(styles).join(' ')}`, href: getYandexMapUrl(), target: "_blank", children: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043A\u0430\u0440\u0442\u0435" }));
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=renderOpenMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderOpenMap.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/renderOpenMap.tsx"],"names":[],"mappings":";AAAA,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,wCAAwC;IAC/C,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,0BAA0B;IAClC,MAAM,EAAE,sCAAsC;IAC9C,QAAQ,EAAE,kCAAkC;IAC5C,IAAI,EAAE,uBAAuB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAsB,EAAE,EAAE;IACtD,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,OAAO,8BAA8B,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IACvF,CAAC,CAAC;IAEF,OAAO,CACL,YACE,SAAS,EAAE,qEAAqE,MAAM,CAAC,MAAM,CAC3F,MAAM,CACP,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACb,IAAI,EAAE,eAAe,EAAE,EACvB,MAAM,EAAC,QAAQ,uGAGb,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderItemProps {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
item?: MenuItemProps;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const RenderItem: import("@redneckz/uni-jsx").UNIComponent<RenderItemProps, any, any>;
|
|
8
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MenuItemProps } from './StickyBottomMenuProps';
|
|
2
|
-
interface RenderMenuItems {
|
|
3
|
-
menuItems: MenuItemProps[];
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const RenderMenuItems: import("@redneckz/uni-jsx").UNIComponent<RenderMenuItems, any, any>;
|
|
7
|
-
export {};
|