@gravity-ui/page-constructor 3.11.0 → 3.12.0
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/README.md +6 -6
- package/build/cjs/components/Media/Image/Image.js +3 -2
- package/build/cjs/hooks/useHeightCalculator.js +1 -1
- package/build/cjs/models/navigation.d.ts +3 -2
- package/build/{esm/navigation/components/Header/Header.css → cjs/navigation/components/DesktopNavigation/DesktopNavigation.css} +28 -36
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +4 -0
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.js +21 -0
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.css +7 -0
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.d.ts +3 -0
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +15 -0
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.css +10 -5
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -10
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js +7 -30
- package/build/cjs/navigation/components/Navigation/Navigation.css +8 -13
- package/build/cjs/navigation/components/Navigation/Navigation.d.ts +4 -7
- package/build/cjs/navigation/components/Navigation/Navigation.js +37 -15
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +28 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.d.ts +3 -9
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +15 -6
- package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.d.ts +5 -4
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +12 -7
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationList/NavigationList.d.ts +3 -0
- package/build/cjs/navigation/components/NavigationList/NavigationList.js +11 -0
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.d.ts +4 -13
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +6 -13
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.css +5 -4
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.d.ts +1 -8
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +6 -6
- package/build/cjs/navigation/containers/Layout/Layout.js +2 -2
- package/build/cjs/navigation/models.d.ts +63 -0
- package/build/cjs/navigation/{constants.js → models.js} +7 -1
- package/build/cjs/navigation/utils.d.ts +11 -1
- package/build/cjs/navigation/utils.js +19 -1
- package/build/esm/components/Media/Image/Image.js +3 -2
- package/build/esm/hooks/useHeightCalculator.js +1 -1
- package/build/esm/models/navigation.d.ts +3 -2
- package/build/{cjs/navigation/components/Header/Header.css → esm/navigation/components/DesktopNavigation/DesktopNavigation.css} +28 -36
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +5 -0
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.js +19 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.css +7 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.d.ts +4 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +11 -0
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.css +10 -5
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -10
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js +9 -31
- package/build/esm/navigation/components/Navigation/Navigation.css +8 -13
- package/build/esm/navigation/components/Navigation/Navigation.d.ts +4 -7
- package/build/esm/navigation/components/Navigation/Navigation.js +35 -15
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +28 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.d.ts +4 -9
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +16 -6
- package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.d.ts +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.d.ts +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.d.ts +5 -4
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +12 -7
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.d.ts +1 -1
- package/build/esm/navigation/components/NavigationList/NavigationList.d.ts +3 -0
- package/build/esm/navigation/components/NavigationList/NavigationList.js +7 -0
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.d.ts +4 -14
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +5 -10
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.css +5 -4
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.d.ts +1 -8
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +6 -6
- package/build/esm/navigation/containers/Layout/Layout.js +2 -2
- package/build/esm/navigation/models.d.ts +63 -0
- package/build/esm/navigation/{constants.js → models.js} +6 -0
- package/build/esm/navigation/utils.d.ts +11 -1
- package/build/esm/navigation/utils.js +17 -0
- package/package.json +20 -12
- package/server/models/navigation.d.ts +3 -2
- package/widget/index.js +1 -1
- package/CHANGELOG.md +0 -1484
- package/build/cjs/navigation/components/Header/Header.d.ts +0 -8
- package/build/cjs/navigation/components/Header/Header.js +0 -86
- package/build/cjs/navigation/components/NavigationDropdownItem/NavigationDropdownItem.d.ts +0 -11
- package/build/cjs/navigation/components/NavigationDropdownItem/NavigationDropdownItem.js +0 -15
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.css +0 -27
- package/build/cjs/navigation/constants.d.ts +0 -6
- package/build/esm/navigation/components/Header/Header.d.ts +0 -9
- package/build/esm/navigation/components/Header/Header.js +0 -82
- package/build/esm/navigation/components/NavigationDropdownItem/NavigationDropdownItem.d.ts +0 -11
- package/build/esm/navigation/components/NavigationDropdownItem/NavigationDropdownItem.js +0 -13
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.css +0 -27
- package/build/esm/navigation/constants.d.ts +0 -6
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HeaderData, ThemedNavigationLogoData } from '../../../models';
|
|
3
|
-
export interface HeaderProps {
|
|
4
|
-
logo: ThemedNavigationLogoData;
|
|
5
|
-
data: HeaderData;
|
|
6
|
-
}
|
|
7
|
-
export declare const Header: React.FC<HeaderProps>;
|
|
8
|
-
export default Header;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Header = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
|
-
const Control_1 = tslib_1.__importDefault(require("../../../components/Control/Control"));
|
|
8
|
-
const OutsideClick_1 = tslib_1.__importDefault(require("../../../components/OutsideClick/OutsideClick"));
|
|
9
|
-
const grid_1 = require("../../../grid");
|
|
10
|
-
const icons_1 = require("../../../icons");
|
|
11
|
-
const models_1 = require("../../../models");
|
|
12
|
-
const utils_1 = require("../../../utils");
|
|
13
|
-
const constants_1 = require("../../constants");
|
|
14
|
-
const Logo_1 = tslib_1.__importDefault(require("../Logo/Logo"));
|
|
15
|
-
const MobileNavigation_1 = tslib_1.__importDefault(require("../MobileNavigation/MobileNavigation"));
|
|
16
|
-
const Navigation_1 = tslib_1.__importDefault(require("../Navigation/Navigation"));
|
|
17
|
-
const NavigationListItem_1 = require("../NavigationListItem/NavigationListItem");
|
|
18
|
-
const b = (0, utils_1.block)('header');
|
|
19
|
-
const ICON_SIZE = 36;
|
|
20
|
-
const MobileMenuButton = ({ isSidebarOpened, onSidebarOpenedChange, }) => {
|
|
21
|
-
const iconProps = {
|
|
22
|
-
icon: isSidebarOpened ? icons_1.NavigationClose : icons_1.NavigationOpen,
|
|
23
|
-
iconSize: ICON_SIZE,
|
|
24
|
-
};
|
|
25
|
-
return (react_1.default.createElement(Control_1.default, Object.assign({ className: b('mobile-menu-button'), onClick: (e) => {
|
|
26
|
-
e.stopPropagation();
|
|
27
|
-
onSidebarOpenedChange(!isSidebarOpened);
|
|
28
|
-
}, size: "l" }, iconProps)));
|
|
29
|
-
};
|
|
30
|
-
const iconSizeKey = 'iconSize';
|
|
31
|
-
const isButtonItem = (item) => item.type === models_1.NavigationItemType.Button;
|
|
32
|
-
const isDropdownItem = (item) => item.type === models_1.NavigationItemType.Dropdown;
|
|
33
|
-
const Header = ({ data, logo }) => {
|
|
34
|
-
const { leftItems, rightItems, iconSize = 20, withBorder = false } = data;
|
|
35
|
-
const [isSidebarOpened, setIsSidebarOpened] = (0, react_1.useState)(false);
|
|
36
|
-
const [activeItemId, setActiveItemId] = (0, react_1.useState)(undefined);
|
|
37
|
-
const [showBorder, setShowBorder] = (0, react_1.useState)(withBorder);
|
|
38
|
-
const getNavigationItemWithIconSize = (0, react_1.useCallback)((item) => {
|
|
39
|
-
const newItem = Object.assign({}, item);
|
|
40
|
-
if ('items' in newItem && isDropdownItem(newItem)) {
|
|
41
|
-
newItem.items = newItem.items.map(getNavigationItemWithIconSize);
|
|
42
|
-
}
|
|
43
|
-
if (!(iconSizeKey in newItem) && !isButtonItem(newItem)) {
|
|
44
|
-
newItem.iconSize = iconSize;
|
|
45
|
-
}
|
|
46
|
-
return newItem;
|
|
47
|
-
}, [iconSize]);
|
|
48
|
-
const leftItemsWithIconSize = (0, react_1.useMemo)(() => leftItems.map(getNavigationItemWithIconSize), [getNavigationItemWithIconSize, leftItems]);
|
|
49
|
-
const rightItemsWithIconSize = (0, react_1.useMemo)(() => rightItems === null || rightItems === void 0 ? void 0 : rightItems.map(getNavigationItemWithIconSize), [getNavigationItemWithIconSize, rightItems]);
|
|
50
|
-
const onActiveItemChange = (0, react_1.useCallback)((id) => {
|
|
51
|
-
setActiveItemId(id);
|
|
52
|
-
}, []);
|
|
53
|
-
const hidePopup = (0, react_1.useCallback)(() => {
|
|
54
|
-
onActiveItemChange();
|
|
55
|
-
}, [onActiveItemChange]);
|
|
56
|
-
const onSidebarOpenedChange = (0, react_1.useCallback)((isOpen) => {
|
|
57
|
-
setIsSidebarOpened(isOpen);
|
|
58
|
-
}, []);
|
|
59
|
-
const hideSidebar = (0, react_1.useCallback)(() => {
|
|
60
|
-
setIsSidebarOpened(false);
|
|
61
|
-
}, []);
|
|
62
|
-
(0, react_1.useEffect)(() => {
|
|
63
|
-
const showBorderOnScroll = () => {
|
|
64
|
-
if (!showBorder) {
|
|
65
|
-
setShowBorder(window.scrollY > 0);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
window.addEventListener('scroll', lodash_1.default.debounce(showBorderOnScroll, 20), { passive: true });
|
|
69
|
-
return () => window.removeEventListener('scroll', lodash_1.default.debounce(showBorderOnScroll, 20));
|
|
70
|
-
});
|
|
71
|
-
return (react_1.default.createElement(grid_1.Grid, { className: b({ 'with-border': showBorder }) },
|
|
72
|
-
react_1.default.createElement(grid_1.Row, null,
|
|
73
|
-
react_1.default.createElement(grid_1.Col, null,
|
|
74
|
-
react_1.default.createElement("header", { className: b('wrapper') },
|
|
75
|
-
logo && (react_1.default.createElement("div", { className: b('left') },
|
|
76
|
-
react_1.default.createElement(Logo_1.default, Object.assign({}, logo, { className: b('logo') })))),
|
|
77
|
-
react_1.default.createElement("div", { className: b('navigation-container') },
|
|
78
|
-
react_1.default.createElement(Navigation_1.default, { className: b('navigation'), links: leftItemsWithIconSize, activeItemId: activeItemId, onActiveItemChange: onActiveItemChange })),
|
|
79
|
-
react_1.default.createElement("div", { className: b('right') },
|
|
80
|
-
react_1.default.createElement(MobileMenuButton, { isSidebarOpened: isSidebarOpened, onSidebarOpenedChange: onSidebarOpenedChange }),
|
|
81
|
-
rightItemsWithIconSize && (react_1.default.createElement("ul", { className: b('buttons') }, rightItemsWithIconSize.map((button, index) => (react_1.default.createElement(NavigationListItem_1.NavigationListItem, { key: index, className: b('buttons-item'), item: button, index: index, activeItemId: activeItemId, hidePopup: hidePopup, column: constants_1.ItemColumnName.Right, onActiveItemChange: onActiveItemChange })))))),
|
|
82
|
-
react_1.default.createElement(OutsideClick_1.default, { onOutsideClick: () => onSidebarOpenedChange(false) },
|
|
83
|
-
react_1.default.createElement(MobileNavigation_1.default, { topItems: leftItems, bottomItems: rightItems, isOpened: isSidebarOpened, activeItemId: activeItemId, onActiveItemChange: onActiveItemChange, onClose: hideSidebar })))))));
|
|
84
|
-
};
|
|
85
|
-
exports.Header = Header;
|
|
86
|
-
exports.default = exports.Header;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import { NavigationDropdownItem } from '../../../models';
|
|
3
|
-
export interface NavigationDropdownProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
data: NavigationDropdownItem;
|
|
6
|
-
onClick: MouseEventHandler;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
hidePopup: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const NavigationDropdown: React.FC<NavigationDropdownProps>;
|
|
11
|
-
export default NavigationDropdown;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
const NavigationItem_1 = tslib_1.__importDefault(require("../NavigationItem/NavigationItem"));
|
|
7
|
-
const NavigationPopup_1 = tslib_1.__importDefault(require("../NavigationPopup/NavigationPopup"));
|
|
8
|
-
const NavigationDropdown = ({ className, data, isActive, hidePopup, onClick, }) => {
|
|
9
|
-
const anchorRef = (0, react_1.useRef)(null);
|
|
10
|
-
const { text, icon, items, iconSize } = data, popupProps = tslib_1.__rest(data, ["text", "icon", "items", "iconSize"]);
|
|
11
|
-
return (react_1.default.createElement(react_1.Fragment, null,
|
|
12
|
-
react_1.default.createElement(NavigationItem_1.default, { className: className, ref: anchorRef, onClick: onClick, isOpened: isActive, data: { text, type: models_1.NavigationItemType.Dropdown, icon, iconSize } }),
|
|
13
|
-
react_1.default.createElement(NavigationPopup_1.default, Object.assign({ open: isActive, onClose: hidePopup, items: items, anchorRef: anchorRef }, popupProps))));
|
|
14
|
-
};
|
|
15
|
-
exports.default = NavigationDropdown;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-navigation-list-item {
|
|
4
|
-
height: var(--header-height);
|
|
5
|
-
line-height: var(--header-height);
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
outline: none;
|
|
8
|
-
color: inherit;
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
}
|
|
11
|
-
.utilityfocus .pc-navigation-list-item:focus {
|
|
12
|
-
outline: 2px solid #ffdb4d;
|
|
13
|
-
}
|
|
14
|
-
.pc-navigation-list-item__content:hover, .pc-navigation-list-item__content:active {
|
|
15
|
-
color: var(--yc-color-text-link);
|
|
16
|
-
}
|
|
17
|
-
.pc-navigation-list-item__slider-container {
|
|
18
|
-
position: absolute;
|
|
19
|
-
right: 0;
|
|
20
|
-
bottom: 0;
|
|
21
|
-
left: 0;
|
|
22
|
-
}
|
|
23
|
-
.pc-navigation-list-item__slider {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 2px;
|
|
26
|
-
background-color: var(--yc-color-text-link);
|
|
27
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HeaderData, ThemedNavigationLogoData } from '../../../models';
|
|
3
|
-
import './Header.css';
|
|
4
|
-
export interface HeaderProps {
|
|
5
|
-
logo: ThemedNavigationLogoData;
|
|
6
|
-
data: HeaderData;
|
|
7
|
-
}
|
|
8
|
-
export declare const Header: React.FC<HeaderProps>;
|
|
9
|
-
export default Header;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import Control from '../../../components/Control/Control';
|
|
4
|
-
import OutsideClick from '../../../components/OutsideClick/OutsideClick';
|
|
5
|
-
import { Col, Grid, Row } from '../../../grid';
|
|
6
|
-
import { NavigationClose, NavigationOpen } from '../../../icons';
|
|
7
|
-
import { NavigationItemType, } from '../../../models';
|
|
8
|
-
import { block } from '../../../utils';
|
|
9
|
-
import { ItemColumnName } from '../../constants';
|
|
10
|
-
import Logo from '../Logo/Logo';
|
|
11
|
-
import MobileNavigation from '../MobileNavigation/MobileNavigation';
|
|
12
|
-
import Navigation from '../Navigation/Navigation';
|
|
13
|
-
import { NavigationListItem } from '../NavigationListItem/NavigationListItem';
|
|
14
|
-
import './Header.css';
|
|
15
|
-
const b = block('header');
|
|
16
|
-
const ICON_SIZE = 36;
|
|
17
|
-
const MobileMenuButton = ({ isSidebarOpened, onSidebarOpenedChange, }) => {
|
|
18
|
-
const iconProps = {
|
|
19
|
-
icon: isSidebarOpened ? NavigationClose : NavigationOpen,
|
|
20
|
-
iconSize: ICON_SIZE,
|
|
21
|
-
};
|
|
22
|
-
return (React.createElement(Control, Object.assign({ className: b('mobile-menu-button'), onClick: (e) => {
|
|
23
|
-
e.stopPropagation();
|
|
24
|
-
onSidebarOpenedChange(!isSidebarOpened);
|
|
25
|
-
}, size: "l" }, iconProps)));
|
|
26
|
-
};
|
|
27
|
-
const iconSizeKey = 'iconSize';
|
|
28
|
-
const isButtonItem = (item) => item.type === NavigationItemType.Button;
|
|
29
|
-
const isDropdownItem = (item) => item.type === NavigationItemType.Dropdown;
|
|
30
|
-
export const Header = ({ data, logo }) => {
|
|
31
|
-
const { leftItems, rightItems, iconSize = 20, withBorder = false } = data;
|
|
32
|
-
const [isSidebarOpened, setIsSidebarOpened] = useState(false);
|
|
33
|
-
const [activeItemId, setActiveItemId] = useState(undefined);
|
|
34
|
-
const [showBorder, setShowBorder] = useState(withBorder);
|
|
35
|
-
const getNavigationItemWithIconSize = useCallback((item) => {
|
|
36
|
-
const newItem = Object.assign({}, item);
|
|
37
|
-
if ('items' in newItem && isDropdownItem(newItem)) {
|
|
38
|
-
newItem.items = newItem.items.map(getNavigationItemWithIconSize);
|
|
39
|
-
}
|
|
40
|
-
if (!(iconSizeKey in newItem) && !isButtonItem(newItem)) {
|
|
41
|
-
newItem.iconSize = iconSize;
|
|
42
|
-
}
|
|
43
|
-
return newItem;
|
|
44
|
-
}, [iconSize]);
|
|
45
|
-
const leftItemsWithIconSize = useMemo(() => leftItems.map(getNavigationItemWithIconSize), [getNavigationItemWithIconSize, leftItems]);
|
|
46
|
-
const rightItemsWithIconSize = useMemo(() => rightItems === null || rightItems === void 0 ? void 0 : rightItems.map(getNavigationItemWithIconSize), [getNavigationItemWithIconSize, rightItems]);
|
|
47
|
-
const onActiveItemChange = useCallback((id) => {
|
|
48
|
-
setActiveItemId(id);
|
|
49
|
-
}, []);
|
|
50
|
-
const hidePopup = useCallback(() => {
|
|
51
|
-
onActiveItemChange();
|
|
52
|
-
}, [onActiveItemChange]);
|
|
53
|
-
const onSidebarOpenedChange = useCallback((isOpen) => {
|
|
54
|
-
setIsSidebarOpened(isOpen);
|
|
55
|
-
}, []);
|
|
56
|
-
const hideSidebar = useCallback(() => {
|
|
57
|
-
setIsSidebarOpened(false);
|
|
58
|
-
}, []);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const showBorderOnScroll = () => {
|
|
61
|
-
if (!showBorder) {
|
|
62
|
-
setShowBorder(window.scrollY > 0);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
window.addEventListener('scroll', _.debounce(showBorderOnScroll, 20), { passive: true });
|
|
66
|
-
return () => window.removeEventListener('scroll', _.debounce(showBorderOnScroll, 20));
|
|
67
|
-
});
|
|
68
|
-
return (React.createElement(Grid, { className: b({ 'with-border': showBorder }) },
|
|
69
|
-
React.createElement(Row, null,
|
|
70
|
-
React.createElement(Col, null,
|
|
71
|
-
React.createElement("header", { className: b('wrapper') },
|
|
72
|
-
logo && (React.createElement("div", { className: b('left') },
|
|
73
|
-
React.createElement(Logo, Object.assign({}, logo, { className: b('logo') })))),
|
|
74
|
-
React.createElement("div", { className: b('navigation-container') },
|
|
75
|
-
React.createElement(Navigation, { className: b('navigation'), links: leftItemsWithIconSize, activeItemId: activeItemId, onActiveItemChange: onActiveItemChange })),
|
|
76
|
-
React.createElement("div", { className: b('right') },
|
|
77
|
-
React.createElement(MobileMenuButton, { isSidebarOpened: isSidebarOpened, onSidebarOpenedChange: onSidebarOpenedChange }),
|
|
78
|
-
rightItemsWithIconSize && (React.createElement("ul", { className: b('buttons') }, rightItemsWithIconSize.map((button, index) => (React.createElement(NavigationListItem, { key: index, className: b('buttons-item'), item: button, index: index, activeItemId: activeItemId, hidePopup: hidePopup, column: ItemColumnName.Right, onActiveItemChange: onActiveItemChange })))))),
|
|
79
|
-
React.createElement(OutsideClick, { onOutsideClick: () => onSidebarOpenedChange(false) },
|
|
80
|
-
React.createElement(MobileNavigation, { topItems: leftItems, bottomItems: rightItems, isOpened: isSidebarOpened, activeItemId: activeItemId, onActiveItemChange: onActiveItemChange, onClose: hideSidebar })))))));
|
|
81
|
-
};
|
|
82
|
-
export default Header;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import { NavigationDropdownItem } from '../../../models';
|
|
3
|
-
export interface NavigationDropdownProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
data: NavigationDropdownItem;
|
|
6
|
-
onClick: MouseEventHandler;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
hidePopup: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const NavigationDropdown: React.FC<NavigationDropdownProps>;
|
|
11
|
-
export default NavigationDropdown;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React, { Fragment, useRef } from 'react';
|
|
3
|
-
import { NavigationItemType } from '../../../models';
|
|
4
|
-
import NavigationItem from '../NavigationItem/NavigationItem';
|
|
5
|
-
import NavigationPopup from '../NavigationPopup/NavigationPopup';
|
|
6
|
-
const NavigationDropdown = ({ className, data, isActive, hidePopup, onClick, }) => {
|
|
7
|
-
const anchorRef = useRef(null);
|
|
8
|
-
const { text, icon, items, iconSize } = data, popupProps = __rest(data, ["text", "icon", "items", "iconSize"]);
|
|
9
|
-
return (React.createElement(Fragment, null,
|
|
10
|
-
React.createElement(NavigationItem, { className: className, ref: anchorRef, onClick: onClick, isOpened: isActive, data: { text, type: NavigationItemType.Dropdown, icon, iconSize } }),
|
|
11
|
-
React.createElement(NavigationPopup, Object.assign({ open: isActive, onClose: hidePopup, items: items, anchorRef: anchorRef }, popupProps))));
|
|
12
|
-
};
|
|
13
|
-
export default NavigationDropdown;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-navigation-list-item {
|
|
4
|
-
height: var(--header-height);
|
|
5
|
-
line-height: var(--header-height);
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
outline: none;
|
|
8
|
-
color: inherit;
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
}
|
|
11
|
-
.utilityfocus .pc-navigation-list-item:focus {
|
|
12
|
-
outline: 2px solid #ffdb4d;
|
|
13
|
-
}
|
|
14
|
-
.pc-navigation-list-item__content:hover, .pc-navigation-list-item__content:active {
|
|
15
|
-
color: var(--yc-color-text-link);
|
|
16
|
-
}
|
|
17
|
-
.pc-navigation-list-item__slider-container {
|
|
18
|
-
position: absolute;
|
|
19
|
-
right: 0;
|
|
20
|
-
bottom: 0;
|
|
21
|
-
left: 0;
|
|
22
|
-
}
|
|
23
|
-
.pc-navigation-list-item__slider {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 2px;
|
|
26
|
-
background-color: var(--yc-color-text-link);
|
|
27
|
-
}
|