@skbkontur/side-menu 3.1.8 → 3.2.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/CHANGELOG.md +11 -0
- package/SideMenuDataTids.d.ts +8 -8
- package/SideMenuDataTids.js +8 -8
- package/hooks/useAnimateOnMount.d.ts +2 -2
- package/hooks/useAnimateOnMount.js +19 -19
- package/hooks/useMemoIcon.d.ts +8 -8
- package/hooks/useMemoIcon.js +27 -27
- package/index.d.ts +14 -14
- package/index.js +14 -14
- package/internal/themes/SideMenuTheme.d.ts +132 -132
- package/internal/themes/SideMenuTheme.js +291 -291
- package/lib/theming/ThemeHelpers.d.ts +18 -18
- package/lib/theming/ThemeHelpers.js +77 -77
- package/lib/theming/ThemeTypes.d.ts +3 -3
- package/lib/theming/ThemeTypes.js +1 -0
- package/lib/utils/memo.d.ts +1 -1
- package/lib/utils/memo.js +9 -9
- package/lib/utils/scripts.d.ts +5 -5
- package/lib/utils/scripts.js +10 -10
- package/package.json +4 -4
- package/src/Navigation.d.ts +52 -52
- package/src/Navigation.js +191 -156
- package/src/SideMenu/SideMenu.d.ts +90 -90
- package/src/SideMenu/SideMenu.js +315 -315
- package/src/SideMenu/SideMenu.styles.d.ts +27 -27
- package/src/SideMenu/SideMenu.styles.js +77 -77
- package/src/SideMenuAvatar/SideMenuAvatar.d.ts +13 -13
- package/src/SideMenuAvatar/SideMenuAvatar.js +18 -18
- package/src/SideMenuBody/SideMenuBody.d.ts +13 -13
- package/src/SideMenuBody/SideMenuBody.js +27 -27
- package/src/SideMenuBody/SideMenuBody.styles.d.ts +5 -5
- package/src/SideMenuBody/SideMenuBody.styles.js +13 -13
- package/src/SideMenuContext.d.ts +30 -30
- package/src/SideMenuContext.js +2 -2
- package/src/SideMenuDivider/SideMenuDivider.d.ts +10 -10
- package/src/SideMenuDivider/SideMenuDivider.js +19 -19
- package/src/SideMenuDivider/SideMenuDivider.styles.d.ts +4 -4
- package/src/SideMenuDivider/SideMenuDivider.styles.js +10 -10
- package/src/SideMenuDropdown/SideMenuDropdown.d.ts +17 -17
- package/src/SideMenuDropdown/SideMenuDropdown.js +40 -40
- package/src/SideMenuDropdown/SideMenuDropdown.styles.d.ts +7 -7
- package/src/SideMenuDropdown/SideMenuDropdown.styles.js +20 -20
- package/src/SideMenuFooter/SideMenuFooter.d.ts +13 -13
- package/src/SideMenuFooter/SideMenuFooter.js +34 -34
- package/src/SideMenuFooter/SideMenuFooter.styles.d.ts +6 -6
- package/src/SideMenuFooter/SideMenuFooter.styles.js +16 -16
- package/src/SideMenuHeader/SideMenuHeader.d.ts +13 -13
- package/src/SideMenuHeader/SideMenuHeader.js +39 -39
- package/src/SideMenuHeader/SideMenuHeader.styles.d.ts +8 -8
- package/src/SideMenuHeader/SideMenuHeader.styles.js +22 -22
- package/src/SideMenuItem/SideMenuItem.d.ts +15 -15
- package/src/SideMenuItem/SideMenuItem.js +16 -16
- package/src/SideMenuLink/SideMenuLink.d.ts +16 -16
- package/src/SideMenuLink/SideMenuLink.js +21 -21
- package/src/SideMenuLink/SideMenuLink.styles.d.ts +3 -3
- package/src/SideMenuLink/SideMenuLink.styles.js +9 -9
- package/src/SideMenuOrganisations/SideMenuOrganisations.d.ts +10 -10
- package/src/SideMenuOrganisations/SideMenuOrganisations.js +16 -16
- package/src/SideMenuSubItem/SideMenuSubItem.d.ts +12 -12
- package/src/SideMenuSubItem/SideMenuSubItem.js +15 -15
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.d.ts +13 -13
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.js +26 -26
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.d.ts +5 -5
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.js +13 -13
- package/src/SideMenuSubLink/SideMenuSubLink.d.ts +14 -14
- package/src/SideMenuSubLink/SideMenuSubLink.js +18 -18
- package/src/Tree.d.ts +17 -17
- package/src/Tree.js +133 -133
- package/src/internal/BackButton.d.ts +9 -9
- package/src/internal/BackButton.js +25 -25
- package/src/internal/Backdrop.d.ts +4 -4
- package/src/internal/Backdrop.js +13 -13
- package/src/internal/Backdrop.styles.d.ts +3 -3
- package/src/internal/Backdrop.styles.js +10 -10
- package/src/internal/Burger.d.ts +1 -1
- package/src/internal/Burger.js +13 -13
- package/src/internal/Burger.styles.d.ts +4 -4
- package/src/internal/Burger.styles.js +11 -11
- package/src/internal/ClickableElement.d.ts +32 -32
- package/src/internal/ClickableElement.js +141 -141
- package/src/internal/ClickableElement.styles.d.ts +10 -10
- package/src/internal/ClickableElement.styles.js +29 -29
- package/src/internal/InnerSubMenu.d.ts +10 -10
- package/src/internal/InnerSubMenu.js +21 -21
- package/src/internal/ItemContent/Caption.d.ts +9 -9
- package/src/internal/ItemContent/Caption.js +73 -73
- package/src/internal/ItemContent/Caption.styles.d.ts +19 -19
- package/src/internal/ItemContent/Caption.styles.js +51 -51
- package/src/internal/ItemContent/Icon.d.ts +6 -6
- package/src/internal/ItemContent/Icon.js +42 -42
- package/src/internal/ItemContent/Icon.styles.d.ts +10 -10
- package/src/internal/ItemContent/Icon.styles.js +28 -28
- package/src/internal/ItemContent/ItemContent.d.ts +8 -8
- package/src/internal/ItemContent/ItemContent.js +68 -68
- package/src/internal/ItemContent/ItemContent.styles.d.ts +14 -14
- package/src/internal/ItemContent/ItemContent.styles.js +40 -40
- package/src/internal/ItemContent/Marker.d.ts +7 -7
- package/src/internal/ItemContent/Marker.js +21 -21
- package/src/internal/ItemContent/Marker.styles.d.ts +11 -11
- package/src/internal/ItemContent/Marker.styles.js +31 -31
- package/src/internal/NestedMenu.d.ts +10 -10
- package/src/internal/NestedMenu.js +26 -26
- package/src/internal/NestedMenu.styles.d.ts +4 -4
- package/src/internal/NestedMenu.styles.js +10 -10
- package/src/internal/RightBorder.d.ts +9 -9
- package/src/internal/RightBorder.js +33 -33
- package/src/internal/RightBorder.styles.d.ts +5 -5
- package/src/internal/RightBorder.styles.js +13 -13
- package/src/internal/SeparatedSubMenu.d.ts +11 -11
- package/src/internal/SeparatedSubMenu.js +64 -64
- package/src/internal/SeparatedSubMenu.styles.d.ts +13 -13
- package/src/internal/SeparatedSubMenu.styles.js +33 -33
- package/src/internal/SideMenuLogotype.d.ts +6 -6
- package/src/internal/SideMenuLogotype.js +80 -79
- package/src/internal/SideMenuLogotype.styles.d.ts +12 -12
- package/src/internal/SideMenuLogotype.styles.js +31 -31
- package/src/internal/SubMenu.d.ts +13 -13
- package/src/internal/SubMenu.js +25 -25
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
-
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
4
|
-
var styles = {
|
|
5
|
-
root: function (t) {
|
|
6
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n width: ", ";\n height: 100%;\n right: 0;\n background: transparent;\n display: flex;\n color: ", ";\n transition: opacity, color 150ms cubic-bezier(0.5, 1, 0.89, 1);\n &:hover {\n color: ", ";\n }\n "], ["\n opacity: 0;\n position: absolute;\n width: ", ";\n height: 100%;\n right: 0;\n background: transparent;\n display: flex;\n color: ", ";\n transition: opacity, color 150ms cubic-bezier(0.5, 1, 0.89, 1);\n &:hover {\n color: ", ";\n }\n "])), t.sideMenuRightBorderWidth, t.sideMenuRightBorderIconColor, t.sideMenuRightBorderHoverIconColor);
|
|
7
|
-
},
|
|
8
|
-
rootWithButton: function () {
|
|
9
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 1;\n "], ["\n opacity: 1;\n "])));
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
export var jsStyles = memoizeStyle(styles);
|
|
13
|
-
var templateObject_1, templateObject_2;
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
+
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
4
|
+
var styles = {
|
|
5
|
+
root: function (t) {
|
|
6
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n width: ", ";\n height: 100%;\n right: 0;\n background: transparent;\n display: flex;\n color: ", ";\n transition: opacity, color 150ms cubic-bezier(0.5, 1, 0.89, 1);\n &:hover {\n color: ", ";\n }\n "], ["\n opacity: 0;\n position: absolute;\n width: ", ";\n height: 100%;\n right: 0;\n background: transparent;\n display: flex;\n color: ", ";\n transition: opacity, color 150ms cubic-bezier(0.5, 1, 0.89, 1);\n &:hover {\n color: ", ";\n }\n "])), t.sideMenuRightBorderWidth, t.sideMenuRightBorderIconColor, t.sideMenuRightBorderHoverIconColor);
|
|
7
|
+
},
|
|
8
|
+
rootWithButton: function () {
|
|
9
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 1;\n "], ["\n opacity: 1;\n "])));
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export var jsStyles = memoizeStyle(styles);
|
|
13
|
+
var templateObject_1, templateObject_2;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CommonClickableElementProps } from './ClickableElement';
|
|
3
|
-
interface SeparatedSubMenuProps extends Pick<CommonClickableElementProps, 'caption'> {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
htmlId: string;
|
|
6
|
-
isOpened?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const SeparatedSubMenuWithStaticFields: React.ForwardRefExoticComponent<SeparatedSubMenuProps & React.RefAttributes<HTMLDivElement>> & {
|
|
9
|
-
__KONTUR_REACT_UI__: string;
|
|
10
|
-
};
|
|
11
|
-
export { SeparatedSubMenuWithStaticFields as SeparatedSubMenu };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonClickableElementProps } from './ClickableElement';
|
|
3
|
+
interface SeparatedSubMenuProps extends Pick<CommonClickableElementProps, 'caption'> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
htmlId: string;
|
|
6
|
+
isOpened?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const SeparatedSubMenuWithStaticFields: React.ForwardRefExoticComponent<SeparatedSubMenuProps & React.RefAttributes<HTMLDivElement>> & {
|
|
9
|
+
__KONTUR_REACT_UI__: string;
|
|
10
|
+
};
|
|
11
|
+
export { SeparatedSubMenuWithStaticFields as SeparatedSubMenu };
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import React, { forwardRef, useContext, useEffect, useRef } from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import { cx } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
5
|
-
import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
|
|
6
|
-
import { jsStylesForSideMenu } from '../SideMenu/SideMenu.styles';
|
|
7
|
-
import { customStyles, jsStyles } from './SeparatedSubMenu.styles';
|
|
8
|
-
import { SideMenuContext } from '../SideMenuContext';
|
|
9
|
-
import { BackButton } from './BackButton';
|
|
10
|
-
import { SideMenuDataTids } from '../../SideMenuDataTids';
|
|
11
|
-
import { ScrollContainer } from '@skbkontur/react-ui';
|
|
12
|
-
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
13
|
-
import { isIE11 } from '@skbkontur/react-ui/lib/client';
|
|
14
|
-
import { navigationAttributeForSeparatedMenu } from '../Navigation';
|
|
15
|
-
/**
|
|
16
|
-
* Отдельностоящее подменю
|
|
17
|
-
*
|
|
18
|
-
* @visibleName SeparatedSubMenu
|
|
19
|
-
*/
|
|
20
|
-
var SeparatedSubMenu = forwardRef(function (_a, ref) {
|
|
21
|
-
var _b, _c, _d;
|
|
22
|
-
var _e, _f, _g;
|
|
23
|
-
var children = _a.children, caption = _a.caption, htmlId = _a.htmlId, isOpened = _a.isOpened;
|
|
24
|
-
var context = useContext(SideMenuContext);
|
|
25
|
-
var scrollContainerRef = useRef(null);
|
|
26
|
-
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
27
|
-
useEffect(function () {
|
|
28
|
-
if (!context.isMobile) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
setTimeout(function () {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
isOpened && ((_a = context.setHasScrollBar) === null || _a === void 0 ? void 0 : _a.call(context, !!((_b = scrollContainerRef.current) === null || _b === void 0 ? void 0 : _b.hasScrollBar('y'))));
|
|
34
|
-
}, 50);
|
|
35
|
-
}, [(_e = context.navigation) === null || _e === void 0 ? void 0 : _e.activeMenuItem]);
|
|
36
|
-
if (!((_f = context.sideMenuRef) === null || _f === void 0 ? void 0 : _f.current)) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
return ReactDOM.createPortal(React.createElement("div", __assign({ className: cx((_b = {},
|
|
40
|
-
_b[jsStylesForSideMenu.container(theme)] = true,
|
|
41
|
-
_b[jsStylesForSideMenu.containerForTouchScreens(theme)] = context.isTouchScreen,
|
|
42
|
-
_b[jsStyles.root(theme)] = true,
|
|
43
|
-
_b[customStyles.rootForMobiles(context.headerHeight)] = context.isMobile,
|
|
44
|
-
_b[jsStyles.rootForDesktop()] = context.isDesktop,
|
|
45
|
-
_b[jsStyles.rootForTouchScreens(theme)] = context.isTouchScreen && context.isOpened && context.isCollapsable,
|
|
46
|
-
_b[jsStyles.rootForNarrowDesktop(theme)] = context.isCollapsable,
|
|
47
|
-
_b[jsStyles.rootWithShadow(theme)] = context.isTablet && !isIE11,
|
|
48
|
-
_b[jsStylesForSideMenu.hidden()] = !isOpened || (!context.isOpened && (context.isTablet || context.isMobile)),
|
|
49
|
-
_b)), ref: ref, "data-tid": SideMenuDataTids.separatedSubMenu }, (_c = {}, _c[navigationAttributeForSeparatedMenu] = htmlId, _c)),
|
|
50
|
-
React.createElement(ScrollContainer, { onScrollStateChangeY: function (state) {
|
|
51
|
-
var _a;
|
|
52
|
-
(_a = context.setScrollState) === null || _a === void 0 ? void 0 : _a.call(context, state);
|
|
53
|
-
}, ref: scrollContainerRef, showScrollBar: context.isTouchScreen ? 'always' : context.showScrollBar },
|
|
54
|
-
React.createElement("ul", { className: cx((_d = {},
|
|
55
|
-
_d[jsStylesForSideMenu.list()] = true,
|
|
56
|
-
_d[jsStyles.contentWrapper(theme)] = true,
|
|
57
|
-
_d[jsStyles.contentWrapperForMobiles()] = context.isMobile,
|
|
58
|
-
_d)) },
|
|
59
|
-
context.isMobile && React.createElement(BackButton, { caption: caption, id: htmlId }),
|
|
60
|
-
children))), (_g = context.sideMenuRef) === null || _g === void 0 ? void 0 : _g.current);
|
|
61
|
-
});
|
|
62
|
-
SeparatedSubMenu.displayName = 'SeparatedSubMenu';
|
|
63
|
-
var SeparatedSubMenuWithStaticFields = Object.assign(SeparatedSubMenu, { __KONTUR_REACT_UI__: 'SeparatedSubMenu' });
|
|
64
|
-
export { SeparatedSubMenuWithStaticFields as SeparatedSubMenu };
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef, useContext, useEffect, useRef } from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import { cx } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
5
|
+
import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
|
|
6
|
+
import { jsStylesForSideMenu } from '../SideMenu/SideMenu.styles';
|
|
7
|
+
import { customStyles, jsStyles } from './SeparatedSubMenu.styles';
|
|
8
|
+
import { SideMenuContext } from '../SideMenuContext';
|
|
9
|
+
import { BackButton } from './BackButton';
|
|
10
|
+
import { SideMenuDataTids } from '../../SideMenuDataTids';
|
|
11
|
+
import { ScrollContainer } from '@skbkontur/react-ui';
|
|
12
|
+
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
13
|
+
import { isIE11 } from '@skbkontur/react-ui/lib/client';
|
|
14
|
+
import { navigationAttributeForSeparatedMenu } from '../Navigation';
|
|
15
|
+
/**
|
|
16
|
+
* Отдельностоящее подменю
|
|
17
|
+
*
|
|
18
|
+
* @visibleName SeparatedSubMenu
|
|
19
|
+
*/
|
|
20
|
+
var SeparatedSubMenu = forwardRef(function (_a, ref) {
|
|
21
|
+
var _b, _c, _d;
|
|
22
|
+
var _e, _f, _g;
|
|
23
|
+
var children = _a.children, caption = _a.caption, htmlId = _a.htmlId, isOpened = _a.isOpened;
|
|
24
|
+
var context = useContext(SideMenuContext);
|
|
25
|
+
var scrollContainerRef = useRef(null);
|
|
26
|
+
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (!context.isMobile) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
isOpened && ((_a = context.setHasScrollBar) === null || _a === void 0 ? void 0 : _a.call(context, !!((_b = scrollContainerRef.current) === null || _b === void 0 ? void 0 : _b.hasScrollBar('y'))));
|
|
34
|
+
}, 50);
|
|
35
|
+
}, [(_e = context.navigation) === null || _e === void 0 ? void 0 : _e.activeMenuItem]);
|
|
36
|
+
if (!((_f = context.sideMenuRef) === null || _f === void 0 ? void 0 : _f.current)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return ReactDOM.createPortal(React.createElement("div", __assign({ className: cx((_b = {},
|
|
40
|
+
_b[jsStylesForSideMenu.container(theme)] = true,
|
|
41
|
+
_b[jsStylesForSideMenu.containerForTouchScreens(theme)] = context.isTouchScreen,
|
|
42
|
+
_b[jsStyles.root(theme)] = true,
|
|
43
|
+
_b[customStyles.rootForMobiles(context.headerHeight)] = context.isMobile,
|
|
44
|
+
_b[jsStyles.rootForDesktop()] = context.isDesktop,
|
|
45
|
+
_b[jsStyles.rootForTouchScreens(theme)] = context.isTouchScreen && context.isOpened && context.isCollapsable,
|
|
46
|
+
_b[jsStyles.rootForNarrowDesktop(theme)] = context.isCollapsable,
|
|
47
|
+
_b[jsStyles.rootWithShadow(theme)] = context.isTablet && !isIE11,
|
|
48
|
+
_b[jsStylesForSideMenu.hidden()] = !isOpened || (!context.isOpened && (context.isTablet || context.isMobile)),
|
|
49
|
+
_b)), ref: ref, "data-tid": SideMenuDataTids.separatedSubMenu }, (_c = {}, _c[navigationAttributeForSeparatedMenu] = htmlId, _c)),
|
|
50
|
+
React.createElement(ScrollContainer, { onScrollStateChangeY: function (state) {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = context.setScrollState) === null || _a === void 0 ? void 0 : _a.call(context, state);
|
|
53
|
+
}, ref: scrollContainerRef, showScrollBar: context.isTouchScreen ? 'always' : context.showScrollBar },
|
|
54
|
+
React.createElement("ul", { className: cx((_d = {},
|
|
55
|
+
_d[jsStylesForSideMenu.list()] = true,
|
|
56
|
+
_d[jsStyles.contentWrapper(theme)] = true,
|
|
57
|
+
_d[jsStyles.contentWrapperForMobiles()] = context.isMobile,
|
|
58
|
+
_d)) },
|
|
59
|
+
context.isMobile && React.createElement(BackButton, { caption: caption, id: htmlId }),
|
|
60
|
+
children))), (_g = context.sideMenuRef) === null || _g === void 0 ? void 0 : _g.current);
|
|
61
|
+
});
|
|
62
|
+
SeparatedSubMenu.displayName = 'SeparatedSubMenu';
|
|
63
|
+
var SeparatedSubMenuWithStaticFields = Object.assign(SeparatedSubMenu, { __KONTUR_REACT_UI__: 'SeparatedSubMenu' });
|
|
64
|
+
export { SeparatedSubMenuWithStaticFields as SeparatedSubMenu };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { SideMenuTheme } from '../../lib/theming/ThemeTypes';
|
|
2
|
-
export declare const customStyles: {
|
|
3
|
-
rootForMobiles(headerHeight?: number
|
|
4
|
-
};
|
|
5
|
-
export declare const jsStyles: {
|
|
6
|
-
root(t: SideMenuTheme): string;
|
|
7
|
-
rootForTouchScreens(t: SideMenuTheme): string;
|
|
8
|
-
rootForNarrowDesktop(t: SideMenuTheme): string;
|
|
9
|
-
rootForDesktop(): string;
|
|
10
|
-
rootWithShadow(t: SideMenuTheme): string;
|
|
11
|
-
contentWrapper(t: SideMenuTheme): string;
|
|
12
|
-
contentWrapperForMobiles(): string;
|
|
13
|
-
};
|
|
1
|
+
import { SideMenuTheme } from '../../lib/theming/ThemeTypes';
|
|
2
|
+
export declare const customStyles: {
|
|
3
|
+
rootForMobiles(headerHeight?: number): string;
|
|
4
|
+
};
|
|
5
|
+
export declare const jsStyles: {
|
|
6
|
+
root(t: SideMenuTheme): string;
|
|
7
|
+
rootForTouchScreens(t: SideMenuTheme): string;
|
|
8
|
+
rootForNarrowDesktop(t: SideMenuTheme): string;
|
|
9
|
+
rootForDesktop(): string;
|
|
10
|
+
rootWithShadow(t: SideMenuTheme): string;
|
|
11
|
+
contentWrapper(t: SideMenuTheme): string;
|
|
12
|
+
contentWrapperForMobiles(): string;
|
|
13
|
+
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
-
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
4
|
-
var styles = {
|
|
5
|
-
root: function (t) {
|
|
6
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n background: ", ";\n left: 100%;\n justify-content: flex-start;\n border-right: 1px solid ", ";\n z-index: 8000;\n "], ["\n position: absolute;\n top: 0;\n background: ", ";\n left: 100%;\n justify-content: flex-start;\n border-right: 1px solid ", ";\n z-index: 8000;\n "])), t.sideMenuSeparatedSubMenuBgColor, t.sideMenuSeparatedSubMenuBorderRightColor);
|
|
7
|
-
},
|
|
8
|
-
rootForTouchScreens: function (t) {
|
|
9
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n left: ", ";\n z-index: -1;\n "], ["\n left: ", ";\n z-index: -1;\n "])), t.sideMenuWidthForTouchScreens);
|
|
10
|
-
},
|
|
11
|
-
rootForNarrowDesktop: function (t) {
|
|
12
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n left: ", ";\n z-index: -1;\n "], ["\n left: ", ";\n z-index: -1;\n "])), t.sideMenuMinimizedWidth);
|
|
13
|
-
},
|
|
14
|
-
rootForDesktop: function () {
|
|
15
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n z-index: -1;\n "], ["\n z-index: -1;\n "])));
|
|
16
|
-
},
|
|
17
|
-
rootWithShadow: function (t) {
|
|
18
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n box-shadow: ", ";\n clip-path: inset(0 -", " 0 0);\n border-right: none;\n "], ["\n box-shadow: ", ";\n clip-path: inset(0 -", " 0 0);\n border-right: none;\n "])), t.sideMenuBoxShadow, t.sideMenuBoxShadowBlurRadius);
|
|
19
|
-
},
|
|
20
|
-
contentWrapper: function (t) {
|
|
21
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), t.sideMenuSeparatedSubMenuPaddingY, t.sideMenuSeparatedSubMenuPaddingX);
|
|
22
|
-
},
|
|
23
|
-
contentWrapperForMobiles: function () {
|
|
24
|
-
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-top: 0;\n "], ["\n padding-top: 0;\n "])));
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
export var customStyles = {
|
|
28
|
-
rootForMobiles: function (headerHeight) {
|
|
29
|
-
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: calc(100vh - ", "px);\n left: 0;\n top: ", "px;\n "], ["\n height: calc(100vh - ", "px);\n left: 0;\n top: ", "px;\n "])), headerHeight, headerHeight);
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export var jsStyles = memoizeStyle(styles);
|
|
33
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
+
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
4
|
+
var styles = {
|
|
5
|
+
root: function (t) {
|
|
6
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n background: ", ";\n left: 100%;\n justify-content: flex-start;\n border-right: 1px solid ", ";\n z-index: 8000;\n "], ["\n position: absolute;\n top: 0;\n background: ", ";\n left: 100%;\n justify-content: flex-start;\n border-right: 1px solid ", ";\n z-index: 8000;\n "])), t.sideMenuSeparatedSubMenuBgColor, t.sideMenuSeparatedSubMenuBorderRightColor);
|
|
7
|
+
},
|
|
8
|
+
rootForTouchScreens: function (t) {
|
|
9
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n left: ", ";\n z-index: -1;\n "], ["\n left: ", ";\n z-index: -1;\n "])), t.sideMenuWidthForTouchScreens);
|
|
10
|
+
},
|
|
11
|
+
rootForNarrowDesktop: function (t) {
|
|
12
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n left: ", ";\n z-index: -1;\n "], ["\n left: ", ";\n z-index: -1;\n "])), t.sideMenuMinimizedWidth);
|
|
13
|
+
},
|
|
14
|
+
rootForDesktop: function () {
|
|
15
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n z-index: -1;\n "], ["\n z-index: -1;\n "])));
|
|
16
|
+
},
|
|
17
|
+
rootWithShadow: function (t) {
|
|
18
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n box-shadow: ", ";\n clip-path: inset(0 -", " 0 0);\n border-right: none;\n "], ["\n box-shadow: ", ";\n clip-path: inset(0 -", " 0 0);\n border-right: none;\n "])), t.sideMenuBoxShadow, t.sideMenuBoxShadowBlurRadius);
|
|
19
|
+
},
|
|
20
|
+
contentWrapper: function (t) {
|
|
21
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), t.sideMenuSeparatedSubMenuPaddingY, t.sideMenuSeparatedSubMenuPaddingX);
|
|
22
|
+
},
|
|
23
|
+
contentWrapperForMobiles: function () {
|
|
24
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-top: 0;\n "], ["\n padding-top: 0;\n "])));
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export var customStyles = {
|
|
28
|
+
rootForMobiles: function (headerHeight) {
|
|
29
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: calc(100vh - ", "px);\n left: 0;\n top: ", "px;\n "], ["\n height: calc(100vh - ", "px);\n left: 0;\n top: ", "px;\n "])), headerHeight, headerHeight);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var jsStyles = memoizeStyle(styles);
|
|
33
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SideMenuHeaderProps } from '../SideMenuHeader/SideMenuHeader';
|
|
3
|
-
declare const SideMenuLogotypeWithStaticFields: React.ForwardRefExoticComponent<SideMenuHeaderProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
-
__KONTUR_REACT_UI__: string;
|
|
5
|
-
};
|
|
6
|
-
export { SideMenuLogotypeWithStaticFields as SideMenuLogotype };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SideMenuHeaderProps } from '../SideMenuHeader/SideMenuHeader';
|
|
3
|
+
declare const SideMenuLogotypeWithStaticFields: React.ForwardRefExoticComponent<SideMenuHeaderProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
__KONTUR_REACT_UI__: string;
|
|
5
|
+
};
|
|
6
|
+
export { SideMenuLogotypeWithStaticFields as SideMenuLogotype };
|
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { __assign, __read, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { Logotype } from '@skbkontur/react-ui-addons/components/Logotype';
|
|
4
|
-
import { jsStyles, sideMenuLogotypeIconSize } from './SideMenuLogotype.styles';
|
|
5
|
-
import { SideMenuContext } from '../SideMenuContext';
|
|
6
|
-
import { Burger } from './Burger';
|
|
7
|
-
import { cx } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
8
|
-
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
9
|
-
import { ThemeContext } from '@skbkontur/react-ui';
|
|
10
|
-
var changeCamelCaseToKebabCase = function (str) {
|
|
11
|
-
return str
|
|
12
|
-
.split('')
|
|
13
|
-
.map(function (letter, idx) {
|
|
14
|
-
return letter.toUpperCase() === letter ? ""
|
|
15
|
-
})
|
|
16
|
-
.join('');
|
|
17
|
-
};
|
|
18
|
-
var getProductName = function (productLogo) {
|
|
19
|
-
var _a;
|
|
20
|
-
// @ts-expect-error: accessing private property
|
|
21
|
-
return ((_a = productLogo === null || productLogo === void 0 ? void 0 : productLogo.type) === null || _a === void 0 ? void 0 : _a.__KONTUR_REACT_UI__)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
parseInt(theme.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_b[jsStyles.
|
|
64
|
-
_b)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_c[jsStyles.
|
|
68
|
-
_c)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_d[jsStyles.
|
|
72
|
-
_d[jsStyles.
|
|
73
|
-
_d))
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Logotype } from '@skbkontur/react-ui-addons/components/Logotype';
|
|
4
|
+
import { jsStyles, sideMenuLogotypeIconSize } from './SideMenuLogotype.styles';
|
|
5
|
+
import { SideMenuContext } from '../SideMenuContext';
|
|
6
|
+
import { Burger } from './Burger';
|
|
7
|
+
import { cx } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
8
|
+
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
9
|
+
import { ThemeContext } from '@skbkontur/react-ui';
|
|
10
|
+
var changeCamelCaseToKebabCase = function (str) {
|
|
11
|
+
return str
|
|
12
|
+
.split('')
|
|
13
|
+
.map(function (letter, idx) {
|
|
14
|
+
return letter.toUpperCase() === letter ? "".concat(idx !== 0 ? '-' : '').concat(letter.toLowerCase()) : letter;
|
|
15
|
+
})
|
|
16
|
+
.join('');
|
|
17
|
+
};
|
|
18
|
+
var getProductName = function (productLogo) {
|
|
19
|
+
var _a;
|
|
20
|
+
// @ts-expect-error: accessing private property
|
|
21
|
+
return ((_a = productLogo === null || productLogo === void 0 ? void 0 : productLogo.type) === null || _a === void 0 ? void 0 : _a.__KONTUR_REACT_UI__)
|
|
22
|
+
? // @ts-expect-error: accessing private property
|
|
23
|
+
changeCamelCaseToKebabCase(productLogo.type.__KONTUR_REACT_UI__.replace(/EN$/i, ''))
|
|
24
|
+
: 'kontur';
|
|
25
|
+
};
|
|
26
|
+
var getStaticIconPath = function (productName) {
|
|
27
|
+
return "https://s.kontur.ru/common-v2/icons-products/".concat(productName, "/").concat(productName, "-").concat(parseInt(sideMenuLogotypeIconSize), ".svg");
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Логотип
|
|
31
|
+
*
|
|
32
|
+
* @visibleName SideMenu.Logotype
|
|
33
|
+
*/
|
|
34
|
+
var SideMenuLogotype = forwardRef(function (_a, ref) {
|
|
35
|
+
var _b, _c, _d;
|
|
36
|
+
var productLogo = _a.productLogo, withWidget = _a.withWidget, konturLogo = _a.konturLogo, iconUrl = _a.iconUrl, rest = __rest(_a, ["productLogo", "withWidget", "konturLogo", "iconUrl"]);
|
|
37
|
+
var context = useContext(SideMenuContext);
|
|
38
|
+
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
39
|
+
var productName = getProductName(productLogo);
|
|
40
|
+
var refLogotype = useRef(null);
|
|
41
|
+
var _e = __read(useState(28), 2), size = _e[0], setSize = _e[1];
|
|
42
|
+
var _f = __read(useState(getStaticIconPath(productName)), 2), productIconUrl = _f[0], setProductIconUrl = _f[1];
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
var logotypeWidth = (_b = (_a = refLogotype.current) === null || _a === void 0 ? void 0 : _a.logotypeRef) === null || _b === void 0 ? void 0 : _b.clientWidth;
|
|
46
|
+
var maxWidth = parseInt(theme.sideMenuWidth) -
|
|
47
|
+
2 * parseInt(theme.sideMenuMarginX) -
|
|
48
|
+
parseInt(theme.sideMenuLogotypePaddingLeft);
|
|
49
|
+
if (logotypeWidth && logotypeWidth > maxWidth && !rest.size) {
|
|
50
|
+
setSize(24);
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
var getWidget = function (withWidget, isMinimizedInNarrowDesktop) {
|
|
54
|
+
if (isMinimizedInNarrowDesktop) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return withWidget;
|
|
58
|
+
};
|
|
59
|
+
var handleError = function () {
|
|
60
|
+
setProductIconUrl(getStaticIconPath('kontur'));
|
|
61
|
+
};
|
|
62
|
+
return (React.createElement("div", { className: cx((_b = {},
|
|
63
|
+
_b[jsStyles.root()] = true,
|
|
64
|
+
_b[jsStyles.rootForTabletsOrMobiles()] = context.isMobile || context.isTablet,
|
|
65
|
+
_b)), ref: ref },
|
|
66
|
+
!context.isMobile && !context.isTablet && (React.createElement("img", { className: cx((_c = {},
|
|
67
|
+
_c[jsStyles.iconHidden(theme)] = true,
|
|
68
|
+
_c[jsStyles.icon()] = !context.isOpened && !(context.isMobile || context.isTablet),
|
|
69
|
+
_c)), src: iconUrl || productIconUrl, alt: productName, onError: handleError })),
|
|
70
|
+
React.createElement("div", { className: cx((_d = {},
|
|
71
|
+
_d[jsStyles.logoWrapper(theme)] = true,
|
|
72
|
+
_d[jsStyles.logoWrapperForTabletsOrMobiles(theme)] = context.isMobile || context.isTablet,
|
|
73
|
+
_d[jsStyles.logoWrapperHidden()] = !context.isOpened && !(context.isMobile || context.isTablet),
|
|
74
|
+
_d)) },
|
|
75
|
+
(context.isTablet || context.isMobile) && React.createElement(Burger, null),
|
|
76
|
+
React.createElement(Logotype, __assign({ ref: refLogotype, size: size, productLogo: productLogo, konturLogo: konturLogo, withWidget: getWidget(withWidget, !context.isOpened && context.isCollapsable) }, rest)))));
|
|
77
|
+
});
|
|
78
|
+
SideMenuLogotype.displayName = 'SideMenuLogotype';
|
|
79
|
+
var SideMenuLogotypeWithStaticFields = Object.assign(SideMenuLogotype, { __KONTUR_REACT_UI__: 'SideMenuLogotype' });
|
|
80
|
+
export { SideMenuLogotypeWithStaticFields as SideMenuLogotype };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SideMenuTheme } from '../../lib/theming/ThemeTypes';
|
|
2
|
-
export declare const sideMenuLogotypeIconSize = "32px";
|
|
3
|
-
export declare const sideMenuLogotypeGapBetweenIconAndLogo = "50px";
|
|
4
|
-
export declare const jsStyles: {
|
|
5
|
-
root(): string;
|
|
6
|
-
rootForTabletsOrMobiles(): string;
|
|
7
|
-
icon(): string;
|
|
8
|
-
iconHidden(t: SideMenuTheme): string;
|
|
9
|
-
logoWrapper(t: SideMenuTheme): string;
|
|
10
|
-
logoWrapperForTabletsOrMobiles(t: SideMenuTheme): string;
|
|
11
|
-
logoWrapperHidden(): string;
|
|
12
|
-
};
|
|
1
|
+
import { SideMenuTheme } from '../../lib/theming/ThemeTypes';
|
|
2
|
+
export declare const sideMenuLogotypeIconSize = "32px";
|
|
3
|
+
export declare const sideMenuLogotypeGapBetweenIconAndLogo = "50px";
|
|
4
|
+
export declare const jsStyles: {
|
|
5
|
+
root(): string;
|
|
6
|
+
rootForTabletsOrMobiles(): string;
|
|
7
|
+
icon(): string;
|
|
8
|
+
iconHidden(t: SideMenuTheme): string;
|
|
9
|
+
logoWrapper(t: SideMenuTheme): string;
|
|
10
|
+
logoWrapperForTabletsOrMobiles(t: SideMenuTheme): string;
|
|
11
|
+
logoWrapperHidden(): string;
|
|
12
|
+
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
-
import { transitionDuration } from '../SideMenu/SideMenu';
|
|
4
|
-
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
5
|
-
export var sideMenuLogotypeIconSize = '32px';
|
|
6
|
-
export var sideMenuLogotypeGapBetweenIconAndLogo = '50px';
|
|
7
|
-
var styles = {
|
|
8
|
-
root: function () {
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding-left: 4px;\n "], ["\n display: flex;\n padding-left: 4px;\n "])));
|
|
10
|
-
},
|
|
11
|
-
rootForTabletsOrMobiles: function () {
|
|
12
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: 0;\n "], ["\n padding-left: 0;\n "])));
|
|
13
|
-
},
|
|
14
|
-
icon: function () {
|
|
15
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n opacity: 1;\n width: auto;\n "], ["\n opacity: 1;\n width: auto;\n "])));
|
|
16
|
-
},
|
|
17
|
-
iconHidden: function (t) {
|
|
18
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "], ["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypeHiddenIconPaddingLeft, transitionDuration);
|
|
19
|
-
},
|
|
20
|
-
logoWrapper: function (t) {
|
|
21
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypePaddingTop, t.sideMenuLogotypePaddingBottom, t.sideMenuLogotypePaddingLeft, transitionDuration);
|
|
22
|
-
},
|
|
23
|
-
logoWrapperForTabletsOrMobiles: function (t) {
|
|
24
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), t.sideMenuLogotypePaddingYForTouchScreens, t.sideMenuLogotypePaddingYForTouchScreens);
|
|
25
|
-
},
|
|
26
|
-
logoWrapperHidden: function () {
|
|
27
|
-
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: 0;\n "], ["\n opacity: 0;\n "])));
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
export var jsStyles = memoizeStyle(styles);
|
|
31
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
+
import { transitionDuration } from '../SideMenu/SideMenu';
|
|
4
|
+
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
5
|
+
export var sideMenuLogotypeIconSize = '32px';
|
|
6
|
+
export var sideMenuLogotypeGapBetweenIconAndLogo = '50px';
|
|
7
|
+
var styles = {
|
|
8
|
+
root: function () {
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding-left: 4px;\n "], ["\n display: flex;\n padding-left: 4px;\n "])));
|
|
10
|
+
},
|
|
11
|
+
rootForTabletsOrMobiles: function () {
|
|
12
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: 0;\n "], ["\n padding-left: 0;\n "])));
|
|
13
|
+
},
|
|
14
|
+
icon: function () {
|
|
15
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n opacity: 1;\n width: auto;\n "], ["\n opacity: 1;\n width: auto;\n "])));
|
|
16
|
+
},
|
|
17
|
+
iconHidden: function (t) {
|
|
18
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "], ["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypeHiddenIconPaddingLeft, transitionDuration);
|
|
19
|
+
},
|
|
20
|
+
logoWrapper: function (t) {
|
|
21
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypePaddingTop, t.sideMenuLogotypePaddingBottom, t.sideMenuLogotypePaddingLeft, transitionDuration);
|
|
22
|
+
},
|
|
23
|
+
logoWrapperForTabletsOrMobiles: function (t) {
|
|
24
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), t.sideMenuLogotypePaddingYForTouchScreens, t.sideMenuLogotypePaddingYForTouchScreens);
|
|
25
|
+
},
|
|
26
|
+
logoWrapperHidden: function () {
|
|
27
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: 0;\n "], ["\n opacity: 0;\n "])));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export var jsStyles = memoizeStyle(styles);
|
|
31
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CommonClickableElementProps } from './ClickableElement';
|
|
3
|
-
interface SubMenuProps extends Pick<CommonClickableElementProps, 'caption'> {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
isOpened?: boolean;
|
|
6
|
-
isSubMenu?: boolean;
|
|
7
|
-
isSeparatedMenu?: boolean;
|
|
8
|
-
htmlId: string;
|
|
9
|
-
}
|
|
10
|
-
declare const SubMenuWithStaticFields: React.ForwardRefExoticComponent<SubMenuProps & React.RefAttributes<HTMLDivElement | HTMLUListElement>> & {
|
|
11
|
-
__KONTUR_REACT_UI__: string;
|
|
12
|
-
};
|
|
13
|
-
export { SubMenuWithStaticFields as SubMenu };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonClickableElementProps } from './ClickableElement';
|
|
3
|
+
interface SubMenuProps extends Pick<CommonClickableElementProps, 'caption'> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
isOpened?: boolean;
|
|
6
|
+
isSubMenu?: boolean;
|
|
7
|
+
isSeparatedMenu?: boolean;
|
|
8
|
+
htmlId: string;
|
|
9
|
+
}
|
|
10
|
+
declare const SubMenuWithStaticFields: React.ForwardRefExoticComponent<SubMenuProps & React.RefAttributes<HTMLDivElement | HTMLUListElement>> & {
|
|
11
|
+
__KONTUR_REACT_UI__: string;
|
|
12
|
+
};
|
|
13
|
+
export { SubMenuWithStaticFields as SubMenu };
|